Search Results

Search found 2033 results on 82 pages for 'andrew g johnson'.

Page 22/82 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • 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

  • Always-indexed MySQL indexing/searching replacements for InnoDB?

    - by Chad Johnson
    I am using InnoDB for a MySQL table, and obviously queries using LIKE and RLIKE/REGEXP can take a lot of time. I've tried Spinx, and it works great, except I have to re-index context at intervals. I can re-index every minute, but I am wondering if there is either 1) a setting in Sphinx to keep records always indexed or 2) other software besides Sphinx that will keep records always indexed. I want it where that immediately upon inserting or updating a record, the index is updated.

    Read the article

  • Dynamic Dispatch without Virtual Functions

    - by Kristopher Johnson
    I've got some legacy code that, instead of virtual functions, uses a kind field to do dynamic dispatch. It looks something like this: // Base struct shared by all subtypes // Plain-old data; can't use virtual functions struct POD { int kind; int GetFoo(); int GetBar(); int GetBaz(); int GetXyzzy(); }; enum Kind { Kind_Derived1, Kind_Derived2, Kind_Derived3 }; struct Derived1: POD { Derived1(): kind(Kind_Derived1) {} int GetFoo(); int GetBar(); int GetBaz(); int GetXyzzy(); // plus other type-specific data and function members }; struct Derived2: POD { Derived2(): kind(Kind_Derived2) {} int GetFoo(); int GetBar(); int GetBaz(); int GetXyzzy(); // plus other type-specific data and function members }; struct Derived3: POD { Derived3(): kind(Kind_Derived3) {} int GetFoo(); int GetBar(); int GetBaz(); int GetXyzzy(); // plus other type-specific data and function members }; and then the POD class's function members are implemented like this: int POD::GetFoo() { // Call kind-specific function switch (kind) { case Kind_Derived1: { Derived1 *pDerived1 = static_cast<Derived1*>(this); return pDerived1->GetFoo(); } case Kind_Derived2: { Derived2 *pDerived2 = static_cast<Derived2*>(this); return pDerived2->GetFoo(); } case Kind_Derived3: { Derived3 *pDerived3 = static_cast<Derived3*>(this); return pDerived3->GetFoo(); } default: throw UnknownKindException(kind, "GetFoo"); } } POD::GetBar(), POD::GetBaz(), POD::GetXyzzy(), and other members are implemented similarly. This example is simplified. The actual code has about a dozen different subtypes of POD, and a couple dozen methods. New subtypes of POD and new methods are added pretty frequently, and so every time we do that, we have to update all these switch statements. The typical way to handle this would be to declare the function members virtual in the POD class, but we can't do that because the objects reside in shared memory. There is a lot of code that depends on these structs being plain-old-data, so even if I could figure out some way to have virtual functions in shared-memory objects, I wouldn't want to do that. So, I'm looking for suggestions as to the best way to clean this up so that all the knowledge of how to call the subtype methods is centralized in one place, rather than scattered among a couple dozen switch statements in a couple dozen functions. What occurs to me is that I can create some sort of adapter class that wraps a POD and uses templates to minimize the redundancy. But before I start down that path, I'd like to know how others have dealt with this.

    Read the article

  • Finding City and Zip Code for a Location

    - by Kristopher Johnson
    Given a latitude and longitude, what is the easiest way to find the name of the city and the US zip code of that location. (This is similar to http://stackoverflow.com/questions/23572/latitude-longitude-database, except I want to convert in the opposite direction.) Related question: http://stackoverflow.com/questions/158557/get-street-address-at-latlong-pair

    Read the article

  • Can you in any way interface Ruby Gems with PHP, Python, etc.?

    - by Chad Johnson
    Stupid question, and forgive me for asking, but someone is asking me, and I am not a super expert with Rails yet. Suppose I have some Rails gem I write. Now suppose a customer has some other framework, like Django or CakePHP, and I want to provide the functionality offered by my gem (eg. CRUD for automotive data) to them as a module in their framework. Could I somehow make it so they could interface my gem with Django or CakePHP? Obviously I could do something with some API magic--and I'll probably end up going that route. But I just want to know whether there is a way to directly interface with Gems from a non-Rails application.

    Read the article

  • Cache an FTP connection via session variables for use via AJAX?

    - by Chad Johnson
    I'm working on a Ruby web Application that uses the Net::FTP library. One part of it allows users to interact with an FTP site via AJAX. When the user does something, and AJAX call is made, and then Ruby reconnects to the FTP server, performs an action, and outputs information. Every time the AJAX call is made, Ruby has to reconnect to the FTP server, and that's slow. Is there a way I could cache this FTP connection? I've tried caching in the session hash, but "We're sorry, but something went wrong" is displayed, and a TCP dump is outputted in my logs whenever I attempt to store it in the session hash. I haven't tried memcache yet. Any suggestions?

    Read the article

  • Using jQuery to make a group of images appear in order.

    - by Sean Johnson
    I have a page that shows a bunch of thumbnails (around 30), and the client is wanting them to appear one by one, in order, going from left to right on the page. This is what I've tried: var start_opacity = 500; $j('.grid-photo').each(function(i) { start_opacity = start_opacity + 500; setTimeout(function() { $j(i).animate({opacity: 1}, 4000); }, start_opacity); }); It doesn't seem to know what i is referencing. Any thoughts?

    Read the article

  • How to hide and show silvelight user control on main Silverlight Control?

    - by Steve Johnson
    Hi all I have a main silverlight control named MainPage.xaml in an asp.net web site. I want to dynamically add and remove control at run time. So, I have created another control Top10.xaml and added to selected canvas area on MainPage.xaml as described on this page(Click Me): Now i need to modify Top10 visibility in MainPage.xaml dynamically when a button is clicked on MainPage.xaml using C# code in MainPage.xaml.cs. Can anybody help me out? Thanks

    Read the article

  • Is there a way to specify a per-host deploy_to path with Capistrano?

    - by Chad Johnson
    I have searched and searched and asked a question already and have not received a clear answer. I have the following deploy script (snippet): set :application, "testapplication" set :repository, "ssh://domain.com//srv/hg/#{application}" set :scm, :mercurial set :deploy_to, "/srv/www/#{application}" role :web, "domain1.com", "domain2.com" role :app, "domain1.com", "domain2.com" role :db, "domain1.com", :primary => true, :norelease => true role :db, "domain2.com", :norelease => true As you see, I have set deploy_to to a specific path. And, I also have specified multiple web servers. However, each web server should have a different deployment path. I want to be able to run "cap deploy" and deploy to all hosts in one shot. I am NOT trying to deploy to staging and then to production. This is all production. My question is: how exactly do I specify a path per server? I have read the "Roles" documentation for Capistrano, and this is unclear. Can someone please post a deploy file example? I have read the documentation, and it is unclear how to do this. Does anyone know? Am I crazy? Am I thinking of this wrong or something? No answers anywhere online. Nowhere. Nothing. Please, someone help.

    Read the article

  • Did "general education" classes make you a better programmer?

    - by Big Johnson
    I'm surprised by the number of general education classes computer science students must complete to get their bachelors. For example, I must take: three English classes two history classes public speaking economics biology I hardly think these general education requirements are unique to the university I attend. My question is (for those of you who have degrees), in what ways have these general education requirements improved your career as a programmer?

    Read the article

  • Hashing a python function to regenerate output when the function is modified

    - by Seth Johnson
    I have a python function that has a deterministic result. It takes a long time to run and generates a large output: def time_consuming_function(): # lots_of_computing_time to come up with the_result return the_result I modify time_consuming_function from time to time, but I would like to avoid having it run again while it's unchanged. [time_consuming_function only depends on functions that are immutable for the purposes considered here; i.e. it might have functions from Python libraries but not from other pieces of my code that I'd change.] The solution that suggests itself to me is to cache the output and also cache some "hash" of the function. If the hash changes, the function will have been modified, and we have to re-generate the output. Is this possible or ridiculous? Updated: based on the answers, it looks like what I want to do is to "memoize" time_consuming_function, except instead of (or in addition to) arguments passed into an invariant function, I want to account for a function that itself will change.

    Read the article

  • How to **delete-protect** a file or folder on Windows Server 2003 and onwards using C#/Vb.Net?

    - by Steve Johnson
    Hi all, Is it possible to delete-protect a file/folder using Registry or using a custom written Windows Service in C#? Using Folder Permissions it is possible, but i am looking for a solution that even restricts the admin from deleting specific folders. The requirement is that the administrator must not be easily track the nature of protection and/or may not be able to avert it easily. Obviously all administrators will be able to revert the procedure if the technique is clearly understood. Like folder Permissions/OwnerShip Settings can easily be reset by an administrator. SO that is not an option. Folder protection software can easily be uninstalled and show clear indication that a particular folder is protected by some special kind of software. SO that too is not an option. Most antivirus programs protect folders and files in Program Dir. Windows itself doesnt allow certain files such as registry files in c:\windows\system32\config to not even copied. Such a protection is desired for folders which allowse to read and write to files but not allow deletion. Similar functionality is desired. The protection has to seemless and invisible. I do not want to use any protection features like FolderLock and Invisible secrets/PC Security and Desktop password etc. Moreover, the solution has to be something other than folder encryption. The solution has to be OS-native so ** that it may implemented ** pro grammatically using C#/VB.Net. Please help. Thanks

    Read the article

  • How to buld selective Projects within a Solution in TS 2008 in Team Build?

    - by Steve Johnson
    Hi all. I have a solution the source Control (TFS 2008) with multiple projects. Some of the projects are independent of each other. I dont want to build the complete solution instead sometimes we need to build some of the projects. I am a total newbie in Team Build. Please help how i can use the <SolutionToBuild Include="$(BuildProjectFolderPath)/../../Development/Main/Build-Development.sln"> <Targets></Targets> <Properties></Properties> </SolutionToBuild> to select only some of the projects from the solution. Kindly give a detailed answer for me as i am absolutely clueless about it. Thanks

    Read the article

  • Rails-like console for PHP?

    - by Chad Johnson
    Every so often, things work in my local PHP development environment, while in my test environment on my server, things do not. It's a nightmare to debug this. If I had a console like Rails provides, debugging would be much much simpler. Is there anything like the Rails console but for PHP? I should mention that I am using a home-brewn PHP application.

    Read the article

  • Cache an FTP connection for use via AJAX?

    - by Chad Johnson
    I'm working on a Ruby web Application that uses the Net::FTP library. One part of it allows users to interact with an FTP site via AJAX. When the user does something, and AJAX call is made, and then Ruby reconnects to the FTP server, performs an action, and outputs information. Every time the AJAX call is made, Ruby has to reconnect to the FTP server, and that's slow. Is there a way I could cache this FTP connection? I've tried caching in the session hash, but "We're sorry, but something went wrong" is displayed, and a TCP dump is outputted in my logs whenever I attempt to store it in the session hash. I haven't tried memcache yet. Any suggestions?

    Read the article

  • What is the standard or best way to deal with database branching with Mercurial or Git branches?

    - by Chad Johnson
    This has been a big question mark on my mind. I'm moving to Mercurial or Git very soon for my web software, and sometimes my branches require significant database changes which other branches should not see. This, I can't always share the same database for my branches. Is there some standard way of dealing with database changes for branching and cloning? What do you all do? I'm using MySQL.

    Read the article

  • How do I add a function to a specific element type in jQuery?

    - by Chad Johnson
    I can do this jQuery.fn.validate = function(options) { var defaults = { validateOPtions1 : '', validateOPtions2 : '' }; var settings = $.extend({}, defaults, options); return this.each(function() { // you validation code goes here }); }; but that will make validate() available for every element. I could do this to any element: $('some selector').validate(). Is there a way I can make this only available to, say, form elements? eg. $('.mySpecialFormClass').validate()?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >