Daily Archives

Articles indexed Wednesday March 16 2011

Page 4/14 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to market R at your institute?

    - by ran2
    Okay, I admit there are lots of threads R vs. something. The strengths of R are obvious to most people here. Still though advertising R in an environment that has been preferring various kinds of other software for quite some time is not easy. Moreover, even in the limited time I´ve been dealing with R, it improved so dramatically that I would mention things among its strengths that I would not have listed when I started my personal R-evolution. So, what I am trying to do here is to collect the most recent and striking arguments that can be put in nutshell and be presented easily. What I got on my list so far is: the Springer useR series ggplot2 and its documentation open source CRAN Rapache rcpp rsocket What can you add to this list? SO threads are also very welcome as answers. EDIT: so far, though indeed very helpful, most answers are arguments (pros) why one would want to use R. Do you have some specific hints that I could include in some kind of overview presentation? EDIT2: I wanted to add this link about R's future to the list...

    Read the article

  • Is SVN out of style?

    - by jitbit
    It's been only several years since I migrated from Visual Source Safe to SVN. And SVN for me is still kinda "WOW! I can do so many things! SVN is so cool!" But many people around me keep saying "SVN? Really? Meh..." And there's so many of them that I'm worried. Should I move my team to Git / Mercurial or some other fancy thing? I know I sound ridiculous and the obvious answer would be "stay with what works for YOU". SVN does work for me... But every time I create a new project in my repository I keep asking myself - may be this was the time to move? So... Is SVN really that bad? Do I miss a huge opportunity by sticking with it?

    Read the article

  • Emphasize Some Comments - but not Dirty the Code

    - by Jon Sandness
    I'm having trouble structuring my comments at the moment. I have major sections of the code that, when scrolling through the document, I want to be able to see those stand out. Examples: This is a normal comment: int money = 100; //start out with 100 money - This is a comment to emphasize a certain part of the code: /****** Set up all the money ******/ But I don't like that this isn't very clean. Is there a standard way of setting up this type of a comment?

    Read the article

  • What usability issues have you had with VS2010?

    - by makerofthings7
    A few of my friends have noticed some quirks with vs2010... notably the Undo/Redo feature doesn't seem to work reliably... often messing up the code beyond comprehension. What other quirks have you seen? Update for vs2010 users (non SP1) Please post your bugs at Microsoft connect, and a corresponding link here so we can up vote them as needed. https://connect.microsoft.com/VisualStudio?wa=wsignin1.0 Update for VS2010 SP1 Users You can download the SP1 for all versions of Visual Studio here. Just be aware that there are compatibility issues mentioned in the readme. Also some people have reported issues with this release. Please report bugs here: https://connect.microsoft.com/VisualStudio?wa=wsignin1.0

    Read the article

  • Python's Django or Delphi's IntraWeb?

    - by Azad Salahli
    Well, forgive me if it is an off-topic question. I have no knowledge about web programming, so I apologize in advance, if it is a stupid question. I will start to build a web based application. To be more specific, I will make a webpage which will have components like buttons, textboxes and etc. It will use a database to store information. My question is, which one is better to learn for that purpose? Python's Django or Delphi's IntraWeb? I know both Delphi and Python(although I know Delphi better).

    Read the article

  • How To Create a Personal VM Server

    - by Danish
    I have a personal Ubuntu server at home for my various personal development needs. I often spend time to configure it for various purposes e.g. for serving a blog or my mercurial repositories etc. However, I am getting very interested in pre-packaged linux appliances available e.g. TurnKey linux etc. It takes no effort to get an appliance up and running! I was wondering if I could make my home server into VM server, where I can run multiple VMs for various needs. The server does not have a screen, hence I would like to be able to manage my VMs from the web or console I guess in short, I am asking if its possible to have my own personal, light weight Amazon EC2. If yes, how can I set it up? Is there an Ubuntu derived distro available for this? OR can I install a couple of packages and get this running?

    Read the article

  • Upgrading 10.04LTS -> 10.10 using custom sources

    - by Boatzart
    I'm trying to upgrade to 10.10 from 10.04 LTS using a custom sources.list file that points to an unofficial mirror*. The mirror does have maverick, but I get the following output when upgrading: boatzart@somecomputer: > sudo do-release-upgrade Checking for a new ubuntu release Done Upgrade tool signature Done Upgrade tool Done downloading extracting 'maverick.tar.gz' authenticate 'maverick.tar.gz' against 'maverick.tar.gz.gpg' tar: Removing leading `/' from member names Reading cache Checking package manager Reading package lists... Done Building dependency tree Reading state information... Done Building data structures... Done Reading package lists... Done Building dependency tree Reading state information... Done Building data structures... Done Updating repository information WARNING: Failed to read mirror file No valid mirror found While scanning your repository information no mirror entry for the upgrade was found. This can happen if you run a internal mirror or if the mirror information is out of date. Do you want to rewrite your 'sources.list' file anyway? If you choose 'Yes' here it will update all 'lucid' to 'maverick' entries. If you select 'No' the upgrade will cancel. Continue [yN] y WARNING: Failed to read mirror file 96% [Working] Checking package manager Reading package lists... Done Building dependency tree Reading state information... Done Building data structures... Done Calculating the changes Calculating the changes Could not calculate the upgrade An unresolvable problem occurred while calculating the upgrade: The package 'update-manager-kde' is marked for removal but it is in the removal blacklist. This can be caused by: * Upgrading to a pre-release version of Ubuntu * Running the current pre-release version of Ubuntu * Unofficial software packages not provided by Ubuntu If none of this applies, then please report this bug against the 'update-manager' package and include the files in /var/log/dist-upgrade/ in the bug report. Restoring original system state Aborting Reading package lists... Done Building dependency tree Reading state information... Done Building data structures... Done Here is the relevant section from /var/log/dist-upgrade/main.log: 2010-11-18 14:05:52,117 DEBUG The package 'update-manager-kde' is marked for removal but it's in the removal blacklist 2010-11-18 14:05:52,136 ERROR Dist-upgrade failed: 'The package 'update-manager-kde' is marked for removal but it is in the removal blacklist.' 2010-11-18 14:05:52,136 DEBUG abort called *I'm located inside of USC, and for some crazy reason any sustained downloads to anywhere outside of the University are throttled down to 5kbps inside of my lab. Because of this I need to use the following sources.list: deb http://mirrors.usc.edu/pub/linux/distributions/ubuntu/ lucid main restricted universe multiverse deb http://mirrors.usc.edu/pub/linux/distributions/ubuntu/ lucid-updates main restricted universe multiverse deb http://mirrors.usc.edu/pub/linux/distributions/ubuntu/ lucid-backports main restricted universe multiverse deb http://mirrors.usc.edu/pub/linux/distributions/ubuntu/ lucid-security main restricted universe multiverse I've tried adding four more entries to the sources.list with s/lucid/maverick/ but that didn't help. Does anyone know how to fix this? Thanks!

    Read the article

  • Enable remote VNC from the commandline?

    - by Stefan Lasiewski
    I have one computer running Ubuntu 10.04, and is running Vino, the default VNC server. I have a second Windows box which is running a VNC client, but does not have any X11 capabilities. I am ssh'd into the Ubuntu host from the Windows host, but I forgot to enable VNC access on the Ubuntu host. On the Ubuntu host, is there a way for me to enable VNC connections from the Ubuntu commandline? Update: As @koanhead says below, there is no man page for vino (e.g. man -k vino and info vino return nothing), and vino --help doesn't show any help).

    Read the article

  • What causes critical glib errors (when coding using messaging menu)?

    - by fluteflute
    If I run the python code below (almost entirely from this useful blog post) then I get three identical nasty looking error messages in the terminal. What might be causing them? I note the number (5857 in the example below) changes slightly on each run. What does this number signify? Is it a memory location or something similar? (messaging-menu.py:5857): GLib-GIO-CRITICAL **: g_dbus_method_invocation_return_dbus_error: assertion `error_name != NULL && g_dbus_is_name (error_name)' failed (messaging-menu.py:5857): GLib-GIO-CRITICAL **: g_dbus_method_invocation_return_dbus_error: assertion `error_name != NULL && g_dbus_is_name (error_name)' failed (messaging-menu.py:5857): GLib-GIO-CRITICAL **: g_dbus_method_invocation_return_dbus_error: assertion `error_name != NULL && g_dbus_is_name (error_name)' failed I'm running this on Natty, I should probably find out if I get the same errors in 10.10 though... import gtk def show_window_function(x, y): print x print y # get the indicate module, which does all the work import indicate # Create a server item mm = indicate.indicate_server_ref_default() # If someone clicks your server item in the MM, fire the server-display signal mm.connect("server-display", show_window_function) # Set the type of messages that your item uses. It's not at all clear which types # you're allowed to use, here. mm.set_type("message.im") # You must specify a .desktop file: this is where the MM gets the name of your # app from. mm.set_desktop_file("/usr/share/applications/nautilus.desktop") # Show the item in the MM. mm.show() # Create a source item mm_source = indicate.Indicator() # Again, it's not clear which subtypes you are allowed to use here. mm_source.set_property("subtype", "im") # "Sender" is the text that appears in the source item in the MM mm_source.set_property("sender", "Unread") # If someone clicks this source item in the MM, fire the user-display signal mm_source.connect("user-display", show_window_function) # Light up the messaging menu so that people know something has changed mm_source.set_property("draw-attention", "true") # Set the count of messages in this source. mm_source.set_property("count", "15") # If you prefer, you can set the time of the last message from this source, # rather than the count. (You can't set both.) This means that instead of a # message count, the MM will show "2m" or similar for the time since this # message arrived. # mm_source.set_property_time("time", time.time()) mm_source.show() gtk.main()

    Read the article

  • Is there an apt command to download a deb file from the repositories to the current directory?

    - by Lekensteyn
    I am often interested in the installation triggers (postinst, postrm) or certain parts of packages (like /usr/share and /etc). Currently, I am running the next command to retrieve the source code: apt-get source [package-name] The downside is, this file is often much bigger than the binary package and does not reflect the installation tree. Right now, I am downloading the packages through http://packages.ubuntu.com/: Search for [package-name] Select the package Click on amd64/i386 for download Download the actual file This takes too long for me and as someone who really likes the shell, I would like to do something like the next (imaginary) command: apt-get get-deb-file [package-name] I could not find something like this in the apt-get manual page. The most close I found was the --download-only switch, but this puts the package in /var/cache/apt/archives (which requires root permissions) and not in the current directory.

    Read the article

  • Teminal hands on load, can't enter anything until CTRL+C

    - by Silver Light
    Hello! I have an issue with terminal in Ubuntu 10.04. When I launch it, it hangs, like this: I cannot do anything until I press CTRL+C: I cannot remember when this started. What can be wrong? Looks like teminal is loading or processing something each time it loads. How can I diagnose and solve this problem? EDIT: Here are the conents of ~/.bashrc: # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # If not running interactively, don't do anything [ -z "$PS1" ] && return # don't put duplicate lines in the history. See bash(1) for more options # ... or force ignoredups and ignorespace HISTCONTROL=ignoredups:ignorespace # append to the history file, don't overwrite it shopt -s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=1000 HISTFILESIZE=2000 # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" # set variable identifying the chroot you work in (used in the prompt below) if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi # set a fancy prompt (non-color, unless we know we "want" color) case "$TERM" in xterm-color) color_prompt=yes;; esac # uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt #force_color_prompt=yes if [ -n "$force_color_prompt" ]; then if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then # We have color support; assume it's compliant with Ecma-48 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such # a case would tend to support setf rather than setaf.) color_prompt=yes else color_prompt= fi fi if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi unset color_prompt force_color_prompt # If this is an xterm set the title to user@host:dir case "$TERM" in xterm*|rxvt*) PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" ;; *) ;; esac # enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' #alias dir='dir --color=auto' #alias vdir='vdir --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi # some more ls aliases alias ll='ls -alF' alias la='ls -A' alias l='ls -CF' # Add an "alert" alias for long running commands. Use like so: # sleep 10; alert alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' # Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi # Source .profile if [ -f ~/.profile ]; then . ~/.profile fi Setting -x at the beginning showed me that it tries to repeat this without stopping: +++++++++++++++++++ '[' 'complete -f -X '\''!*.@(pdf|PDF)'\'' acroread gpdf xpdf' '!=' 'complete -f -X '\''!*.@(pdf|PDF)'\'' acroread gpdf xpdf' ']' +++++++++++++++++++ line='complete -f -X '\''!*.@(pdf|PDF)'\'' acroread gpdf xpdf' +++++++++++++++++++ line='complete -f -X '\''!*.@(pdf|PDF)'\'' acroread gpdf xpdf' +++++++++++++++++++ line=' acroread gpdf xpdf' +++++++++++++++++++ list=("${list[@]}" $line) +++++++++++++++++++ read line

    Read the article

  • Program to Hide/show Given window with hotkey?

    - by Wayne Werner
    Hi, I'm fairly sure this program exists, but I don't remember what it was called. There are a few drop-down terminal programs (guake, yakuke, tilde), and I've been a fan of guake for a while. However, since I discovered GNU Screen I've been more interested in using Eterm. But I would like to make it dropdown/hide on keypress, similar to the way Guake does. I remember at some point that someone mentioned a program that allowed you to do similar things with basically any other window. Unfortunately my time spent googling around for terms like "show/hide any terminal ubuntu" have been met with stupid Windows search engine spam. Any clue where I could find the program I'm looking for? Thanks!

    Read the article

  • What is 'Ubuntu Unity' (for the Desktop)?

    - by Martin
    Ok, so there's the buzz of Canonical (wanting to) switch for new Ubuntu version from the GNOME default desktop to their own Unity shell. (I hope that's accurate.) It seems I can not totally fathom what Unity actually is. For looking at its homepage it currently is firmly targeted at netbooks and the somehow different usage model on these. Is it a classical desktop? -- Taskbar? Shortcuts? Is the difference between Ubuntu(GNOME)+Unity more/less pronounced than the difference between Ubuntu and Kubuntu? Will "my parents" be able to get the interface if they've been using the classical gnome desktop so far? Edit: I would not like to split this up into more specific questions, as What is Unity? is exactly what the people I set up Ubuntu boxes for will ask me if they hear that the newer Ubuntu version is using that instead of the Desktop -- and it might well happen someone phrases it like that :-) I will certainly not give them the link to the HP as the explanation there does not lay out if it is a desktop or something more or something less: (It does not for me - therefore I'm asking here.) Unity is designed for netbooks and related touch-based devices. It includes [...] that makes it fast and easy to access [...] while removing screen elements that are rarely used in mobile and netbook computing. (emphasis mine) -- the explanation there doesn't even mention the desktop-PC! Unity has a vertical task management panel on the left-hand side and a menu panel at the top of the screen. [...] This sounds like a re-themed normal desktop. Clicking on an icon will give the target application focus if it is already running or launch it if it is not already running. If you click the ... Aha. Sounds like Windows 7. ... icon of an application that already has focus, Unity will activate an Expose-style view of all the open windows associated with that application. No clue what that's supposed to be. So it would really be nice if someone could explain for non desktop-design-terms experts what Unity is.

    Read the article

  • Why does my Messaging Menu code not work when split into functions?

    - by fluteflute
    Below are two python programs. They're exactly the same, except for one is split into two functions. However only the one that's split into two functions doesn't work - the second function doesn't work. Why would this be? Note the code is taken from this useful blog post. Without functions (works): import gtk def show_window_function(x, y): print x print y # get the indicate module, which does all the work import indicate # Create a server item mm = indicate.indicate_server_ref_default() # If someone clicks your server item in the MM, fire the server-display signal mm.connect("server-display", show_window_function) # Set the type of messages that your item uses. It's not at all clear which types # you're allowed to use, here. mm.set_type("message.im") # You must specify a .desktop file: this is where the MM gets the name of your # app from. mm.set_desktop_file("/usr/share/applications/nautilus.desktop") # Show the item in the MM. mm.show() # Create a source item mm_source = indicate.Indicator() # Again, it's not clear which subtypes you are allowed to use here. mm_source.set_property("subtype", "im") # "Sender" is the text that appears in the source item in the MM mm_source.set_property("sender", "Unread") # If someone clicks this source item in the MM, fire the user-display signal mm_source.connect("user-display", show_window_function) # Light up the messaging menu so that people know something has changed mm_source.set_property("draw-attention", "true") # Set the count of messages in this source. mm_source.set_property("count", "15") # If you prefer, you can set the time of the last message from this source, # rather than the count. (You can't set both.) This means that instead of a # message count, the MM will show "2m" or similar for the time since this # message arrived. # mm_source.set_property_time("time", time.time()) mm_source.show() gtk.mainloop() With functions (second function is executed but doesn't actually work): import gtk def show_window_function(x, y): print x print y # get the indicate module, which does all the work import indicate def function1(): # Create a server item mm = indicate.indicate_server_ref_default() # If someone clicks your server item in the MM, fire the server-display signal mm.connect("server-display", show_window_function) # Set the type of messages that your item uses. It's not at all clear which types # you're allowed to use, here. mm.set_type("message.im") # You must specify a .desktop file: this is where the MM gets the name of your # app from. mm.set_desktop_file("/usr/share/applications/nautilus.desktop") # Show the item in the MM. mm.show() def function2(): # Create a source item mm_source = indicate.Indicator() # Again, it's not clear which subtypes you are allowed to use here. mm_source.set_property("subtype", "im") # "Sender" is the text that appears in the source item in the MM mm_source.set_property("sender", "Unread") # If someone clicks this source item in the MM, fire the user-display signal mm_source.connect("user-display", show_window_function) # Light up the messaging menu so that people know something has changed mm_source.set_property("draw-attention", "true") # Set the count of messages in this source. mm_source.set_property("count", "15") # If you prefer, you can set the time of the last message from this source, # rather than the count. (You can't set both.) This means that instead of a # message count, the MM will show "2m" or similar for the time since this # message arrived. # mm_source.set_property_time("time", time.time()) mm_source.show() function1() function2() gtk.mainloop()

    Read the article

  • Looking for open-source solutions for a knowledge sharing website

    - by Bundarr
    There is a need in my workplace to setup a knowledge sharing site, a place where users can discuss projects they are working share documentation ask questions I am looking for a open-source system that answers these needs, and that can be setup in a week, and requires only PHP and MySQL. I am a Wordpress fan and developer and could easily implement such a system in Wordpress, however this system needs to be very simple to use for the technically challenged. Without customization, Wordpress users would still need to login to the "back-end" to post. I like the Stackexchange (OSQA) format, but these do not allow for file uploading out of the box. I do not have experience with Buddy Press, would this be an alternative?

    Read the article

  • Do I get SEO rankings for redirects? [closed]

    - by Gavin Morrice
    Possible Duplicate: Could I buy a domain name to increase traffic to my site like this? Url's add SEO weight to any site. If I have a site that (for example) sells chickens and the url is http://cluckorama.com and I own www.chickensforsale.com Will search engines list chickens for sale if I set a permanent redirect to cluckorama.com? (provided the content of cluckorama.com is relevant to chickens for sale)

    Read the article

  • On-Site Factors that Affect CPC

    - by ashes999
    I have a few websites on various niche topics, all running Adsense. The most promising one currently has a CPC that hovers around $1; the rest have CPCs of $0.25-$0.50. I'm curious to know what on-site factors affect CPC. That is to say, what I can do, legally (in white-hat compliance) to increase my CPC? Some factors that affect CPC but are not within my control (and therefore, beyond the scope of my question -- they're just examples) include: What advertisers are paying for keywords on my site What pages people are landing on etc.

    Read the article

  • Web Hosting Checklist

    - by Chris
    Hello, I am a web developer that is starting to look into hosting his own website. I would like to showcase my programming skills (PHP, MySQl, C#, Wordpress). My knowledge of languages I am OK with but the actually hosting site is where my knowledge starts to get a little shaky. I know the basics (bandwidth, sub-domains, re-write rules) but I would love your input, to help me formulate a check list of certain web-hosting services that I should be on the look-out for. Also I was wondering if there were any reliable hosting providers who give you the option to host both c# code-behinds and PHP code. As I would like to have two versions of my site, one in C# and one in PHP the hope is that if I need to look for another job this website will help me show possible employers my server side knowledge. I hope this is enough info, I did some researching online but found a bunch of unless articles and I've always have had luck on the StackExchange sites. So hopefully you, can help me. Thanks alot.

    Read the article

  • Platform for DS/Gameboy Dev - Managed Memory, Tools, and Unit Testing

    - by ashes999
    I'm interested in dabbling in Nintendo DS, 3DS, or GBA development. I would like to know what my (legal) options for development tools and IDEs are. In particular, I would not consider moving in this direction unless I can find: A programming language that has managed memory (garbage collection) A unit testing tool akin to JUnit, NUnit, etc. for unit tests I would also prefer if other tools exist, like code-coverage, etc. for that platform. But the main thing is managed memory and unit testing. What options are out there?

    Read the article

  • Unsafe, super-fast cross-process memory buffer?

    - by John
    Cross-process memory buffers always have some overhead, and my understanding is this is quite high. But what if you're implementing a cross-process render-buffer, this isn't critically important in the same way as other data so are there techniques we can use to get 'raw' access to a chunk of memory from multiple processes, with no safety nets apart from it not crashing? Or do modern operating systems simply not work with unabstracted memory in a way to make this possible? I'm working in C++ but the question applies to Win XP/Vista/7, MacOSX 10.5+ (& Linux less importantly).

    Read the article

  • Problem with dropdown in IE8 Compatibility Mode

    - by bsmith95610
    Hello, I am having a problem with my site in IE8 Compatibility mode. Below is a URL where you get the basic idea of what my websites dropdowns look like. The dropdowns are done in CSS and when you hover over one dropdown the submenu for the dropdown expands under the dropdown to the right of it. It works correctly in Safari, Chrome, Firefox, and normal IE8. But when you go to compatibility mode it isn't working correctly. Any help would be much appreciated. http://jsfiddle.net/h5xZT/28/ Thanks

    Read the article

  • Using Zend_Navigation, how do I create image-based navigation?

    - by SimpleCoder
    (I'm assuming my navigation should be in a layout script.) I have a navigation bar composed of rollover images. The image corresponding to the page that is active should be a different color, though. I do this by changing the image. My question is, where and how should I implement this using Zend_Navigation? Details: The menu itself is just a stack of divs that are floated to the left within a container. Each div has a background image. Thank you for your help,

    Read the article

  • How to change a recursive function for count files and catalogues?

    - by user661999
    <?php function scan_dir($dirname) { $file_count = 0 ; $dir_count = 0 ; $dir = opendir($dirname); while (($file = readdir($dir)) !== false) { if($file != "." && $file != "..") { if(is_file($dirname."/".$file)) ++$file_count; if(is_dir($dirname."/".$file)) { ++ $dir_count; scan_dir($dirname."/".$file); } } } closedir($dir); echo "There are $dir_count catalogues and $file_count files.<br>"; } $dirname = "/home/user/path"; scan_dir($dirname); ?> Hello, I have a recursive function for count files and catalogues. It returns result for each catalogue. But I need a common result. How to change the script? It returns : There are 0 catalogues and 3 files. There are 0 catalogues and 1 files. There are 2 catalogues and 14 files. I want: There are 2 catalogues and 18 files.

    Read the article

  • Installing Gtk2 on portable strawberry

    - by XoR
    I downloaded "strawberry-perl-5.12.2.0-portable" and "gtk+-bundle_2.22.1-20101227_win32". I extracted strawberry-perl in some directory and there I put gtk folder with gtk stuff. In portableshell.bat I changed Path env and added: "%drivep%\gtk\bin;%drivep%\gtk\lib;". Don't ask me why I added lib directory, I saw that some guy added it in some website. When I run in portableshell command: "pkg-config --libs --cflags gtk+-2.0" I get: c:\test>pkg-config --libs --cflags gtk+-2.0 -mms-bitfields -Ic:/test/gtk/include/gtk-2.0 -Ic:/test/gtk/lib/gtk-2.0/include - Ic:/test/gtk/include/atk-1.0 -Ic:/test/gtk/include/cairo -Ic:/test/gtk/include/g dk-pixbuf-2.0 -Ic:/test/gtk/include/pango-1.0 -Ic:/test/gtk/include/glib-2.0 -Ic :/test/gtk/lib/glib-2.0/include -Ic:/test/gtk/include -Ic:/test/gtk/include/free type2 -Ic:/test/gtk/include/libpng14 -Lc:/test/gtk/lib -lgtk-win32-2.0 -lgdk-wi n32-2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lgdk_pixb uf-2.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl All folders looks fine, I also have complete log of compiling glib here. It looks like it doesn't compile because pkg-config gives bad data, or something. Does anyone have some idea how to make this thing work?

    Read the article

  • Java JNI leak in c++ process.

    - by user662056
    Hi all.. I am beginner in Java. My problem is: I am calling a Java class's method from c++. For this i am using JNI. Everythings works correct, but i have some memory LEAKS in the process of c++ program... So.. i did simple example.. 1) I create a java machine (jint res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);) 2) then i take a pointer on java class (jclass cls = env-FindClass("test_jni")); 3) after that i create a java class object object, by calling the constructor (testJavaObject = env-NewObject(cls, testConstruct);) AT THIS very moment in the process of c++ program is allocated 10 MB of memory 4) Next i delete the class , the object, and the Java Machine .. AT THIS very moment the 10 MB of memory are not free ................. So below i have a few lines of code c++ program void main() { { //Env JNIEnv *env; // java virtual machine JavaVM *jvm; JavaVMOption* options = new JavaVMOption[1]; //class paths options[0].optionString = "-Djava.class.path=C:/Sun/SDK/jdk/lib;D:/jms_test/java_jni_leak;"; // other options JavaVMInitArgs vm_args; vm_args.version = JNI_VERSION_1_6; vm_args.options = options; vm_args.nOptions = 1; vm_args.ignoreUnrecognized = false; // alloc part of memory (for test) before CreateJavaVM char* testMem0 = new char[1000]; for(int i = 0; i < 1000; ++i) testMem0[i] = 'a'; // create java VM jint res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args); // alloc part of memory (for test) after CreateJavaVM char* testMem1 = new char[1000]; for(int i = 0; i < 1000; ++i) testMem1[i] = 'b'; //Creating java virtual machine jclass cls = env->FindClass("test_jni"); // Id of a class constructor jmethodID testConstruct = env->GetMethodID(cls, "<init>", "()V"); // The Java Object // Calling the constructor, is allocated 10 MB of memory in c++ process jobject testJavaObject = env->NewObject(cls, testConstruct); // function DeleteLocalRef, // In this very moment memory not free env->DeleteLocalRef(testJavaObject); env->DeleteLocalRef(cls); // 1!!!!!!!!!!!!! res = jvm->DestroyJavaVM(); delete[] testMem0; delete[] testMem1; // In this very moment memory not free. TO /// } int gg = 0; } java class (it just allocs some memory) import java.util.*; public class test_jni { ArrayList<String> testStringList; test_jni() { System.out.println("start constructor"); testStringList = new ArrayList<String>(); for(int i = 0; i < 1000000; ++i) { // ??????? ?????? testStringList.add("TEEEEEEEEEEEEEEEEST"); } } } process memory view, after crating javaVM and java object: testMem0 and testMem1 - test memory, that's allocated by c++. ************** testMem0 ************** JNI_CreateJavaVM ************** testMem1 ************** // create java object jobject testJavaObject = env->NewObject(cls, testConstruct); ************** process memory view, after destroy javaVM and delete ref on java object: testMem0 and testMem1 are deleted to; ************** JNI_CreateJavaVM ************** // create java object jobject testJavaObject = env->NewObject(cls, testConstruct); ************** So testMem0 and testMem1 is deleted, But JavaVM and Java object not.... Sow what i do wrong... and how i can free memory in the c++ process program.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >