usage

Copying minor updates to another branch with git

I've started playing with git locally, and have come up against a use case that I'm not sure how best to handle. I'm working on a spike in a branch, but then come across a simple correction that should also apply to master. The best I've found for the moment is: git stash git checkout master //do my correction manually git commit -a gi...

python optparse, how to include additional info in usage output?

Using python's optparse module I would like to add extra example lines below the regular usage output. My current help_print() output looks like this: usage: check_dell.py [options] options: -h, --help show this help message and exit -s, --storage checks virtual and physical disks -c, --chassis checks specified chassis components...

Delphi: storing data in classes vs records, memory usage reduction

Hi, I have quite a lot of data to store, read and modify in memory while the application works. The data could be compared to a tree, where each node is described by limited number of strings and integers, and has quite a lot of subelements. Currently the data is stored using classes/objects, like TRootElement = class fName, fDescripti...

VB.net application in "Real World" software?

Hi, I'm curious to know the spread level of programs coded in VB.net. I'm asking, because I coded in VB.net during my university years in aerospace engineering , because our informatics professor wanted us to do that and we learned at least a very basic experience in programming. So I coded a horizon finder as a project-work and asked a...

XCode immediately show filecontent on click

I'm new to XCode. I use XCode 3.1.3. In my project, i have on the left side the list of my project files, on the right side there is a textwindow showing code, and on top there's another small field showing some info about the file. At first, when i clicked in the left list on a file, the file content immediately showed up in the textfi...

iPhone: monitor data (internet) usage

is there a way to monitor how much data(internet) each application used? if I cannot monitor applications is there a way to get all internet requests information? (get data passed, url, etc) (I would like to use this info in an app Im developing for iphone) Thanks ...

Hashtables and usage in Java

What is Hashtables used for in Java? Further more please give examples of simple usage of Hashtables. ...

Plugging in jQuery HoverIntent for Sliding Panel

I have the following code running to create a dropdown accordion that reveals the hidden div "#top_mailing_hidden" when the div "#top_mailing" is hovered. The problem is that when I interrupt the animation by mousing Out and then mousing Over again it aborts the animation and screws up. I have the following code: //Top Mailing List Dr...

Should the command line "usage" be printed on stdout or stderr?

When printing the "usage" of an application, should it be done on stdout or on stderr? Depending on the application I've seen several cases, but there doesn't seem to be one rule. Maybe I'm mistaken and there is one good practice. In that case, what is it? ...

C++: What is the appropriate use for the std::logic_error exception?

If you use std::logic_error exception in your code, in what case do you use it for? ...

using __init__.py

I am not getting usage scenarios or design goals of python __init__.py in my projects. Assume that I have 'model' directory (refers as a package) which I have kept the following files. 1. __init__.py 2. meta.py 3. solrmodel.py 4. mongomodel.py 5. samodel.py I found two ways of using __init__.py. I have common definition which n...

Flex AIR SwfLoader CPU Usage > 50% problem

I have an AIR application, I use SwfLoader to load another swf file to display in this app. The problem is the CPU Usage always takes over 50%, but it only takes 15% when the swf file runs in standalone mode. Does anyone meet this issue? Please give me some advices. Thanks a lot ...

Is CPU execution time different in Loop with Sleep() and Long Loops without sleep(), with both having the same total running time?

Hello, I have a loop that runs for approx. 25 minutes i.e 1500 seconds. [100 loops with sleep(15)] The execution time for the statements inside loop is very less. My scripts are hosted on GoDaddy. I am sure that they are having some kind of limit on execution time. My question is, are they concerned with "the total CPU execution tim...

browser memory increasing constantly with javascript ajax calls

Hi, I have a strange behaviour. I am using a rather heavy page (4000 nodes) meant to display a dispatch system for delivery operations. Every 30 sec. I am refreshing with jquery, the list of operations (3000 nodes over 4000). It works perfectly well, but... each time, the memory of both firefox and chrome is increasing by 3 to 6ko. Of c...

How can I find out how much memory an instance of a C++ class consumes?

Hi, I am developing a Graph-class, based on boost-graph-library. A Graph-object contains a boost-graph, so to say an adjacency_list, and a map. When monitoring the total memory usage of my program, it consumes quite a lot (checked with pmap). Now, I would like to know, how much of the memory is exactly consumed by a filled object of thi...

How to detect in a Flex app if a camera is already in use by another application?

I am making an application that plays the video stream from the user's local system (both Windows and Mac). I use the Camera.getCamera() method and in turn Camera.names to get a list of camera attached with the system. Unfortunately, if the camera is already in use by another application, say a desktop application on user's system, the...

Js (+Mootools) - Why my script use over 60% of processor?

On this site - LINK - i need to use 3 banner scrollers (2x vertical + 1x horizontal). I've tried to do it in flash, but then everyone web browsers shut down, or suspended. Now i want to do it in JS (i use mootools). All data come from MySQL. Here's the complete code (even if you don't know mootools, You should understand it) global $wpd...

Is it possible to use Eclipse Editor in my application

Hello, Is there a compact way to extract eclipse editor as a stand-alone component and add it to another application? thanks in advance for your answers. ...

What really is the purpose of "base" keyword in c#?

Thus for used base class for some commom reusable methods in every page of my application... public class BaseClass:System.Web.UI.Page { public string GetRandomPasswordUsingGUID(int length) { string guidResult = System.Guid.NewGuid().ToString(); guidResult = guidResult.Replace("-", string.Empty); return guidResul...

C++: Should I use strings or char arrays, in general?

I'm a bit fuzzy on the basic ways in which programmers code differently in C and C++. One thing in particular is the usage of strings in C++ over char arrays, or vice versa. So, should I use strings or char arrays, in general, and why? ...