Daily Archives

Articles indexed Saturday April 17 2010

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

  • How to move a ruby on rails application to a new server

    - by ManiacZX
    I have a rails app on an old Ubuntu server I need to move onto a new machine. I haven't worked with ruby on rails so I don't really know anything about the structure of the app. I want to load this onto an Ubuntu 8.04 AMI on Amazon EC2 and am looking for any information regarding the migration process such as: Do I copy over the entire folder defined as the application root in the mongrel config (for ex: /u/apps/myapp/current) or just certain folders? Am I looking for trouble if I go with the latest versions of ruby and the various gems? Any general gotchas to look out for in the process. Current server information: root@webnode001:/# cat /proc/version Linux version 2.6.15-27-server (buildd@terranova) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) #1 SMP Fri Dec 8 18:43:54 UTC 2006 root@webnode001:/# rails -v Rails 1.2.3 root@webnode001:/# mongrel_rails cluster::configure --version Version 1.0.1 root@webnode001:/# gem -v 0.9.0 root@webnode001:/# gem list -l *** LOCAL GEMS *** actionmailer (1.3.3, 1.2.5) Service layer for easy email delivery and testing. actionpack (1.13.3, 1.12.5) Web-flow and rendering framework putting the VC in MVC. actionwebservice (1.2.3, 1.1.6) Web service support for Action Pack. activerecord (1.15.3, 1.15.2, 1.14.4) Implements the ActiveRecord pattern for ORM. activesupport (1.4.2, 1.4.1, 1.3.1) Support and utility classes used by the Rails framework. cgi_multipart_eof_fix (2.1) Fix an exploitable bug in CGI multipart parsing which affects Ruby <= 1.8.5 when multipart boundary attribute contains a non-halting regular expression string. daemons (1.0.7, 1.0.5, 1.0.4, 1.0.2) A toolkit to create and control daemons in different ways eventmachine (0.7.2, 0.7.0) Ruby/EventMachine socket engine library fastercsv (1.2.0, 1.1.0) FasterCSV is CSV, but faster, smaller, and cleaner. fastthread (1.0) Optimized replacement for thread.rb primitives ferret (0.11.4) Ruby indexing library. gem_plugin (0.2.2, 0.2.1) A plugin system based only on rubygems that uses dependencies only mongrel (1.0.1, 0.3.13.4) A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps. mongrel_cluster (0.2.1) Mongrel plugin that provides commands and Capistrano tasks for managing multiple Mongrel processes. mysql (2.7) MySQL/Ruby provides the same functions for Ruby programs that the MySQL C API provides for C programs. piston (1.3.3) Piston is a utility that enables merge tracking of remote repositories. rails (1.2.3, 1.1.6) Web-application framework with template engine, control-flow layer, and ORM. rake (0.7.3, 0.7.1) Ruby based make-like utility. sources (0.0.1) This package provides download sources for remote gem installation swiftiply (0.5.1) A fast clustering proxy for web applications.

    Read the article

  • How to make 7zip faster

    - by user34463
    I normally use winRAR over 7Zip simply because its faster and only a little less efficient with compression. I did a few tests on different filetypes and sizes comparing the 7zip and winRAR default settings on their normal compression and their best compression, and in a lot of cases winRAR was 50% faster and in some it was actually 100% faster. But, I do like FOSS more. So here are my questions: Is there a way to make 7zip speed up? I'd like it to at least be on par with rar's speed Is there a way to make recovery segments in 7zip like you can in rar? I didn't see any, but I guess it could be a command line thing. I tested winrar and 7zip using the latest stable version of each (4.something with 7zip). Is the 9.x beta release noticeably faster at compression? I'm talking about faster at a comparable setting in WinRAR, not just lowering to bare minimum compression. If it matters, I use a quad core intel i7 720 (1.6ghz)/(2.8ghz) with 4gb DDR3 ram, and the 64-bit version of 7zip.

    Read the article

  • Can I "reprogram" an American Express USB drive?

    - by SkippyFire
    I recently received a USB drive that looks like a credit card as a promotion. The drive portion flips out to plug it in. When you plug it in, it opens the run dialog, and opens a URL to an American Express web page. I was able to find it in the Device Manager: But I don't know what else to do? Is there a way I can convert this into a plain old USB drive? Or better yet, can I modify the command that it runs when inserted into a computer?

    Read the article

  • Good error flagging

    - by Wayne
    For everyone that was thinking of the error_reporting() function, then it isn't, what I need is whenever a MySQL query has been done, and the statement has like if($result) { echo "Yes, it was fine... bla bla"; } else { echo "Obviously, the echo'ing will show in a white page with the text ONLY..."; } Whenever statements have been true or false, I want the error to be appeared when redirected with the header() function and echo the error reporting in a div somewhere on the page. Basically something like this: $error = ''; This part appears inside the div tags <div><?php echo $error; ?></div> So the error part will be echoed when redirected with the header() if($result) { $error = "Yes, it was fine... bla bla"; header("Location: url"); } else { $error = "Something wrong happened..."; header("Location: url"); } But that just doesn't work :(

    Read the article

  • using Multi Probe LSH with LSHKIT

    - by Yijinsei
    Hi Guys, I have read through the source code for mplsh, but I still unsure on how to use the indexes generated by lshkit to speed up the process in comparing feature vector in Euclidean Distance. Do you guys have any experience regarding this?

    Read the article

  • C# Linq List Contains Similar Elements

    - by John Peters
    Hi All, I am looking for linq query to see if there exists a similar object I have an object graph as follows Cart myCart = new Cart { List<CartProduct> myCartProduct = new List<CartProduct> { CartProduct cartProduct1 = new CartProduct { List<CartProductAttribute> a = new List<CartProductAttribute> { CartProductAttribute cpa1 = new CartProductAttribute{ title="red" }, CartProductAttribute cpa2 = new CartProductAttribute{ title="small" } } } CartProduct cartProduct2 = new CartProduct { List<CartProductAttribute> d = new List<CartProductAttribute> { CartProductAttribute cpa3 = new CartProductAttribute{ title="john" }, CartProductAttribute cpa4 = new CartProductAttribute{ title="mary" } } } } } I would like to get from the Cart = a CartProduct that has the exact same CartProductAttribute title values as a CartProduct that I need to compare. No more and no less. E.G. I need to find a similar CartProduct that has a CartProductAttribute with title="red" and a cartProductAttribute with title="small" in myCart (eg 'cartProduct1' in the example) CartProduct cartProductToCompare = new CartProduct { List<CartProductAttribute> cartProductToCompareAttributes = new List<CartProductAttribute> { CartProductAttribute cpa5 = new CartProductAttribute{ title="red" }, CartProductAttribute cpa6 = new CartProductAttribute{ title="small" } } } So from object graph myCart cartProduct1 cpa1 (title=red) cpa2 (title=small) cartProduct2 cpa3 (title=john) cpa4 (title=mary) Linq query looking for cartProductToCompare cpa5 (title=red) cpa6 (title=small) Should find cartProduct1 Hope all this makes sense... Thanks

    Read the article

  • can lapply not modify variables in a higher scope

    - by stevejb
    I often want to do essentially the following: mat <- matrix(0,nrow=10,ncol=1) lapply(1:10, function(i) { mat[i,] <- rnorm(1,mean=i)}) But, I would expect that mat would have 10 random numbers in it, but rather it has 0. (I am not worried about the rnorm part. Clearly there is a right way to do that. I am worry about affecting mat from within an anonymous function of lapply) Can I not affect matrix mat from inside lapply? Why not? Is there a scoping rule of R that is blocking this?

    Read the article

  • Set an event for a div with multiple class

    - by acidzombie24
    I am trying to set an event on a div whos parent has a class="classA classB"; My css is being applied but i cant figure out how to specify it with jquery. How do i set an event with jquery for this class combination $('[class=classA classB]').live('click', function () { alert('a'); }); html <div class="classA classB">...moredivs...</div>

    Read the article

  • Winelib & XCode

    - by Chris Becke
    Does anyone have any experience and/or tips wrt using Xcode to build winlib binaries on the Mac? As part of a Windows - Mac OS X crossplatform port i'm looking at an initial winelib port of the app before reworking the windowing to use Cocoa. None of the winelib tutorials ive seen so far mention anything other than command line builds using make files and winegcc, so Im wondering if its worth bothering at all trying to get an Xcode project built linking against winelib.

    Read the article

  • can we set up cron jobs in Google App Engine without using SDK???

    - by nok
    I downloaded java SDK from Google App Engine. I tried running appcfg.cmd from command prompt. But it gives this error. Error opening registry key 'Software\JavaSoft\Java Runtime Environment' Error: could not find java.dll Error: could not find Java 2 Runtime Environment. All i want to do with Google App Engine is to set up cron jobs with 1 minute frequency. I don't want to make any application in Google App Engine. I just want the cron job set up. Is there any way to set up cron job in Google App Engine without using the java SDK ???

    Read the article

  • Problem dispatching with google mobile analytics for iphone

    - by Eamonn
    I have integrated Google mobile analytics into my iphone app, but for some reason the page views and events are not dispatching. I put this into my app delegate applicationDidFinishLaunching method (i've x'd out the UA string): [[GANTracker sharedTracker] startTrackerWithAccountID:@"UA-xxxxxx-x" dispatchPeriod:10 delegate:self]; NSError *error; [[GANTracker sharedTracker] trackPageview:@"/home" withError:&error]; This is the delegate method: - (void)trackerDispatchDidComplete:(GANTracker *)tracker eventsDispatched:(NSUInteger)eventsDispatched eventsFailedDispatch:(NSUInteger)eventsFailedDispatch { NSLog(@"Google Analytics Dispatch: succeeded:%i, failed:%i",eventsDispatched,eventsFailedDispatch); } which prints out the message: Google Analytics Dispatch: succeeded:0, failed:190 Did anyone else run into this problem?

    Read the article

  • Which cross threading invoke function is better for a control that is inherited?

    - by Stevoni
    I have a relatively simple question regarding the best way to call the DataGridView.Rows.Add function when it is inherited into the current control. Which is the best way to make the call to the inherited control? Call it directly in the invoke or call it using recursive-like function? They both seem to produce the same result, a row gets added and the quantity is returned, but which is the most efficient? The delegate: Private Delegate Function ReturnDelegate() As Object The two ways are: A) Private Overloads Function AddRow() As Integer If InvokeRequired Then Return CInt(Invoke(New ReturnDelegate(AddressOf AddRow))) Else Return Rows.Add() End If End Function Or B) Private Function RowsAdd() As Integer If Me.InvokeRequired Then Return CInt(Me.Invoke(New ReturnDelegate(AddressOf MyBase.Rows.Add))) Else Return MyBase.Rows.Add End If End Function

    Read the article

  • How do I do distributed UML development (à la FOSS)?

    - by James A. Rosen
    I have a UML project (built in IBM's Rational System Architect/Modeler, so stored in their XML format) that has grown quite large. Additionally, it now contains several pieces that other groups would like to re-use. I come from a software development (especially FOSS) background, and am trying to understand how to use that as an analogy here. The problem I am grappling with is similar to the Fragile Base Class problem. Let me start with how it works in an object-oriented (say, Java or Ruby) FOSS ecosystem: Group 1 publishes some "core" package, say "net/smtp version 1.0" Group 2 includes Group 1's net/smtp 1.0 package in the vendor library of their software project At some point, Group 1 creates a new 2.0 branch of net/smtp that breaks backwards compatibility (say, it removes an old class or method, or moves a class from one package to another). They tell users of the 1.0 version that it will be deprecated in one year. Group 2, when they have the time, updates to net/smtp 2.0. When they drop in the new package, their compiler (or test suite, for Ruby) tells them about the incompatibility. They do have to make some manual changes, but all of the changes are in the code, in plain text, a medium with which they are quite familiar. Plus, they can often use their IDE's (or text editor's) "global-search-and-replace" function once they figure out what the fixes are. When we try to apply this model to UML in RSA, we run into some problems. RSA supports some fairly powerful refactorings, but they seem to only work if you have write access to all of the pieces. If I rename a class in one package, RSA can rename the references, but only at the same time. It's very difficult to look at the underlying source (the XML) and figure out what's broken. To fix such a problem in the RSA editor itself means tons of clicking on things -- there is no good equivalent of "global-search-and-replace," at least not after an incomplete refactor. They real sticking point seems to be that RSA assumes that you want to do all your editing using their GUI, but that makes certain operations prohibitively difficult. Does anyone have examples of open-source UML projects that have overcome this problem? What strategies do they use for communicating changes?

    Read the article

  • Copy constructor, objects, pointers

    - by Pauff
    Let's say I have this: SolutionSet(const SolutionSet &solutionSet) { this->capacity_ = solutionSet.capacity_; this->solutionsList_ = solutionSet.solutionsList_; // <-- } And solutionsList_ is a vector<SomeType*> vect*. What is the correct way to copy that vector (I suppose that way I'm not doing it right..)?

    Read the article

  • PHP & MySQL Image deletion problem?

    - by IMAGE
    I have this script that deletes a users avatar image that is stored in a folder name thumbs and another named images and the image name is stored in a mysql database. But for some reason the script deletes all the users info for example if the users id is 3 all of the users info like first name last name age and so are deleted as well, basically everything is deleted including the user how do I fix this so only the images and image name is deleted? Here is the code. $user_id = '3'; if (isset($_POST['delete_image'])) { $a = "SELECT * FROM users WHERE avatar = '". $avatar ."' AND user_id = '". $user_id ."'"; $r = mysqli_query ($mysqli, $a) or trigger_error("Query: $a\n<br />MySQL Error: " . mysqli_error($mysqli)); if ($r == TRUE) { unlink("../members/" . $user_id . "/images/" . $avatar); unlink("../members/" . $user_id . "/images/thumbs/" . $avatar); $a = "DELETE FROM users WHERE avatar = '". $avatar ."' AND user_id = '". $user_id ."'"; $r = mysqli_query ($mysqli, $a) or trigger_error("Query: $a\n<br />MySQL Error: " . mysqli_error($mysqli)); } }

    Read the article

  • Is there any real benefit to using ASP.Net Authentication with ASP.Net MVC?

    - by alchemical
    I've been researching this intensely for the past few days. We're developing an ASP.Net MVC site that needs to support 100,000+ users. We'd like to keep it fast, scalable, and simple. We have our own SQL database tables for user and user_role, etc. We are not using server controls. Given that there are no server controls, and a custom membershipProvider would need to be created, where is there any benefit left to use ASP.Net Auth/Membership? The other alternative would seem to be to create custom code to drop a UniqueID CustomerID in a cookie and authenticate with that. Or, if we're paranoid about sniffers, we could encrypt the cookie as well. Is there any real benefit in this scenario (MVC and customer data is in our own tables) to using the ASP.Net auth/membership framework, or is the fully custom solution a viable route?

    Read the article

  • How to write syntax highlighting? c++

    - by ML
    Hi All, I am embarking on some learning and I want to write my own syntax highlighting for files in C++. Can anyone give me ideas on how to go about doing this? To me it seems that when a file is opened: 1. it would need to be parsed and decided what type of source file it is. Trusting the extension might not be full-proof a way to know what keywords/commands apply to what language a way to decide what color each keyword/command gets I want to do this on OS X, C++ or Objective-C Can anyone provide pointers on how I might get started with this?

    Read the article

  • R in a netbook - system requirements for using R

    - by Brani
    I know it's not a programming question but I'm in a hurry to choose a netbook like this and I haven't been able to find the minimum system requirements for an R installation (e.g. minimum RAM). I am interested in a small netbook so as to be able to use it in class. Has anybody used R in a netbook that would recommend for that use?

    Read the article

  • In OpenGL vertex shader, gl_Position doesn't get homogenized..

    - by KJ
    Hi everyone, I was expecting gl_Position to automatically get homogenized (divided by w), but it seems not working.. Why do the followings make different results? 1) void main() { vec4 p; ... omitted ... gl_Position = projectionMatrix * p; } 2) ... same as above ... p = projectionMatrix * p; gl_Position = p / p.w; I think the two are supposed to generate the same results, but it seems it's not the case. 1 doesn't work while 2 is working as expected.. Could it possibly be a precision problem? Am I missing something? This is driving me almost crazy.. helps needed. Many thanks in advance!

    Read the article

  • Reasons for NSManagedObjectMergeError error on [NSManagedObjectContext save:]

    - by ross-kimes
    I have a application that combines threading and CoreData. I and using one global NSPersistentStoreCoordinator and a main NSManagedObjectContextModel. I have a process where I have to download 9 files simultaneously, so I created an object to handle the download (each individual download has its own object) and save it to the persistentStoreCoordinator. In the [NSURLConnection connectionDidFinishLoading:] method, I created a new NSManagedObject and attempt to save the data (which will also merge it with the main managedObjectContext). I think that it is failing due to multiple process trying to save to the persistentStoreCoordinator at the same time as the downloads are finishing around the same time. What is the easiest way to eliminate this error and still download the files independently? Thank you!

    Read the article

  • Tile Collision Question

    - by Alu
    Hey guys, I'm working on tile collision. Currently, I just draw the tile map the normal way (two for loops) and there is no scrolling. Right now, to check if my player is over a tile, I use tileX = (int)person1v.X / 16; tileY = (int)person1v.Y / 16; However, I want to detect collision before I hit the tile so it could act as a wall. How do I detect collision before even making the move?

    Read the article

  • Facebook Share doesn't pick up title / description meta tags that are changed after page load.

    - by Memo
    Apparently Facebook Share doesn't pick up the title / description meta tags that are changed (via JavaScript) after the page load. It basically use the meta tags that are available upon load. This is a simple example. The link will change the title / description meta tags upon click. You can confirm that using Firebug. Click the f|Share button: Facebook still always shows "A title that is available upon page load." and "A description that is available upon page load." Anybody knows how to fix this?

    Read the article

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