Search Results

Search found 1976 results on 80 pages for 'grab'.

Page 49/80 | < Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • How should I be storing objects that I wish to access in reverse order of the way I placed them in

    - by andrew hicks
    I'm following this guide here: http://www.mazeworks.com/mazegen/mazetut/index.htm Or more specficially create a CellStack (LIFO) to hold a list of cell locations set TotalCells = number of cells in grid choose a cell at random and call it CurrentCell set VisitedCells = 1 while VisitedCells < TotalCells find all neighbors of CurrentCell with all walls intact if one or more found choose one at random knock down the wall between it and CurrentCell push CurrentCell location on the CellStack make the new cell CurrentCell add 1 to VisitedCells else pop the most recent cell entry off the CellStack make it CurrentCell endIf endWhile Im writing this in java, My problem is. How should I be storing my visited cells, So that I can access them from reverse order of when I placed them in. Like this? List<Location> visitedCells = new ArrayList<Location>(); Then do I grab with visitedCells.get(visitedCells.size()-1)? Location stores the x, y and z. Not something Im trying to ask you.

    Read the article

  • How to to dump JS array... (boommarklet?)

    - by Soulhuntre
    A page on a site I use is holding some of my data hostage. Once I have logged into the site and navigated to the right page, the data I need is in the array eeData[] - it is 720 elements long (once every 2 minutes of a given day). Rather than simulate the requests to the underlying stuff json supplier and since its only once a day, I am happy to simply develop a bookmarklet to grab the data - preferably as a XML or CSV file. Any pointers to sample code or hints would help. I found a bookmarklet here that is based on this script that does part of this - but I am not up to speed on any potential JS file IO to see if it is possible to induce a file "download" of the data, or pop it opn in a new window I can copy / paste.

    Read the article

  • Using jQuery, how do I way attach a string array as a http parameter to a http request?

    - by predhme
    I have a spring controller with a request mapping as follows @RequestMapping("/downloadSelected") public void downloadSelected(@RequestParam String[] ids) { // retrieve the file and write it to the http response outputstream } I have an html table of objects which for every row has a checkbox with the id of the object as the value. When they submit, I have a jQuery callback to serialize all ids. I want to stick those ids into an http request parameter called, "ids" so that I can grab them easily. I figured I could do the following var ids = $("#downloadall").serializeArray(); Then I would need to take each of the ids and add them to a request param called ids. But is there a "standard" way to do this? Like using jQuery?

    Read the article

  • What would be the best approach for this?

    - by chobo
    I have a site which has an area that requires authentication. Right now I use the roles attribute on all the controllers in that area, and I run a query to retrieve that users ID, and all their settings. It seems like a code or design smell to me that I am retrieving the userid and settings each time a controller in that area loads up? I'm not sure if I should be using sessions, or if ASP.Net MVC 2.0 provides some unique way to handle this. Another concern is security. Overall, I don't really know which way to turn. Design wise I would like the userId and settings retrieved only once when the user logs into the area. Right now I grab the userId each time a controller loads up, and then if required, I query the database for their settings each time as well.

    Read the article

  • Help, I need to debug my BrowserHelperObject (BHO) (in C++) after a internet explorer 8 crash in Rel

    - by BHOdevelopper
    Hi, here is the situation, i'm developping a Browser Helper Object (BHO) in C++ with Visual Studio 2008, and i learned that the memory wasn't managed the same way in Debug mode than in Release mode. So when i run my BHO in debug mode, internet explorer 8 works just fine and i got no erros at all, the browser stays alive forever, but as soon as i compile it in release mode, i got no errors, no message, nothing, but after 5 minutes i can see through the task manager that internet explorer instances are just eating memory and then the browser just stop responding every time. Please, I really need some hint on how to get a feedback on what could be the error. I heard that, often it was happening because of memory mismanagement. I need a software that just grab a memory dump or something when iexplorer crashes to help me find the problem. Any help is appreciated, I'll be looking for responses every single days, thank you.

    Read the article

  • Hibernate Query - Get latest versions by timestamp?

    - by Slim
    I have a database that is being used as a sort of version control system. That is, instead of ever updating any rows, I add a new row with the same information. Each row also contains a version column that is a date timestamp, so the only difference is the new row will have a more recent timestamp. What I'm having trouble with is writing an efficient hibernate query to return the latest version of these rows. For the sake of example, these are rows in a table called Product, the timestamped column is version. There are multiple versions of multiple products in the table. So there may be multiple versions (rows) of ProductA, multiple versions of ProductB, etc. And I would like to grab the latest version of each. Can I do this in just a single hibernate query? session.createQuery("select product from Product product where...?"); Or would this require some intermediate steps?

    Read the article

  • Cross domain secure cookie usage?

    - by asdasda
    I have a website that came with a SSL site for HTTPS but its on a different server. Example being my website: http://example.com my SSL site: http://myhostingcompany.com/~myuseraccount/ So I can do transactions over HTTPS and we have user accounts and everything but it is located on a different domain. The cookie domain is set for that one. Is there a way I can check on my actual site to see if a cookie is set for the other one? And possibly grab its data and auth a user? I think this violates a major principle of security and can't be done for good reasons, but am i wrong? is this possible?

    Read the article

  • Grabbing Just The Top Entry From A LINQ Query

    - by Soo
    I basically have a lot of poorly designed code to do something that, I'm sure, can be done far more elegantly. What I'm trying to do is grab the last date from a database table. var Result = from a in DB.Table orderby a.Date descending select new {Date = a}; foreach(var Row in Result) { LastDate = Row.Date.Date; break; } Basically, there's a foreach loop that is designed to run only once. Crappy code! What's a "best practice" way to accomplish the same thing?

    Read the article

  • ASP.NET Speed up DataView sorting/paging

    - by rlb.usa
    I have a page in ASP.NET where I'm using a Repeater to display a record listing. But it's slow as molasses, I've been tasked with speeding it up (sorting,paging). I've got it set up as follows: When user enters page, grab all of the data from the database (500 records, up to 4 relation'ed records) Store it all in Application["MyDataView"] On sort or paging, simply use the data view's internal sort/page method (no db calls) and rebind. I understand that databases can take time to query, but simply to have the DataView call it's sort method (no db calls) takes 10ish seconds, that's an alarmingly slow. Two questions: Why is it taking so long? How can I speed it up? A gridview is not possible.

    Read the article

  • C# LINQ join With Just One Row

    - by Soo
    I'm trying to make a query that grabs a single row from an SQL database and updates it. TableA AId AValue TableB BId AId BValue Ok, so TableA and TableB are linked by AId. I want to select a row in TableB based on AValue using a join. The following query is what I have and only grabs a value from TableB based on AId, I just don't know how to grab a row from TableB using AValue. I know you would need to use a join, but I'm not sure how to accomplish that. var row = DbObject.TableB.Single(x => x.AId == 1) row.BValue = 1; DbObject.SubmitChanges();

    Read the article

  • Limit calls to external database with Python CGI

    - by Matt Ball
    I've got a Python CGI script that pulls data from a GPS service; I'd like this information to be updated on the webpage about once every 10s (the max allowed by the GPS service's TOS). But there could be, say, 100 users viewing the webpage at once, all calling the script. I think the users' scripts need to grab data from a buffer page that itself only upates once every ten seconds. How can I make this buffer page auto-update if there's no one directly viewing the content (and not accessing the CGI)? Are there better ways to accomplish this?

    Read the article

  • Is there a way of getting a file name and inserting into Matlab script?

    - by torr
    In a folder, I have both my .m file that contains the script and an imaging .dcm file that needs to be analyzed. Folder structure: Folder1/analysis.m Folder1/meas_dynamic_123.dcm My script (analysis.m) begins as follows: target =''; <== here should go the full path to the file + filename example: /Volumes/Data/Folder1/meas_dynamic_123.m txt = dir(target); // etc So I'm wondering if there is a way of when running analysis.m it will: automatically search the folder it's in, grab the full path + filename of file containing string dynamic in the name, insert its full path + name into target variable continue running the script Does anyone have any pointers on how to achieve this? Using ffpath?

    Read the article

  • android RegEx external GPS string

    - by user1271363
    I have a problem with seperating information in a string i get from the external GPS stream. Heres a example of a string: $GPGSV,3,3,12,22,09,276,31,25,24,247,24,27,54,131,,32,04,359,19*71 $GPGLL,5703.85365,N,00953.88360,E,075510.00,A,A*69 $GPPWR,028a,1,0,1,1 $GPRMC,075511.00,A,5703.85369,N,00953.88430,E,0.335,302.17,070912,,,A*6E $GPVTG,302.17,T,,M,0.335,N,0.621,K,A*3A Want i am trying to do is to get the " $GPGLL,5703.85365,N,00953.88360,E,075510.00,A,A*69 " out so i can grab the longtitude and latitude and then update my textview with it. But keep getting string out of bounch exeption and i start wondering if i am handling this in the wrong way. Anyone that can put me in the right direction in how to solve this?

    Read the article

  • How do I sub sample data by group using ddply?

    - by Maiasaura
    I've got a data frame with far too many rows to be able to do a spatial correlogram. Instead, I want to grab 40 rows for each species and run my correlogram on that subset. I wrote a function to subset a data frame as follows: samp <- function(dataf) { dataf[sample(1:dim(dataf)[1], size=40, replace=FALSE),] } Now I want to apply this function to each species in a larger data frame. When I try something like culled_data = ddply (larger_data, .(species), subset, samp) I get this error: Error in subset.data.frame(piece, ...) : 'subset' must evaluate to logical Anyone got ideas on how to do this?

    Read the article

  • Should repeated use of the camera crash an app?

    - by Sam
    I have an app that builds a slideshow from user images. They can grab from their library or take a picture. I have found that repeated use of grabbing an image from the library is fine. But repeated use of taking a picture causes erratic behavior. I have been getting crashes but mostly what happens seems to be a reloading of the view after "didFinishPickingMediaWithInfo", which messes things up. I have no leaks and it seems to be releasing properly after each picture is taken. I am resizing the image and saving it in a data base. Is anyone else running into this situation? Was the camera not designed to be called this often?

    Read the article

  • Regular Expression to capture the first <p> of HTML

    - by Program.X
    I have the following regular expression: (?:<(?<tag>\w*)>(?<text>.*)</\k<tag>>) I want it t grab the text within the first HTML element. eg. <p>This should capture</p>This shouldn't Works, but ... <p>This should capture</p><p>This shouldn't</p> Doesn't work. As you'd expect, it returns: This should capture</p><p>This shouldn't I'm racking my brains here. How can I just have it select the FIRST inner text? (I'm trying to be tag-agnostic, so <strong>This should match</strong> is equally appropriate, etc.)

    Read the article

  • Fast, cross-platform timer?

    - by dsimcha
    I'm looking to improve the D garbage collector by adding some heuristics to avoid garbage collection runs that are unlikely to result in significant freeing. One heuristic I'd like to add is that GC should not be run more than once per X amount of time (maybe once per second or so). To do this I need a timer with the following properties: It must be able to grab the correct time with minimal overhead. Calling core.stdc.time takes an amount of time roughly equivalent to a small memory allocation, so it's not a good option. Ideally, should be cross-platform (both OS and CPU), for maintenance simplicity. Super high resolution isn't terribly important. If the times are accurate to maybe 1/4 of a second, that's good enough. Must work in a multithreaded/multi-CPU context. The x86 rdtsc instruction won't work.

    Read the article

  • Prevent RegEx Hang on Large Matches...

    - by developerjay
    This is a great regular expression for dates... However it hangs indefinitely on this one page I tried... I wanted to try this page ( http://pleac.sourceforge.net/pleac%5Fpython/datesandtimes.html ) for the fact that it does have lots of dates on it and I want to grab all of them. I don't understand why it is hanging when it doesn't on other pages... Why is my regexp hanging and/or how could I clean it up to make it better/efficient ? Python Code: monthnames = "(?:Jan\w*|Feb\w*|Mar\w*|Apr\w*|May|Jun\w?|Jul\w?|Aug\w*|Sep\w*|Oct\w*|Nov(?:ember)?|Dec\w*)" pattern1 = re.compile(r"(\d{1,4}[\/\\\-]+\d{1,2}[\/\\\-]+\d{2,4})") pattern4 = re.compile(r"(?:[\d]*[\,\.\ \-]+)*%s(?:[\,\.\ \-]+[\d]+[stndrh]*)+[:\d]*[\ ]?(PM)?(AM)?([\ \-\+\d]{4,7}|[UTCESTGMT\ ]{2,4})*"%monthnames, re.I) patterns = [pattern4, pattern1] for pattern in patterns: print re.findall(pattern, s) btw... when i say im trying it against this site.. I'm trying it against the webpage source.

    Read the article

  • jquery - how is multiple selection working in this example?

    - by hatorade
    The relevant snippet of HTML: <span class="a"> <div class="fieldname">Question 1</div> <input type="text" value="" name="q1" /> </span> The relevant jQuery: $.each($('.a'), function(){ $thisField = $('.fieldname', $(this)); }); What exactly is being set to $thisField? If my understanding of multiple selectors in jQuery is correct, it should be grabbing the outer <span> element AND the inner <div> element. But for some reason, if I use $thisField.prepend("hi"); it ends up putting hi right before the text Question 1, but not before <div>. I thought multiple selectors would grab both elements, and that prepend() adds hi to the beginning of BOTH elements, not just the <div>

    Read the article

  • When configuring daily backups, which files should I include to be sure I have the MySQL db's

    - by user575599
    I have a dedicated LAMP server with cpanel hosting 100 websites (some of them have MySQL db's). I am currently using the Jungle Disk Server Edition to backup our files from our LAMP server to Amazon S3. Once a week were are backing up the entire cpanel which is an enormous strain on resources but that is a separate issue. Now, what I want to do is to set up a daily job to backup just the HTML files and the MySQL db's. If I just backup the "public_html" folder will my MySQL database info be stored in that directory? Would backing up the public_html folder be enough to recover the db? I can find plenty of resources online about how to manually backup MySQL db's but with a 100 sites, I need it automated. I'm hoping for an easy solution where I can just grab a folder to backup each day.

    Read the article

  • hadoop - large database query

    - by Mastergeek
    Situation: I have a Postgres DB that contains a table with several million rows and I'm trying to query all of those rows for a MapReduce job. From the research I've done on DBInputFormat, Hadoop might try and use the same query again for a new mapper and since these queries take a considerable amount of time I'd like to prevent this in one of two ways that I've thought up: 1) Limit the job to only run 1 mapper that queries the whole table and call it good. or 2) Somehow incorporate an offset in the query so that if Hadoop does try to use a new mapper it won't grab the same stuff. I feel like option (1) seems more promising, but I don't know if such a configuration is possible. Option(2) sounds nice in theory but I have no idea how I would keep track of the mappers being made and if it is at all possible to detect that and reconfigure. Help is appreciated and I'm namely looking for a way to pull all of the DB table data and not have several of the same query running because that would be a waste of time.

    Read the article

  • Get a return value from a screen'd command

    - by AndyMac
    I'm running a process in a screen (on Ubuntu 13.10, if it matters). I can execute a command within that screen with: screen -p 0 -X eval 'stuff \"$command\"\015' I'm not 100% sure what this command is doing to begin with, though it's functioning correctly. The reason behind it is I'm running a Minecraft server (still) and this screens in to the correct screen, and throws the command on the running command line. So that's good, so far. But what I'd like is to be able to run this command with a return value. So for example, if I were to run a "list" command, it'd tell me how many people and who is online, but I need to capture that output and put it somewhere. Anyone know of a way to accomplish this? I can't tell the minecraft server command line to redirect the output somewhere else since it doesn't have direct command line access, so the only way I could do this would be to grab all output of the screen while I'm connected ... but I'm not sure if that's possible.

    Read the article

  • Robust Way of Selecting All Text in Textbox

    - by Emil
    I'm trying to have the content of the an HTML textbox be selected fully onFocus. I know the simple solution of putting a onfocus="this.select()" on the component but this is not a good solution because if a user double clicks into the area the selection is lost and in browsers like chrome it is rarely working like it should and just reverts into input form. I have searched on Google for a little while and can't find a good solution, most suggestions are of this simple solution. What I would like it is that the selection inside the textbox not change once selected and if possible the user should not be able to edit the content of the textbox, for example if you have used AdSense when you grab code from AdSense the selection never changes and your unable to alter the code in the textbox. Any solutions would be appreciated.

    Read the article

  • PHP: Parsing of a given form input variable

    - by Jaime Cross
    How would I go about parsing incoming form data where the name changes based on section of site like: <input type="radio" name="Motorola section" value="Ask a question"> where 'Motorola section may be that, or Verizon section, or Blackberry section, etc. I do not have any control over changing the existing forms unfortunately, so must find a way to work with what is there. Basically, I need to be able to grab both the name="" data as well as its coresponding value="" data to be able to populate the email that gets sent properly.

    Read the article

  • Efficient way to access a mapping of identifiers in Python

    - by sixbelo
    I am writing an app to do a file conversion and part of that is replacing old account numbers with a new account numbers. Right now I have a CSV file mapping the old and new account numbers with around 30K records. I read this in and store it as dict and when writing the new file grab the new account from the dict by key. My question is what is the best way to do this if the CSV file increases to 100K+ records? Would it be more efficient to convert the account mappings from a CSV to a sqlite database rather than storing them as a dict in memory?

    Read the article

< Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >