Search Results

Search found 3492 results on 140 pages for 'chris cochran'.

Page 101/140 | < Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >

  • Need some help synch'ing outer loop counter with dialog.onconfirm()

    - by Chris Barnhill
    I am writing a game for Facebook. IN the following code, I have a problem. I have a for loop executing, and in that loop, I call a dialog and implement 'onconfirm' for the dialog. The problem is that I need to access th e loop counter inside of the onconfirm function. But because the onconfirm is called outside of the scope of the for loop, the counter value is no longer valid because it's been incremented. I need some way to pass the counter value to the dialog onconfirm as it was at the time the dialog was displayed, not after the loop has finished. Or maybe someone has a better solution. Any help would be appreciated. Thanks. function unloadCargo() { //debugger; var actionPrompt = document.getElementById('action-prompt'); actionPrompt.setTextValue('Unloading cargo...'); var ajax = new Ajax(); ajax.responseType = Ajax.JSON; ajax.ondone = function(data) { debugger; if(data.unloadableCargo.length == 0) { loadCargo(); } else { //console.log('unloadable cargo='+dump(data.unloadableCargo)); var i = 0; var j = 0; var ucCount = data.unloadableCargo.length; for(i = 0; i < ucCount; i++) { cargoDialog = new Dialog(); cargoDialog.showChoice('Unload Cargo', 'Unload ' + data.unloadableCargo[i].goods_name + ' at ' + data.unloadableCargo[i].city_name + ' for ' + data.unloadableCargo[i].payoff + 'M euros?'); cargoDialog.onconfirm = function() { //console.log('unloadable cargo onconfirm='+dump(data.unloadableCargo)); var ajax = new Ajax(); var param = {"city_id": data.unloadableCargo[i].city_id, "goods_id": data.unloadableCargo[i].goods_id, "payoff": data.unloadableCargo[i].payoff}; ajax.ondone = function(demandData) { var demands = document.getElementById('demands'); var innerXhtml = '<span>'; for(var j = 0; j < demandData.demands.length; j++) { innerXhtml = innerXhtml + ' <div class="demand-item"><div class="demand-city">' + demandData.demands[j].city + '</div><div class="demand-pay">' + demandData.demands[j].cost + '</div><div class="demand-goods">' + demandData.demands[j].goods + '</div></div>'; } innerXtml = innerXhtml + ' </span>'; demands.setInnerXHTML(innerXhtml); // update balance loadCargo(); } ajax.post(baseURL + "/turn/do-unload-cargo", param); } cargoDialog.oncancel = function() { loadCargo(); } } //loadCargo(); } } ajax.post(baseURL + '/turn/unload-cargo'); }

    Read the article

  • How are two-dimensional arrays formatted in memory?

    - by Chris Cooper
    In C, I know I can dynamically allocate a two-dimensional array on the heap using the following code: int** someNumbers = malloc(arrayRows*sizeof(int*)); for (i = 0; i < arrayRows; i++) { someNumbers[i] = malloc(arrayColumns*sizeof(int)); } Clearly, this actually creates a one-dimensional array of pointers to a bunch of separate one-dimensional arrays of integers, and "The System" can figure you what I mean when I ask for: someNumbers[4][2]; But when I statically declare a 2D array, as in the following line...: int someNumbers[ARRAY_ROWS][ARRAY_COLUMNS]; ...does a similar structure get created on the stack, or is it of another form completely? (i.e. is it a 1D array of pointers? If not, what is it, and how do references to it get figured out?) Also, when I said, "The System," what is actually responsible for figuring that out? The kernel? Or does the C compiler sort it out while compiling?

    Read the article

  • Exporting dates properly formatted on Google Appengine in Python

    - by Chris M
    I think this is right but google appengine seems to get to a certain point and cop-out; Firstly is this code actually right; and secondly is there away to skip the record if it cant output (like an ignore errors and continue)? class TrackerExporter(bulkloader.Exporter): def __init__(self): bulkloader.Exporter.__init__(self, 'SearchRec', [('__key__', lambda key:key.name(), None), ('WebSite', str, None), ('DateStamp', lambda x: datetime.datetime.strptime(x, '%d-%m-%Y').date(), None), ('IP', str, None), ('UserAgent', str, None)]) Thanks

    Read the article

  • How are variables bound to the body of a define_method?

    - by Chris
    While trying to brush up my Ruby skills I keep running across this case which I can't figure out an explanation for by just reading the API docs. An explanation would be greatly appreciated. Here's the example code: for name in [ :new, :create, :destroy ] define_method("test_#{name}") do puts name end end What I want/expect to happen is that the name variable will be bound to the block given to define_method and that when #test_new is called it will output "new". Instead each defined method outputs "destroy" -- the last value assigned to the name variable. What am I misunderstanding about define_method and its blocks? Thanks!

    Read the article

  • 1180: Call to a possibly undefined method addEventListener

    - by Chris
    I'm going through some AS3 training, but I'm getting a weird error... I'm trying to add an event listener to the end of a motion tween in AS. I've created a tween, highlighted the frames, right clicked and copied the tween as AS and pasted it into the movie clip (I think there's a better way to do this, but I'm not sure what it is...) When I try to add the listener to the end of that code, I get the error. Here's my code. import fl.motion.AnimatorFactory; import fl.motion.MotionBase; import fl.motion.Motion; import flash.filters.*; import flash.geom.Point; import fl.motion.MotionEvent; import fl.events.*; var __motion_Enemy_3:MotionBase; if(__motion_Enemy_3 == null) { __motion_Enemy_3 = new Motion(); __motion_Enemy_3.duration = 30; // Call overrideTargetTransform to prevent the scale, skew, // or rotation values from being made relative to the target // object's original transform. // __motion_Enemy_3.overrideTargetTransform(); // The following calls to addPropertyArray assign data values // for each tweened property. There is one value in the Array // for every frame in the tween, or fewer if the last value // remains the same for the rest of the frames. __motion_Enemy_3.addPropertyArray("x", [0]); __motion_Enemy_3.addPropertyArray("y", [0]); __motion_Enemy_3.addPropertyArray("scaleX", [1.000000,1.048712,1.097424,1.146136,1.194847,1.243559,1.292271,1.340983,1.389695,1.438407,1.487118,1.535830,1.584542,1.633254,1.681966,1.730678,1.779389,1.828101,1.876813,1.925525,1.974237,2.022949,2.071661,2.120372,2.169084,2.217796,2.266508,2.315220,2.363932,2.412643]); __motion_Enemy_3.addPropertyArray("scaleY", [1.000000,1.048712,1.097424,1.146136,1.194847,1.243559,1.292271,1.340983,1.389695,1.438407,1.487118,1.535830,1.584542,1.633254,1.681966,1.730678,1.779389,1.828101,1.876813,1.925525,1.974237,2.022949,2.071661,2.120372,2.169084,2.217796,2.266508,2.315220,2.363932,2.412643]); __motion_Enemy_3.addPropertyArray("skewX", [0]); __motion_Enemy_3.addPropertyArray("skewY", [0]); __motion_Enemy_3.addPropertyArray("rotationConcat", [0]); __motion_Enemy_3.addPropertyArray("blendMode", ["normal"]); __motion_Enemy_3.addPropertyArray("cacheAsBitmap", [false]); __motion_Enemy_3.addEventListener(MotionEvent.MOTION_END, hurtPlayer); // Create an AnimatorFactory instance, which will manage // targets for its corresponding Motion. var __animFactory_Enemy_3:AnimatorFactory = new AnimatorFactory(__motion_Enemy_3); __animFactory_Enemy_3.transformationPoint = new Point(0.499558, 0.500000); // Call the addTarget function on the AnimatorFactory // instance to target a DisplayObject with this Motion. // The second parameter is the number of times the animation // will play - the default value of 0 means it will loop. // __animFactory_Enemy_3.addTarget(<instance name goes here>, 0); } function hurtPlayer(event:MotionEvent):void { this.parent.removeChild(this); } I've tried a few places for it, both with the animFactory_Enemy_3 variable and the motion_Enemy_3 variable - getting the same error both times.

    Read the article

  • Delays in .net app when connecting to oracle db using Oracle.DataAccess

    - by chris
    I have a .net desktop app that connects to an oracle database. At times, there are very noticable delays. I ran a trace on the code, and it was always in the DataReader.Read(). I turned on sql tracing, and found the following, which corresponds to the delays I'm seeing: (2128) [23-MAR-2010 13:00:07:310] nsprecv: reading from transport... (2128) [23-MAR-2010 13:00:07:310] nttrd: entry (2128) [23-MAR-2010 13:00:24:655] nttrd: socket 676 had bytes read=2047 (2128) [23-MAR-2010 13:00:24:655] nttrd: exit (2128) [23-MAR-2010 13:00:24:655] nsprecv: 2047 bytes from transport There's about a 14 second pause in there. I'm pretty sure that there's not a problem in the code, but not sure where to look at next. Is there anyone out there with experience with oracle trace that can explain what's going on?

    Read the article

  • In-order tree traversal

    - by Chris S
    I have the following text from an academic course I took a while ago about in-order traversal (they also call it pancaking) of a binary tree (not BST): In-order tree traversal Draw a line around the outside of the tree. Start to the left of the root, and go around the outside of the tree, to end up to the right of the root. Stay as close to the tree as possible, but do not cross the tree. (Think of the tree — its branches and nodes — as a solid barrier.) The order of the nodes is the order in which this line passes underneath them. If you are unsure as to when you go “underneath” a node, remember that a node “to the left” always comes first. Here's the example used (slightly different tree from below) However when I do a search on google, I get a conflicting definition. For example the wikipedia example: Inorder traversal sequence: A, B, C, D, E, F, G, H, I (leftchild,rootnode,right node) But according to (my understanding of) definition #1, this should be A, B, D, C, E, F, G, I, H Can anyone clarify which definition is correct? They might be both describing different traversal methods, but happen to be using the same name. I'm having trouble believing the peer-reviewed academic text is wrong, but can't be certain.

    Read the article

  • Has anybody used the WB B-tree library?

    - by Chris B
    I stumbled across the WB on-disk B-tree library: http://people.csail.mit.edu/jaffer/WB It seems like it could be useful for my purposes (swapping data to disk during very large statistical calculations that do not fit in memory), but I was wondering how stable it is. Reading the manual, it seems worringly 'researchy' - there are sections labelled [NOT IMPLEMENTED] etc. But maybe the manual is just out-of-date. So, is this library useable? Am I better off looking at Tokyo Cabinet, MemcacheDB, etc.? By the way I am working in Java.

    Read the article

  • php request variables assigning $_GEt

    - by chris
    if you take a look at a previous question http://stackoverflow.com/questions/2690742/mod-rewrite-title-slugs-and-htaccess I am using the solution that Col. Shrapnel proposed- but when i assign values to $_GET in the actual file and not from a request the code doesnt work. It defaults away from the file as if the $_GET variables are not set The code I have come up with is- if(!empty($_GET['cat'])){ $_GET['target'] = "category"; if(isset($_GET['page'])){ $_GET['pageID'] = $_GET['page']; } $URL_query = "SELECT category_id FROM cats WHERE slug = '".$_GET['cat']."';"; $URL_result = mysql_query($URL_query); $URL_array = mysql_fetch_array($URL_result); $_GET['category_id'] = $URL_array['category_id']; }elseif($_GET['product']){ $_GET['target'] = "product"; $URL_query = "SELECT product_id FROM products WHERE slug = '".$_GET['product']."';"; $URL_result = mysql_query($URL_query); $URL_array = mysql_fetch_array($URL_result); print_r($URL_array); $_GET['product_id'] = $URL_array['product_id']; The original variable string that im trying to represent is /cart.php?Target=product&product_id=16142&category_id=249 And i'm trying to build the query string variables with code and including cart.php so i can use cleaner URL's So I have product/product-title-with-clean-url/ going to slug.php?product=slug Then the slug searches the db for a record with the matching slug and returns the product_id as in the code above.Then built the query string and include cart.php

    Read the article

  • Is there a way to validate the presence of Javadoc and/or inline code comments?

    - by Chris Aldrich
    We are trying to put quality code processes in place for a large project I am working on. Right now a lot of developers are not putting in Javadoc or in-line code comments into their code. Ok right now. But it will severely hurt us in the very near future. We are using Maven 2.0.9 as our build tool, as well as Hudson for Continuous Integration. We are using Subversion as our source versioning tool/code repository, Rational Application Developer and Rational Softare Architect (essentially Eclipse) 7.5.1 as our IDE's, and then Subclipse as our Eclipse plug-in to connect to SVN. Is there a plug-in or a way to validate that a developer put in Javadoc and/or in-line code comments in order to allow a commit to SVN? This isn't intended to be a substitute for good code reviews, but merely a help to make sure that developers are reminded to add this documentation before committing. We are still intending on conducting code reviews that would also review documentation. Has anyone found any plug-ins for something like this? Any links? Any ideas?

    Read the article

  • Configuring Warden for use in RSpec controller specs

    - by Chris Peters
    I was able to use Devise's sign_in method to log in a user in my controller specs. But now that I'm removing Devise from my application, I'm not quite sure how to get similar functionality working with just Warden on its own. How should I go about setting up spec/spec_helper.rb and related spec/support/*.rb files to get Warden running within controller specs sufficiently? I've tried setting up a file at spec/support/warden.rb with these contents: RSpec.configure do |config| config.include Warden::Test::Helpers config.after do Warden.test_reset! end end Then I have before calls similar to this to authenticate a user factory: before { login_as FactoryGirl.create(:user) } But here is the error that I keep seeing: NameError: undefined method `user' for nil:NilClass This error traces back to my authenticate_user! method in the controller: def authenticate_user! redirect_to login_path, notice: "You need to sign in or sign up before continuing." if env['warden'].user.nil? end I'd appreciate any guidance that anyone could provide.

    Read the article

  • Codeigniter Image Library Cropping an Image with 2 sets of coordinates to make square anywhere?

    - by chris
    Spending time reading through the docs, and searching for examples. I understand cropping an image from top 0, and left 0 is pretty straight forward. However. I would like to pass 2 sets of coordinates, a starting point and an ending point. Four Points, a Square that is defined anywhere. However from the examples I am finding, and from what I gather the rendition is not going to let me do this. codeigniter so I am seeking confirmation on this thought, is it true that I can only provide end points from 0, and it crops a square based on said end points or can I actually specify an x start, an x end, and similar for y? Or is there some other technique I can use within codeigniter that will allow me to pass for coordinates for starting and ending points?

    Read the article

  • Using JavaScript to parse an XML file

    - by Chris Clouten
    I am new to Stack OverFlow and coding in general. I am trying to take an XML file and render it in the browser using JavaScript. I have looked around at some sample code of how to do this and came up with the following code: <!DOCTYPE html> <html> <body> <script> if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","social.xml",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; document.write("<table border='1'>"); var x=xmlDoc.getElementsByTagName("CD"); for (i=0;i<x.length;i++) { document.write("<tr><td>"); document.write(x[i].getElementsByTagName("c_id")[0].childNodes[0].nodeValue); document.write("</td><td>"); document.write(x[i].getElementsByTagName("facebook_id")[0].childNodes[0].nodeValue); document.write("</td></tr>"); } document.write("</table>"); </script> </body> </html> Anyway, when I run this on my local server none of the data that I am trying to display in the table appears. My .html file and .xml file are in the same folder, so I believe I have the correct file pathway. I could just be making a rookie mistake here, but I can't for the life of me figure out why a table listing the c_id and facebook_id values is not being created. I looked around for answers and haven't been able to find any. Any help would be greatly appreciated. Thanks!

    Read the article

  • After installing .net 3.5 SP1, get missing DLL error

    - by chris
    I just installed a number of updates to my machine, and am now encountering the following error when I run an asp.net MVC application on my local machine: Compiler Error Message: CS0006: Metadata file 'C:\WINNT\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll' could not be found I have removed the reference to this from the project (not really sure why it was there in the first place) but still get the error. Any idea on how to resolve this?

    Read the article

  • How to lowercase every element of a collection efficiently?

    - by Chris
    Whats the most efficient way to lower case every element of a list or set? My idea for a List: final List<String> strings = new ArrayList<String>(); strings.add("HELLO"); strings.add("WORLD"); for(int i=0,l=strings.size();i<l;++i) { strings.add(strings.remove(0).toLowerCase()); } is there a better, faster way? How would this exmaple look like for a set? As there is currently no method for applying an operation to each element of a set (or list) can it be done without creating an additional temporary set? Something like this would be nice: Set<String> strings = new HashSet<String>(); strings.apply( function (element) { this.replace(element, element.toLowerCase();) } ); Thanks,

    Read the article

  • A way to edit content by altering one file?

    - by Chris
    Hi, I have a contact css tab on my left side on my website, I have more then 30 pages and I don't wantto manually alter all those pages later when data had changed. Does anyone knows a sollution so I only have to alter 1 file to have all pages edited? Perhaps in javascript? The code below is for the tab <div class="slide-out-div"> <a class="handle" href="http://link-for-non-js-users">Content</a> <h3>Onze contact gegevens</h3> <p>Adres: van Ostadestraat 55<br /> Postcode: 8932 JZ<br /> Plaats: Leeuwarden<br /> Tel: 058 844 66 28<br /> Mob: 0629594595 <br /> E-mail: <a href="mailto:[email protected]">[email protected]</a><br /><br /> </p> <p>Mocht u vragen hebben dan kunt u gerust bij ons terecht voor meer informatie.</p>

    Read the article

  • [Linux] domain socket "sendto" encounter "errno 111, connection refused"

    - by z.cHris
    I am using domain socket to get values from another process, like A to get a value from B, It works well for months. But recently, A is failed during "sendto" message to B with "errno 111, connection refused" occasionally. I checked the B domain socket bind file, it is exists. I also do some tests in another machine, also works well. So, does anyone encounter this problem before? Can anyone have some clues what might be probably wrong in this scenario? Thanks very much.

    Read the article

  • Reading a C/C++ data structure in C# from a byte array

    - by Chris Miller
    What would be the best way to fill a C# struct from a byte[] array where the data was from a C/C++ struct? The C struct would look something like this (my C is very rusty): typedef OldStuff { CHAR Name[8]; UInt32 User; CHAR Location[8]; UInt32 TimeStamp; UInt32 Sequence; CHAR Tracking[16]; CHAR Filler[12];} And would fill something like this: [StructLayout(LayoutKind.Explicit, Size = 56, Pack = 1)]public struct NewStuff{ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] [FieldOffset(0)] public string Name; [MarshalAs(UnmanagedType.U4)] [FieldOffset(8)] public uint User; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] [FieldOffset(12)] public string Location; [MarshalAs(UnmanagedType.U4)] [FieldOffset(20)] public uint TimeStamp; [MarshalAs(UnmanagedType.U4)] [FieldOffset(24)] public uint Sequence; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] [FieldOffset(28)] public string Tracking;} What is best way to copy OldStuff to NewStuff, if OldStuff was passed as byte[] array? I'm currently doing something like the following, but it feels kind of clunky. GCHandle handle;NewStuff MyStuff;int BufferSize = Marshal.SizeOf(typeof(NewStuff));byte[] buff = new byte[BufferSize];Array.Copy(SomeByteArray, 0, buff, 0, BufferSize);handle = GCHandle.Alloc(buff, GCHandleType.Pinned);MyStuff = (NewStuff)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(NewStuff));handle.Free(); Is there better way to accomplish this?

    Read the article

  • MS Word to Stylesheet

    - by Chris Johnson
    Is there an easy way to automatically convert a bunch of MS Word documents to xslt stylesheets that can be displayed in the browser? What I have is a large collection of forms in Word format that have to be displayed in the browser, or sent to the user, with known fields populated from a data source, edited by a user and, finally, printed (including the original headers and footers). The data entered by the user will not need to be saved. I'm not sure if converting the documents to stylesheets is even feasible. Maybe someone has a better idea of how to achieve this? Installing Office on the server is not an option in my case.

    Read the article

  • Need help optimizing a NHibernate criteria query that uses Restrictions.In(..)

    - by Chris F
    I'm trying to figure out if there's a way I can do the following strictly using Criteria and DetachedCriteria via a subquery or some other way that is more optimal. NameGuidDto is nothing more than a lightweight object that has string and Guid properties. public IList<NameGuidDto> GetByManager(Employee manager) { // First, grab all of the Customers where the employee is a backup manager. // Access customers that are primarily managed via manager.ManagedCustomers. // I need this list to pass to Restrictions.In(..) below, but can I do it better? Guid[] customerIds = new Guid[manager.BackedCustomers.Count]; int count = 0; foreach (Customer customer in manager.BackedCustomers) { customerIds[count++] = customer.Id; } ICriteria criteria = Session.CreateCriteria(typeof(Customer)) .Add(Restrictions.Disjunction() .Add(Restrictions.Eq("Manager", manager)) .Add(Restrictions.In("Id", customerIds))) .SetProjection(Projections.ProjectionList() .Add(Projections.Property("Name"), "Name") .Add(Projections.Property("Id"), "Guid")) // Transform results to NameGuidDto criteria.SetResultTransformer(Transformers.AliasToBean(typeof(NameGuidDto))); return criteria.List<NameGuidDto>(); }

    Read the article

  • Removing DOM event handlers in long-running browser session

    - by Chris Beck
    I have a browser interface with a ul#contacts list on the left and div#contact property panel (email, phone) on the right. Click a contact in the list and my app makes an XHR request to get the contact property HTML fragment and update div#contact.innerHTML. Each contact fragment has an "Edit Contact" link. With JS, I progressively upgrade that link with an event listener that performs an XHR request to replace the static property panel with an in-place edit form. This can happen many times during a single browser session. How should I clean up my "Edit Contact" event listener? Do I need to remove it manually before the form overwrites the property panel? Or is the event listener cleaned up automatically when the contents of div#contact (and the node that I'm listening on) is overwritten? FWIW, I still consider IE6 to be part of my target market.

    Read the article

  • Reusing a NSString variable - does it cause a memory leak?

    - by Chris S
    Coming from a .NET background I'm use to reusing string variables for storage, so is the code below likely to cause a memory leak? The code is targeting OS X on the iphone/itouch so no automatic GC. -(NSString*) stringExample { NSString *result = @"example"; result = [result stringByAppendingString:@" test"]; // where does "example" go? return result; } What confuses me is an NSStrings are immutable, but you can reuse an 'immutable' variable with no problem.

    Read the article

  • Nested Execution Flow Control

    - by chris
    I've read tens of answers related to callbacks, promises and other ways to control flow, but I can't still wrap my head around this task, obviously due to my lack of competence. I have a nested problem: In test_1() (and the other functions) I would like to ensure that the rows are added to the table according to the order in which the elements are in the object; I would like to execute either test_2 or test_3 (or both after each other) only after test_1 has finished completely. Actually the right sequence will only be known at runtime (there will be a switch with the possible sequences, like 1,2,3 or 1,3,2 or 1,2,1,3 or 1,3,3,2, etc...) Code: $(function () { // create table tbl = document.createElement('table'); tbl.className = "mainTbl"; $("body").append(tbl); }); function test_1() { $.each(obj, function () { var img = new Image(); img.onload = function () { // add row of data to table var row = tbl.insertRow(-1); var c1 = row.insertCell(0); c1.innerHTML = "loaded"; }; img.onerror = function () { // add row of data to table var row = tbl.insertRow(-1); var c1 = row.insertCell(0); c1.innerHTML = "not loaded"; }; img.src = this.url; }); } function test_2() { $.each(obj, function () { var img = new Image(); img.onload = function () { // add row of data to table var row = tbl.insertRow(-1); var c1 = row.insertCell(0); c1.innerHTML = "loaded"; }; img.onerror = function () { // add row of data to table var row = tbl.insertRow(-1); var c1 = row.insertCell(0); c1.innerHTML = "not loaded"; }; img.src = this.url; }); } function test_3() { $.each(obj, function () { var img = new Image(); img.onload = function () { // add row of data to table var row = tbl.insertRow(-1); var c1 = row.insertCell(0); c1.innerHTML = "loaded"; }; img.onerror = function () { // add row of data to table var row = tbl.insertRow(-1); var c1 = row.insertCell(0); c1.innerHTML = "not loaded"; }; img.src = this.url; }); } I know that calling the functions in sequence doesn't work as they don't wait for each other... I think promises are they way to go but I can't find the right combination and the documentation is way too complex for my skills. What's the best way to structure the code so that it's executed in the right order?

    Read the article

  • Selenium WebDriver works but SLOW (Java)

    - by Chris
    Code: WebDriver driver = new FirefoxDriver(); driver.get("http://www.cnn.com"); File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); FileUtils.copyFile(scrFile, new File("c:\\test\\screenshot.png")); I am using Selenium WebDriver to take a screenshot of webpages. It runs great. However, from the time I hit run in eclipse to the time the screenshot shows up in my local drive is 7-10 seconds. Most of the latency seems to be launching Firefox. How can I speed up this process? Is there a way that I can use an already opened Firefox browser to save on opening a new one? Is this code somehow heavy? Details- Tried on CentOS box and Win7 box both using eclipse. myspeedtest.net shows 22Mbps down and 1 Mbps up.

    Read the article

< Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >