Search Results

Search found 1941 results on 78 pages for 'james ferguson'.

Page 47/78 | < Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >

  • ViewController vs. View

    - by James
    Trying to wrap my head around the apple design scheme. I have a UIViewController and the corresponding XIB file that has my main screen in my application. I want to have a button on this XIB that displays another "form" (this is my disconnect) in the foreground where the user selects from a myriad of choices, then it hides that "form" and goes back to the first one. I'm completely lost here. Initially I thought I'd just add another view and set the self.view of my controller to the new view, add another IBAction and call it a day, but I can't seem to make that work. For sake of argument, say I want to "gray out" the current form, have a modal type window that takes up roughly 60% of the screen and requires you select an option, then it hides itself and we go back to normal. What is the standard approach here? Thanks

    Read the article

  • How do you delete rows from UITableView?

    - by James
    This has been bugging me for hours now and i have not been able to figure it out. I am importing data into a tableview using core data and NSMutableArray. As shown below. CORE DATA ARRAY NSMutableArray *mutableFetchResults = [CoreDataHelper getObjectsFromContext:@"Spot" :@"Name" :YES :managedObjectContext]; self.entityArray = mutableFetchResults; TABLE VIEW - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSManagedObject *object = (NSManagedObject *)[entityArray objectAtIndex:indexPath.row]; NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; } NSString *lat1 = [object valueForKey:@"Email"]; //NSLog(@"Current Spot Latitude:%@",lat1); float lat2 = [lat1 floatValue]; //NSLog(@"Current Spot Latitude Float:%g", lat2); NSString *long1 = [object valueForKey:@"Description"]; //NSLog(@"Current Spot Longitude:%@",long1); float long2 = [long1 floatValue]; //NSLog(@"Current Spot Longitude Float:%g", long2); //Getting current location from NSDictionary CoreDataTestAppDelegate *appDelegate = (CoreDataTestAppDelegate *) [[UIApplication sharedApplication] delegate]; NSString *locLat = [NSString stringWithFormat:appDelegate.latitude]; float locLat2 = [locLat floatValue]; //NSLog(@"Lat: %g",locLat2); NSString *locLong = [NSString stringWithFormat:appDelegate.longitude]; float locLong2 = [locLong floatValue]; //NSLog(@"Long: %g",locLong2); //Distance Shizzle //Prime's Location CLLocation *loc1 = [[CLLocation alloc] initWithLatitude:lat2 longitude:long2]; //Home Location CLLocation *loc2 = [[CLLocation alloc] initWithLatitude:locLat2 longitude:locLong2]; double distance = [loc1 getDistanceFrom: loc2] / 1000; int myInt = (int)(distance + (distance>0 ? 0.5 : -0.5)); //NSLog(@"INT VAL :%i", myInt); NSMutableString* converted = [NSMutableString stringWithFormat:@"%.1f", distance]; [converted appendString: @" Km"]; //NSLog(@"Distance between Prime and home = %g", converted); if (myInt < 11) { cell.textLabel.text = [object valueForKey:@"Name"]; cell.detailTextLabel.text = [NSString stringWithFormat:converted]; } else { } // Configure the cell... return cell; } I am trying to get the table only to display results that are within a certain distance. This method here works apart from the fact that the results over a certain distance are still in the table, they are just not graphically visible. I am led to believe that i have to carry out the filtering process before the formatting the table but i can not seem to do this. Please help. My xcode skills are not brilliant so code suggestions would be helpfull.

    Read the article

  • Why do I need to commit ignores under TortoiseSVN?

    - by James McMahon
    When I select ignore on a files under version control it marks the parent directory as changes, then when I then do a commit, it checks in svn:ignore property to the repository, resulting in another revision. Why do I need to commit the svn:ignore property? Is this a TortoiseSVN issue or just the way SVN works?

    Read the article

  • Problem using Lazy<T> from within a generic abstract class

    - by James Black
    I have a generic class that all my DAO classes derive from, which is defined below. I also have a base class for all my entities, but that is not generic. The method GetIdOrSave is going to be a different type than how I defined SabaAbstractDAO, as I am trying to get the primary key to fulfill the foreign key relationships, so this function goes out to either get the primary key or save the entity and then get the primary key. The last code snippet has a solution on how it will work if I get rid of the generic part, so I think this can be solved by using variance, but I can't figure out how to write an interface that will compile. public abstract class SabaAbstractDAO<T> { ... public K GetIdOrSave<K>(K item, Lazy<SabaAbstractDAO<BaseModel>> lazyitemdao) where K : BaseModel { if (item != null && item.Id.IsNull()) { var itemdao = lazyitemdao.Value; item.Id = itemdao.retrieveID(item); if (item.Id.IsNull()) { return itemdao.SaveData(item); } } return item; } } I am getting this error, when I try to compile: Argument 2: cannot convert from 'System.Lazy<ORNL.HRD.LMS.Dao.SabaCourseDAO>' to 'System.Lazy<ORNL.HRD.LMS.Dao.SabaAbstractDAO<ORNL.HRD.LMS.Models.BaseModel>>' I am trying to call it this way: GetIdOrSave(input.OfferingTemplate, new Lazy<SabaCourseDAO>( () => { return new SabaCourseDAO() { Dao = Dao }; }) ); If I change the definition to this, it works. public K GetIdOrSave<K>(K item, Lazy<SabaCourseDAO> lazyitemdao) where K : BaseModel { So, how can I get this to compile using variance (if needed) and generics, so I can have a very general method that will only work with BaseModel and AbstractDAO<BaseModel>? I expect I should only need to make the change in the method and perhaps abstract class definition, the usage should be fine.

    Read the article

  • NSIS Uninstaller Working Directory

    - by James Thigpen
    I am using NSIS to create my installers/uninstallers, and the uninstaller seems to have a weird behavior. I don't put the installer in $INSTDIR, it is located at $INSTDIR/subdir/uninstall.exe (it's a addon installer for a host application). When I run the installer then, it thinks the application installation root is $INSTDIR/subdir instead of $INSTDIR. It then can't find all the files in subdir/* as it's already in subdir. If I move the executable, it seems to just accept the current directory as where the application installation root is. I can move it to $INSTDIR and all is well. Thanks.

    Read the article

  • How to loop a video in Flash

    - by james
    So i had a video that was in quicktime format, threw it into flash, encoded it without a problem and here is the result i got: http://www.healthcarepros.net/travel.html I would like the video to "loop" or "autorewind" as soon as it ends but i am having the hardest time trying to figure how to do this. Here is my code, any help would be greatly appreciated... if (AC_FL_RunContent == 0) { alert("This page requires AC_RunActiveContent.js."); } else { AC_FL_RunContent( 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'width', '330', 'height', '245', 'src', 'healthcare-video', 'quality', 'high', 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'align', 'middle', 'play', 'true', 'loop', 'true', 'scale', 'showall', 'wmode', 'window', 'devicefont', 'false', 'id', 'healthcare-video', 'bgcolor', '#ffffff', 'name', 'healthcare-video', 'menu', 'true', 'allowFullScreen', 'false', 'allowScriptAccess','sameDomain', 'movie', 'healthcare-video', 'salign', '' ); //end AC code } <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="330" height="245" id="healthcare-video" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="loop" value="true" /> <param name="play" value="true" /> <param name="movie" value="healthcare-video.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="healthcare-video.swf" play="true" flashvars="autoplay=true&play=true&autorewind=true" quality="high" bgcolor="#ffffff" width="330" height="245" name="healthcare-video" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>

    Read the article

  • Open Source Project & Language Selection

    - by James
    I'm getting ready to start an open-source project that will target .NET/Mono. For those who have started their own open source venture... Do you let the fact that a project is going to be open-source weigh on the decision of what language to use? For example. Most .NET open-source projects are written in C#. However, if you were more comfortable with VB.NET, Boo, Nemerle, etc... would you use it? What other considerations are there? This particular project will be a core library and application for geocaching. Similar to GSAK.

    Read the article

  • C++ vs. C++/CLI: Const qualification of virtual function parameters

    - by James McNellis
    [All of the following was tested using Visual Studio 2008 SP1] In C++, const qualification of parameter types does not affect the type of a function (8.3.5/3: "Any cv-qualifier modifying a parameter type is deleted") So, for example, in the following class hierarchy, Derived::Foo overrides Base::Foo: struct Base { virtual void Foo(const int i) { } }; struct Derived : Base { virtual void Foo(int i) { } }; Consider a similar hierarchy in C++/CLI: ref class Base abstract { public: virtual void Foo(const int) = 0; }; ref class Derived : public Base { public: virtual void Foo(int i) override { } }; If I then create an instance of Derived: int main(array<System::String ^> ^args) { Derived^ d = gcnew Derived; } it compiles without errors or warnings. When I run it, it throws the following exception and then terminates: An unhandled exception of type 'System.TypeLoadException' occurred in ClrVirtualTest.exe Additional information: Method 'Foo' in type 'Derived'...does not have an implementation. That exception seems to indicate that the const qualification of the parameter does affect the type of the function in C++/CLI (or, at least it affects overriding in some way). However, if I comment out the line containing the definition of Derived::Foo, the compiler reports the following error (on the line in main where the instance of Derived is instantiated): error C2259: 'Derived': cannot instantiate abstract class If I add the const qualifier to the parameter of Derived::Foo or remove the const qualifier from the parameter of Base::Foo, it compiles and runs with no errors. I would think that if the const qualification of the parameter affects the type of the function, I should get this error if the const qualification of the parameter in the derived class virtual function does not match the const qualification of the parameter in the base class virtual function. If I change the type of Derived::Foo's parameter from an int to a double, I get the following warning (in addition to the aforementioned error, C2259): warning C4490: 'override': incorrect use of override specifier; 'Derived::Foo' does not match a base ref class method So, my question is, effectively, does the const qualification of function parameters affect the type of the function in C++/CLI? If so, why does this compile and why are there no errors or warnings? If not, why is an exception thrown?

    Read the article

  • Standard Practice for Continuous Integration of Maven Multi-module projects

    - by James Kingsbery
    I checked around, and couldn't find a good answer to this: We have a multi-module Maven project which we want to continuously integrate. We thought of two strategies for handling this: Have our continuous integration server (TeamCity, in this case, but I've used others before and they seem to have the same issue) point to the aggregator POM file, and just build everything Have our continuous integration server point at each individual module Is there a standard, preferred practice for this? I've checked Stack Overflow, Google, the Continuous Integration book, and did not find anything, but maybe I missed it.

    Read the article

  • c# ListView focus on second column

    - by James
    I have a ListView with several columns, let's say column A,B,C,D in that order, sorted by column A. In long lists I could press a letter on my keyboard and scroll down to the first item in column A that begins with the letter pressed. A new column has been inserted at the beginning, yet I still want to be able to press a letter on my keyboard and scroll according to the values in column A which is now the second column. How can I set the focus back to column A without making it the first column?

    Read the article

  • User Friendly Video Review with Locking

    - by James Cori
    We have a jquery/php/mysql system that allows a user to log in and review videos built by a system for online viewing. When a user begins reviewing a video, the video is marked as such. But now we've cornered ourselves into the classic browser-based application problem of the user navigating away or closing the browser without completing review. That video would then enter a state of limbo of constantly being reviewed, but never completed, and never re-entering the queue. Options we have are: Build a service (which we already have others) to find review sessions that are outside a duration boundary and reset them back into the queue. Reset review sessions outside a duration boundary when that user logs in. Essentially, if a user locks out a video for review, it'll be unlocked the next time they log in. A suggestion made to me was to use the php/apache session length and on expiration, reset any pending review jobs. I don't even know where to look to implement this as this is one project on a shared server, so it shouldn't be an apache config, but the reset mechanism would need to know the database credentials to be able to reset it... The worst solution everyone hates is preventing the user from navigating away with javascript, asking "Are you sure?!" This system is used by a few hired reviewers, so I'm not exactly dealing with the public here, but I can't prevent users from sharing logins for speedier review, which would knock out the 2nd option above because it would unlock a video being reviewed by someone else using the same login.

    Read the article

  • How do I remove an array dimension where the elements sum to zero?

    - by James
    I am assigning a 3D array, which contains some information for a number of different loadcases. Each row in the array defines a particular loadcase (of which there are 3) and I would like to remove the loadcase (i.e. the row) if ALL the elements of the row (in 3D) are equal to zero. The code I have at the moment is: Array = zeros(3,5) %# Initialise array Numloadcases = 3; Array(:,:,1) = [10 10 10 10 10; 0 0 0 0 0; 0 0 0 0 0;]; %# Expand to a 3D array Array(:,:,2) = [10 10 10 10 10; 0 0 0 0 0; 0 0 0 0 0;]; Array(:,:,3) = [10 10 10 10 10; 0 0 0 0 0; 0 0 20 0 0;]; Array(:,:,4) = [10 10 10 10 10; 0 0 0 0 0; 0 0 20 0 0;]; %# And to remove the second row: for i = 1:Numloadcases if sum(Array(i,:,:)) == 0 Array(i,:,:) = []; end end At the moment, the for loop I have to remove the rows causes an indexing error, as the size of the array changes in the loop. Can anyone see a work around for this?

    Read the article

  • How to correctly cache images

    - by James Simpson
    I just installed Google's Page Speed plugin to Firebug, and everything looks good except for caching. I have set headers to cache my JS and CSS files, but it says the images aren't being cached. How can I make sure the images get cached for 30 days? These are static images, so I can't just add the headers with PHP like I did with the other files.

    Read the article

  • Injecting all registered instances of a type

    - by James L
    I can successfully perform container.ResolveAll<IMyInterface>(), and I get back an Enumerable containing every registered IMyInterface. However, I can't find a way to have these injected into the constructor of my class. I have tried using ResolvedArrayParameter(), but this gives me an empty enumerator. Am I doing something wrong, or could this be a bug in Unity?

    Read the article

  • Python, Unicode, and the Windows console

    - by James Sulak
    When I try to print a Unicode string in a windows console, I get a "UnicodeEncodeError: 'charmap' codec can't encode character ...." error. I assume this is because the Windows console does not accept Unicode-only characters. What's the best way around this? Is there any way I can make Python automatically print a "?" instead of failing in this situation? Edit: I'm using Python 2.5.

    Read the article

  • How do I output an ISO-8601 formatted string in Javascript?

    - by James A. Rosen
    I have a date object from which I'd like to render an HTML snippet like <abbr title="2010-04-02T14:12:07">A couple days ago</abbr>. I have the "relative time in words" portion from another library. How do I render the title portion? I've tried the following: isoDate: function(msSinceEpoch) { var d = new Date(msSinceEpoch); return d.getUTCFullYear() + '-' + (d.getUTCMonth() + 1) + '-' + d.getUTCDate() + 'T' d.getUTCHours() + ':' + d.getUTCMinutes() + ':' + d.getUTCSeconds(); } But that gives me "2010-4-2T"

    Read the article

  • Container fix width. Center div dynamic width. want left right divs to fill out remaining width equally

    - by james
    Have Three columns..Combine width of all three is fixed.. 2nd ( center ) column will have dynamic content.. I need left and right column to fill out remaining space ( container width - center column dynamic width )equally. Example: http://jsfiddle.net/htKje/ <div class="container"> <div class="bg"></div> <div>Lorem Ipsum</div> <div class="bg"></div> </div> CSS : .container { width:500px; } .bg {backgrould:#CCC; }

    Read the article

  • C# class design - expose variables for reading but not setting

    - by James Brauman
    I have a a polygon class which stores a list of Microsoft.Xna.Framework.Vector2 as the vertices of the polygon. Once the polygon is created, I'd like other classes to be able to read the position of the vertices, but not change them. I am currently exposing the vertices through this field: /// <summary> /// Gets the vertices stored for this polygon. /// </summary> public List<Vector2> Vertices { get { return _vertices; } } List<Vector2> _vertices; However you can change any vertex using code like: Polygon1.Vertices[0] = new Vector2(0, 0); or Polygon1.Vertices[0].X = 0; How can I limit other classes to be able to only read the properties of these vertices, and not be able to set a new one to my List? The only thing I can think of is to pass a copy to classes that request it. Note that Vector2 is a struct that is part of the XNA framework and I cannot change it. Thanks.

    Read the article

  • Construct a LPCWSTR on WinCE in C++ (Zune/ZDK)

    - by James Cadd
    What's a good way to construct an LPCWSTR on WinCE 6? I'd like to find something similar to String.Format() in C#. My attempt is: OSVERSIONINFO vi; memset (&vi, 0, sizeof vi); vi.dwOSVersionInfoSize = sizeof vi; GetVersionEx (&vi); char buffer[50]; int n = sprintf(buffer, "The OS version is: %d.%d", vi.dwMajorVersion, vi.dwMinorVersion); ZDKSystem_ShowMessageBox(buffer, MESSAGEBOX_TYPE_OK); That ZDKSystem_ShowMessageBox refers to the ZDK for hacked Zunes available at: http://zunedevwiki.org This line of code works well with the message box call: ZDKSystem_ShowMessageBox(L"Hello Zune", MESSAGEBOX_TYPE_OK); My basic goal is to look at the exact version of WinCE running on a Zune HD to see which features are available (i.e. is it R2 or earlier?). Also I haven't seen any tags for the ZDK so please edit if something is more fitting!

    Read the article

  • Posting an image and textual based data to a wcf service

    - by James Hay
    I have a requirement to write a web service that allows me to post an image to a server along with some additional information about that image. I'm completely new to developing web services (normally client side dev) so I'm a little stumped as to what I need to look into and try. How do you post binary data and plain text into a servic? What RequestFormat should I use? It looks like my options are xml or json. Can I use either of these? Bit of a waffly question but I just need some direction rather than a solution as I can't seem to find much online.

    Read the article

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