Search Results

Search found 208 results on 9 pages for 'gavin simpson'.

Page 5/9 | < Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >

  • What's a good pure-python, document-based and flat-file database engine?

    - by joe Simpson
    Hi, for development i'd love to have a flat file database with the requirements up in the title, but I don't seem to be able to find a database with these requirements. I can't seem to get MetaKit to work. I only need it to work on the development machine, but in the real world my product will have more data and needs more room and will need something better. Does anyone know of a database engine capable of this or do I need to just use python's pickle and load and save a file? Joe

    Read the article

  • Flash Player - green box with version number

    - by Gavin
    I'm trying to get a very simple Flash video working using SWFembed, and it does work across multiple computers at this point in multiple browsers, but as soon as I pushed it live I got this: http://cl.ly/1EDS I've adjusted file permissions, but it is exactly the same code and files as in another directory on the server. I've seen this a few times (green box with version number), but have not been able to find any reference to it online. Thanks for any suggestions in advance!

    Read the article

  • How to extend the Eclipse Java Editor to add coloured overlays

    - by Gavin Clarke
    I have an idea for an Eclipse plugin which I've been toying with. I need to be able to extend the Eclipse Java Editor component and add coloured overlays to the code based on pluggable external metrics. Unfortunately there doesn't appear to be any kind of syntax highlighting extension point. Does anyone know how I might be able to extend the exisitng eclipse Java Editor to add custom highlighting rules? Bear in mind I'm new to Eclipse plugin programming so please give as much detail as possible.

    Read the article

  • Overview of PHP shorthand

    - by James Simpson
    I've been programming in PHP for years now, but I've never learned how to use any shorthand. I come across it from time to time in code and have a hard time reading it, so I'd like to learn the different shorthand that exists for the language sot hat I can read it and start saving time/lines by using it, but I can't seem to find a comprehensive overview of all of the shorthand. A Google search pretty much exclusively shows the shorthand for if/else statements, but I know there must be more than just that. By shorthand, I am talking about stuff like: ($var) ? true : false;

    Read the article

  • How can I print a web page on a server?

    - by Gavin Schultz
    Suppose I develop a web page using the cool Google visualization API, and it does everything the user wants. They can the parameters, look at the graphs, and print the page to get a reasonable-looking report. All good. Now suppose I want to do the same thing server-side. For example, say we need a set of report generated at a specific time of day, printed to a PDF and emailed to a manager. It's not a user-initiated action, so we don't have a user's browser or their printer. We have a URL that would render the report if we had a browser, and that's it. Is there a good way to do this server-side? Is this just foolish? Has anyone done anything like that before? Do any of the major browsers have APIs that might provide such functionality? Keep in mind too that it's not just static HTML; probably javascript will be running first to shift the DOM around. I know we could implement a whole different reporting engine on the server side to do this, but that will (a) generate reports that look a bit different, and (b) require me to build/maintain two sets of functionality. Instead, I'd be happy if I could just render the page / pages I want in an invisible server-side browser and print it to a PDF (let's mostly ignore that step - I know any number of PDF printer drivers that could do this). I don't really want to do it ugly either - i.e. by starting a browser process and then sending keystrokes directly to the window either - that's just bound to fall apart with a slight nudge. The only related question I found had an answer like that. Any advice appreciated!

    Read the article

  • collapse jquery treeview plugin when focusing on another element

    - by Andy Simpson
    Hello all, Is there a way to have the jquery treeview plugin automatically collapse when a user focuses on another element. More detail about what I am trying to do: I have a form where a user has to select an item from a large selection. To make this easier I have set up a small list of 5 commonly selected items each with associated radio select buttons. However if the item wanted is not in this common list the user has to use the treeview to search through different categories to find the item. Is there a way to collapse the treeview when the user clicks on one of the radio buttons from the common item list? Thanks for your help in advance, Andy

    Read the article

  • How to dynamically load & unload a TinyMCE Plugin

    - by Matt Simpson
    Does anyone know if there is a way I can dynamically load and unload a TinyMCE plugin after TinyMCE has already been loaded? Specifically, I'm thinking about asking the user whether or not they wish to load the fullpage plugin using perhaps a radio button or something above TinyMCE: <input type="radio" name="fullpage" value="enabled" /> Enable Fullpage Plugin<br /> <input type="radio" name="fullpage" value="disabled" /> Disable Fullpage Plugin<br /> <textarea name="tinymce" id="tinymce">...</textarea> I suppose I could destroy the original instance and load a new config (one for enabled / one for disabled), but it seems as though there should be a more elegant way of loading and unloading plugins.

    Read the article

  • Get Auto Increment value with MySQL query

    - by James Simpson
    I currently have a database with over 6 million rows and growing. I currently do SELECT COUNT(id) FROM table; in order to display the number to my users, but the database is getting large and I have no need to store all of those rows except to be able to show the number. Is there a way to select the auto_increment value to display so that I can clear out most of the rows in the database? Using LAST_INSERT_ID() doesn't seem to work.

    Read the article

  • Alternatives to CAT.NET for website security analysis

    - by Gavin Miller
    I'm looking for an alternative tool to CAT.NET for performing static security scans on .NET code. Currently the CAT.NET tooling/development is at a somewhat fragile stage and doesn't offer the reliability that I'm looking for. Are there any alternative static code analyzers that you use for detecting security issues?

    Read the article

  • Lua parser in python

    - by Joe Simpson
    Hi, I'm looking into using Lua in a web project. I can't seem to find any way of directly parsing in pure python and running Lua code in Python. Does anyone know how to do this? Joe

    Read the article

  • Setting ModerationInformation.Status from Approved back to pending removes

    - by Gavin Morgan
    Seeing if anyone else has had this problem and a resolution to it. I have a visual studio sequential workflow on a list (not a library) which does NOT use tasks, the approval process is done through the Approve/Reject OOTB buttons on the list item. The approval is a 2 stage approval, whereby if the 1st stage is completed (via clicking the Approve OOTB button), i reset the ModerationInformation.Status from Approved back to pending then send an email to the 2nd stage approver. My problem is, when i set the the ModerationInformation.Status back to Pending from Approved so there is never an approved version, the Creator loses permissions to view the item, and i get the "cannot find item" error from SharePoint for the person who created the item. The 1st and 2nd level approvers and anyone with approve rights CAN still see the item. Some more background information. the code i am using to update the moderationinformation is I get the properties from the workflow event and get a hook into the listitem properties.Item.ModerationInformation.Status = SPModerationStatusType.Pending; properties.Item.Update(); can anyone help.

    Read the article

  • Fluent NHibernate MappingException : could not instantiate id generator

    - by Mark Simpson
    I'm pottering around with Fluent NHibernate to try and get a simple app up and running. I'm running through this Fluent NHibernate Tutorial. Everything seems to be going fine and I've created the required classes etc. and it all builds, but when I run the test, I get an exception. Someone in the comments section of the tutorial has the same problem, but I can't find any good information on what's causing it. Any help appreciated. It's probably something trivial. Exception details: FluentNHTest.Tests.Mappings.CustomerMappingTests.ValidateMappings: FluentNHibernate.Cfg.FluentConfigurationException : An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail. ---- FluentNHibernate.Cfg.FluentConfigurationException : An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail. ---- NHibernate.MappingException : could not instantiate id generator ---- System.FormatException : Input string was not in a correct format.

    Read the article

  • Generating a readable colour from RGB?

    - by Joe Simpson
    Hi, I'm putting in a function which will allow a user to input a color (eg: purple) and it will change the look of their profile to be purple. It's interpreted from text into a 'Color' class which stores them inside itself as RGB numbers (int for red, one for green and other for blue). What i don't know how to do is logically turn these three numbers into another 3 which will make a readable colour. Can anyone help me on how to do this? Joe

    Read the article

  • How do I get the window id and tab number of a Terminal window using AppleScript via the ScriptingBr

    - by Gavin Brock
    I can open a Terminal tab using the following AppleScript: tell application "Terminal" set myTab to do script "exec sleep 1" get myTab end tell This returns a string like: tab 1 of window id 3263 of application "Terminal". This is great, I can see the window id 3263 and tab number 1 (although I don't know how to query myTab to get only these values). In the Cocoa ScriptingBridge, I can do: SBApplication *terminal; SBObject *tab; terminal = [SBApplication applicationWithBundleIdentifier:@"com.apple.terminal"] tab = [terminal doScript:@"exec sleep 1" in:nil] How do I get the window id and tab number from the tab object?

    Read the article

  • Rails "rake test" crashing

    - by Homer J. Simpson
    Hi, this might be rather unspecific, but I'm trying to do 'rake test' on a new rails app, and end up with (in /Users/myname/dev/railstest/RailsApplication1) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I"lib:test" "/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I"lib:test" "/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I"lib:test" "/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" No other output. System is Leopard 10.5, Rails 2.3.5, Ruby 1.86 Any ideas ?

    Read the article

  • Stop 2 identical queries from executing almost simultaneously?

    - by James Simpson
    I have developed an AJAX based game where there is a bug caused (very remote, but in volume it happens at least once per hour) where for some reason two requests get sent to the processing page almost simultaneously (the last one I tracked, the requests were a difference of .0001 ms). There is a check right before the query is executed to make sure that it doesn't get executed twice, but since the difference is so small, the check hasn't finished before the next query gets executed. I'm stumped, how can I prevent this as it is causing serious problems in the game. Just to be more clear, the query is starting a new round in the game, so when it executes twice, it starts 2 rounds at the same time which breaks the game, so I need to be able to stop the script from executing if the previous round isn't over, even if that previous round started .0001 ms ago.

    Read the article

  • iPhone: Problems releasing UIViewController in a multithreaded environment

    - by bart-simpson
    Hi! I have a UIViewController and in that controller, i am fetching an image from a URL source. The image is fetched in a separate thread after which the user-interface is updated on the main thread. This controller is displayed as a page in a UIScrollView parent which is implemented to release controllers that are not in view anymore. When the thread finishes fetching content before the UIViewController is released, everything works fine - but when the user scrolls to another page before the thread finishes, the controller is released and the only handle to the controller is owned by the thread making releaseCount of the controller equals to 1. Now, as soon as the thread drains NSAutoreleasePool, the controller gets releases because the releaseCount becomes 0. At this point, my application crashes and i get the following error message: bool _WebTryThreadLock(bool), 0x4d99c60: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now... The backtrace reveals that the application crashed on the call to [super dealloc] and it makes total sense because the dealloc function must have been triggered by the thread when the pool was drained. My question is, how i can overcome this error and release the controller without leaking memory? One solution that i tried was to call [self retain] before the pool is drained so that retainCount doesn't fall to zero and then using the following code to release controller in the main thread: [self performSelectorOnMainThread:@selector(autorelease) withObject:nil waitUntilDone:NO]; Unfortunately, this did not work out. Below is the function that is executed on a thread: - (void)thread_fetchContent { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSURL *imgURL = [NSURL URLWithString:@"http://www.domain.com/image.png"]; // UIImage *imgHotspot is declared as private - The image is retained // here and released as soon as it is assigned to UIImageView imgHotspot = [[[UIImage alloc] initWithData: [NSData dataWithContentsOfURL: imgURL]] retain]; if ([self retainCount] == 1) { [self retain]; // increment retain count ~ workaround [pool drain]; // drain pool // this doesn't work - i get the same error [self performSelectorOnMainThread:@selector(autorelease) withObject:nil waitUntilDone:NO]; } else { // show fetched image on the main thread - this works fine! [self performSelectorOnMainThread:@selector(showImage) withObject:nil waitUntilDone:NO]; [pool drain]; } } Please help! Thank you in advance.

    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

  • Jquery Uploader not saving to a folder in the site root

    - by Iain Simpson
    im trying to integrate the Jquery Uploader into my website http://blueimp.github.com/jQuery-File-Upload/ The problem I am having is that I cant seem to get it save the folder I want to to save to. In the UploadHander.php I have the following settings 'script_url' => $this->get_full_url().'/', 'upload_dir' => dirname($_SERVER['SCRIPT_FILENAME']).'./images/machinery/', 'upload_url' => $this->get_full_url().'./images/machinery/', This results in an image uploaded url that looks like this http://domain.com/rcsetch/up/server/php/machinery/image.jpg Other than putting my php files in the root of the website, im not sure how to get it to work, as what I want it to do is upload the files to http://domain.com/images/machinery and not to the create a folder in the directory where all the php files for the uploader are located.

    Read the article

  • How to optimize this user ranking query

    - by James Simpson
    I have 2 databases (users, userRankings) for a system that needs to have rankings updated every 10 minutes. I use the following code to update these rankings which works fairly well, but there is still a full table scan involved which slows things down with a few hundred thousand users. mysql_query("TRUNCATE TABLE userRankings"); mysql_query("INSERT INTO userRankings (userid) SELECT id FROM users ORDER BY score DESC"); mysql_query("UPDATE users a, userRankings b SET a.rank = b.rank WHERE a.id = b.userid"); In the userRankings table, rank is the primary key and userid is an index. Both tables are MyISAM (I've wondered if it might be beneficial to make userRankings InnoDB).

    Read the article

  • Efficient storage/retrieval method for replayable comet style applications (Google Wave, Etherpad)

    - by Gareth Simpson
    I am considering a web application that would have the same kind of multi user, automatic saving, infinite undo / replay capabilities that you see in Google Wave and Etherpad (albeit on a drastically smaller scale and userbase). Before I go away and reinvent the wheel, is this something that has already been addressed as either a piece of technology or library, or even just a design pattern. I know this isn't necessarily the best Stack Overflow question as there is probably not a "right" answer, but my Google-fu has failed me and I'd just like a reading list! Ordinarily I would be developing under python/django but this is not a firm requirement just a preference :)

    Read the article

  • Why are my connections not closed even if I explicitly dispose of the DataContext?

    - by Chris Simpson
    I encapsulate my linq to sql calls in a repository class which is instantiated in the constructor of my overloaded controller. The constructor of my repository class creates the data context so that for the life of the page load, only one data context is used. In my destructor of the repository class I explicitly call the dispose of the DataContext though I do not believe this is necessary. Using performance monitor, if I watch my User Connections count and repeatedly load a page, the number increases once per page load. Connections do not get closed or reused (for about 20 minutes). I tried putting Pooling=false in my config to see if this had any effect but it did not. In any case with pooling I wouldn't expect a new connection for every load, I would expect it to reuse connections. I've tried putting a break point in the destructor to make sure the dispose is being hit and sure enough it is. So what's happening? Some code to illustrate what I said above: The controller: public class MyController : Controller { protected MyRepository rep; public MyController () { rep = new MyRepository(); } } The repository: public class MyRepository { protected MyDataContext dc; public MyRepository() { dc = getDC(); } ~MyRepository() { if (dc != null) { //if (dc.Connection.State != System.Data.ConnectionState.Closed) //{ // dc.Connection.Close(); //} dc.Dispose(); } } // etc } Note: I add a number of hints and context information to the DC for auditing purposes. This is essentially why I want one connection per page load

    Read the article

  • Custom Django Field is deciding to work as ForiegnKey for no reason

    - by Joe Simpson
    Hi, i'm making a custom field in Django. There's a problem while trying to save it, it's supposed to save values like this 'user 5' and 'status 9' but instead in the database these fields show up as just the number. Here is the code for the field: def find_key(dic, val): return [k for k, v in dic.items() if v == val][0] class ConnectionField(models.TextField): __metaclass__ = models.SubfieldBase serialize = False description = 'Provides a connection for an object like User, Page, Group etc.' def to_python(self, value): if type(value) != unicode: return value value = value.split(" ") if value[0] == "user": return User.objects.get(pk=value[1]) else: from social.models import connections return get_object_or_404(connections[value[0]], pk=value[1]) def get_prep_value(self, value): from social.models import connections print value, "prep" if type(value) == User: return "user %s" % str(value.pk) elif type(value) in connections.values(): o= "%s %s" % (find_key(connections, type(value)), str(value.pk)) print o, "return" return o else: print "CONNECTION ERROR!" raise TypeError("Value is not connectable!") Connection is just a dictionary with the "status" text linked up to the model for a StatusUpdate. I'm saving a model like this which is causing the issue: Relationship.objects.get_or_create(type="feedback",from_user=request.user,to_user=item) Please can someone help, Many Thanks Joe *_*

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >