Search Results

Search found 2008 results on 81 pages for 'greg smith'.

Page 54/81 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • sort associative array PHP

    - by jim smith
    Here's my array, how do I sort it by saleref? Array ( [xml] => Array ( [sale] => Array ( [0] => Array ( [saleref] => 12345 [saleline] => 1 [product] => producta [date] => 19/ 3/10 [manifest] => 0 [qty] => 1 [nextday] => [order_status] => ) [1] => Array ( [saleref] => 12344 [saleline] => 1 [product] => productb [date] => 18/ 3/10 [manifest] => 11892 [qty] => 1 [nextday] => [order_status] => )

    Read the article

  • How to manage lifecycle in a ViewGroup-derived class?

    - by Scott Smith
    I had a bunch of code in an activity that displays a running graph of some external data. As the activity code was getting kind of cluttered, I decided to extract this code and create a GraphView class: public class GraphView extends LinearLayout { public GraphView(Context context, AttributeSet attrs) { super(context, attrs); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.graph_view, this, true); } public void start() { // Perform initialization (bindings, timers, etc) here } public void stop() { // Unbind, destroy timers, yadda yadda } . . . } Moving stuff into this new LinearLayout-derived class was simple. But there was some lifecycle management code associated with creating and destroying timers and event listeners used by this graph (I didn't want this thing polling in the background if the activity was paused, for example). Coming from a MS Windows background, I kind of expected to find overridable onCreate() and onDestroy() methods or something similar, but I haven't found anything of the sort in LinearLayout (or any of its inherited members). Having to leave all of this initialization code in the Activity, and then having to pass it into the view seemed like it defeated the original purpose of encapsulating all of this code into a reusable view. I ended up adding two additional public methods to my view: start() and stop(). I make these calls from the activity's onResume() and onPause() methods respectively. This seems to work, but it feels like I'm using duct tape here. Does anyone know how this is typically done? I feel like I'm missing something...

    Read the article

  • Is locking on the requested object a bad idea?

    - by Quick Joe Smith
    Most advice on thread safety involves some variation of the following pattern: public class Thing { private static readonly object padlock = new object(); private string stuff, andNonsense; public string Stuff { get { lock (Thing.padlock) { if (this.stuff == null) this.stuff = "Threadsafe!"; } return this.stuff; } } public string AndNonsense { get { lock (Thing.padlock) { if (this.andNonsense == null) this.andNonsense = "Also threadsafe!"; } return this.andNonsense; } } // Rest of class... } In cases where the get operations are expensive and unrelated, a single locking object is unsuitable because a call to Stuff would block all calls to AndNonsense, degrading performance. And rather than create a lock object for each call, wouldn't it be better to acquire the lock on the member itself (assuming it is not something that implements SyncRoot or somesuch for that purpose? For example: public string Stuff { get { lock (this.stuff) { // Pretend that this is a very expensive operation. if (this.stuff == null) this.stuff = "Still threadsafe and good?"; } return this.stuff; } } Strangely, I have never seen this approach recommended or warned against. Am I missing something obvious?

    Read the article

  • Trim Cells using VBA in Excel

    - by Greg Reynolds
    I have what seems like a simple problem with some data in Excel. I have a lot of data with leading spaces pasted from a web table, and I would like to get rid of the initial space. I cribbed the following code (I am completely new to VBA), but it doesn't seem to work. When I step through it in the debugger it looks like an infinite loop. Any help would be appreciated! Sub DoTrim() For Each cell In Selection.Cells If cell.HasFormula = False Then cell = Trim(cell) End If Next End Sub

    Read the article

  • Why does Apple create it's views this way

    - by John Smith
    In the hope of fixing a bug of mine from another post i would like to know why apple writes this (for it's Elements example) UIView *localContainerView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; self.containerView = localContainerView; [localContainerView release]; instead of the simpler method: containerView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; ?

    Read the article

  • What do I need to develop an Iron Python web app in Visual Studio 2010

    - by Greg
    Hi, I've got Visual Studio 2010. To develop a web app in Iron Python (i.e. to use a Ruby like language not C#) what downloads to I need? e.g. is the DLR already in VS2010, Iron Python itself Once setup would I actually be still developing an ASP.net MVC web app but just using Ruby for the language, or is the model something different to this? thanks

    Read the article

  • jQuery - How to Use slideDown (or show) function on a table row?

    - by Greg
    I'm trying to add a row to a table and have that row slide into view, however the slidedown function seems to be adding a display:block style to the table row which messes up the layout. Any ideas how to work around this? Here's the code: $.get('/some_url',{'val1':id}, function(data){ var row = $('#detailed_edit_row'); row.hide(); row.html(data); row.slideDown(1000); });

    Read the article

  • Could someone give me their two cents on this optimization strategy

    - by jimstandard
    Background: I am writing a matching script in python that will match records of a transaction in one database to names of customers in another database. The complexity is that names are not unique and can be represented multiple different ways from transaction to transaction. Rather than doing multiple queries on the database (which is pretty slow) would it be faster to get all of the records where the last name (which in this case we will say never changes) is "Smith" and then have all of those records loaded into memory as you go though each looking for matches for a specific "John Smith" using various data points. Would this be faster, is it feasible in python, and if so does anyone have any recommendations for how to do it?

    Read the article

  • Is ASP.net MVC a direct copy of Ruby on Rails concepts?

    - by Greg
    Hi, I'm been developing Ruby on Rails previously. I'm now looking at an ASP.net web app and I'm looking at WebForms and MVC. As I look at MVC it feels as if I'm looking at the result of something a Ruby on Rails developer implemented after being forced to work in MS land. So I'm wondering: Was MVC more or less taken directly from Ruby on Rails and it's concepts? (either intentionally or unintentionally)

    Read the article

  • Can I use Linq-to-xml to persist my object state without having to use/know Xpath & XSD Syntax?

    - by Greg
    Hi, Can I use Linq-to-xml to persist my object state without having to use/know Xpath & XSD Syntax? ie. really looking for simple but flexible way to persist a graph of object data (e.g. have say 2 or 3 classes with associations) - if Linq-to-xml were as simple as saying "persist this graph to XML", and then you could also query it via Linq, or load it into memory again/change/then re-save to the xml file.

    Read the article

  • How to add value to second column using wxListCtrl in wxWidgets (C++ code)??

    - by azm882
    I've following code: int column_width = 100; long indx1 = alist-InsertColumn(0, L"User Name", wxLIST_FORMAT_LEFT, column_width); long indx2 = alist-InsertColumn(1, L"User Id", wxLIST_FORMAT_LEFT, column_width); long itemIndex1 = alist-InsertItem(indx1, L"John Smith", -1); alist-SetItem(indx1, 1, L"jsmith"); I expect to see two columns with User Name and User Id as heading with "My Name" and "My Id" as values on the first row. Instead I only see "John Smith" under column User Name but nothing under User ID column. Here is a link to the snapshot showing the result: http://drop.io/agtyt6s Thanks!

    Read the article

  • C++ - Access array (in main) from methods outside main

    - by John Smith
    I have an array in my main class that holds objects that I need to print out for a menu listing. The array is declared and initialized in main. I need to, however, access the same array in a sub-menu function. If I copy the code (for loop that prints out the values) to the sub-menu, nothing is printed (presumably because it can't access the original array and has made a new, blank one). Is there any way (without making the array a global variable) that I can access the array in this sub-menu? Both the main and the sub-menu function are in the same file and the sub-menu is called from main. Maybe to put it more simply, can I use scope resolution to bring me up one 'level' in scope?

    Read the article

  • Replace method doesn't work properly

    - by John Smith
    Hello I have a string and when i try to use replace method in for loop it doesn't work String phrase="hello friend"; String[] wordds=phrase.split(" "); String newPhrase="sup friendhello weirdo"; for (int g=0;g<2;g++) { finalPhrase+=newPhrase.replace(wordds[g],"");} } System.out.println(finalPhrase) It prints out "sup hello weirdo" and i expect it to print "sup weirdo". What am i doing wrong?

    Read the article

  • HttpWebRequest possibly slowing website

    - by Steven Smith
    Using Visual studio 2012, C#.net 4.5 , SQL Server 2008, Feefo, Nopcommerce Hey guys I have Recently implemented a new review service into a current site we have. When the change went live the first day all worked fine. Since then though the sending of sales to Feefo hasnt been working, There are no logs either of anything going wrong. In the OrderProcessingService.cs in Nop Commerce's Service, i call a HttpWebrequest when an order has been confirmed as completed. Here is the code. var email = HttpUtility.UrlEncode(order.Customer.Email.ToString()); var name = HttpUtility.UrlEncode(order.Customer.GetFullName().ToString()); var description = HttpUtility.UrlEncode(productVariant.ProductVariant.Product.MetaDescription != null ? productVariant.ProductVariant.Product.MetaDescription.ToString() : "product"); var orderRef = HttpUtility.UrlEncode(order.Id.ToString()); var productLink = HttpUtility.UrlEncode(string.Format("myurl/p/{0}/{1}", productVariant.ProductVariant.ProductId, productVariant.ProductVariant.Name.Replace(" ", "-"))); string itemRef = ""; try { itemRef = HttpUtility.UrlEncode(productVariant.ProductVariant.ProductId.ToString()); } catch { itemRef = "0"; } var url = string.Format("feefo Url", login, password,email,name,description,orderRef,productLink,itemRef); var request = (HttpWebRequest)WebRequest.Create(url); request.KeepAlive = false; request.Timeout = 5000; request.Proxy = null; using (var response = (HttpWebResponse)request.GetResponse()) { if (response.StatusDescription == "OK") { var stream = response.GetResponseStream(); if(stream != null) { using (var reader = new StreamReader(stream)) { var content = reader.ReadToEnd(); } } } } So as you can see its a simple webrequest that is processed on an order, and all product variants are sent to feefo. Now: this hasnt been happening all week since the 15th (day of the implementation) the site has been grinding to a halt recently. The stream and reader in the the var content is there for debugging. Im wondering does the code redflag anything to you that could relate to the process of website? Also note i have run some SQL statements to see if there is any deadlocks or large escalations, so far seems fine, Logs have also been fine just the usual logging of Bots. Any help would be much appreciated! EDIT: also note that this code is in a method that is called and wrapped in A try catch UPDATE: well forget about the "not sending", thats because i was just told my code was rolled back last week

    Read the article

  • How can I link in both remote and local assets into a webview?

    - by Greg
    I'm loading HTML-formatted content into my app from a web service, then plugging that into a local HTML template that lives within the app. Now, I need to set the UIWebView's BaseURL to point at the remote server so that all relative image links will load. However, I'm also trying to link in some local assets (CSS, JavaScript). Thus far, I have not found any documentation on how to link in local assets without relying on the UIWebView's baseURL. I've tried injecting the absolute file path of my CSS and JS into my HTML template, but it hasn't worked... I don't know if that means that it doesn't work, or if I'm just doing it wrong. Has anyone ever run into this scenario, and if so, how did you address it? Thanks in advance, I really appreciate any tips!

    Read the article

  • Problems with i18n using django translation on App-Engine with Korean and Hindi

    - by Greg
    I've got a setup based on the post here, and it works perfectly. Adding more languages to the mix, it recognises them fine, except for Korean (ko) and Hindi (hi). Chinese/Japanese/Hebrew are all fine, so nothing to do with encodings/charsets I don't think. Taking a look into the django code inside the app-engine SDK, I notice that all the languages that I'm using except for ko and hi are ones that ship with django - in the default settings.py and inside the locale folder they are missing. If I copy one of the locale folders inside the /usr/local/google_appengine/lib/django[...]/conf/locale and rename it to be 'ko', then it starts working in my app, but I won't be able to replicate this modification when I deploy to app-engine, so need a bit of help understanding what I might be doing wrong. my settings.py is definitely being taken into account, as if I remove languages from there then they stop working (as they should). If I copied the django modules into my app, under 'lib' there say, could I use those instead of the ones app-engine tries to use, maybe? I'm brand new to python/django/app-engine, and developing on a Mac with Leopard, if that makes any difference. I have the latest app-engine SDK as of tuesday.

    Read the article

  • c# - what approach can I use to extend a group of classes that include implemented methods? (see des

    - by Greg
    Hi, I want to create an extendible package I am writing that has Topology, Node & Relationship classes. The idea is these base classes would have the various methods in them necessary to base graph traversal methods etc. I would then like to be able to reuse this by extending the package. For example the base requirements might see Relationship with a parentNode & childNode. Topology would have a List of Nodes and List of Relationships. Topology would have methods like FindChildren(int depth). Then the usage would be to extend these such that additional attributes for Node and Relationships could be added etc. QUESTION - What would be the best approach to package & expose the base level classes/methods? (it's kind of like a custom collection but with multiple facets). Would the following concepts come into play: Interfaces - would this be a good idea to have ITopology, INode etc, or is this not required as the user would extend these classes anyway? Abstract Classes - would the base classes be abstract classes Custom Generic Collection - would some approach using this concept assist (but how would this work if there are the 3 different classes) thanks

    Read the article

  • iPhone - customizing WebKit

    - by Greg
    Hello, Apple has disabled the overflow CSS aspect in mobile Safari so it is not possible to scroll inside a fixed height div. This is quite annoying. While making an iPhone native app, is it possible to access WebKit settings to turn that feature on ?

    Read the article

  • Creating a contact form using divs with 4 extra divs for "Corners"?

    - by mark smith
    Hi there, i have tried to create a contact form (a standard form, square in nature but with rounded corners)... I can't use the CSS3 specs so i have an image for each corner.. I have set the images on the background-image and no repeat but it seems if the div is empty then it doesn't display, is there a hack - although prefer an alternative clean method :-) So on the top level i presume i have 1 div for the Upper-Left (corner) and then the upper-middle (just has a color assigned) and then a div for the upper-right (corner) .. so i presume i need to float all these to the left??? Or am i missing something? Thanks in advance

    Read the article

  • Is it possible to virtualize war file execution without separate J2EE container deployments?

    - by Smith
    Let's say I want to allow my developers to upload their war files to a web app (not the application server itself) running on our intranet and that web app would then run those wars as if they were separate apps deployed individually in our J2EE container. In other words, we are not actually deploying the wars as separate apps in the container - they are simply running side-by-side inside this one web app that acts like a J2EE container. Is that possible? Something like a war virtualization app?

    Read the article

  • How do you have grayed out text in a textfield that dissapears when the user clicks on it

    - by John Smith
    In HTML & JS, how do you make a textfield that has grayed out text telling the user what the field is for that goes away when the user clicks on the field? For example, in firefox the search field in the top right hand side says which search engine it uses when there's nothing entered, then once you click it's an empty textfield, but if you leave it blank and remove focus from the textfield then the grayed out text is back again. Is there a name for this behavior? Also, is it possible to do in pure css without the use of js to do the on focus / on blur events?

    Read the article

  • Jquery return element html instead of content

    - by jim smith
    I have something like this <ul> <li class="aclass" id="a">content</li> <li class="aclass" id="b">content</li> <li class="aclass" id="c">content</li> <li class="aclass" id="d">content</li> <li class="aclass" id="e">content</li> <li class="aclass" id="f">content</li> </ul> I have code like $(".aclass").live("mousedown",function() { alert($this.html()); }); This will alert the content, what I would like to do is alert the entire element like <li class="aclass" id="f">content</li> I've tried $(this).parent() but that returns the whole UL

    Read the article

  • iPhone: keep text looking good after scale transform applied?

    - by Greg Maletic
    I'm applying a scale transform to a UIView that draws a number. (The number is literally being drawn with drawInRect; no UILabel in sight.) The scale transform makes the view smaller by quite a bit...say, 80% smaller. The resulting number looks a little "chunky". Is there a way that I can keep my text looking nice and anti-aliased, the way it's supposed to look? Thanks.

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >