Search Results

Search found 1676 results on 68 pages for 'andrew philpott'.

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

  • Using javascript to print images

    - by andrew
    Hi all, I would like to know if it's possible to use javascript to open a popup window containing an image, and at the same time have the print dialog show. Once someone clicks on print, the popup closes. Is this easily attainable?

    Read the article

  • Batch file writing to log then ending process

    - by Andrew Service
    I have a batch file that calls a process and in that process I have: IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL% Now I wanted to upgrade this a bit and give some meaningful message to an output log when if the process fails, also I do not want the main batch to continue processing because the next processes are dependent on data from previous calls; I wonder if this would be correct but not sure: CALL Process 1 IF %ERRORLEVEL% NEQ 0 GOTO ErrorInfirstProcess /B %ERRORLEVEL% :ErrorInfirstProcess ECHO Process 1 Failed on %Date% at %Time%. >>C:\Log.txt" CALL Process 2 IF %ERRORLEVEL% NEQ 0 GOTO ErrorInSecondProcess /B %ERRORLEVEL% :ErrorInSecondProcess ECHO Process 2 Failed on %Date% at %Time%. >>C:\Log.txt" I also want to know if I still need the /B or do I need to put an EXIT command after the echo? Thanks A

    Read the article

  • Setting many key/value pairs

    - by Andrew
    Hi, I'm working on a rake task which imports from a JSON feed into an ActiveRecord called Person. Person has quite a few attributes and rather than write lines of code for setting each attribute I'm trying different methods. The closest I've got is shown below. This works nicely as far as outputing to screen but when I check the values have actually been set on the ActiveRecord itself it's always nil. So it looks like I can't use .to_sym to solve my problem? Any suggestions? I should also mention that I'm just starting out with Ruby, have been doing quite a bit of Objective-c and now need to embrace the Interwebs :) http = Net::HTTP.new(url.host, url.port) http.read_timeout = 30 json = http.get(url.to_s).body parsed = JSON.parse(json) if parsed.has_key? 'code' updatePerson = Person.find_or_initialize_by_code(parsed['code']) puts updatePerson.code parsed.each do |key, value| puts "#{key} is #{value}" symkey = key.to_sym updatePerson[:symkey] = value.to_s updatePerson.save puts "#{key}....." # shows the current key puts updatePerson[:symkey] # shows the correct value puts updatePerson.first_name # a sample key, it's returning nil end

    Read the article

  • getting userbase vote average and individual user's vote in the same query?

    - by Andrew Heath
    Here goes: T1 [id] [desc] 1 lovely 2 ugly 3 slender T2 [id] [userid] [vote] 1 1 3 1 2 5 1 3 2 2 1 1 2 2 4 2 3 4 In one query (if possible) I'd like to return: T1.id, T1.desc, AVG(T2.vote), T2.vote (for user viewing the page) I can get the first 3 items with: SELECT T1.id, T1.desc, AVG(T2.vote) FROM T1 LEFT JOIN T2 ON T1.id=T2.id GROUP BY T1.id and I can get the first, second, and fourth items with: SELECT T1.id, T1.desc, T2.vote FROM T1 LEFT JOIN T2 ON T1.id=T2.id WHERE T2.userid='1' GROUP BY T1.id but I'm at a loss as to how to get all four items in one query. I tried inserting a select as the fourth term: SELECT T1.id, T1.desc, AVG(T2.vote), (SELECT T2.vote FROM T2 WHERE T2.userid='1') AS userVote etc etc but I get an error that the select returns more than one row... Help? My reason for wanting to do this in one query instead of two is that I want to be able to sort the data within MySQL rather than one it's been split into a number of arrays.

    Read the article

  • When can argv[0] have null ?

    - by andrew-dufresne
    What I have understand about passing arguments to main() from command line is that argc has a minimum value of 1 and argv[0] will always have the program name with its path in it. If arguments are provided at the command line, then argc will have a value greater than one and argv1 to argv[argc-1] will have those arguments. Now a paragraph at this link says that argv[0] will be a string containing the program's name or a null string if that is not available. Now, how and when can argv[0] have null string? I mean program name with its path will always be available so when can it be null? Writer says that "if that is not available" but when and how it is possible that program name will not be available? Thanks for your time and support. Regards

    Read the article

  • Really basic Django E-commerce? Where do I start

    - by Andrew
    I'm trying to set up a really basic e-commerce site with Django, and am trying to figure out the best place to start. I am relatively comfortable with the framework itself, but have never done any sort of e-commerce development in any language, so I want to learn about some best practices so I don't make any huge or obvious mistakes. I've looked at Satchmo, and even went as far as installing and playing around with it, but it looks like way more than I want. I basically want to show users a list of things, and let them click a button to buy one. No cart, no shipping, just click a button, connect with Authorize.net (or something similar) to do the transaction, and then display a confirmation page. Any suggestions or online tutorials people have found helpful? Even perhaps a tutorial in another language. Or maybe a really lightweight Django plugin that doesn't try to do everything like Satchmo? I've been coming up with very little so far. Thanks!

    Read the article

  • Help with create action in a different show page

    - by Andrew
    Hi, I'm a Rails newbie and want to do something but keep messing something up. I'd love some help. I have a simple app that has three tables. Users, Robots, and Recipients. Robots belong_to users and Recipients belong_to robots. On the robot show page, I want to be able to create recipients for that robot right within the robot show page. I have the following code in the robot show page which lists current recipients: <table> <% @robot.recipients.each do |recipient| %> <tr> <td><b><%=h recipient.chat_screen_name %></b> via <%=h recipient.protocol_name</td> <td><%= link_to 'Edit', edit_recipient_path(recipient) %>&nbsp;</td> <td><%= link_to 'Delete', recipient, :confirm => 'Are you sure?', :method => :delete %></td> </tr> <% end %> </table> What I'd like to do is have an empty field in which the user can add a new recipient, and have tried the following: I added this to the Robots Show view: <% form_for(@robot.recipient) do |f| %> Enter the screen name<br> <%= f.text_field :chat_screen_name %> <p> <%= f.submit 'Update' %> </p> <% end %> and then this to the Robot controller in the show action: @recipient = Recipient.new @recipients = Recipient.all Alas, I'm still getting a NoMethod error that says: "undefined method `recipient' for #" I'm not sure what I'm missing. Any help would be greatly appreciated. Thank you.

    Read the article

  • Embed Git Commit Log in Rails App?

    - by Andrew
    So, I have a 'development blog' in a rails app I'm working on right now. I'm using Git for version control and deployment (although right now I'm the only person working on it). Now, when I make changes in Git I put a pretty decent log entry about what I've done. I'd love to have the Git commit log automatically posted to the development blog -- or otherwise available for others to read within the deployed site. Is there an automated way to pull the Git Commit Log into a view in a rails app?

    Read the article

  • Windows Forms application C# | Sending Tweet

    - by Andrew Craswell
    I've been able to get my Twitter web app working just fine, but I've recently decided to add Tweeting functionality from a Windows Form, but I'm having no luck sending tweets. No errors are thrown or anything. Mind looking over my code? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using TweetSharp; namespace TwitterAdvirtiser { public partial class Form1 : Form { private string cKey = "xxx"; private string cSecret = "xxx"; private string oToken = "xxx"; private string aToken = "xxx"; public Form1() { InitializeComponent(); OnStart(); } private void OnStart() { //Authenticate with Twitter TwitterService service = new TwitterService(cKey, cSecret); service.AuthenticateWith(oToken, aToken); service.SendTweet("testing"); } } } It seems like I'm authenticating just fine, I can walk through debug mode and see all my details in the TwitterUser structure, and yet my tweets never show up on my feed. Whats up? By the way, I'm using Visual Studios 2010, and .NET 4.0. I have verified that the oToken and aToken strings have my developer tokens.

    Read the article

  • How do you remove functionality from a program in ruby?

    - by Andrew Grimm
    You have some code you want to remove associated with an obsolete piece of functionality from a ruby project. How do ensure that you get rid of all of the code? Some guidelines that usually help in refactoring ruby apply, but there are added challenges because having code that isn't being called by anything won't break any unit tests.

    Read the article

  • Why does Google append while(1); in front of their JSON responses?

    - by Andrew Koester
    This is something I've always been curious about, is exactly why Google appends while(1); in front of their (private) JSON responses. For example, here's a response while turning a calendar on and off in Google Calendar: while(1);[['u',[['smsSentFlag','false'],['hideInvitations','false'],['remindOnRespondedEventsOnly','true'],['hideInvitations_remindOnRespondedEventsOnly','false_true'],['Calendar ID stripped for privacy','false'],['smsVerifiedFlag','true']]]] I would assume this is to prevent people from doing an eval() on it, but all you'd really have to do is replace the while and then you'd be set. I would assume eval prevention is to make sure people write safe JSON parsing code. I've seen this used in a couple other places, too, but a lot more so with Google (Mail, Calendar, Contacts, etc.) Strangely enough, Google Docs starts with &&&START&&& instead, and Google Contacts seems to start with while(1); &&&START&&&. Does anyone know what's going on here?

    Read the article

  • SEO dynamic / AJAX pages

    - by Andrew
    I have a very dynamic / ajax powered website which also includes iframes and due this reason I have a very bad SEO rank and it come in my mind to make one more additional version of the site (text based / no script) and serve it to the search engines based on the user agent . Please let me know if you think that is a feasible method and if it's not what else would you recommend me to do .. I don't want to loose any fancy ajax feature but I also need to keep the website on the google map :) thank you in advance for any answer ! btw the website is developed in asp.net c# .

    Read the article

  • "'Objects' may not respond to 'functions'" warnings.

    - by Andrew
    Hello all, for the last couple of weeks I've finally gotten into Obj-C from regular C and have started my first app. I've watched tutorials and read through a book along with a lot of webpages, but I know I've only just begun. Anyway, for most of the night and this morning, I've been trying to get this code to work, and now that it will compile, I have a few warnings. I've searched and found similar problems with solutions, but still no dice. What I'm trying to do is put an array made from a txt document into the popup list in a combo box. AwesomeBoxList.h: #import <Cocoa/Cocoa.h> @interface AwesomeBoxList : NSObject { IBOutlet NSComboBox *ComboBoz; } -(NSArray *) getStringzFromTxtz; - (void) awesomeBoxList; @end AwesomeBoxList.m: #import "AwesomeBoxList.h" @implementation AwesomeBoxList -(NSArray *)getStringzFromTxtz { ... return combind; } - (void) awesomeBoxList { [ComboBoz setUsesDataSource:YES]; [ComboBoz setDataSource: [ComboBoz getStringzFromTxtz]: //'NSComboBox' may not respond to 'getStringzFromTxtz' [ComboBoz comboBox:(NSComboBox *)ComboBoz objectValueForItemAtIndex: [ComboBoz numberOfItemsInComboBox:(NSComboBox *)ComboBoz]]]; /*'NSComboBox' may not respond to '-numberOfItemsInComboBox:' 'NSComboBox' may not respond to '-comboBox:objectValueForItemAtIndex:' 'NSComboBox' may not respond to '-setDataSource:' */ } @end So, with all of these errors and my still shallow knowledge of Obj-C, I must be making some sort of n00b mistake. Thanks for the help.

    Read the article

  • OpenGL 3.3 different colours with fragment shader [solved]

    - by Andrew Seymour
    I'm an OpenGL newbie. I'm trying to colour 3 circles but only 3 white circles are appearing. n is 3 in this example. Each vertice has 5 points, 2 for position and 3 for color Here is where I think a problem may lie: glEnableVertexAttribArray(0); glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer); glVertexAttribPointer( 0, 2, GL_FLOAT, GL_FALSE, 5*sizeof(float), (void*)0 ); glEnableVertexAttribArray(1); glVertexAttribPointer( 1, 3, GL_FLOAT, GL_FALSE, 5*sizeof(float), (void*)(2*sizeof(float)) ); glDrawElements(GL_TRIANGLES, 20 * 3 * n, GL_UNSIGNED_INT, 0); glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); My shaders: #version 330 core in vec3 Color; out vec4 outColor; void main() { outColor = vec4(Color, 1.0); } #version 330 core layout(location = 0) in vec2 position; layout(location = 1) in vec3 color out vec3 Color void main(){ gl_Position = vec4(position, 0.0, 1.0); Color = color; } Thanks for taking a look Andy EDIT: layout(location = 1) in vec3 color out vec3 Color layout(location = 1) in vec3 color; out vec3 Color;

    Read the article

  • Flash Displaying Weird Text in a Dynamic Text Field

    - by Andrew M
    I am working in Flash CS5 and I have placed a text field (dynamic, classic text) on the stage. I am accessing it through Actionscript on the same frame like this: var ct:TextField = TextField(getChildByName("Temperature")); ct.text = "Hello world"; What ACTUALLY appears is this: eo wor So... The H, Ls, and D are gone. Mysteriously. Without warning. I am sitting here utterly confused. Is this just me? PS. The text field is set to Myriad Pro Bold, a font on my computer, so it isn't like it's a font problem.

    Read the article

  • Best way to remove from NSMutableArray while iterating?

    - by Andrew Grant
    In Cocoa, if I want to loop through an NSMutableArray and remove multiple objects that fit a certain criteria, what's the best way to do this without restarting the loop each time I remove an object? Thanks, Edit: Just to clarify - I was looking for the best way, e.g. something more elegant than manually updating the index I'm at. For example in C++ I can do; iterator it = someList.begin(); while (it != someList.end()) { if (shouldRemove(it)) it = someList.erase(it); }

    Read the article

  • 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

  • Why is an anonymous inner class containing nothing generated from this code?

    - by Andrew Westberg
    When run through javac on the cmd line Sun JVM 1.6.0_20, this code produces 6 .class files OuterClass.class OuterClass$1.class OuterClass$InnerClass.class OuterClass$InnerClass2.class OuterClass$InnerClass$InnerInnerClass.class OuterClass$PrivateInnerClass.class When run through JDT in eclipse, it produces only 5 classes. OuterClass.class OuterClass$1.class OuterClass$InnerClass.class OuterClass$InnerClass2.class OuterClass$InnerClass$InnerInnerClass.class OuterClass$PrivateInnerClass.class When decompiled, OuterClass$1.class contains nothing. Where is this extra class coming from and why is it created? package com.test; public class OuterClass { public class InnerClass { public class InnerInnerClass { } } public class InnerClass2 { } //this class should not exist in OuterClass after dummifying private class PrivateInnerClass { private String getString() { return "hello PrivateInnerClass"; } } public String getStringFromPrivateInner() { return new PrivateInnerClass().getString(); } }

    Read the article

  • How do I programmatically run all the JUnit tests in my Java application?

    - by Andrew McKinlay
    From Eclipse I can easily run all the JUnit tests in my application. I would like to be able to run the tests on target systems from the application jar, without Eclipse (or Ant or Maven or any other development tool). I can see how to run a specific test or suite from the command line. I could manually create a suite listing all the tests in my application, but that seems error prone - I'm sure at some point I'll create a test and forget to add it to the suite. The Eclipse JUnit plugin has a wizard to create a test suite, but for some reason it doesn't "see" my test classes. It may be looking for JUnit 3 tests, not JUnit 4 annotated tests. I could write a tool that would automatically create the suite by scanning the source files. Or I could write code so the application would scan it's own jar file for tests (either by naming convention or by looking for the @Test annotation). It seems like there should be an easier way. What am I missing?

    Read the article

  • asp.net forms authentification security issues

    - by Andrew Florko
    Hi there, I have a kind of asp.net forms authentication with the code like that: FormsAuthentication.SetAuthCookie(account.Id.ToString(), true); HttpContext.Current.User = new GenericPrincipal(new GenericIdentity(account.Id.ToString()), null); What kind of additional efforts shall I take to make authentication cookie (that is user id) more securable? (https, encoding for example) Thank you in advance!

    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

  • 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

  • World Economic Crisis. IT prospects

    - by Andrew Florko
    There was alike question in 2008, 2 years passed. Please, share your expectations about IT market and employment in the next year or two (or so far you can predict). IMHO Russia (my native country) fully met Crisis in spring, 2008. Stock markets shrank 3(!) times during half a year. Many developers were fired those days but I suppose just because business was shocked and freezed some projects. Developers expected +20% salary growth per year in 2004-2007 (Developer salary in Moscow was about 2-3K$ in early 2008). Then there was 30% (very subjective) salary cut-off in 2008 and salaries were frozen till 2009. Now things are slowly coming back to 2008. Looking in the future I expect pessimistic scenario and another crash. Our economic depends more and more on oil & gas every year. IT that serves industry will be shrinked because we can't compete to China in real production. Due to high currency board (rubble is strong compared to dollar) we can't rely on offshore programming. Our officials are concerned on innovative economic breakthrough but it's an ordinary budget money assignemtn in practice. I don't believe in innovations either because who require innovations if you have debts and tomorrow is vapor?

    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

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