Search Results

Search found 3747 results on 150 pages for '500'.

Page 59/150 | < Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >

  • Bulk update & occasional insert (coredata) - Too slow

    - by Andrew
    Update: Currently looking into NSSET's minusSet links: http://stackoverflow.com/questions/1475636/comparing-two-arrays Hi guys, Could benefit from your wisdom here.. I'm using Coredata in my app, on first launch I download a data file and insert over 500 objects (each with 60 attributes) - fast, no problem. Each subsequent launch I download an updated version of the file, from which I need to update all existing objects' attributes (except maybe 5 attributes) and create new ones for items which have been added to the downloaded file. So, first launch I get 500 objects.. say a week later my file now contains 507 items.. I create two arrays, one for existing and one for downloaded. NSArray *peopleArrayDownloaded = [CoreDataHelper getObjectsFromContext:@"person" :@"person_id" :YES :managedObjectContextPeopleTemp]; NSArray *peopleArrayExisting = [CoreDataHelper getObjectsFromContext:@"person" :@"person_id" :YES :managedObjectContextPeople]; If the count of each array is equal then I just do this: NSUInteger index = 0; if ([peopleArrayExisting count] == [peopleArrayDownloaded count]) { NSLog(@"Number of people downloaded is same as the number of people existing"); for (person *existingPerson in peopleArrayExisting) { person *tempPerson = [peopleArrayDownloaded objectAtIndex:index]; // NSLog(@"Updating id: %@ with id: %@",existingPerson.person_id,tempPerson.person_id); // I have 60 attributes which I to update on each object, is there a quicker way other than overwriting existing? index++; } } else { NSLog(@"Number of people downloaded is different to number of players existing"); So now comes the slow part. I end up using this (which is tooooo slow): NSLog(@"Need people added to the league"); for (person *tempPerson in peopeArrayDownloaded) { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"person_id = %@",tempPerson.person_id]; // NSLog(@"Searching for existing person, person_id: %@",existingPerson.person_id); NSArray *filteredArray = [peopleArrayExisting filteredArrayUsingPredicate:predicate]; if ([filteredArray count] == 0) { NSLog(@"Couldn't find an existing person in the downloaded file. Adding.."); person *newPerson = [NSEntityDescription insertNewObjectForEntityForName:@"person" inManagedObjectContext:managedObjectContextPeople]; Is there a way to generate a new array of index items referring to the additional items in my downloaded file? Incidentally, on my tableViews I'm using NSFetchedResultsController so updating attributes will call [cell setNeedsDisplay]; .. about 60 times per cell, not a good thing and it can crash the app. Thanks for reading :)

    Read the article

  • how many lines of code does my class library have

    - by zachary
    for metrics reasons I need to know how many lines of code my class library has. I'm doing this for code coverage.... So if Class library 1 has 50 lines of code and 100% coverage And if Class library 2 has 500 lines of code and 0% coverage My total coverage is 90% Any idea how to do this? Is there a utility or a way to use Visual Studio?

    Read the article

  • dynamically scale images in php jpg/png/gif

    - by Patrick
    Is there a simple way of dynamically scaling an image in php? Id like to specifically use some kind of function where i can insert it into my heml such as <img src=image.php?img=boss.jpg&width=500> and of course it would then scale the image to whatever height constrains it to 500px wide i appreciate all input, thanks. EDIT does need to include jpg png and gif file types

    Read the article

  • Can't get jQuery to get focus on cloned input fields

    - by Rebel1Moon
    I have a page that needs to create dynamic form fields as often as the user needs, and I am trying to use Ajax to tie it in to my database for faster form entry and to prevent user typos. So, I have put my Ajax returned data into popup div, the user selects, then the form field is filled in. The problem comes on the cloned fields. They don't seem to want to bring up the popup div when focused. I am thinking it is something to do with when they get created/added to the DOM. Here is my JS that creates the clones: $(document).ready(function() { var regex = /^(.*)(\d)+$/i; var cloneIndex = $(".clonedInput").length; $("button.clone").live("click", function(){ $(this).parents(".clonedInput").clone() .appendTo("#course_container") .attr("id", "clonedInput" + cloneIndex) .find("*").each(function() { var id = this.id || ""; var match = id.match(regex) || []; if (match.length == 3) { this.id = match[1] + (cloneIndex); } }); cloneIndex++; numClones=cloneIndex-1; //alert("numClones "+numClones); }); Here is where I expect to be able to get focus on the correct cloned field and call the popup. The baker_equiv0 id is original code, whereas baker_equiv1 is the first clone. $('#baker_equiv0').focus(function() { \\ THIS CODE WORKS $('.popup').fadeIn(500); $('#results').empty(); // document.enter_data.baker_equiv1.value="test"; THIS LINE WORKS //alert("numClones "+numClones); }); $('#baker_equiv1').focus(function() { // THIS DOESN'T EVER FIRE alert("numClones "+numClones); $('.popup').fadeIn(500); $('#results').empty(); }); Here is the HTML with the form: <label for="baker_equiv" class="">Baker Equivalent: <span class="requiredField">*</span></label> <input type="text" class="cinputsa" name="baker_equiv[]" id="baker_equiv0" size="8" ONKEYUP="get_equiv(this.value);"> If I put this in the HTML code above, it works fine: onfocus="alert(this.id)" I'd also be interested in how to adjust the JS code to work based on the id array created rather than having to copy code for each potential set of fields clones, i.e., baker_equiv[] rather than baker_equiv0, baker_equiv1, etc. Thanks all!

    Read the article

  • Can Prototype or JQuery return an HTTP status code on an AJAX request

    - by jotto
    url = "http://example.com" new Ajax.Request(url, { onComplete: function(transport) { alert(transport.status); } }); I'd like that to return a status of 200 if the site is working, or 500 if it is not working, etc.. But that code is returning 0 all the time. Ultimately, I want to have a setinterval function that regularly pings a website for uptime status.

    Read the article

  • priority_queue with dynamic priorities

    - by Layne
    Hey, I have a server application which accepts incomming queries and executes them. If there are too many queries they should be queued and if some of the other queries got executed the queued queries should be executed as well. Since I want to pass queries with different priorities I think using a priority_queue would be the best choice. e.g. The amout of the axcepting queries (a) hit the limt and new queries will be stored in the queue. All queries have a priority of 1 (lowest) if some of the queries from (a) get executed the programm will pick the query with the highest priority out of the queue and execute it. Still no problem. Now someone is sending a query with a priority of 5 which gets added to the queue. Since this is the query with the highest priority the application will execute this query as soon as the running queries no longer hit the limit. There might be the worst case that 500 queries with a priority of 1 are queued but wont be executed since someone is always sending queries with a priority of 5 hence these 500 queries will be queued for a looooong time. In order to prevent that I want to increase the prioritiy of all queries which have a lower priority than the query with the higher priority, in this example which have a priority lower than 5. So if the query with a priority of 5 gets pulled out of the queue all other queries with a priority < 5 should be increased by 0.2. This way queries with a low priority wont be queued for ever even if there might be 100 queries with a higher priority. I really hope can help me to solve the problem with the priorities: Since my queries consist of an object I thought something like this might work: class Query { public: Query( std::string p_stQuery ) : stQuery( p_stQuery ) {}; std::string getQuery() const {return stQuery;}; void increasePriority( const float fIncrease ) {fPriority += fIncrease;}; friend bool operator < ( const Query& PriorityFirst, const Query& PriorityNext ) { if( PriorityFirst.fPriority < PriorityNext.fPriority ) { if( PriorityFirst.fStartPriority < PriorityNext.fStartPriority ) { Query qTemp = PriorityFirst; qTemp.increasePriority( INCREASE_RATE ); } return true; } else { return false; } }; private: static const float INCREASE_RATE = 0.2; float fPriority; // current priority float fStartPriority; // initialised priority std::string stQuery; };

    Read the article

  • how to do this in MySql Query??

    - by deep
    ID NAME AMT 1 Name1 1000 2 Name2 500 3 Name3 3000 4 Name1 5000 5 Name2 2000 6 Name1 3000 consider above table as sample. am having a problem in my sql query, Am using like this. Select name,amt from sample where amt between 1000 and 5000 it returns all the values in the table between 1000 and 5000, instead I want to get maximum amount record for each name i.e., 3 name3 3000 4 name1 5000 5 name2 2000

    Read the article

  • Hadoop On Azure C#Isotope

    - by Sreesankar
    During the initial release of the HadoopOnAzure, Microsoft had provided the C#Isotope SDK as a programatic interface to the Hadoop cluster on the Azure. After the HDInsight release this is removed from the downoads. More over while trying with the previous version of the sdk we get a 500 - Internal Server Error. Any idea if this services is disabled? If so whats the alternative way to programatically interface with the HDInsight Cluster on Azure?

    Read the article

  • Is nginx / node.js / postgres a very scalable architecture?

    - by Luc
    I have an app running with: one instance of nginx as the frontend (serving static file) a cluster of node.js application for the backend (using cluster and expressjs modules) one instance of Postgres as the DB Is this architecture sufficient if the application needs scalability (this is only for HTTP / REST requests) for: 500 request per seconds (each requests only fetches data from the DB, those data could be several ko, and with no big computation needed after the fetch). 20000 users connected at the same time Where could be the bottlenecks ?

    Read the article

  • wait t time before launch an action ?

    - by Nanis
    Hi, I actually had a multiautocompletetextview, where i call host after 3 characters to have a dynamic search list. But if the user put others characters, my code call host for each of them. So it must be very long. Could I wait a moment (about 500 ms) before launching the action , in order to look if user do an action or not ? that's possible ?

    Read the article

  • What would be better, (1 database + 4 tables) or (2 databases + 2 tables each) ?

    - by griseldas
    Hi there, I would like to be advised on what would be better (in regards to performance) A) 1 DATABASE with 4 tables or B) 2 DATABASES (same server), each with 2 tables. The tables size and usage are more or less similar, so the 2 tables on Database 1 would be similar usage/size to the 2 tables on database 2 The tables could have +500,000 records and the 2 tables on each database are not related (no join queries etc between them) Thanks in advance for your comments

    Read the article

  • jquery ie errors?! animate?

    - by daniel Crabbe
    ie being quite baffling at the mo! really domn't know how; $("#info").delay(500).animate({ 'left': "0px", }, 250 ); can throw an erro but it does? Thinks its the animate but not sure how? link http://rundell.modernactivity.co.uk/ (line 175-177) works fine in all other browsers. any help welcome...

    Read the article

  • Struts formbean problem

    - by xain
    Hi, I have a struts app with a jsp with the code: ... ... <input name="inrofol" class="inputfilter" id="inrofol" size="22" maxlength="20" type="text"> ... And even though it's not linked to the associated form bean, I get the exception Error 500: No getter method for property: "inrofol" of bean: "com.test.forms.CompForm" Any hints ? Thanks

    Read the article

  • JavaScript IF with AND/OR.. not working

    - by nobosh
    Can someone who is a master at JS tell me what's wrong with this? if ( $.trim($("#add-box-text").val()).length < 2 && $.trim($("#add-box-text").val()) != "Click here to add an item" ) { // If it's LT than 1 Character, don't submit $("#add-box-text").effect('highlight', {color: '#BDC1C7'}, 500); // Refocus $("#add-box-text").focus(); }

    Read the article

  • Want to have vertical scroll bar if content is more than expected in popwindow

    - by OM The Eternity
    Want to have vertical scroll bar if content is more than expected in popwindow... I have a snippet to display the popwindow on click of a button which is given below: window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,left=150,overflow-x:hidden') with this, i am not able to have th vertical scrollbar if i have the more than expected content in it, How can i get the vertical scroll bar display byitself whenever needed?

    Read the article

  • SELECT GROUP BY latest entry in INBOX msg sent by user

    - by Mohatir S
    i am building a simple PM for my personal website where a user can join and send message to the registered users on my website, i am stuck in grouping and selecting latest user (by latest msg time) in INBOX page my table : id msg_from msg_to msg date in_del out_del i want to show latest user's id each in a group here is my SQL query : SELECT ttalk.id, ttalk.msg_from, users.first_name, users.last_name FROM ttalk INNER JOIN users ON ttalk.msg_from = users.id WHERE ttalk.msg_to = '$_SESSION[user_id]' AND ttalk.in_del='0' GROUP BY ttalk.msg_from DESC LIMIT 500 Thanks in advance :-)

    Read the article

  • jquery dialog popup window problem

    - by kumar
    I have this code $("#window").dialog({ resizable: true, height: 180, title: titles, width: 500, modal: false, buttons: { "OK": function () { $(this).dialog("close"); } } }); i am able to get the popup perfectly but the problem I am getting here is.. On the top of the Dialog box I have 'X' I am not able to see that X on dialog popup's but when I resize my window I can able to see.. what I am doing wrong in this? Thanks for your all help

    Read the article

  • how do you set a handler for appengine_rpc?

    - by python for ever
    i followed what is said in the article. but still i get these errors: first this warning : No handlers could be found for logger "google.appengine.tools.appengine_rpc" then this error: HTTPError: HTTP Error 500: Internal Server Error anyone has an idea about what i am doing wrong? thanks.

    Read the article

  • Cannot get document.getElementByID to work

    - by user1804234
    The following function doesn't work for some reason. Can someone see what the problem is? function checkMaxLen(txt, maxLen) { var actualLen = txt.value.length; var remain = maxLen - actualLen; document.getElementById('remainChar').Value = remain; } <input type="text" id="remainChar" runat="server" value="500"/> Whenever I try to run the function, I get this error: Microsoft JScript runtime error: Unable to set value of the property 'Value': object is null or undefined

    Read the article

< Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >