Daily Archives

Articles indexed Wednesday June 16 2010

Page 20/119 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • How do you efficiently bulk index lookups?

    - by Liron Shapira
    I have these entity kinds: Molecule Atom MoleculeAtom Given a list(molecule_ids) whose lengths is in the hundreds, I need to get a dict of the form {molecule_id: list(atom_ids)}. Likewise, given a list(atom_ids) whose length is in the hunreds, I need to get a dict of the form {atom_id: list(molecule_ids)}. Both of these bulk lookups need to happen really fast. Right now I'm doing something like: atom_ids_by_molecule_id = {} for molecule_id in molecule_ids: moleculeatoms = MoleculeAtom.all().filter('molecule =', db.Key.from_path('molecule', molecule_id)).fetch(1000) atom_ids_by_molecule_id[molecule_id] = [ MoleculeAtom.atom.get_value_for_datastore(ma).id() for ma in moleculeatoms ] Like I said, len(molecule_ids) is in the hundreds. I need to do this kind of bulk index lookup on almost every single request, and I need it to be FAST, and right now it's too slow. Ideas: Will using a Molecule.atoms ListProperty do what I need? Consider that I am storing additional data on the MoleculeAtom node, and remember it's equally important for me to do the lookup in the molecule-atom and atom-molecule directions. Caching? I tried memcaching lists of atom IDs keyed by molecule ID, but I have tons of atoms and molecules, and the cache can't fit it. How about denormalizing the data by creating a new entity kind whose key name is a molecule ID and whose value is a list of atom IDs? The idea is, calling db.get on 500 keys is probably faster than looping through 500 fetches with filters, right?

    Read the article

  • Microsoft expressions ... How its different from visual studio ?

    - by Xinus
    I heard just Microsoft Expressions studio from my project manager and he told me to explore on it and find out if we can do development faster using it as compared to vs2008, I started downloading trial version and started googling about it, but I couldn't find answers to following questions Why Microsoft came out with new IDE when they already have very successful one i.e. the visual studio ? How its different that visual studio ? Does it offer advantages over visual studio ? Can somebody please help me find out these answers ?

    Read the article

  • LINQ nested joins

    - by ace
    Im trying to convert a SQL join to LINQ. I need some help in getting the nested join working in LINQ. This is my SQL query, Ive cut it short just to show the nested join in SQL: LEFT OUTER JOIN dbo.TaskCommentRecipient RIGHT OUTER JOIN dbo.TaskComment ON dbo.TaskCommentRecipient.TaskCommentID = dbo.TaskComment.TaskCommentID ON dbo.Task.Taskid = dbo.TaskComment.TaskCommentTaskId

    Read the article

  • Acer Aspire One -- strange battery problem, charges only up to ~90%

    - by houbysoft
    I have this strange problem on the acer aspire one d250. It happened already once before, stayed for about two weeks, and then "fixed itself". The problem is as follows: the battery can't seem to get fully charged; ie the indicator is stuck at about 90% (it's probably not a software problem -- I have ArchLinux and Windows 7 installed and both report exactly the same) and it never passes that value, but it still shows the status as "charging" (I tried everything I could think of -- leaving it charging for extremely long amounts of time, doing a few complete charge-recharge cycles, removing/reinserting the battery, cleaning the connectors, even updating the BIOS, etc., and nothing helped). Also, when it is getting charged, it charges pretty fast until about 70% and then progresses extremely slowly. The battery holds the charge that appears on the battery indicator normally. Just can't get the battery to charge fully -- I can't get it past the 90%. At first I thought this would be a simple battery failure (even if the computer is not that old, about 6-7 months), but as I mentioned it happened once before, and then one day it fixed itself. I tried contacting Acer about this, but the support was not helpful, completely stupid, it seemed like they used canned responses, the usual. Any thoughts on how to fix this?

    Read the article

  • Text Editor like Pages iPad App

    - by tek3
    Hi all, I want to implement a functionality similar to found in Pages app..i.e. text floating around images, image zooming etc.. I have been struggling with this part of my application but no success yet. Would be grateful if someone provides me with some pointers in this regard , like 'Which UIControl should I use?','Help in thinking logic' etc.. Thanx in advance.

    Read the article

  • Regarding grep in solaris

    - by Arav
    I want grep for a particular work in multiple files. Multiple files are stored in variable testing. TESTING=$(ls -tr *.txt) echo $TESTING test.txt ab.txt bc.txt grep "word" "$TESTING" grep: can't open test.txt ab.txt bc.txt Giving me an error. Is there any other way to do it other than for loop

    Read the article

  • reorder list elements - jQuery?

    - by Alex
    Hello, I am experimenting with jQuery lately, and I was wondering if it's possible with js or pure jquery to reorder <li> elements. So if I have a silly list like the following: <ul> <li>Foo</li> <li>Bar</li> <li>Cheese</li> </ul> How would I move the list elements around? Like put the list element with Cheese before the list element with Foo or move Foo to after Bar. So is it possible? If so, how? Thanks!!

    Read the article

  • JQuery JQGrid local data loading issue

    - by ollie314
    Hi, I've got a problem with the following code <script type="text/javascript"> var mydata = [ {id:"1",name:"foo"},{id:"2",name:"bar"} ]; jQuery(document).ready(function() { jQuery("#lgrid").jqGrid({ data: mydata, datatype: "local", height: 150, width:600, rowNum: 10, rowList: [10,20,30], colNames:['id','name'], colModel:[ {name:'id',index:'id', width:60, sorttype:"int"}, {name:'name',index:'name', width:60}], pager: "#pgrid", viewrecords: true, caption: "Contacts" }); }); </script> And In the body .... <table id="lgrid"></table> <div id="pgrid"></div> With this code, I never display the data into the grid. Somebody has an idea about this issue ? Thanks.

    Read the article

  • How to get php form data to pdf in table structure using WAMP

    - by Fero
    Hi I am displaying all the users in the form using php where the data are fetched from db. When i click on the icon all users data should be show in a pdf with a good table structure. i am hereby using fpdf to generate it. i created pdf but the records are not in formatted structure. How should this can be done. kindly advice. thanks in advance strong text

    Read the article

  • Rewriting a simple Pygame 2D drawing function in C++

    - by Dominic Bou-Samra
    I have a 2D list of vectors (say 20x20 / 400 points) and I am drawing these points on a screen like so: for row in grid: for point in row: pygame.draw.circle(window, white, (particle.x, particle.y), 2, 0) pygame.display.flip() #redraw the screen This works perfectly, however it's much slower then I expected. I want to rewrite this in C++ and hopefully learn some stuff (I am doing a unit on C++ atm, so it'll help) on the way. What's the easiest way to approach this? I have looked at Direct X, and have so far followed a bunch of tutorials and have drawn some rudimentary triangles. However I can't find a simple (draw point).

    Read the article

  • Is it so bad to have heaps of elements in your DOM?

    - by alex
    I am making a real estate non interactive display for their shop window. I have kicked jCarousel into doing what I want: Add panels per AJAX Towards the end of the current set, go and AJAX some new panels and insert them This works fine, but it appears calling jQuery's remove() on the prior elements cause an ugly bump. I'm not sure if calling hide() will free up any resources, as the element will still exist (and the element will be off screen anyway). I've seen this, and tried carousel.reset() from within a callback. It just clears out all the elements. This will be running on Google Chrome on Windows XP, and will solely by displaying on LCD televisions. I am wondering, if I can't find a reasonable solution to remove the extra DOM elements, will it bring my application to a crawl, or will Chrome do some clever garbage collecting? Or, how would you solve this problem? Thanks

    Read the article

  • irritating TortoiseSVN error - file or directory is corrupted and chkdsk at boot

    - by WalterJ89
    Can't move 'D:\Documents\Websites\blah.svn\tmp\entries' to 'D:\ ... .svn\entries': The file or directory is corrupted and unreadable. Any thoughts on what would cause this? This usually happens when trying to commit a large number of new files. Sometimes an update fixes it but most of the time I have to delete the offending directory, re-download it, and attempt to add or update it again. EDIT: it seems my pc always wanting to chkdsk as boot is related.

    Read the article

  • Covariance in Java

    - by Bobby
    Why does the following not work in Java? It would work in C#: public static final List<String> Split(String str, char delimiter) { if ((str == null) || "".equals(str)) { return new CopyOnWriteArrayList<String>(); } } I get an error saying this method has to return List. CopyOnWriteArrayList implements the List interface. Why does covariance not apply on return values in Java?

    Read the article

  • Snow Leopard dock - when I minimize files, where do they go?

    - by user40150
    I upgraded to Snow Leopard a bit ago. Recently, when I minimize files in any application the files disappear - no icon that I can find, showing how to bring to a dominant window any of the minimized files. I search, can't find, have to re-boot app., and lose data. Not good. When I minimize files, where do they go, how do I reopen them, and how can I change it so icons for all minimized files remain visible? Thanks

    Read the article

  • c# - online classes

    - by I__
    my company is sponsoring me to take some online c# classes. i have a pretty good background in vb.net but im not so string in OOP can someone please recommend some c# classes online that i can take?

    Read the article

  • how to set data into textfeild

    - by shishir.bobby
    hi all i have a table view containing some text. and an selecting a row, i hv to set text on another view's textfeild based on the selected index of row od table view. this is hoe it looks like -(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { abc *abcController = [ [ abcController alloc] initWithNibName:@"abcController" bundle:[NSBundle mainBundle]]; [self.navigationController abcController animated:YES]; coffeeObj = [appdelegate.coffeeArray objectAtIndex:indexPath.row]; abcController.sender.text =[NSString stringWithFormat:@" to %@", coffeeObj.to]; abcController.mobileNumber.text = [NSString stringWithFormat:@" from %@", coffeeObj.from]; [abcController release]; } and this is how my textfeilds looks like, which is in table view if(indexPath.row == 0) textField.keyboardType = UIKeyboardTypeDefault; else textField.keyboardType = UIKeyboardTypePhonePad; textField.autocorrectionType = UITextAutocorrectionTypeNo; [cell.contentView addSubview:textField]; if(indexPath.row == 0) { self.sender = textField; cell.textLabel.text = NSLocalizedString(@"From :", @" "); NSLog(@"sender: %@", self.sender.text); } else { self.mobileNumber = textField; cell.textLabel.text = NSLocalizedString(@"To :" ,@" "); NSLog(@"mobile Number: %@", self.mobileNumber.text); } [textField release]; my problem is i am not abel to set text in these textfeilds from previous view..... plz let me knw where i am wrong..... w8ing for a quick reply.. regards shishir

    Read the article

  • running a batch file from oracle forms 6i using host

    - by user176217
    I am trying to run a batch file. the file is located here: C:\Program Files\Java\jre6\bin\getfile.bat I use this in oracle forms 6i: first i assign this path to a variable: tmp_msg := 'C:\Program Files\Java\jre6\bin\getfile.bat' then I use the host command: host( 'cmd /c' || tmp_msg, no_screen); This is exactly as I have it. It doesn't give me an error, but I don't get the result that I'm expecting. I'm actually executing java code in the batch file like so: java -classpath path;addedpackage.jar myClass I hope someone can help me with this. Thank you.

    Read the article

  • Architecture of a single-page JavaScript web application?

    - by fig-gnuton
    How should a complex single-page JS web application be structured on the client-side? Specifically I'm curious about how to cleanly structure the application in terms of its model objects, UI components, any controllers, and objects handling server persistence. MVC seemed like a fit at first. But with UI components nested at various depths (each with their own way of acting on/reacting to model data, and each generating events which they themselves may or may not handle directly), it doesn't seem like MVC can be cleanly applied. (But please correct me if that's not the case.) -- (This question resulted in two suggestions of using ajax, which is obviously needed for anything other than the most trivial one-page app.)

    Read the article

  • Unable to start Tomcat 6.x when Mac OS X 10.6 is boot up

    - by SkyEagle888
    I am using Mac OS X 10.6 and installed MAMP and Tomcat. My Tomcat is installed in /Users/(userID)/Tomcat I can start Tomcat server in Terminal without a problem But it cannot be started automatically when Mac OS X is boot up. I put a file org.apache.tomcat.plist in /Library/LaunchDaemons Disabled Label org.apache.tomcat ProgramArguments /Users/henryfok/Tomcat/bin/startup.sh RunAtLoad Any hint ?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >