Search Results

Search found 16731 results on 670 pages for 'memory limit'.

Page 86/670 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • How long should it take for someone to be able to type code from memory?

    - by LordSnoutimus
    Hi, I understand that this question could be answered with a simple sentence and that it may be viewed as subjective, however, I am a young student who is interested in pursuing a career in programming and wondered how long it took some of you to get to the level of experience you are now?. I ask this because I am currently working on building an application in Java on the Android platform and it bothers me that I am constantly having to look up how to write a certain section of code in my application such as writing to a database, or how the if loop should be structured. My question really is, how long did it take for you to become experienced enough to actually know exactly how your next line of code was going to look, before you even wrote it?

    Read the article

  • Removing a view from it's superview causes memory error - why?

    - by mystify
    Xcode is throwing an error at me: malloc: * error for object 0x103f000: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug I tracked down the code until a line where I do this: - (void)inputValueCommitted:(NSString *)animationID finished:(BOOL)finished context:(void *)context { // retainCount of myView is 2! (one for the retain-property, one for beeing a subview) [self.myView removeFromSuperview]; // ERROR-LINE !! self.myView = nil; } When I remove that errorful line, the error is gone. So in conclusion: I can't get rid of my view! It's an UIImageView with nothing else inside, just showing an image. What I do is this: I create an UIView Animation Block, create that UIImageView, assign it to an retain-property with self.myView = ..., and after the animation is done, I just want to get rid of that view. So I remove it from it's superview and then set my property to nil, which lets it go away - in theory. Did anyone else encounter such issues? iPhone SDK 3.0.

    Read the article

  • SELECT a list of elements and 5 tags for each one

    - by Vittorio Vittori
    Hi, I'm trying to query a set of buldings listed on a table, these buildings are linked with tags. I'm able to do it, but my problem is how limit the number of tags to see: table buildings id building_name style 1 Pompidou bla 2 Alcatraz bla 3 etc. etc. table tags // they can be 50 or more per building id tag_name 1 minimal 2 gothic 3 classical 4 modern 5 etc. table buildings_tags id building_id tag_id I though to do something like this to retrieve the list, but this isn't compplete: SELECT DISTINCT(tag), bulding_name FROM buldings INNER JOIN buildings_tags ON buildings.id = buildings_tags.building_id INNER JOIN tags ON tags.id = buildings_tags.tag_id LIMIT 0, 20 // result building tag Pompidou great Pompidou france Pompidou paris Pompidou industrial Pompidou renzo piano <= How to stop at the 5th result? Pompidou hi-tech Pompidou famous place Pompidou wtf etc.. etc... this query loads the buildings, but this query loads all the tags linked for the building, and not only 5 of them?

    Read the article

  • How to solve Memory leaks in Lib Xml Parser in objective-C where the list is returned?

    - by Madan Mohan
    Hi Guys, I got leaks in Lib Xml Parser while retrieving the data from the net, Here in the below code, I have allocated the list - (void)getCustomersList { // make an operation so we can push it into the queue SEL method = @selector(parseForData); NSInvocationOperation *op = [[NSInvocationOperation alloc] initWithTarget:self selector:method object:nil]; customersTempList = [[NSMutableArray alloc] initWithCapacity:20];// allocated list [self.retrieverQueue addOperation:op]; [op release]; } // return each recode // in parser .m class one of the condition in endElement where it shows a leak. else if(0 == strncmp((const char *)localname, kCustomerElement, kCustomerElementLength)) { [customersTempList addObject:customer]; printf("\n no of objects in temp list:%d", [customersTempList count]); if ([customersTempList count] == 20) { NSMutableArray* argsList = [customersTempList copy];//////////////////////here it is showing leak. printf("\n Calling reload data with %d new objects", [argsList count]); SEL selector = @selector(parser:addCustomerObject:); NSMethodSignature *sig = [(id)self.delegate methodSignatureForSelector:selector]; if(nil != sig && [self.delegate respondsToSelector:selector]) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; [invocation retainArguments]; [invocation setTarget:self.delegate]; [invocation setSelector:selector]; [invocation setArgument:&self atIndex:2]; [invocation setArgument:&argsList atIndex:3]; [invocation performSelectorOnMainThread:@selector(invoke) withObject:NULL waitUntilDone:NO]; } [customersTempList removeAllObjects]; } } // returned the list after all the records are stored in the list else if(0 == strncmp((const char *)localname, kCustomersElement, kCustomersElementLength)) { printf("\n Calling reload data with %d new objects", [customersTempList count]); NSMutableArray* argsList = [customersTempList copy]; printf("\n Calling reload data with %d new objects", [argsList count]); SEL selector = @selector(parser:addCustomerObject:); NSMethodSignature *sig = [(id)self.delegate methodSignatureForSelector:selector]; if(nil != sig && [self.delegate respondsToSelector:selector]) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; [invocation retainArguments]; [invocation setTarget:self.delegate]; [invocation setSelector:selector]; [invocation setArgument:&self atIndex:2]; [invocation setArgument:&argsList atIndex:3]; [invocation performSelectorOnMainThread:@selector(invoke) withObject:NULL waitUntilDone:NO]; } [customersTempList removeAllObjects]; } } please help me out of this, Thanks, Madan.

    Read the article

  • Why can't I reclaim my dynamically allocated memory using the "delete" keyword?

    - by synaptik
    I have the following class: class Patient { public: Patient(int x); ~Patient(); private: int* RP; }; Patient::Patient(int x) { RP = new int [x]; } Patient::~Patient() { delete [] RP; } I create an instance of this class on the stack as follows: void f() { Patient p(10); } Now, when f() returns, I get a "double free or corruption" error, which signals to me that something is attempted to be deleted more than once. But I don't understand why that would be so. The space for the array is created on the heap, and just because the function from inside which the space was allocated returns, I wouldn't expect the space to be reclaimed. I thought that if I allocate space on the heap (using the new keyword), then the only way to reclaim that space is to use the delete keyword. Help! :)

    Read the article

  • Huge Graph Structure

    - by Harph
    I'm developing an application in which I need a structure for represent a huge graph (between 1000000 and 6000000 nodes and 100 or 600 edges) in memory. The edges representation will contain some attribute of the relation. I have tried a memory map representation, arrays, dictionaries and string for represent that structure in memory, but this always crash because the memory limit. I would to get an advice of how can I represent this, or something similar. By the way, I'm using python.

    Read the article

  • Using too much memory in C/NDK?

    - by rebeccamaher
    I've recently found out there is no hard limit to how much memory you can allocate in C/NDK on Android. This is in contrast to Java where the limit is ~24Mb. I'm working on a few apps that could greatly benefit from using about ~50Mb total. Is this far too much memory to use? Does anyone have any experience with developing apps that go above the Java limit and what impact this has across devices? Obviously, I don't want to kill all background apps by consuming too much memory and I know the Android devs suggest not using too much memory but limiting all apps to ~24Mb is very limiting to certain kinds of apps. I've seen a few Android games recently that say they use ~256Mb. I'm planning to use about 50Mb total for my app. Does this sound reasonable in terms of stability across devices that have a limit of 24Mb?

    Read the article

  • Concatenating a string and byte array in to unmanaged memory.

    - by Scott Chamberlain
    This is a followup to my last question. I now have a byte[] of values for my bitmap image. Eventually I will be passing a string to the print spooler of the format String.Format("GW{0},{1},{2},{3},", X, Y, stride, _Bitmap.Height) + my binary data; I am using the SendBytesToPrinter command from here. Here is my code so far to send it to the printer public static bool SendStringPlusByteBlockToPrinter(string szPrinterName, string szString, byte[] bytes) { IntPtr pBytes; Int32 dwCount; // How many characters are in the string? dwCount = szString.Length; // Assume that the printer is expecting ANSI text, and then convert // the string to ANSI text. pBytes = Marshal.StringToCoTaskMemAnsi(szString); pBytes = Marshal.ReAllocCoTaskMem(pBytes, szString.Length + bytes.Length); Marshal.Copy(bytes,0, SOMTHING GOES HERE,bytes.Length); // this is the problem line // Send the converted ANSI string + the concatenated bytes to the printer. SendBytesToPrinter(szPrinterName, pBytes, dwCount); Marshal.FreeCoTaskMem(pBytes); return true; } My issue is I do not know how to make my data appended on to the end of the string. Any help would be greatly appreciated, and if I am doing this totally wrong I am fine in going a entirely different way (for example somehow getting the binary data concatenated on to the string before the move to unmanaged space. P.S. As a second question, will ReAllocCoTaskMem move the data that is sitting in it before the call to the new location?

    Read the article

  • Do the 'up to date' guarantees provided by final field in Java's memory model extend to indirect ref

    - by mattbh
    The Java language spec defines semantics of final fields in section 17.5: The usage model for final fields is a simple one. Set the final fields for an object in that object's constructor. Do not write a reference to the object being constructed in a place where another thread can see it before the object's constructor is finished. If this is followed, then when the object is seen by another thread, that thread will always see the correctly constructed version of that object's final fields. It will also see versions of any object or array referenced by those final fields that are at least as up-to-date as the final fields are. My question is - does the 'up-to-date' guarantee extend to the contents of nested arrays, and nested objects? An example scenario: Thread A constructs a HashMap of ArrayLists, then assigns the HashMap to final field 'myFinal' in an instance of class 'MyClass' Thread B sees a (non-synchronized) reference to the MyClass instance and reads 'myFinal', and accesses and reads the contents of one of the ArrayLists In this scenario, are the members of the ArrayList as seen by Thread B guaranteed to be at least as up to date as they were when MyClass's constructor completed?

    Read the article

  • Minimum 4 Characters or Show Nothing - PHP

    - by ali
    Hi, I want to show up only words with minimum 4 Characters, actually I can limit the hits and show only words with min. 100 hits - but how can I set a min. character length? thank you! function sm_list_recent_searches($before = '', $after = '', $count = 20) { // List the most recent successful searches. global $wpdb, $table_prefix; $count = intval($count); $results = $wpdb->get_results( "SELECT `terms`, `datetime` FROM `{$table_prefix}searchmeter_recent` WHERE 100 < `hits` ORDER BY `datetime` DESC LIMIT $count"); if (count($results)) { foreach ($results as $result) { echo '<a href="'. get_settings('home') . '/search/' . urlencode($result->terms) . '">'. htmlspecialchars($result->terms) .'</a>'.", "; } } }

    Read the article

  • How do you detach an array of strings from shared memory? C

    - by Tim
    I have: int array_id; char* records[10]; // get the shared segment if ((array_id = shmget(IPC_PRIVATE, 1, 0666)) == -1) { perror("Array Creating"); } // attach records[0] = (char*) shmat(array_id, (void*)0, 0); if ((int) *records == -1) { perror("Array Attachment"); } which works fine, but when i try and detach i get an "invalid argument" error. // detach int error; if( (error = shmdt((void*) records[0])) == -1) { perror(array detachment); } any ideas? thank you

    Read the article

  • Running out of memory when getting a bitmap from a server?

    - by ikky
    Hi! I'm making an application which uses MANY images. The application gets the images from a server, and downloads them one at a time. After many images the creation of a bitmap returns an exception, but i don't know how to solve this. Here is my function for downloading the images: public static Bitmap getImageFromWholeURL(String sURL) { HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(sURL); myRequest.Method = "GET"; // If it does not exist anything on the url, then return null try { HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(myResponse.GetResponseStream()); myResponse.Close(); return bmp; } catch (Exception e) { return null; } } Can anyone help me out here? Thanks in advance!

    Read the article

  • PHP - How to display other values, when a query is limited by 3?

    - by Dodi300
    Hello. Can anyone tell me how to display the other values, when a query is limited my 3. In this question I asked how to order and limit values, but now I want to show the others in another query. How would I go about doing this? Here's the code I used before: $query = "SELECT gmd FROM account ORDER BY gmd DESC LIMIT 3"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { } Thanks!

    Read the article

  • MySQL Query to receive random combinations from two tables.

    - by Michael
    Alright, here is my issue, I have two tables, one named firstnames and the other named lastnames. What I am trying to do here is to find 100 of the possible combinations from these names for test data. The firstnames table has 5494 entries in a single column, and the lastnames table has 88799 entries in a single column. The only query that I have been able to come up with that has some results is: select * from (select * from firstnames order by rand()) f LEFT JOIN (select * from lastnames order by rand()) l on 1=1 limit 10; The problem with this code is that it selects 1 firstname and gives every lastname that could go with it. While this is plausible, I will have to set the limit to 500000000 in order to get all the combinations possible without having only 20 first names(and I'd rather not kill my server). However, I only need 100 random generations of entries for test data, and I will not be able to get that with this code. Can anyone please give me any advice?

    Read the article

  • pointer to preallocated memory as an input parameter and have the function fill it

    - by djones2010
    test code: void modify_it(char * mystuff) { char test[7] = "123456"; //last element is null i presume for c style strings here. //static char test[] = "123123"; //when i do this i thought i should be able to gain access to this bit of memory when the function is destroyed but that does not seem to be the case. //char * test = new char[7]; //this is also creating memory on stack and not the heap i reckon and gets destroyed once the function is done with. strcpy_s(mystuff,7,test); //this does the job as long as memory for mystuff has been allocated outside the function. mystuff = test; //this does not work. I know with c style strings you can't just do string assignments they have to be actually copied. in this case I was using this in conjunction with static char test thinking by having it as static the memory would not get destroyed and i can then simply point mystuff to test and be done with it. i would later have address the memory cleanup in the main function. but anyway this never worked. } int main(void) { char * mystuff = new char [7]; //allocate memory on heap where the pointer will point cool(mystuff); std::string test_case(mystuff); std::cout<<test_case.c_str(); //this is the only way i know how to use cout by making it into a string c++ string. delete [] mystuff; return 0; } in the case, of a static array in the function why would it not work. in the case, when i allocated memory using new in the function does it get created on the stack or heap? in the case, i have string which needs to be copied into a char * form. everything i see usually requires const char* instead of just char*. I know i could use reference to take care of this easy. Or char ** to send in the pointer and do it that way. But i just wanted to know if I could do it with just char *. Anyway your thoughts and comments plus any examples would be very helpful.

    Read the article

  • What's in-memory database technology that do realtime materialized view?

    - by KA100
    What I'm looking for is something like materialized views in front-end that shows my data in diffident ways without full recalculation. let's say I have stock watcher with many front-end views and dashborads some based on aggregation, order by or just filter with different criteria defined realtime by user. Now, I receive online record updates from some webservice and it's not like "data warehouse" every single record can be updated any time and it actually happens every second. Is there any technology can help me in such I create something like materialized view and it's update it without doing full recalculation every time data changed. Thank you.

    Read the article

  • Iterating over a large data set in long running Python process - memory issues?

    - by user1094786
    I am working on a long running Python program (a part of it is a Flask API, and the other realtime data fetcher). Both my long running processes iterate, quite often (the API one might even do so hundreds of times a second) over large data sets (second by second observations of certain economic series, for example 1-5MB worth of data or even more). They also interpolate, compare and do calculations between series etc. What techniques, for the sake of keeping my processes alive, can I practice when iterating / passing as parameters / processing these large data sets? For instance, should I use the gc module and collect manually? Any advice would be appreciated. Thanks!

    Read the article

  • CopSSH SFTP -- limit users access to their home directory only

    - by bradvido
    Let me preface this by saying I've read and followed these instructions at the FAQ many times: http://www.itefix.no/i2/node/37 It does not do what the title claims... It allows every user access to every other user's home directory, as well as access to all subfolders below the copssh installation path. I'm only using this for SFTP access and I need my users to be sandboxed into only their home directory. If you know a fool-proof way to lock users down so they can see only their home directory and its subfolders, stop reading now and reply with the solution. The details: Here is exactly what i tried as I followed the FAQ. My copSSH installation directory is: C:\Program Files\CopSSH net localgroup sftp_users /ADD **Create a user group to hold all my SFTP users cacls c:\ /c /e /t /d sftp_users **For that group, deny access at the top level and all levels below cacls "C:\Program Files\CopSSH" /c /e /t /r sftp_users **Allow my user group access to the copSSH installation directory and its subdirectories For each sftp user, I create a new windows user account, then I: net localgroup sftp_users sftp_user_1 /add **Add my user to the group I've created Open the activate user wizard for CopSSH, choosing the user, "/bin/sftponly" and Remove copssh home directory if it exists **Remains checked Create keys for public key authentication **Remains checked Create link to user's real home directory **Remains checked This works, however, every user has access to every other user's home directory as well as the CopSSH root directory.... So I tried denying access for all users to the user home directory: cacls "C:\Program Files\CopSSH\home" /c /e /t /d sftp_users **Deny access for users to the user home directory Then I tried adding permissions on a user-by-user basis for each users home\username folder. However,these permission were not allowed by windows because of the above deny rule i created at the home directory was being inherited and over-riding my allow rule. The next step for me would be to remove the deny rule at the home directory and for each user folder, add a deny rule for every user it doesn't belong to, and add an allow rule for the one user it does belong to. However, as my user list gets long, this will become very cumbersome. Thanks for the help!

    Read the article

  • Windows 7 / ATI CCC - Monitor limit?

    - by james.ingham
    Hi all, I have a Ati 4850 X2 and back in the days when Windows 7 was in beta, I had this running with 4 monitors (Crossfire off). Now I have come to set this up again, with a RTM version of Windows 7 and the latest ATI drivers and it seems I can only have two monitors on at one time. If I try and set the monitors up in Control Panel, it simply disables the non-primary monitor, and if I attempt to do it in CCC, I get the message "To extend the desktop, a desktop or display must be disabled." Does anyone know why this is and/or how to fix it? I've currently tried using the latest ATI drivers and the drivers (i think) I was using over a year ago when I had this setup. Thanks - James

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >