Search Results

Search found 3496 results on 140 pages for 'chris boden'.

Page 85/140 | < Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >

  • Equality with Double.NaN

    - by chris
    I have the following code... if (Price_Foreign != Double.NaN) { output.Append(spacer); output.Append(String.Format("{0,-10:C} USD",Price_Foreign)); } Which outputs: NaN USD What gives? I'm using Double.NaN to indicate that the value doesn't exist, and shouldn't be output.

    Read the article

  • What is the "box model?"

    - by Chris
    During a recent interview for a front-end developer position I was asked what the box model was. I thought the interviewer was referring to testing (i.e. white box testing, black box testing). I was wrong. What is the box model, in reference to front-end development?

    Read the article

  • PHP syntax for referencing self with late static binding

    - by Chris
    When I learned PHP it was pretty much in procedural form, more recently I've been trying to adapt to the OOP way of doing things. Hoever the tutorials I've been following were produced before PHP 5.3 when late static binding was introduced. What I want to know is how do I reference self when calling a function from a parent class. For example these two methods were written for a User class which is a child of DatabaseObject. Right now they're sitting inside the User class, but, as they're used in other child classes of DatabaseObject I'd like to promote them to be included inside DatabaseObject. public static function find_all() { global $database; $result_set = self::find_by_sql("select * from ".self::$table_name); return $result_set; } and: protected function cleaned_attributes() { global $database; $clean_attributes = array(); foreach($this->attributes() as $key => $value) { $clean_attributes[$key] = $database->escape_value($value); } return $clean_attributes; } So I have three questions: 1) How do I change the self:: reference when I move it to the parent. Is it static:: or something similar? 2) When calling the function from my code do I call it in the same way, as a function of the child class eg User::find_all() or is there a change there also? 3) Is there anything else I need to know before I start chopping bits up?

    Read the article

  • Getting my head around the practical applications of strong and weak pointers in Objective-C

    - by Chris Wilson
    I've just read the accepted excellent answer to this question that clarifies the conceptual differences between strong and weak pointers in Objective-C, and I'm still trying to understand the practical differences. I come from a C++ background where these concepts don't exist, and I'm having trouble figuring out where I would use one vs the other. Could someone please provide a practical example, using Objective-C code, that illustrates the different uses of strong and weak pointers?

    Read the article

  • Better way to set unix permissions when deploying war file

    - by Chris G
    We have a vendor application where we download their updates and deploy a war file. We are deploying the war file on a unix application server running oracle application server 9i. I believe when we deploy the war file, we remove the previous install and then deploy the new war file. When we deploy the war file, sometimes we have to manually set the unix file permissions for the class and other files. We do this so all the unix user ids can run the processes they need. Is there a better way to do this?

    Read the article

  • how can I get _NET_WORKAREA for seperate monitors

    - by Chris Camacho
    using gdk_screen_get_monitor_geometry (xrandr) I can get the resolutions for separate monitors (for example when there are 2 monitors used as a single screen like nvidias twinview) However _NET_WORKAREA seems to give one giant area even if the resolution of the other monitor is smaller. (a panel at the bottom of the second monitor would appear to be inside this work area) How can I get the actual workarea of other monitors even getting struts there seems no support for separate monitors just the main one...

    Read the article

  • Python - Get Instance Variables

    - by Chris Bunch
    Is there a built-in method in Python to get an array of all a class' instance variables? For example, if I have this code: class hi: def __init__(self): self.ii = "foo" self.kk = "bar" Is there a way for me to do this: >>> mystery_method(hi) ["ii", "kk"] Thanks guys! Edit: I originally had asked for class variables erroneously. Thanks to all who brought this to my attention!

    Read the article

  • getting a tiled image collection on the iPad (deepzoom)

    - by Chris B
    I have a set of tiled image collections created via microsoft's deep zoom composer, and a silverlight app that currently consumes them for display via MultiScaleImage - it's all working pretty well - I'd just like to get some experience with iPad programming and have a couple of ideas for some ipad applications. All my ideas rely on me being able to display/manipulate these tiled image sets (on the iPad). I just picked up a iMac to facilitate this. I'm not seeing any objective-c / cocoa-touch libraries for this though, so am assuming I will have to roll my own. (Saw the seadragon ajax component, which is pretty slick, but I'm dealing with collections here, which it doesn't support. I would also like to roll this as a native app just to get the experience). The only open source project I found for displaying/manipulating the tiled image sets was Openzoom -a flash component. I'm not to familiar with actionscript either (python, java, c#, and c are the only languages I have really used), but briefly inspecting the code I didn't really have any issues with it and can probably use it for hints on how to swap the tiles in and out, etc.. But, as I'm pretty new to obj-c/cocoa-touch, some pointers in the right direction would be appreciated. 1) Are there any other projects out there I am missing, or is openzoom my best bet for some reference? 2) Should I be trying to do this display in the UIKit framework, or should I do it as an OpenGL display? 3) Any other suggestions/pointers that I didn't think to ask.

    Read the article

  • Deserialize jSON Google AJAX Translation API

    - by Chris Porter
    I've got the JSON coming back like this: {"responseData": [{"responseData":{"translatedText":"elefante"},"responseDetails":null,"responseStatus":200},{"responseData":{"translatedText":"Burro"},"responseDetails":null,"responseStatus":200}], "responseDetails": null, "responseStatus": 200} And I need to parse it into a ResponseData object I have set-up: public class ResponseData { public string translatedText = string.Empty; public object responseDetails = null; public HttpStatusCode responseStatus = HttpStatusCode.OK; public List<ResponseData> responseData { get; set; } } I Deserialize it like this: JavaScriptSerializer serializer = new JavaScriptSerializer(); ResponseData translation = serializer.Deserialize<ResponseData>(responseJson); But no matter what the translated text is always empty.

    Read the article

  • Dojo dialog, the iPad and the virtual keyboard issue

    - by Chris Butler
    Recently, I have been working on a project where the interface should work for desktop and tablets (in particular the iPad). One issue I am coming across is with a Dojo dialog on the iPad when text entry is taking place. Basically here is what happens: Load Dojo interface with buttons on iPad - OK Press button (touch) to show dialog (90% height and width) - OK Click on text box (touch) like DateTextBox or TimeTextBox - OK, the virtual keyboard is opened Click the date or time I want in the UI (touch) - OK, but I can't see all of the options since it is longer than the screen size... Try to scroll down (swipe up with two fingers or click 'next' in the keyboard) - not OK and the dialog repositions itself to have it's top at the top of the viewport area. Basically, the issue is that the dialog keeps trying to reposition itself. Am I able to stop dialog resizing and positioning if I catch the window onResize events? Does anyone else have this issue with the iPad and Dojo dialogs? Also, I found this StackOverflow topic on detecting the virtual keyboard, but it wasn't much help in this case... http://stackoverflow.com/questions/2593139/ipad-web-app-detect-virtual-keyboard-using-javascript-in-safari Thanks!

    Read the article

  • Replace duplicate spaces with single space in TSQL

    - by Chris
    I need to ensure that a given field does not have more than one space (not concerned about all white space, just space) between characters. So 'single spaces only' Needs to turn into 'single spaces only' The below will not work select replace('single spaces only',' ',' ') as it would result in 'single spaces only' I would really prefer to stick with native TSQL rather than a CLR based solution. Thoughts?

    Read the article

  • In Google App Engine, what is the simplest way to keep a record of items that you have put into memc

    - by Chris Boesch
    I am starting to use memcache more frequently to avoid having to recalculate things between page requests. When the memcache periodically clears, as it is designed to do, I have to start all over rebuilding various items that I have placed in memcache. What I would like to do is create a very simple model that enables me to periodically save the items that I put into memcache based on the memcache keys that I'm using along with a datetime that is related to the data being memcached. What is the best way to do this? I'm looking for something like this: class MemcacheRecord(db.Model): key = db.StringProperty(required=True) value = #Something that can store whatever memcache can validThru = db.DateTimeProperty(required=True) def set(self, key, value, validThru): #Save a new memcache record newMemcacheRecord = MemcacheRecord(key=key, value=value, validThru=validThru) .. return True # or False def get_latest(self, key): #Get the memcache record with the most recent validThru datetime latestMemcacheRecord = MemcacheRecord.all().order('-validThru').get() return {'validThru':latestMemcacheRecord.validThru, 'value':latestMemcachRecord.value}

    Read the article

  • checkUnique function?

    - by Chris Leah
    Hey, so I have created a function to check the DB for unique entries, but when I call the function it doesn't seem to work and gives me a fatal error any ideas from the function or do you wish to see the sign up page calling it. Thanks :) //Check for unique entries function checkUnique($table, $field, $compared) { $query = $mysqli->query('SELECT '.$mysqli->real_escape_string($field).' FROM '.$mysqli->real_escape_string($table).' WHERE "'.$mysqli->real_escape_string($field).'" = "'.$mysqli->real_escape_string($compared).'"'); if(!$query){ return TRUE; } else { return FALSE; } } The page calling it..... if (!empty($_POST['username']) && !empty($_POST['password']) && $_POST['password']==$_POST['password_confirm'] && !empty($_POST['email']) && validateEmail($_POST['email']) == TRUE && checkUnqiue('users', 'email', $_POST['email']) == TRUE && checkUnique('users', 'username', $_POST['username']) == TRUE)

    Read the article

  • Handling national language prefix for checkconstraints

    - by Chris Chilvers
    I'm trying to create a check constraint such as CHECK Type IN (N'Create', N'Remove') for an enumeration's value. Sqlite complains about this syntax and only accepts CHECK Type IN ('Create', 'Remove'). The main database will be Sql Server 2005, but I use sqlite's in memory database for unit tests. Is there any way to get sqlite to recognise the national language (N) prefix? Alternatively, is there an easy way when using FluentNHibernate to adapt an nvarchar constant to match the database's dialect?

    Read the article

  • Why can I not view foreign language characters in my mysql DB?

    - by Chris
    I am inserting the following characters into my DB: ?? / ?? This is the meta tag on the page that is inserting the characters: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> I have altered all the columns in my table that is holding the characters to be utf8_unicode_ci The foreign characters show up like so in the DB: 汉字 / 漢字 When I use a sql statement to display those foreign characters on a page, they display correctly again as: ?? / ?? I am guessing I have some setting that is not correct in my DB, since it stores it correctly, but does not display it correctly. What can i do to make the foreign language characters to display correctly in my DB?

    Read the article

  • Delete or comment out non-working JUnit tests?

    - by Chris Knight
    I'm currently building a CI build script for a legacy application. There are sporadic JUnit tests available and I will be integrating a JUnit execution of all tests into the CI build. However, I'm wondering what to do with the 100'ish failures I'm encountering in the non-maintained JUnit tests. Do I: 1) Comment them out as they appear to have reasonable, if unmaintained, business logic in them in the hopes that someone eventually uncomments them and fixes them 2) Delete them as its unlikely that anyone will fix them and the commented out code will only be ignored or be clutter for evermore 3) Track down those who have left this mess in my hands and whack them over the heads with the printouts of the code (which due to long-method smell will be sufficently suited to the task) while preaching the benefits of a well maintained and unit tested code base

    Read the article

  • How to force asp.net MVC 2 to redirect to default controller/action

    - by Chris
    In a brand new ASP.NET MVC2 project, I want the user to be redirected to http://<mysite>/home/index rather than http://<mysite>/ We do this with our other sites for tracking purposes, to avoid the scenario where hits to the same default page show up as http://<mysite>/ http://<mysite>/default.aspx How do I accomplish this so that http://<mysite>/ automatically redirects to whatever default controller/action I have set up in my routing? Please note that I am aware the two are functionally equivalent, as the default controller action will be executed either way. I'm just interested in forcing consistent URLs in the browser.

    Read the article

  • Displaying timecode using NSTimer and NSDateFormatter

    - by Chris B
    Hi. I am very close to completing my first iphone app and it has been a joy. I am trying to add running timecode using the current time via an NSTimer displaying the current time (NSDate) on a UILabel. NSDate is working fine for me, showing hour, minute, second, milliseconds. But instead of milliseconds, I need to show 24 frames per second. The problem is that I need the frames per second to be synced 100% with the hour, minute and second, so I can't add the frames in a separate timer. I tried that and had it working but the frame timer was not running in sync with the date timer. Can anyone help me out with this? Is there a way to customize NSDateFormatter so that I can have a date timer formatted with 24 frames per second? Right now I'm limited to formatting just hours, minutes, seconds, and milliseconds. Here's the code I'm using right now -(void)runTimer { // This starts the timer which fires the displayCount method every 0.01 seconds runTimer = [NSTimer scheduledTimerWithTimeInterval: .01 target: self selector: @selector(displayCount) userInfo: nil repeats: YES]; } //This formats the timer using the current date and sets text on UILabels - (void)displayCount; { NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease]; NSDate *date = [NSDate date]; // This will produce a time that looks like "12:15:07:75" using 4 separate labels // I could also have this on just one label but for now they are separated // This sets the Hour Label and formats it in hours [formatter setDateFormat:@"HH"]; [timecodeHourLabel setText:[formatter stringFromDate:date]]; // This sets the Minute Label and formats it in minutes [formatter setDateFormat:@"mm"]; [timecodeMinuteLabel setText:[formatter stringFromDate:date]]; // This sets the Second Label and formats it in seconds [formatter setDateFormat:@"ss"]; [timecodeSecondLabel setText:[formatter stringFromDate:date]]; //This sets the Frame Label and formats it in milliseconds //I need this to be 24 frames per second [formatter setDateFormat:@"SS"]; [timecodeFrameLabel setText:[formatter stringFromDate:date]]; }

    Read the article

  • Invert regexp in vim

    - by Chris J
    There's a few "how do I invert a regexp" questions here on stackoverflow, but I can't find one for vim (if it does exist, by goggle-fu is lacking today). In essence I want to match all non-printable characters and delete them. I could write a short script, or drop to a shell and use tr or something similar to delete, but a vim solution would be dandy :-) Vim has the atom \p to match printable characters, however trying to do this :s/[^\p]//g to match the inverse failed and just left me with every 'p' in the file. I've seen the (?!xxx) sequence in other questions, and vim seems to not recognise this sequence. I've not found seen an atom for non-printable chars. In the interim, I'm going to drop to external tools, but if anyone's got any trick up their sleeve to do this, it'd be welcome :-) Ta!

    Read the article

  • Emacs persistent folding mode

    - by Chris
    There are plenty of ways to fold code in Emacs and I've settled in on using the outline minor mode... it works great! However, I really want my folding to be persisted when I close and re-open files. It is quite frustrating to have folding set up in a file the way I like it, only to have that lost when I restart Emacs. Has anyone found a way to keep the folding state of a file persistent?

    Read the article

  • Objective-c memory management

    - by Chris
    I have a method which runs this: Track* track = [[Track alloc] init:[obj objectForKey:@"PersistentID"] :[obj objectForKey:@"Name"] :[obj objectForKey:@"Artist"] :(NSInteger*)[obj objectForKey:@"Total Time"] :(NSInteger*)[obj objectForKey:@"Play Count"]]; [self setCurrentTrack:(Track*) track]; [track release]; Do I have to release track?

    Read the article

< Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >