Search Results

Search found 1688 results on 68 pages for 'andrew patterson'.

Page 52/68 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • How to Inserting message into View that depends on session value. ASP.NET MVC. Best practice

    - by Andrew Florko
    User have to populate multistep questionnaire web-forms and step messages depend on the option chosen by user at the very beginning. Messages are stored in web.config file. I use asp.net mvc project, strong typed views and keep business logic separated from controller in static class. I don't want to make business logic dependency on web.config. Well, I have to insert message into view that depends on session value. There are at least 2 options how to implement this: View model has property that is populated in controller/businessLogic and rendered in view like <%: Model.HelpMessage1 %>. I have to pass web.config values from controller to businessLogic that makes business logic methods signature too complex. I don't want to make configuration source abstract (in order to let business logic read configuration values from its methods directly) also. Create static helper class that is called from view like <%: ViewHelper.HelpMessage1(Model.Option1) %>. But in this case logic what to show seems to be separated into two classes: business logic & viewHelper. What will you suggest? Thank you in advance!

    Read the article

  • How do you populate a NSArrayController with CoreData rows programmatically?

    - by Andrew McCloud
    After several hours/days of searching and diving into example projects i've concluded that I need to just ask. If I bind the assetsView (IKImageBrowserView) directly to an IB instance of NSArrayController everything works just fine. - (void) awakeFromNib { library = [[NSArrayController alloc] init]; [library setManagedObjectContext:[[NSApp delegate] managedObjectContext]]; [library setEntityName:@"Asset"]; NSLog(@"%@", [library arrangedObjects]); NSLog(@"%@", [library content]); [assetsView setDataSource:library]; [assetsView reloadData]; } Both NSLogs are empty. I know i'm missing something... I just don't know what. The goal is to eventually allow multiple instances of this view's "library" filtered programmatically with a predicate. For now i'm just trying to have it display all of the rows for the "Asset" entity. Addition: If I create the NSArrayController in IB and then try to log [library arrangedObjects] or manually set the data source for assetsView I get the same empty results. Like I said earlier, if I bind library.arrangedObjects to assetsView.content (IKImageBrowserView) in IB - with same managed object context and same entity name set by IB - everything works as expected. - (void) awakeFromNib { // library = [[NSArrayController alloc] init]; // [library setManagedObjectContext:[[NSApp delegate] managedObjectContext]]; // [library setEntityName:@"Asset"]; NSLog(@"%@", [library arrangedObjects]); NSLog(@"%@", [library content]); [assetsView setDataSource:library]; [assetsView reloadData]; }

    Read the article

  • Firebug shows error "_11 is undefined"

    - by Andrew
    Actually that's it. What does this error mean? I've googled on it, but found nothing. This error appears in firebug console after the page is loaded, or when i click on tabs. It does not prevent the execution of another JavaScript code, but the nature of it is mysterious for me.

    Read the article

  • Do I have to call release on an objective-c retain class variable when setting it to a new object?

    - by Andrew Arrow
    Say I have: @property (nonatomic,retain) NSString *foo; in some class. And I call: myclass.foo = [NSString stringWithString:@"string1"]; myclass.foo = [NSString stringWithString:@"string2"]; Should I have called [myclass.foo release] before setting it to "string2" to avoid a memory leak? Or the fact that nothing is pointing to the first "string1" object anymore is good enough? And in the dealloc method [foo release] will be called.

    Read the article

  • How can I dynamically load and execute all of the Javascript files in a directory?

    - by Andrew
    I'm making a very simple content-management system in Javascript. It uses plugins which are individual .js files which live in a "modules" folder. Currently I'm loading them with JQuery's getScript() function, but I have to manually define the list of available modules. Is there any way to dynamically load the list of Javascript files so that the user can install additional modules by simply dropping them into the "modules" folder?

    Read the article

  • Does SQL Server have any kind of magic undo feature?

    - by Andrew G. Johnson
    Long story short is I tried to quickly update a single row in SQL Server using the Management studio and just typed UPDATE table SET column='value' and forgot the WHERE other_column='other_value' portion. Went for lunch, came back and theres 15 unread emails waiting for me. Happened about an hour ago, waiting for the database guy to come back to see when the last backup was. There's no magic UNDO feature though is there?

    Read the article

  • MYSQL Inserting rows that reference main rows.

    - by Andrew M
    I'm transferring my access logs into a database. I've got two tables: urlRequests id : int(10) host : varchar(100) path: varchar(300) unique index (host, path) urlAccesses id : int(10) request : int(10) <-- reference to urlRequests row ip : int(4) query : varchar(300) time : timestamp I need to insert a row into urlAccesses for every page load, but first a row in urlRequests has to exist with the requested host and path so that urlAccesses's row can reference it. I know I can do it this way: A. check if a row exists in urlRequests B. insert a row in urlRequests if it needs it C. insert a row into urlAccesses with the urlRequests's row id referenced That's three queries for every page load if the urlRequests row doesn't exist. I'm very new to MySQL, so I'm guessing that there's a way to go about this that would be faster and use less queries.

    Read the article

  • Organizing PHP includes in your development environment

    - by Andrew Heath
    I'm auditing my site design based on the excellent Essential PHP Security by Chris Shiflett. One of the recommendations I'd like to adopt is moving all possible files out of webroot, this includes includes. Doing so on my shared host is simple enough, but I'm wondering how people handle this on their development testbeds? Currently I've got an XAMPP installation configured so that localhost/mysite/ matches up with D:\mysite\ in which includes are stored at D:\mysite\includes\ In order to keep include paths accurate, I'm guess I need to replicate the server's path on my local disk? Something like D:\mysite\public_html\ Is there a better way?

    Read the article

  • Breakpoint pointing out "objc_autoreleaseNoPool"

    - by Andrew
    So I'm debugging an app in preperation for its app so release, and I enabled a universal breakpoint for "All Exceptions". Since then, everytime I run the app, the console prints: Catchpoint 2 (throw)Pending breakpoint 1 - "objc_exception_throw" resolved objc[11765]: Object 0x8f18ff0 of class __NSCFLocale autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug objc[11765]: Object 0x8f190a0 of class __NSCFNumber autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug objc[11765]: Object 0x8f1fef0 of class __NSCFLocale autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug Literally printed 3 times. I have no idea what this means but it looks bad. Any advice would be appreciated.

    Read the article

  • Finding an asp:button and asp:textbox in Javascript

    - by Andrew
    What I'm trying to do is get an asp:button to click. The only problem is that it is within a few tags. Example: <loginview> <asp:login1> <logintemplate> //asp:textbox and asp:button are located here. </loginview> </asp:login> </logintemplate> So how would I get javascript to point to that location so that I can manipulate it. For example, get the button to click.

    Read the article

  • Can Grails exceptionHandler support the following Error Handling Flow

    - by Andrew
    In my rails app that I am porting to grails whenever an unexpected error occurs I intercept the error automatically and display a form to the user informing them that an error has occured and asking them for further information. Meanwhile, as the form is rendered I write the stack trace and other information about who was logged in to a database table. Then if the form is submitted I add that information to the error report. I cannot tell from the exceptionHandler documentation and BootStrap examples whether that will allow me to grab all the information including various session and request parameters and then stuff them into a database and then post a form. Any thoughts?

    Read the article

  • Extend legacy site with another server-side programming platform best practice

    - by Andrew Florko
    Company I work for have a site developed 6-8 years ago by a team that was enthusiastic enough to use their own private PHP-based CMS. I have to put dynamic data from one intranet company database on this site in one week: 2-3 pages. I contacted company site administrator and she showed me administrative part - CMS allows only to insert html blocks & manage site map (site is deployed on machine that is inside company & fully accessible & upgradeable). I'm not a PHP-guy & I don't want to dive into legacy hardly-who-ever-heard-about CMS engine I also don't want to contact developers team, 'cos I'm not sure they are still present and capable enough to extend this old days site and it'll take too much time anyway. I am about to deploy helper asp.net site on IIS with 2-3 pages required & refer helper site via iframe from present site. New pages will allow to download some dynamic content from present site also. Is it ok and what are the pitfalls with iframe approach?

    Read the article

  • Common Utility for Exception Searching

    - by Andrew
    I wrote this little helper method to search the exception chain for a particular exception (either equals or super class). However, this seems like a solution to a common problem, so was thinking it must already exist somewhere, possibly in a library I have already imported. So, any ideas on if/where this might exist? boolean exceptionSearch(Exception base, Class<?> search) { Throwable e = base; do { if (search.isAssignableFrom(e.getClass())) { return true; } } while ((e = e.getCause()) != null); return false; }

    Read the article

  • JQuery Load() syntax - Changing data source on mouseenter

    - by Andrew Parisi
    Hey everyone. I've written this simple function that is supposed to load a portion of an XML file on mouseenter. It works fine when I specify the data source explicitly, shown below. I have a number of '.invest-port-thumb' divs, each with a unique link. The following code works fine—but it loads the whole XML file—and I only want a portion: $(document).ready(function() { $('.invest-port-thumb a').mouseenter(function() { $('#slider-name').load(this.href); }); }); This code also works fine—loading only the 'cName' portion that I want it to load...Except that this code refers to one of the files, instead of the value of this.href. $(document).ready(function() { $('.invest-port-thumb a').mouseenter(function() { $('#slider-name').load('port/atd.xml cName'); }); }); I guess what I'm saying, syntax wise—How can I combine this.href and the data matching cName? Thanks for the help!

    Read the article

  • Is it okay for multiple objects to retain the same object in Objective-C/Cocoa?

    - by Andrew Arrow
    Say I have a tableview class that lists 100 Foo objects. It has: @property (nonatomic, retain) NSMutableArray* fooList; and I fill it up with Foos like: self.fooList = [NSMutableArray array]; while (something) { Foo* foo = [[Foo alloc] init]; [fooList addObject:foo]; [foo release]; } First question: because the NSMutableArray is marked as retain, that means all the objects inside it are retained too? Am I correctly adding the foo and releasing the local copy after it's been added to the array? Or am I missing a retain call? Then if the user selects one specific row in the table and I want to display a detail Foo view I call: FooView* localView = [[FooView alloc] initWithFoo:[self.fooList objectAtIndex:indexPath.row]]; [self.navigationController pushViewController:localView animated:YES]; [localView release]; Now the FooView class has: @property (nonatomic, retain) Foo* theFoo; so now BOTH the array is holding on to that Foo as well as the FooView. But that seems okay right? When the user hits the back button dealloc will be called on FooView and [theFoo release] will be called. Then another back button is hit and dealloc is called on the tableview class and [fooList release] is called. You might argue that the FooView class should have: @property (nonatomic, assign) Foo* theFoo; vs. retain. But sometimes the FooView class is called with a Foo that's not also in an array. So I wanted to make sure it was okay to have two objects holding on to the same other object.

    Read the article

  • Why is my web page left-aligned on iPad?

    - by Andrew
    I recently built a site and centered it using margin: 0 auto. I also wrapped elements in a .wrapper class with a width set to 960px and then had the parent element extend across the whole browser. When I view the Brands screen on an iPad though, the site is left-aligned and does not extend across the whole window. Any thoughts to why this might be happening, and how to correct it? See below for a screenshot:

    Read the article

  • Changing printer preferences in Windows programmatically

    - by Andrew Alexander
    I've written a script that installs several printers for a new user. I want to change the settings on some of these so that they can print on both sides of the page. I BELIEVE this involves modifying an attribute with printui, however it might need VB script or possibly another .NET language (I'd either use VB, C# or IronPython). I can add a comment to a given printer, but how do I select preferences and modify them? Pseudocode would look like this: printui.exe /n printername /??? [how to change quality desired] OR calls to the relevant Windows API.

    Read the article

  • How can I unshorten a URL using python?

    - by Andrew
    I want to be able to take a shortened or non-shortened URL and return its un-shortened form. How can I make a python program to do this? Additional Clarification: Case 1: shortened -- unshortened Case 2: unshortened -- unshortened e.g. bit.ly/silly in the input array should be google.com in the output array e.g. google.com in the input array should be google.com in the output array Thanks for the help!

    Read the article

  • Python - removing double quotation marks " so that script runs

    - by andrew k
    I am using Python scripts to edit the table of many shape files. The following script runs fine, but if there are any " marks in the SIT_FULL_S field, the script errors and shuts down. gp.CalculateField_management(fc + "\\Parcels.shp","SIT_FULL_S", "!SIT_FULL_S!.lstrip('0')", "PYTHON") arcgisscripting.ExecuteError: ERROR 000539: Error running expression: "9030 W SR 2 HWY "A"".lstrip('0') <type 'exceptions.SyntaxError'>: invalid syntax (<string>, line 1) Failed to execute (CalculateField). I have two options, create a new script that runs through and deletes all occurances of ", and then run the above script or modify the above script to ignore the " and contiue running. Can anyone help ?

    Read the article

  • App Engine: how would you... snapshotting entities

    - by Andrew B.
    Let's say you have two kinds, Message and Contact, related by a db.ListProperty of keys on Message. A user creates a message, adds some contacts as recipients, and emails the message. Later, the user deletes one of the contact entities that was a recipient of the message. Our application should delete the appropriate Contact entity, but we want to preserve the original recipient list for the message that was sent for the user's records. In essence, we want a snapshot of the message entity at the time it was sent. If we naively delete the contact entity, though, we lose snapshot integrity; if not, we are left with an invalid key. How would you handle this situation, either in controller logic or model changes? class User(db.Model): email = db.EmailProperty(required=True) class Contact(db.Model): email = db.EmailProperty(required=True) user = db.ReferenceProperty(User, collection_name='contacts') class Message(db.Model): recipients = db.ListProperty(db.Key) # contacts sender = db.ReferenceProperty(User, collection_name='messages') body = db.TextProperty() is_emailed = db.BooleanProperty(default=False)

    Read the article

  • JTable cells not rendering shapes properly

    - by Andrew
    I'm trying to render my JTable cells with a subclassed JPanel and the cells should appear as coloured rectangles with a circle drawn on them. When the table displays initially everything looks OK but then when a dialog or something is displayed over the cells when it is removed the cells that have been covered do not rendered properly and the circles are broken up etc. I then have to move the scroll bar or extend the window to get them to redraw properly. The paintComponent method of the component I'm using to render the cells is below: protected void paintComponent(Graphics g) { setOpaque(true); super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; GradientPaint gradientPaint = new GradientPaint(new Point2D.Double(0, 0), Color.WHITE, new Point2D.Double(0, getHeight()), paintRatingColour); g2d.setPaint(gradientPaint); g2d.fillRect(0, 0, getWidth(), getHeight()); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); Rectangle clipBounds = g2d.getClipBounds(); int x = new Double(clipBounds.getWidth()).intValue() - 15; int y = (new Double(clipBounds.getHeight()).intValue() / 2) - 6; if (level != null) { g2d.setColor(iconColour); g2d.drawOval(x, y, width, height); g2d.fillOval(x, y, width, height); } }

    Read the article

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