Search Results

Search found 1870 results on 75 pages for 'matt mcclellan'.

Page 61/75 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • Java - 'continue' loop iteration after certain timeout period

    - by Matt
    Is there a way to exit ('continue;') a loop iteration after a certain timeout period? I have a loop that will run gathering data from the web and then use this data to make a calculation. The data become obsolete after about 1 to 2 seconds so if the loop iteration takes longer than 1 second then i want it to 'continue' to the next iteration. Sometimes gathering the data can take time but sometimes the calculation can take longer than 1 second so a HTTP timeout won't work for what i need. Also, while doing the calculation the thread i am using is blocked so i cannot check System.currentTimeMillis(); Is there a way to use another Thread to check the time and force the original for loop to continue.

    Read the article

  • Getting up to speed on modern architecture

    - by Matt Thrower
    Hi, I don't have any formal qualifications in computer science, rather I taught myself classic ASP back in the days of the dotcom boom and managed to get myself a job and my career developed from there. I was a confident and, I think, pretty good programmer in ASP 3 but as others have observed one of the problems with classic ASP was that it did a very good job of hiding the nitty-gritty of http so you could become quite competent as a programmer on the basis of relatively poor understanding of the technology you were working with. When I changed on to .NET at first I treated it like classic ASP, developing stand-alone applications as individual websites simply because I didn't know any better at the time. I moved jobs at this point and spent the next several years working on a single site whose architecture relied heavily on custom objects: in other words I gained a lot of experience working with .NET as a middle-tier development tool using a quite old-fashioned approach to OO design along the lines of the classic "car" class example that's so often used to teach OO. Breaking down programs into blocks of functionality and basing your classes and methods around that. Although we worked under an Agile approach to manage the work the whole setup was classic client/server stuff. That suited me and I gradually got to grips with .NET and started using it far more in the manner that it should be, and I began to see the power inherent in the technology and precisely why it was so much better than good old ASP 3. In my latest job I have found myself suddenly dropped in at the deep end with two quite young, skilled and very cutting-edge programmers. They've built a site architecture which is modelling along a lot of stuff which is new to me and which, in truth I'm having a lot of trouble understanding. The application is built on a cloud computing model with multi-tenancy and the architecture is all loosely coupled using a lot of interfaces, factories and the like. They use nHibernate a lot too. Shortly after I joined, both these guys left and I'm now supposedly the senior developer on a system whose technology and architecture I don't really understand and I have no-one to ask questions of. Except you, the internet. Frankly I feel like I've been pitched in at the deep end and I'm sinking. I'm not sure if this is because I lack the educational background to understand this stuff, if I'm simply not mathematically minded enough for modern computing (my maths was never great - my approach to design is often to simply debug until it works, then refactor until it looks neat), or whether I've simply been presented with too much of too radical a nature at once. But the only way to find out which it is is to try and learn it. So can anyone suggest some good places to start? Good books, tutorials or blogs? I've found a lot of internet material simply presupposes a level of understanding that I just don't have. Your advice is much appreciated. Help a middle-aged, stuck in the mud developer get enthusastic again! Please!

    Read the article

  • Is there a better way than a sequence of if's to handle events?

    - by Matt
    I recently ran across several objects implemented to handle events with a hard coded mapping using this pattern: public void handleEvent(Event event) { if(event.getCode() == SOME_STATIC_EVENT) doSomething(event); if(event.getCode() == ANOTHER_STATIC_EVENT) doSomethingElse(event); } where doSomething functions are implemented as methods of the same class. In hopes of striving for looser coupling, how would you suggest abstracting out this pattern? Also, what's the best approach for mapping 0..N functions to a fired event?

    Read the article

  • Do graphic cards have instruction sets of their own?

    - by Matt
    Do graphic cards have instruction sets of their own? I assume they do, but I have been wondering if it is proprietary or if there is some sort of open standard. Is every GPU instruction preceded by a CPU instruction or is it seamless? That is does OpenGL or DirectX call on the driver layer via the CPU which then sends a GPU instruction down the bus or is it more elaborate.

    Read the article

  • If you stick to standard coding in .NET, is there reason to manually invoke the GC or run finalizers

    - by Matt
    If you stick to managed code and standard coding (nothing that does unconventional things withe CLR) in .NET, is there any reason to manually invoke the GC or request to run finalizers on unreferenced objects? The reason I ask is thaty I have an app that grows huge in Working Memory set. I'm wondering if calling System.GC.Collect(); and System.GC.RunFinalizers(); would help, and if it would force anything that wouldn't be done by the CLR normally anyways.

    Read the article

  • Using innerHTML to add ordered list fails in IE

    - by Matt
    I'm using the following Javascript code to populate a DIV with an ordered list: // send script back in split list var scriptList = script.split("\n"); var finalScript = "<ol>\n"; var count = 0; while(scriptList.length >= count) { if((scriptList[count]=="") || (scriptList[count] == undefined)) { count ++; continue; } finalScript = finalScript + "<li>" + scriptList[count] + "</li>\n"; count ++; } finalScript = finalScript + "</ol>"; scriptingDiv.innerHTML = finalScript; In firefox, if i look in the DOM using Firebug, this correctly translates to the following and correctly displays an ordered list. <ol> <li>This is the first item in the list</li> <li>This is the second item in the list</li> </ol> In IE, it displays as if the </li> tags are <br /> tags and ignores all the other tags, like this: This is the first item in the list This is the second item in the list Do I need to dynamically add the ordered list to the DOM for this to work? As opposed to just setting the html code in the div using .innerHTML? TIA

    Read the article

  • Count the number of dates between two dates

    - by Matt Mitchell
    I'm looking to count the dates covered (inclusive) between two DateTimes (not .TotalDays) For example: 2012-2-1 14:00 to 2012-2-2 23:00 -> 2 2012-2-1 14:00 to 2012-2-2 10:00 -> 2 2012-2-1 14:00 to 2012-2-1 15:00 -> 1 2012-1-1 00:00 to 2012-12-31 23:59 -> 366 I can get this functionality with the code below: DateTime dt1 = new DateTime(2000,1,2,12,00,00); DateTime dt2 = new DateTime(2000,1,3,03,00,00); int count = 0; for (DateTime date = dt1; date.Date <= dt2.Date; date = date.AddDays(1)) count++; return count; Is there a better way?

    Read the article

  • Help with basic php and xml needed

    - by Matt
    Hi, I'm really new to xml, with this being my first dip into it. I'm trying to add some text to an image using php and xml. I keep getting the following error: Parse error: syntax error, unexpected '}' in /home/a8744502/public_html/userbar.php on line 18 Below is my code. <?php header ("Content-type: image/jpeg"); $doc = new DOMDocument(); $doc->load( "http://phogue.net/feed/". LIBXML_DTDLOAD ); $procon = $doc->getElementsByTagName( "procon" ); $packages = $procon->getElementsByTagName( "package" ); $value = 0; foreach($packages as $package) { $downloadsA = $package->getElementsByTagName( "downloads" ); $downloads = $downloadsA->item(0)->nodeValue; $value = $downloads + $value } $font = "visitor1.tff"; $font = 4; $im = ImageCreateFromjpeg("procon_plugindeveloper.jpg"); $x = 360; $y = 0; $background_color = imagecolorallocate ($im, 255, 255, 255); $text_color = imagecolorallocate ($im, 255, 255, 255); imagestring ($im, $font, $x, $y, $value, $text_color); imagejpeg ($im); ?> The xml file is of the form <procon> -<packages> --<package> ---<downloads> ---</doanloads> --</package> --<package> ---<downloads> ---</doanloads> --</package> --<package> ---<downloads> ---</doanloads> --</package> -</packages> </procon> The idea is that it should print out the sum of all the downloads tags that are contained in . Any help is appreciated :-)

    Read the article

  • jqGrid: Is it possible to commit a cell change when tabbing off instead of pressing Enter?

    - by The Matt
    I have a simple in-line edit in my grid, and I want to commit the change when the user tabs off the textbox. The default behavior of jqGrid forces the user to press 'Enter' to commit the change, but this is non-intuitive for our users. onSelectRow: function(id) { $(gridCoreGroups).editRow(id, true, undefined, function(response) { alert("hello world"); } } I've worked my way through the events provided, but they all happen as a result of the user pressing 'Enter', which I want to avoid. Is there something I can wire up that would trigger an action when the user tabs off this cell?

    Read the article

  • Excluding a specific substring from a regex

    - by Matt S
    I'm attempting to mangle a SQL query via regex. My goal is essentially grab what is between FROM and ORDER BY, if ORDER BY exists. So, for example for the query: SELECT * FROM TableA WHERE ColumnA=42 ORDER BY ColumnB it should capture TableA WHERE ColumnA=42, and it should also capture if the ORDER BY expression isn't there. The closest I've been able to come is SELECT (.*) FROM (.*)(?=(ORDER BY)) which fails without the ORDER BY. Hopefully I'm missing something obvious. I've been hammering in Expresso for the past hour trying to get this.

    Read the article

  • Html 5 Time Tag not recognized by IE8 when cloning

    - by matsientst
    I have been having trouble getting IE to recognize the new Time tag in this context. This all works great in FF. Here is the code: var origComment = $('.articleComment:first div'); if (origComment.length > 0) { var commentHtml = origComment.clone(true); commentHtml.find('time').text('today'); var html = '<article class="' + ((side == 'LEFT') ? '' : 'that') + '">' + commentHtml.html() + '</article>'; $(html).insertAfter('.articleComment:last'); The HTML looks something like this: <article class="articleComment that"> <div id="156" class="parent"> <div class="byline"> <p>Posted <time pubdate="pubdate" datetime="2010-05-07T09:11:08">today</time> by<br/> <a class="username" href="/u/matt">matt</a> </p> <p class="report"><a href="#">Report?</a></p> </div> <div class="comment">left</div> </div> </article> IE can find the Time tag but it returns a collection of 2 elements. I assume the beginning and ending. However, I cannot access it to modify it. I have tried val(), html() and text(). I also can't drop to the actual HTMLElement. I can't get(0).innerHTML. But, if I .get(0).tagName it actually is the Time tag I've got. Any ideas? I hope this makes sense.

    Read the article

  • Where are possible locations of queueing/buffering delays in Linux multicast?

    - by Matt
    We make heavy use of multicasting messaging across many Linux servers on a LAN. We are seeing a lot of delays. We basically send an enormous number of small packages. We are more concerned with latency than throughput. The machines are all modern, multi-core (at least four, generally eight, 16 if you count hyperthreading) machines, always with a load of 2.0 or less, usually with a load less than 1.0. The networking hardware is also under 50% capacity. The delays we see look like queueing delays: the packets will quickly start increasing in latency, until it looks like they jam up, then return back to normal. The messaging structure is basically this: in the "sending thread", pull messages from a queue, add a timestamp (using gettimeofday()), then call send(). The receiving program receives the message, timestamps the receive time, and pushes it in a queue. In a separate thread, the queue is processed, analyzing the difference between sending and receiving timestamps. (Note that our internal queues are not part of the problem, since the timestamps are added outside of our internal queuing.) We don't really know where to start looking for an answer to this problem. We're not familiar with Linux internals. Our suspicion is that the kernel is queuing or buffering the packets, either on the send side or the receive side (or both). But we don't know how to track this down and trace it. For what it's worth, we're using CentOS 4.x (RHEL kernel 2.6.9).

    Read the article

  • Stable/repeatable random sort (MySQL, Rails)

    - by Matt Rogish
    I'd like to paginate through a randomly sorted list of ActiveRecord models (rows from MySQL database). However, this randomization needs to persist on a per-session basis, so that other people that visit the website also receive a random, paginate-able list of records. Let's say there are enough entities (tens of thousands) that storing the randomly sorted ID values in either the session or a cookie is too large, so I must temporarily persist it in some other way (MySQL, file, etc.). Initially I thought I could create a function based on the session ID and the page ID (returning the object IDs for that page) however since the object ID values in MySQL are not sequential (there are gaps), that seemed to fall apart as I was poking at it. The nice thing is that it would require no/minimal storage but the downsides are that it is likely pretty complex to implement and probably CPU intensive. My feeling is I should create an intersection table, something like: random_sorts( sort_id, created_at, user_id NULL if guest) random_sort_items( sort_id, item_id, position ) And then simply store the 'sort_id' in the session. Then, I can paginate the random_sorts WHERE sort_id = n ORDER BY position LIMIT... as usual. Of course, I'd have to put some sort of a reaper in there to remove them after some period of inactivity (based on random_sorts.created_at). Unfortunately, I'd have to invalidate the sort as new objects were created (and/or old objects being removed, although deletion is very rare). And, as load increases the size/performance of this table (even properly indexed) drops. It seems like this ought to be a solved problem but I can't find any rails plugins that do this... Any ideas? Thanks!!

    Read the article

  • Adding new records in Access without wrecking the form

    - by Matt Parker
    I'm working on a simple Access 2003 application to keep track of things that need to be done for clients for some colleagues. Each colleague has a set of clients, and each client has a set of actions that need to be taken by a certain date. I've set up a form that consists of a combobox for client ID (indexed), a drop-down for the person who is handling that client's case, and a button for adding new clients (a standard Access-created Add Record button). The actions are listed in a subform below these three elements. The problem I've run into is that the first person I tested this on clicked the button to add a new record, then didn't fill it out and tried to select another client from the drop-down list. Access interprets this as an attempt to set the selected Client ID as the ID for the new record and rightfully throws an error for duplicate primary keys. I can think of a couple of ways around this problem, but I'd much rather hear your elegant solutions than kludge together some junk in a language I don't know. Let me know if you have any questions. Thank you.

    Read the article

  • Are background threads a bad idea? Why?

    - by Matt Grande
    So I've been told what I'm doing here is wrong, but I'm not sure why. I have a webpage that imports a CSV file with document numbers to perform an expensive operation on. I've put the expensive operation into a background thread to prevent it from blocking the application. Here's what I have in a nutshell. protected void ButtonUpload_Click(object sender, EventArgs e) { if (FileUploadCSV.HasFile) { string fileText; using (var sr = new StreamReader(FileUploadCSV.FileContent)) { fileText = sr.ReadToEnd(); } var documentNumbers = fileText.Split(new[] {',', '\n', '\r'}, StringSplitOptions.RemoveEmptyEntries); ThreadStart threadStart = () => AnotherClass.ExpensiveOperation(documentNumbers); var thread = new Thread(threadStart) {IsBackground = true}; thread.Start(); } } (obviously with some error checking & messages for users thrown in) So my three-fold question is: a) Is this a bad idea? b) Why is this a bad idea? c) What would you do instead?

    Read the article

  • MySQL Query still executing after a day..?

    - by Matt Jarvis
    Hi - I'm trying to isolate duplicates in a 500MB database and have tried two ways to do it. One creating a new table and grouping: CREATE TABLE test_table as SELECT * FROM items WHERE 1 GROUP BY title; But it's been running for an hour and in MySQL Admin it says the status is Locked. The other way I tried was to delete duplicates with this: DELETE bad_rows.* from items as bad_rows inner join ( select post_title, MIN(id) as min_id from items group by title having count(*) 1 ) as good_rows on good_rows.post_title = bad_rows.post_title; ..and this has been running for 24hours now, Admin telling me it's Sending data... Do you think either or these queries are actually still running? How can I find out if it's hung? (with Apple OS X 10.5.7)

    Read the article

  • Fluent nHibernate - How to map a non-key column on a junction table?

    - by The Matt
    Taking an example that is provided on the Fluent nHibernate website, I need to extend it slightly: I need to add a 'Quantity' column to the StoreProduct table. How would I map this using nHibernate? An example mapping is provided for the given scenario above, but I'm not sure how I would get the Quantity column to map to a property on the Product class: public class StoreMap : ClassMap<Store> { public StoreMap() { Id(x => x.Id); Map(x => x.Name); HasMany(x => x.Employee) .Inverse() .Cascade.All(); HasManyToMany(x => x.Products) .Cascade.All() .Table("StoreProduct"); } }

    Read the article

  • How is this input tag linking to another page?

    - by Matt
    Response.Write("<div><input type='submit' name='submit' value='Update Cart' /></div>") Response.Write("<div><input type='submit' name='submit' value='Shop More' /></div>") Response.Write("<div><input type='submit' name='submit' value='Checkout' /></div>") that is some example code from my teacher, but he hasn't answered my email in a couple days so I need some help. When you click the Update Cart button it just updates the cart page it's on, but when you click the Shop More button it links to Shop.aspx a different page, and the Checkout links to another page as well. I can't figure out how it is linking just from that code, anybody have any insights?

    Read the article

  • MPMoviePlayerController iPhone 3G & .mov file format

    - by Matt
    Just posting a question to the world... My app is currently setup to play video files. The app is setup to play .mov files and when tested on a 3GS, iPhone 4, and an iPad, it works great. But when playing on an iPhone 3G, the file does not play. Is this based on different compression standards that the 3G can't handle? I liked the .mov extension as it was compressed nicely to stream to the device. I have now converted the video files to .m4v so it will play on the 3G, but the file is now 3 times the size. Thanks in advance for any answers I get!!

    Read the article

  • Eclipse Doesn't List Classes Within Java Packages

    - by Matt Robertson
    Usually when I'm typing a Java import statement in Eclipse or otherwise referencing a class via the packages that it is in, Eclipse shows a context menu with a list of all classes within that package. There have been several times, however, that it would only shows subpackages within a package and would not show classes within that package. Does anyone know why this is? It sounds like a setting/preference was changed, but I never knowingly changed anything related to this.

    Read the article

  • Using a dropdown on a static webpage as a DataSource in C#.net

    - by Matt
    I know this is a terrible way of doing things, but it's for an internal app where security is no issue. Basically, an old group created a php page with a drop down and this drop down is populated with entries from a DB. The DB owner is currently absent and for the sake of time, I would just need something that turns the entries in that drop down, always at the same url with the same ID every load into a List. Is there a quick, painless way to do this in .NET?

    Read the article

  • Automatic VisualState Manager in Silverlight

    - by Matt
    If you create a simple button and then choose Edit Template - Edit a Copy, Blend will automatically generate a style area, along with all the button states (MouseEnter, MouseLeave, Pressed, etc). No where in the code behind or auto generated style area does it say that on a "MouseOver" event, change the state to "MouseOver", but it still manages to work! Is the only way to change a button's state have to be done the code behind using the VisualStateManager.GoToState method, or can you change it much like CSS does (a:hover) using the VisualStateManager? From my experience, setting just doesn't seem to do the trick.

    Read the article

  • Fluent mapping help

    - by Matt Thrower
    Hi, This is probably a very simple question but I'm new to nHibernate and I'm having trouble working this out. I have a Page object, which can have many Region objects. I also have a Workflow object. Page and Region objects both have a relationship to Workflow and it's this double association that I'm having trouble with. The PageMap has HasMany(Function(x) x.Regions).Cascade.All() And the RegionMap has: References(Function(x) x.Page) And this all seems to work. But how do I define the relationship between Workflow and these two objects?

    Read the article

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