Admin
Jul 11, 2020
14 comments
755
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...
Snippet
Delete table
Admin
Jun 23, 2020
24 comments
631
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...
Snippet
Common Ruby on Rails gem installation errors
Admin
Apr 09, 2020
13 comments
983
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(){ ...
Snippet
Pass value from JSP to Javascript
Admin
Mar 08, 2019
19 comments
1.2K
ssh -i MyAmazonKey.pem ubuntu@server-ip
Snippet
Server login using Mobaxterm(AWS)
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...
Snippet
Configuring RSA key pair to login to server using Fi...
Admin
Aug 11, 2018
22 comments
1.05K
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...
Snippet
Installing TCL/Tk on windows
Admin
May 26, 2018
23 comments
1.1K
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...
Snippet
Sending files over network in Java
Admin
May 25, 2018
0 comments
726
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...
Snippet
Image Resizing in Java
Admin
Apr 21, 2018
16 comments
833
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...
Snippet
Machine Learning Prerequisites
Admin
Mar 03, 2018
19 comments
1.04K
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. ...
Snippet
Setting up docker
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...
Tutorial
Implementing the Singleton Design Pattern in JavaScript
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...
Tutorial
Apache fails to start, Address already in use (but n...