Saturday, December 20, 2014
Saturday, December 13, 2014
Rails: running a particular migration
This is an old Stackoverflow question - http://stackoverflow.com/questions/753919/run-a-single-migration-file
If the migration file is:
--
db/migrate/20141211192127_add_col1_to_table1.rb
class AddCol1ToTable1 < ActiveRecord::Migration
def change
add_column :table1, :col1, :boolean
end
end
--
Then, we have to do the following in Rails console:
> require Rails.root + "db/migrate/20141211192127_add_col1_to_table1.rb"
> AddCol1ToTable1.new.migrate(:up)
If the migration file is:
--
db/migrate/20141211192127_add_col1_to_table1.rb
class AddCol1ToTable1 < ActiveRecord::Migration
def change
add_column :table1, :col1, :boolean
end
end
--
Then, we have to do the following in Rails console:
> require Rails.root + "db/migrate/20141211192127_add_col1_to_table1.rb"
> AddCol1ToTable1.new.migrate(:up)
Wednesday, December 10, 2014
Sunday, December 7, 2014
An introduction to functional programming
https://codewords.hackerschool.com/issues/one/an-introduction-to-functional-programming
Imperative & corresponding Functional code has been used for explanations.
Imperative & corresponding Functional code has been used for explanations.
Labels:
algorithms,
programming,
software engineering
Thursday, December 4, 2014
ebook: Distributed Systems
Free 2013 ebook about Distributed Systems:
http://book.mixu.net/distsys/single-page.html
http://book.mixu.net/distsys/single-page.html
Sunday, October 26, 2014
"You're already doing TDD" written by david banham
You're already doing TDD written by david banham
http://blog.davidbanham.com/articles/tdd/
http://blog.davidbanham.com/articles/tdd/
Thursday, October 23, 2014
Sunday, October 19, 2014
How to Solve Error:: VMware Workstation and Hyper-V are not compatible.
http://www.youtube.com/watch?v=IrP4vlw5LUY
To turn off Hyper-V:
bcdedit /set hypervisorlaunchtype off
reboot
To turn on Hyper-V:
bcdedit /set hypervisorlaunchtype auto
reboot
To turn off Hyper-V:
bcdedit /set hypervisorlaunchtype off
reboot
To turn on Hyper-V:
bcdedit /set hypervisorlaunchtype auto
reboot
Saturday, October 18, 2014
Thursday, October 9, 2014
Scott Hanselman - Scaling Yourself
A great talk by Scott Hanselman about Effectivness, Efficiency, Time Management.. etc..
Tuesday, October 7, 2014
Sunday, October 5, 2014
Friday, October 3, 2014
Monday, September 29, 2014
Ruby: detect
From
http://stackoverflow.com/questions/2986852/ruby-detect-method :
Detect returns the first item in the list for which the block returns TRUE. Your first example:
http://stackoverflow.com/questions/2986852/ruby-detect-method :
Detect returns the first item in the list for which the block returns TRUE. Your first example:
>> [1,2,3,4,5,6,7].detect { |x| x.between?(3,4) }
=> 3
Returns 3
because that is the first item in the list that returns TRUE for the expression x.between?(3,4)
.detect
stops iterating after the condition returns true for the first time. select
will iterate until the end of the input list is reached and returns all of the items where the block returned true. Sunday, September 21, 2014
Thursday, September 18, 2014
Tuesday, September 16, 2014
Sunday, September 14, 2014
Algorirthms Visualized (Animated) - algomation.com/
http://www.algomation.com/
Videos in youtube:
http://www.youtube.com/watch?v=aXXWXz5rF64 - Bubble Sort vs Quick Sort
An introductory course in Harvard: CS50
http://cs50.tv/
https://www.youtube.com/watch?v=h2d9b_nEzoA - CS50 - Arrays, Linked Lists, Hash Tables
Videos in youtube:
http://www.youtube.com/watch?v=aXXWXz5rF64 - Bubble Sort vs Quick Sort
An introductory course in Harvard: CS50
http://cs50.tv/
https://www.youtube.com/watch?v=h2d9b_nEzoA - CS50 - Arrays, Linked Lists, Hash Tables
Thursday, September 11, 2014
Databases, Algorithms
Databases:
Excellent lecture series on Database Technology from Professor Jens Dittich
https://infosys.uni-saarland.de/datenbankenlernen/
Algorithms:
https://www.learneroo.com/subjects/8
Excellent lecture series on Database Technology from Professor Jens Dittich
https://infosys.uni-saarland.de/datenbankenlernen/
Algorithms:
https://www.learneroo.com/subjects/8
Sunday, August 31, 2014
Thursday, August 28, 2014
Wednesday, August 27, 2014
Tuesday, August 26, 2014
Monday, August 25, 2014
Tuesday, August 19, 2014
Friday, August 15, 2014
Sunday, August 10, 2014
UI related: Bootstrap Snippets
Bootstrap Snippets like Login Form, Sign-in Form, User Profile etc
http://snipplicious.com/
http://snipplicious.com/
Sunday, August 3, 2014
Prezi.com - tool to create presentations
Website to create Presentations: https://prezi.com
Free option - presentations that we create will be public
Free option - presentations that we create will be public
Saturday, August 2, 2014
Tool to use when accessing Exchange email using a web-browser (Using Javascript Code in Bookmarks - Part II)
I created a small tool to use when accessing my company's Exchange email using a web-browser
STEP 0:
Drag the below link to your Bookmarks bar
Email Tool
STEP 1-3:
See below pic
STEP 0:
Drag the below link to your Bookmarks bar
Email Tool
STEP 1-3:
See below pic
Javascript related
http://casual-effects.blogspot.ca/2014/01/an-introduction-to-javascript-for.html
Another variation mutates the global namespace object:
Module
There are several ways of using functions to group state and implement module-like functionality. The simplest is to have modules be objects that contain functions (and constants, and variables...).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| use strict; var module = ( function () { // This cannot be seen outside of the module, so it will not create namespace function aPrivateFunction(z) { return Math.sqrt(z); } // Freezing and sealing are two ways to prevent accidental mutation of the // module after creation. return Object.freeze({ // These are accessible as module.anExportedFunction after the definition anExportedFunction: function (x, y) { return x + aPrivateFunction(y); }, anotherExportedFunction: function (x) { return 2 * x; } }); })(); |
Another variation mutates the global namespace object:
1
2
3
4
5
6
7
8
9
10
| use strict; // Use function to create a local scope and persistent environment ( function () { function aPrivateFunction(z) { return Math.sqrt(z); } // Mutate the global environment this .anExportedFunction = function (x, y) { return x + aPrivateFunction(y); }; this .anotherExportedFunction = function (x) { return 2 * x; }; })(); |
Subscribe to:
Posts (Atom)
Followers
Blog Archive
-
▼
2014
(134)
-
►
October
(10)
- "You're already doing TDD" written by david banham
- git in 2 minutes
- How to Solve Error:: VMware Workstation and Hyper-...
- How to register your phone for development for Win...
- Intro to d3.js
- Game development - Unity & C#
- Scott Hanselman - Scaling Yourself
- Hacker News API through Firebase
- Puzzle Driven Development
- Windows 10 Tech Preview on a VM
-
►
August
(13)
- HackerEarth.com
- Ruby: Metaprogramming related
- Rails: Deface related
- 'React' as an alternative to Angular, Knockout etc
- Hash Collisions
- Bootstrap tutorial
- Ruby, Rails related
- UI related: Bootstrap Snippets
- Prezi.com - tool to create presentations
- Tool to use when accessing Exchange email using a ...
- Javascript related
-
►
October
(10)