Daily Archives

Articles indexed Wednesday March 17 2010

Page 11/128 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Memory Allocation Profiling in C++

    - by Amit Kumar
    I am writing an application and am surprised to see its total memory usage is already too high. I want to profile the dynamic memory usage of my application: How many objects of each kind are there in the heap, and which functions created these objects? Also, how much memory is used by each of the object? Is there a simple way to do this? I am working on both linux and windows, so tools of any of the platforms would suffice. NOTE: I am not concerned with memory leaks here.

    Read the article

  • What does get-task-allow do in Xcode?

    - by Mr. Matt
    So when I set up my entitlements in my iPhone app project, I create a new Entitlements.plist, and set the value of get-task-allow to false. But why? What does this key represent? EDIT Note this is related to this question - I found that flipping the value of this key to true allowed me to install the app on my device)

    Read the article

  • question about sorting

    - by skydoor
    Bubble sort is O(n) at best, O(n^2) at worst, and its memory usage is O(1) . Merge sort is always O(n log n), but its memory usage is O(n). Which algorithm we would use to implement a function that takes an array of integers and returns the max integer in the collection, assuming that the length of the array is less than 1000. What if the array length is greater than 1000?

    Read the article

  • web2py or grok (zope) on a big portal,

    - by Robert
    Hi, I am planning to make some big project (1 000 000 users, approximately 500 request pre second - in hot time). For performance I'm going to use no relational dbms (each request could cost lot of instructions in relational dbms like mysql) - so i can't use DAL. My question is: how web2py is working with a big traffic, is it work concurrently? I'm consider to use web2py or Gork - Zope, How is working zodb(Z Object Database) with a lot of data? Is there some comparison with object-relational postgresql? Could you advice me please.

    Read the article

  • Avoid generating empty STDOUT and STDERR files with Sun Grid Engine (SGE) and array jobs

    - by vy32
    I am running array jobs with Sun Grid Engine (SGE). My carefully scripted array job workers generate no stdout and no stderr when they function properly. Unfortunately, SGE insists on creating an empty stdout and stderr file for each run. Sun's manual states: STDOUT and STDERR of array job tasks will be written into dif- ferent files with the default location .['e'|'o']'.' In order to change this default, the -e and -o options (see above) can be used together with the pseudo-environment-vari- ables $HOME, $USER, $JOB_ID, $JOB_NAME, $HOSTNAME, and $SGE_TASK_ID. Note, that you can use the output redirection to divert the out- put of all tasks into the same file, but the result of this is undefined. I would like to have the output files suppressed if they are empty. Is there any way to do this?

    Read the article

  • Grails: Problem with nested associations in criteria builder

    - by Mr.B
    I have a frustrating problem with the criteria builder. I have an application in which one user has one calendar, and a calendar has many entries. Seems straightforward enough, but when I try to get the calendar entries for a given user, I can't access the user property (MissingMethodException). Here's the code: def getEntries(User user) { def entries = Entries.createCriteria().list() { calendar { user { eq("user.id", user.id) } } } } I have even tried the following variation: def getEntries(User user) { def entries = Entries.createCriteria().list() { calendar { eq("user", user) } } } That did not raise an exception, but didn't work either. Here's the relevant parts of the domain classes: class Calendar { static belongsTo = [user: User] static hasMany = [entries: Entries] ... } class User { Calendar calendar ... } class Entry { static belongsTo = [calendar: Calendar] ... } When Googling I came across a similar problem noted in early 2008: http://jira.codehaus.org/browse/GRAILS-1412 But according to that link this issue should have been solved long ago. What am I doing wrong?

    Read the article

  • Is there a jquery List plugin that will auto-sort items and has robust add/remove methods?

    - by Breadtruck
    I have been googling for hours looking for something to handle my situation. I am not skilled enough to write my own jquery plugin ..YET!! The plugin should auto-sort the list, not as important as being able to add/remove items from the list easily. Themeroller capable would be a plus. I would basically use anything as long as I could add a item to the list (or any other container for that matter), item is coming from a modal popup that is using ajax to search for the item. Once the item is found I want to click that item and have it added to the list and it would put it into the correct order based on alphabetic sort. I think where I am losing sight is the complexity of the item and needing to have the item contain: The name of the item a hidden value, [the int id of the item], one or two checkboxes for turning on/off a feature for that item. I am really open to any ideas, suggestions on a better process, or a pointer to a plugin that might get me close.

    Read the article

  • Diff tool to align shuffled lines

    - by Ken Bloom
    Suppose I have two documents that are identical except the lines are shuffled. Is there a tool that can show me which lines in document A correspond to which lines on document B by drawing lines to connect them (kinda like Cairo does for machine translation word alignments)? What if the files have some level of differing lines (I don't want to figure out which lines are similar to each other -- if there isn't an exact match for a line, then that line has no match.) Note: I am not looking to sort the files and compare them, rather I am looking to get a visualization of how far out of order the files are relative to each other, and which particular regions tend to move together, and which tend to be shuffled.

    Read the article

  • JQuery Ajax Load Mobile Browser Back Functionality

    - by Brad
    Currently working on a mobile site using the .load() technique: $.ajaxSetup ({cache: false}); contentLoad(); function contentLoad() { $('a.inline').click(function(){ var toLoad = $(this).attr('href')+' #content'; $('#loading').show(); $('#content').load(toLoad,'',showNewContent) function showNewContent() { $('#loading').hide(); $('#content').show(); contentLoad(); } return false; }); } How would I be able to integrate back and forward button functionality into mobile browsers? Hope this is possible. Thanks in advance.

    Read the article

  • How to access Postgresql using QT in Windows

    - by dummystories
    Hi to all, I am developing an application using QtRuby and postgresql. I sucessfully developed and running sucessfully in Linux. Now i want to run the same application in windows. But i am failing to connect to database(Postgresql). I am getting the following errors: QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC Can any one help how to resolve my problem. I am waiting for your replies. Regards, Narasimha Raju.Naidu

    Read the article

  • Prevent Ruby on Rails from sending the session header

    - by hurikhan77
    How do I prevent Rails from always sending the session header (Set-Cookie). This is a security problem if the application also sends the Cache-Control: public header. My application touches (but does not modify) the session hash in some/most actions. These pages display no private content so I want them to be cacheable - but Rails always sends the cookie header, no matter if the sent session hash is different from the previous or not. What I want to achieve is to only send the hash if it is different from the one received from the client. How can you do that? And probably that fix should also go into official Rails release? What do you think?

    Read the article

  • C# Proposal: Compile Time Static Checking Of Dynamic Objects

    - by Paulo Morgado
    C# 4.0 introduces a new type: dynamic. dynamic is a static type that bypasses static type checking. This new type comes in very handy to work with: The new languages from the dynamic language runtime. HTML Document Object Model (DOM). COM objects. Duck typing … Because static type checking is bypassed, this: dynamic dynamicValue = GetValue(); dynamicValue.Method(); is equivalent to this: object objectValue = GetValue(); objectValue .GetType() .InvokeMember( "Method", BindingFlags.InvokeMethod, null, objectValue, null); Apart from caching the call site behind the scenes and some dynamic resolution, dynamic only looks better. Any typing error will only be caught at run time. In fact, if I’m writing the code, I know the contract of what I’m calling. Wouldn’t it be nice to have the compiler do some static type checking on the interactions with these dynamic objects? Imagine that the dynamic object that I’m retrieving from the GetValue method, besides the parameterless method Method also has a string read-only Property property. This means that, from the point of view of the code I’m writing, the contract that the dynamic object returned by GetValue implements is: string Property { get; } void Method(); Since it’s a well defined contract, I could write an interface to represent it: interface IValue { string Property { get; } void Method(); } If dynamic allowed to specify the contract in the form of dynamic(contract), I could write this: dynamic(IValue) dynamicValue = GetValue(); dynamicValue.Method(); This doesn’t mean that the value returned by GetValue has to implement the IValue interface. It just enables the compiler to verify that dynamicValue.Method() is a valid use of dynamicValue and dynamicValue.OtherMethod() isn’t. If the IValue interface already existed for any other reason, this would be fine. But having a type added to an assembly just for compile time usage doesn’t seem right. So, dynamic could be another type construct. Something like this: dynamic DValue { string Property { get; } void Method(); } The code could now be written like this; DValue dynamicValue = GetValue(); dynamicValue.Method(); The compiler would never generate any IL or metadata for this new type construct. It would only thee used for compile type static checking of dynamic objects. As a consequence, it makes no sense to have public accessibility, so it would not be allowed. Once again, if the IValue interface (or any other type definition) already exists, it can be used in the dynamic type definition: dynamic DValue : IValue, IEnumerable, SomeClass { string Property { get; } void Method(); } Another added benefit would be IntelliSense. I’ve been getting mixed reactions to this proposal. What do you think? Would this be useful?

    Read the article

  • IOCTL call error when trying to format an SD card

    - by masfenix
    Found an SD card (1GB) lying around. Thought I might pop that into my card reader and see if anything is on it. Nothing. There isn't even a file system on it. I right-click and go "format" but nothing happens. So I try in command. > format f: Insert new disk for drive F: and press ENTER when ready... Error in IOCTL call. What does this mean?

    Read the article

  • Pass by reference in Boost::Python

    - by Fabzter
    Hi everybody. Consider something like: struct Parameter { int a; Parameter(){a = 0} void setA(int newA){a = newA;} }; struct MyClass { void changeParameter(Parameter &p){ p.setA(-1);} }; Well, let's fast forward, and imagine I already wrapped those classes, exposing everything to python, and imagine also I instantiate an object of Parameter in the C++ code, which I pass to the python script, and that python script uses a MyClass object to modify the instance of Parameter I created at the beginning in the C++ code. After that code executes, in C++ Parameter instance is unchanged!!! This means it was passed by value (or something alike :S), not by reference. But I thought I declared it to be passed by reference... I can't seem to find Boost::Python documentation about passing by reference (although there seems to be enough doc about returning by reference...). Can anyone give some hint or pointer please?

    Read the article

  • Div that should take up the "rest of the page" expands beyond the page in ie.

    - by Clox
    Okay, this is REALLY starting to bug me... This page works fine in both Chrome and Firefox. www.bloggan.tk But if it's opened in internet-explorer it always expands beyond the page and introduces the scrollbar no matter what the resolution of the browser is. I have NO idea what change in the html it was that cause this... Here's the blogger-template-html-source I'd REALLY appreciate if someone could help me with this. Thanks in advance! Edit: I've "solved" it for IE using javascript, but that's only temporary (i hope). The version without javascript can be seen here, so that you still will be able to know what I'm talking about. Still trying to solve it, and still hoping for someone to help me.

    Read the article

  • Having to hit the site login button twice after first turning on computer

    - by John
    Hello, The code below is for a login that I'm using. It works fine, but when I first try logging in after turning on my computer, it only works the second time that I hit the "Login" button. Any idea how I can make it not require hitting the "Login" button twice in this situation? Thanks in advance, John function isLoggedIn() { if (session_is_registered('loginid') && session_is_registered('username')) { return true; // the user is loged in } else { return false; // not logged in } return false; } if (!isLoggedIn()) { if (isset($_POST['cmdlogin'])) { if (checkLogin($_POST['username'], $_POST['password'])) { show_userbox(); } else { echo "Incorrect Login information !"; show_loginform(); } } else { show_loginform(); } } else { show_userbox(); } function show_loginform($disabled = false) { echo '<form name="login-form" id="login-form" method="post" action="./index.php"> <div class="usernameformtext"><label title="Username">Username: </label></div> <div class="usernameformfield"><input tabindex="1" accesskey="u" name="username" type="text" maxlength="30" id="username" /></div> <div class="passwordformtext"><label title="Password">Password: </label></div> <div class="passwordformfield"><input tabindex="2" accesskey="p" name="password" type="password" maxlength="15" id="password" /></div> <div class="registertext"><a href="http://www...com/sandbox/register.php" title="Register">Register</a></div> <div class="lostpasswordtext"><a href="http://www...com/sandbox/lostpassword.php" title="Lost Password">Lost password?</a></div> <p class="loginbutton"><input tabindex="3" accesskey="l" type="submit" name="cmdlogin" value="Login" '; if ($disabled == true) { echo 'disabled="disabled"'; } echo ' /></p></form>'; } EDIT: Here is another function that is used. function isLoggedIn() { if (session_is_registered('loginid') && session_is_registered('username')) { return true; // the user is loged in } else { return false; // not logged in } return false; }

    Read the article

  • Connecting to tcp server from client running in android device

    - by Andhravaala
    Hi, I am trying to connect to a standalone desktop tcp server(java) from tcp client application in android device. But I am not able to connect to that. I tried to write a desktop tcp client and tried to connect to server(remote server). It is working fine. But When I am trying to connecting from android, I am getting a IOException while creating Socket instance. Can anyone help me in this ? Thanks in advance....

    Read the article

  • Windows Series Phone 7 "Cloud"

    - by user275561
    I have been reading up on "Cloud computing" on here and still not getting it. Basically I want to develop for the WP7 http://msdn.microsoft.com/en-us/library/ff402531%28v=VS.92%29.aspx#AppPlat_Overview_Arch Now it mentions everything as being in the "Cloud". Is any server just a cloud? If i have a WCF service or wsdl on my server. Can I consider myself that "Cloud"? Or is there something that a server emits that checks whether or not it is a cloud?

    Read the article

  • Inaccurate performance counter timer values in Windows Performance Monitor

    - by krisg
    I am implementing instrumentation within an application and have encountered an issue where the value that is displayed in Windows Performance Monitor from a PerformanceCounter is incongruent with the value that is recorded. I am using a Stopwatch to record the duration of a method execution, then first i record the total milliseconds as a double, and secondly i pass the Stopwatch's TimeSpan.Ticks to the PerformanceCounter to be recorded in the Performance Monitor. Creating the Performance Counters in perfmon: var datas = new CounterCreationDataCollection(); datas.Add(new CounterCreationData { CounterName = name, CounterType = PerformanceCounterType.AverageTimer32 }); datas.Add(new CounterCreationData { CounterName = namebase, CounterType = PerformanceCounterType.AverageBase }); PerformanceCounterCategory.Create("Category", "performance data", PerformanceCounterCategoryType.SingleInstance, datas); Then to record i retrieve a pre-initialized counter from a collection and increment: _counters[counter].IncrementBy(timing); _counters[counterbase].Increment(); ...where "timing" is the Stopwatch's TimeSpan.Ticks value. When this runs, the collection of double's, which are the milliseconds values for the Stopwatch's TimeSpan show one set of values, but what appears in PerfMon are a different set of values. For example... two values recorded in the List of milliseconds are: 23322.675, 14230.614 And what appears in PerfMon graph are: 15.546, 9.930 Can someone explain this please?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >