Search Results

Search found 276 results on 12 pages for 'stewart robinson'.

Page 7/12 | < Previous Page | 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Python: re-initialize a function's default value for subsequent calls to the function.

    - by Peter Stewart
    I have a function that calls itself to increment and decrement a stack. I need to call it a number of times, and I'd like it to work the same way in subsequent calls but, as expected, it doesn't re-use the default value. I've read that this is a newbie trap and I've seen suggested solutions, but I haven't been able to make any solution work. It would be nice to be able to "fun.reset" def a(x, stack = [None]): print x,' ', stack if x > 5: temp = stack.pop() if x <=5: stack.append(1) if stack == []: return a(x + 1) print a(0) print a(2) #second call print a(3) #third call I expected this to work, but it doesn't. print a(0, [None]) print a(2, [None]) #second call print a(3, [None]) #third call Can I reset the function to it's initial state? Any help would be appreciated.

    Read the article

  • Need to close a popup after javascript completes image upload then load new page

    - by Michael Robinson
    I got a problem. I have a image upload script that runs on a popup up when you select "upload button", after it is complete instead of closing it stays in the uploader.html window. I need it to close and go to a new page. Here is some of the xml that the script uses, can I change the "urlOnUploadSucess" line to close the popup and load a new page on the original page I came from? .....<upload preload="Preloading images:" upload="Uploading images to server:" prepare="Processing and image compression:" of="of" cancel="Cancel" start="Start" warning_empty_required_field="Warning! One of the required fields is empty!" confirm="Will be uploaded:"/> <urls urlToUpload="upload.php?" urlOnUploadSuccess="http://www.baublet.com/purchase.html" urlOnUploadFail="http://www.baublet.com/tryagain.html" urlUpdateFlashPlayer="http://www.baublet.com/flashalternative.html" useMessageBoxesAfterUpload="false" messageOnUploadSuccess="Images were successfully uploaded!" messageOnUploadFail="Error! Images failed to upload!" jsFunctionNameOnUpload=""/> ..... Thanks, Michael

    Read the article

  • Too many connections RealityRP Emulator

    - by Chase Robinson
    I've been having a problem with the stability of my role play emulator, every now and then, after awhile of using a command such as :shoot x , it will disconnect due to too many connections, or it will disconnect when people are messaging etc.. I've debugged it, and ran while playing it, it disconnected with the Too Many Connections error, Connection.Open(); Is the code that is causing the issue, how do i fix this?

    Read the article

  • Codeigniter Form validation problem

    - by ben robinson
    Please please please can someone help me $this-load-library('form_validation'); $this-load-helper('cookie'); $data = array(); if($_POST) { // Set validation rules including additional validation for uniqueness $this-form_validation-set_rules('yourname', 'Your Name', 'trim|required'); $this-form_validation-set_rules('youremail', 'Your Email', 'trim|required|valid_email'); $this-form_validation-set_rules('friendname', 'Friends Name', 'trim|required'); $this-form_validation-set_rules('friendemail', 'Friends Email', 'trim|required|valid_email'); // Run the validation and take action if($this-form_validation-run()) { echo 'valid; } } else{ echo 'problem'; } Form validation is coming back with no errors can cany one see why?

    Read the article

  • How is includegraphic interfering with tabular?

    - by Charles Stewart
    I'm editing a text provided by my client as a LyX file that includes graphics and other files that I don't have. I've "commented out" the graphics by putting in a custom preamble that substitutes the file-loading definitions with macros that just quote their arguments. However, the \includegraphic macro throws up an error in the two tabular environments where it is used, complaining that \endfirsthead was never defined. What is this macro, and why is it interfering with mine? The preamble: \usepackage{natbib} \def\fileloc{/some/path/stylefile} \newif\iftextproof \IfFileExists\alifefileloc\textproofalse\textprooftrue \iftextproof \usepackage{./stylefile} %natbib subst: \renewcommand\cite[1]{{\tt #1}} %suppress graphics includes: \def\quotearg#1{\expandafter\string\csname #1\endcsname} \newcommand\gobbleIG[2][*void*]{{\footnotesize \quotearg{#2}}} \newcommand\gobbleSF[2][*unnamed*]{{\bf #1}} \let\includegraphics=\gobbleIG \let\subfigure=\gobbleSF \else \usepackage\fileloc \fi

    Read the article

  • Building a complete online payment gateway like Paypal

    - by John Stewart
    So this question isn't about integrating an existing payment gateway into my site. This is more of a architectural question. I want to build a system similar to Paypal. Now I understand that Paypal offers a lot of features under the roof and I can't implement all of them at once. I want to implement the core functionality of Paypal and other such services. So my question is (rather discussion is) around how would one go about building such a system. Some points to discuss: Handle payments through existing banks. I am guessing that I would need access to local bank protocols to get this. Allow users to securely store and process their payments How does Paypal handle the transactions? Thoughts?

    Read the article

  • EXC_BAD_ACCESS when scrolling table after json data is imported

    - by Michael Robinson
    Hello, I'm having a bear of a time trying to figure out why I'm getting a EXC_BAD ACCESS error. The console is giving me this eror: " -[CFArray objectAtIndex:]: message sent to deallocated instance 0x3b14110", I Can't figure it out...Thanks in advance. // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [rows count]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell. NSDictionary *dict = [rows objectAtIndex: indexPath.row]; cell.textLabel.text = [dict objectForKey:@"name"]; cell.detailTextLabel.text = [dict objectForKey:@"age"]; return cell; } // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.0/255.0 green:207.0/255.0 blue:255.0/255.0 alpha:1.0]; self.title = NSLocalizedString(@"How Big Now", @"How Big Now"); NSURL *url = [NSURL URLWithString:@"http://10.0.1.8/~imac/iphone/jsontest.php"]; NSString *jsonreturn = [[NSString alloc] initWithContentsOfURL:url]; // NSLog(jsonreturn); // Look at the console and you can see what the restults are NSData *jsonData = [jsonreturn dataUsingEncoding:NSUTF32BigEndianStringEncoding]; NSError *error = nil; // In "real" code you should surround this with try and catch NSDictionary * dict = [[CJSONDeserializer deserializer] deserializeAsDictionary:jsonData error:&error]; if (dict) { rows = [dict objectForKey:@"member"]; } NSLog(@"Array: %@",rows); [jsonreturn release]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } @end

    Read the article

  • What is the optimum way to secure a company wide wiki?

    - by Mark Robinson
    We have a wiki which is used by over half our company. Generally it has been very positively received. However, there is a concern over security - not letting confidential information fall into the wrong hands (i.e. competitors). The default answer is to create a complicated security matrix defining who can read what document (wiki page) based on who created it. Personally I think this mainly solves the wrong problem because it creates barriers within the company instead of a barrier to the external world. But some are concerned that people at a customer site might share information with a customer which then goes to the competitor. The administration of such a matrix is a nightmare because (1) the matrix is based on department and not projects (this is a matrix organisation), and (2) because in a wiki all pages are by definition dynamic so what is confidential today might not be confidential tomorrow (but the history is always readable!). Apart from the security matrix, we've considered restricting content on the wiki to non super secret stuff, but off course that needs to be monitored. Another solution (the current) is to monitor views and report anything suspicious (e.g. one person at a customer site having 2000 views in two days was reported). Again - this is not ideal because this does not directly imply a wrong motive. Does anyone have a better solution? How can a company wide wiki be made secure and yet keep its low threshold USP? BTW we use MediaWiki with Lockdown to exclude some administrative staff.

    Read the article

  • Does Flickr "Know" if a Hotlinked Image Does Not Link Back to Source?

    - by Michael Robinson
    From Flickr's community guidelines: "Do link back to Flickr when you post your photos elsewhere. The Flickr service makes it possible to post images hosted on Flickr to outside web sites. However, pages on other web sites that display images hosted on flickr.com must provide a link from each photo back to its photo page on Flickr." Our company currently allows image hotlinking for user-uploaded images. It turns out that this has been more popular than we had expected, and I would like to capitalize on this if possible. We will be altering the guidelines to include a clause similar to Flickr's, quoted above. As hotlinking costs us, both in terms of server load and bandwidth, we would like to get at least something out of it, other than merely a warm feeling inside. My question: Does Flickr "know" if a hotlinked image does not link back to its source? Bonus: if Flickr knows, how?

    Read the article

  • How to access SharePoint web part properties?

    - by shannon.stewart
    I have created a feature for SharePoint 2007 that has a web part. I have added a custom property to the web part like so: [Personalizable(PersonalizationScope.Shared)] [WebBrowsable(true)] [Category("My Custom Properties")] [WebDisplayName("ServiceURL")] [WebDescription("The URL for the Wcf service")] public string ServiceURL { get; set; } Along with this web part, I've added a custom page that the web part will have a link to. I would like to reference the web part property from the custom page, but I don't know where these properties are stored. I've tried to access it using the code below, but both property collections don't have any properties stored. SPFeaturePropertyCollection spProperties = SPContext.Current.Site.Features[this.FeatureGuid].Properties; or SPFeaturePropertyCollection spProperties = SPContext.Current.Site.Features[this.FeatureGuid].Definition.Properties; My question is how can I get a reference to the web part property from other pages?

    Read the article

  • Enhanced Podcasts and MPMoviePlayerViewController

    - by Ben Robinson
    Hi, This is a bit of an odd/specific one - possibly a bug? I'm using MPMoviePlayerViewController to play a variety of files, including Enhanced Podcasts - these are audio files, but with a slideshow of images, often created using GarageBand. Until (i think) iOS 3.2 they weren't supported at all, now they are and play fine in the iPod app, but in my app the slideshow doesn't start, the full screen movie player opens, and the audio begins, but all I see is the QuickTime logo. If I scrub the track the pictures appear - and will continue to play correctly - but I see nothing if I don't scrub! Any ideas?? On a related note, these files also include a small rectangluar button containing an (i) button on the right hand side - anybody know what it is or should do?! It does nothing for me!

    Read the article

  • Recommendations for a C++ polymorphic, seekable, binary I/O interface

    - by Trevor Robinson
    I've been using std::istream and ostream as a polymorphic interface for random-access binary I/O in C++, but it seems suboptimal in numerous ways: 64-bit seeks are non-portable and error-prone due to streampos/streamoff limitations; currently using boost/iostreams/positioning.hpp as a workaround, but it requires vigilance Missing operations such as truncating or extending a file (ala POSIX ftruncate) Inconsistency between concrete implementations; e.g. stringstream has independent get/put positions whereas filestream does not Inconsistency between platform implementations; e.g. behavior of seeking pass the end of a file or usage of failbit/badbit on errors Don't need all the formatting facilities of stream or possibly even the buffering of streambuf streambuf error reporting (i.e. exceptions vs. returning an error indicator) is supposedly implementation-dependent in practice I like the simplified interface provided by the Boost.Iostreams Device concept, but it's provided as function templates rather than a polymorphic class. (There is a device class, but it's not polymorphic and is just an implementation helper class not necessarily used by the supplied device implementations.) I'm primarily using large disk files, but I really want polymorphism so I can easily substitute alternate implementations (e.g. use stringstream instead of fstream for unit tests) without all the complexity and compile-time coupling of deep template instantiation. Does anyone have any recommendations of a standard approach to this? It seems like a common situation, so I don't want to invent my own interfaces unnecessarily. As an example, something like java.nio.FileChannel seems ideal. My best solution so far is to put a thin polymorphic layer on top of Boost.Iostreams devices. For example: class my_istream { public: virtual std::streampos seek(stream_offset off, std::ios_base::seekdir way) = 0; virtual std::streamsize read(char* s, std::streamsize n) = 0; virtual void close() = 0; }; template <class T> class boost_istream : public my_istream { public: boost_istream(const T& device) : m_device(device) { } virtual std::streampos seek(stream_offset off, std::ios_base::seekdir way) { return boost::iostreams::seek(m_device, off, way); } virtual std::streamsize read(char* s, std::streamsize n) { return boost::iostreams::read(m_device, s, n); } virtual void close() { boost::iostreams::close(m_device); } private: T m_device; };

    Read the article

  • Ensuring a divs content has changed over time in Selenium

    - by Stewart Robinson
    I have a div that contains a slideshow. ( http://film.robinhoodtax.org/issues/education ) I am using Selenium to test it. So far I have been using the HTML/Selenium script below to validate that the slideshow is actually working. But my assertEval is failing. How can I correctly detect the slideshow and make sure it is moving?. You can see I've approached this by storing the HTML and waiting then trying again but it isn't working. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="selenium.base" href="" /> <title>New Test</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> <tr><td rowspan="1" colspan="3">New Test</td></tr> </thead><tbody> <tr> <td>open</td> <td>/issues/education</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>assertElementPresent</td> <td>css=div[id='views-nivo-slider-ImagesGallery-block_1']</td> <td></td> </tr> <tr> <td>storeHtmlSource</td> <td>css=div[id='views-nivo-slider-ImagesGallery-block_1']</td> <td>first</td> </tr> <tr> <td>pause</td> <td>3000</td> <td></td> </tr> <tr> <td>storeHtmlSource</td> <td>css=div[id='views-nivo-slider-ImagesGallery-block_1']</td> <td>second</td> </tr> <tr> <td>assertEval</td> <td>${first} == ${second}</td> <td>second</td> </tr> </tbody></table> </body> </html>

    Read the article

  • A PHP Library / Class to Count Words in Various Languages?

    - by Michael Robinson
    Some time in the near future I will need to implement a cross-language word count, or if that is not possible, a cross-language character count. I'd love it if I just had to look at English, but I need to consider every language here, Chinese, Korean, English, Arabic, Hindi, and so on. I would like to know if Stack Overflow has any leads on where to start looking for an existing product / method to do this in PHP, as I am a good lazy programmer* *http://blogoscoped.com/archive/2005-08-24-n14.html

    Read the article

  • Using PHP session_id() to Make Sure iframe is Generated by Our Server Dynamically

    - by Michael Robinson
    We use iframes to show ads on our site. Iframes are used to allow us to keep the ad generation code and other site modules separate. As we track ad views on our site, and need to be able to keep an accurate count of which pagetype gets what views, I must ensure that users can't simply copy-paste the iframe in which the ad is loaded onto another site. This would cause ad count to become inflated for this page, and the count would not match the view count of the page the iframe "should" be displayed in. Before anyone says so: no I can't simply compare the page view count with the ad view count, or use the page view count * number of ads per page, as # of ads per page will not necessarily be static. I need to come up with a solution that will allow ads to be shown only for iframes that are generated dynamically and are shown on our pages. I am not familiar with PHP sessions, but from what little reading I have had time to do, the following seems to be to be an acceptable solution: Add "s = session_id()" to the src of the ad's iframe. In the code that receives and processes ad requests, only return (and count) and ad if s == session_id(). Please correct me if I'm wrong, but this would ensure: Ads would only be returned to iframes whose src was generated alongside the rest of the page's content, as is the case during normal use. We can return our logo to ad calls with an invalid session_id. So a simple example would be: One of our pages: <?php session_start(); ?> <div id="someElement"> <!-- EVERYONE LOVES ADS --> <iframe src="http//awesomesite.com/ad/can_has_ad.php?s=<?php echo session_id(); ?>></iframe> </div> ad/can_has_ad.php: <?php session_start(); ?> if($_GET['s'] == session_id()){ echo 'can has ad'; } else{ echo '<img src="http://awesomesite.com/images/canhaslogo.jpg"/>'; } And finally, copied code with static 's' parameter: <!-- HAHA LULZ I WILL SCREW WITH YOUR AD VIEW COUNTS LULZ HAHA --> <iframe src="http//awesomesite.com/ad/can_has_ad.php?s=77f2b5fcdab52f52607888746969b0ad></iframe> Which would give them an iframe showing our awesome site's logo, and not screw with our view counts. I made some basic test cases: two files, one that generates the iframe and echos it, and one that the iframe's src is pointed to, that checks the 's' parameter and shows an appropriate message depending on the result. I copied the iframe into a file and hosted it on a different server, and the correct message was displayed (cannot has ad). So, my question is: Would this work or am I being a PHP session noob, with the above test being a total fluke? Thanks for your time! Edit: I'm trying to solve this without touching the SQL server

    Read the article

  • I need to speed up a function. Should I use cython, ctypes, or something else?

    - by Peter Stewart
    I'm having a lot of fun learning Python by writing a genetic programming type of application. I've had some great advice from Torsten Marek, Paul Hankin and Alex Martelli on this site. The program has 4 main functions: generate (randomly) an expression tree. evaluate the fitness of the tree crossbreed mutate As all of generate, crossbreed and mutate call 'evaluate the fitness'. it is the busiest function and is the primary bottleneck speedwise. As is the nature of genetic algorithms, it has to search an immense solution space so the faster the better. I want to speed up each of these functions. I'll start with the fitness evaluator. My question is what is the best way to do this. I've been looking into cython, ctypes and 'linking and embedding'. They are all new to me and quite beyond me at the moment but I look forward to learning one and eventually all of them. The 'fitness function' needs to compare the value of the expression tree to the value of the target expression. So it will consist of a postfix evaluator which will read the tree in a postfix order. I have all the code in python. I need advice on which I should learn and use now: cython, ctypes or linking and embedding. Thank you.

    Read the article

  • programmatically creating property list from json to include an array

    - by Michael Robinson
    [{"memberid":"18", "useridFK":"30", "loginName":"Johnson", "name":"Frank", "age":"23", "place":"School", },] Someone else posted a similar question but without the fact that it was coming from a JSON deserialization. Quinn had some suggestions but it was confused about where to place/replace the following code (if it's correct): NSDictionary *item1 = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@" member",[NSNumber numberWithInt:3],nil] forKeys:[NSArray arrayWithObjects:@"Title",@"View",nil]]; into this: NSData *jsonData = [jsonreturn dataUsingEncoding:NSUTF32BigEndianStringEncoding]; NSError *error = nil; NSDictionary * dict = [[CJSONDeserializer deserializer] deserializeAsDictionary:jsonData error:&error]; if (dict) { rowsArray = [dict objectForKey:@"member"]; [rowsArray retain]; } My Array.plist needs to look like the following: Root: Dictionary V Rows: Array V Item 0: Dictionary Title: String 18 V Children Array V Item 0 Dictionary Title String 30 etc. Thanks in advance. Every tutorial on JSON only shows a simple array being returned, never a 2-D..It's driving me crazy trying to figure this out.

    Read the article

  • Paypal Payflow pro library

    - by John Stewart
    I already have an express checkout integrated with my Codeigniter application. Now I want to integrate seamless paypal where I collect the CC information and pass it to Paypal (via backend) and once everything is approved, my application shows that to the user. All this with out ever going to Paypal's website. I know that Paypal gives a bunch of sample code but they have so many different products that advertise to do the same thing. Is there any wrapper library in PHP that I can use for handling all this? What sort of design decision is involved in migrating to such system? Would I need SSL certificates for this?

    Read the article

  • generate php code from wsdl

    - by John Stewart
    I have a bunch of webservices that I need to write PHP clients for. Now I can manually write wrappers for each of the WSDL files but i wanted to see if there is a tool that can help me by generating the wrappers in PHP. Any idea if there are any tools that do this? Thanks

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12  | Next Page >