
Delete table
Suppose you want to remove a 'comments' table from a blog application. You can do so by performing the following tasks from the command line (e.g., Terminal). Step one: $ rails console Step two: $ ActiveRecord::Migration.drop_table(:c...
Issue 1 - Error in installing pg gem Installing pg 0.19.0 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /home/luke/.rvm/gems/ruby-2.4.1/gems/pg-0.19.0/ext /home/luke/.rvm/rub...
In JavaScript, you can use following two ways to get hidden field value in a form : document.getElementById(‘hidden field id’).value document.formName.elements[‘hidden field name’].value See an example here… function printIt(){ ...
ssh -i MyAmazonKey.pem ubuntu@server-ip
Generate public/private key pair using Puttygen. Add passphrase for the private key Copy the public key. Login to the remote server and go to the ssh directory Open the 'authorized_keys' file and add the public key copied in the above step a...
Installing Tcl/Tk on Windows On Windows, the easiest way to get Tcl/Tk onto your machine is to install the ActiveTcl distribution from ActiveState, which includes Tcl, Tk, plus a number of other extension libraries. Once installed, open a consol...
Client Code import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.Socket; public class Client { public static void main (String [] args ) throws IOExc...
package com.test1; import java.awt.AlphaComposite; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public c...
Following is a checklist before venturing into the Machine Learning world: Machine Learning prerequisites: Python Multivariate Calculus Linear Algebra Probability theory and statistical inference Algorithms Machine Learning Course Sour...
Uninstall Old Versions $ sudo apt-get remove docker docker-engine docker.io Install Support Drivers If you're using version 3 of the Linux kernel, install the linux-image-extra-* packages, which allow Docker to use the aufs storage drivers. ...
What is the Singleton design pattern? The Singleton design pattern is a creational pattern that states that one and only one instance of a class would persist in the memory during the application's life cycle. In other words, this design patte...
I got this error on a fresh install when starting apache2 Ubuntu 12.10. It's a bug in the apache2. It gets hung in the background. Here is my walkthrough to where the bugs might be in the software. Here's the error I got: el@titan:~$ sudo servi...