Monday, December 27, 2010

PostgreSQL

I have used MySQL for last 8 years. It is good database but still lucks few functionalities. Oracle bought Sun and it is not clear future of MySQL..

Alex Leo excellent lecture on PostgreSQL.. Including good explaination on partition, replication, sharding, indexing...

Семинар «PostgreSQL в высконагруженных проектах». Часть 1 from Alex Leo on Vimeo.



Семинар «PostgreSQL в высконагруженных проектах». Часть 2 from Alex Leo on Vimeo.

Wednesday, November 24, 2010

Being an early or later riser


  1. watch out

  2. crack of down - very early hour

  3. up at the crack of down

  4. stoop - area outside front doors

  5. ungodly hour - very early in the morning, too early

  6. turn over a new leaf - new phase to begin

  7. be in habit of something

  8. stay up - to be awake all night

  9. sleep-deprived very tired

  10. deprive - withholding something

  11. to make the switch

  12. night owl - awake very late at night

  13. early riser -person that gets up early

  14. a change man

  15. commendable - admirable

  16. the early bird gets the warm

Thursday, November 11, 2010

Jury Duty

Last Thursday 11/4/2010 went to Brooklyn court for jury duty. Got dismissed and waiver for 8 years :)

Sunday, October 17, 2010

The Last Jew


Place on hold the book in Brooklyn Public Library. I finished reading the book. The book is about inquisition and jews in Spain.
After reading the book, I got better understanding of jewish life in Spain in 14th century.

Saturday, October 9, 2010

purveyor

1. One that furnishes provisions, especially food.
2. One that promulgates something: a purveyor of lies.

Antagonist

Antogonist - An antagonist (from Greek ἀνταγωνιστής - antagonistes, "opponent, competitor, rival"[1]) is a character, group of characters, or an institution, that represents the opposition against which the protagonist must contend. In other words, 'A person, or a group of people who oppose the main character, or the main characters.'[2] In the classic style of story where in the action consists of a hero fighting a villain, the two can be regarded as protagonist and antagonist, respectively.[3] The antagonist may also represent a major threat or obstacle to the main character by their very existence, without necessarily actively targeting him or her.

Kitchen Confidential


The book about chefs, kitchens and restaurant business. I read this book on train.

Tuesday, October 5, 2010

Voice Mail greeting

I realized that voicemail greeting on IPhone was not set... Here is my new greeting

"This is (name). I'm currently unable to take your call. Please leave your name, phone number, and a brief message, and I will contact you as soon as possible. Thanks."

Sunday, October 3, 2010

SELF JOIN to delete from the same table

DELETE o FROM users u, uc_orders AS o JOIN uc_orders AS o1 ON o.order_id = o1.order_id
WHERE o1.uid = u.uid AND (u.mail like 'test%);

Wednesday, September 29, 2010

Posture

I would like to start fixing my posture. Plan?

Monday, September 20, 2010

CAAD9-5

I picked up CAAD9-5 bicycle from local bicycle store Roy's Sheepshead Cycle and went for 35 miles ride. The bike is much better compare to my previous and I'm very excited with my purchase.
Some images below:

Drinking the Kool-Aid

Today at work I heard the expression "Drinking the Kool-Aid". The meaning of it:

"Drinking the Kool-Aid" means becoming a firm believer in something: accepting an argument or philosophy wholeheartedly or blindly. The term originated with the Jonestown Massacre,[1][2][3] where members of the Peoples Temple were said to have committed suicide by drinking Kool-Aid laced with cyanide.

Sunday, September 12, 2010

Bicyle trips to Far Rockaway




Saturday and Sunday morning ride bicycle to Far Rockaway, Jamaica Bay, Howard Beach and back. 7 bridges total

Thursday, September 2, 2010

mysql to CSV file


SELECT * INTO OUTFILE 'result.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM my_table;

Saturday, August 7, 2010

Thursday, July 1, 2010

nepotism

nepotism |ˈnepəˌtizəm|
noun
the practice among those with power or influence of favoring relatives or friends, esp. by giving them jobs.
DERIVATIVES
nepotist noun
nepotistic |ˌnepəˈtistik| adjective
ORIGIN mid 17th cent.: from French népotisme, from Italian nepotismo, from nipote ‘nephew’ (with reference to privileges bestowed on the “nephews” of popes, who were in many cases their illegitimate sons).

Thursday, June 10, 2010

Set Default web browser for Mac OS X

Steps needed to change default browser:

  1. Start Safari

  2. Preferences

  3. General Tab

  4. Choose Default Web Browser

  5. Close the preferences window.

Quit Frozen Application on Mac

ps -A | grep {application}
kill -9 {process-id}

How to Kill a Mac OS X Application That Just Won’t Quit

Saturday, May 22, 2010

Happiness by Matthieu Ricard

I read the book twice. Mr. Ricard gives advice how to be happy. The book is the introduction to Buddhist.

Sunday, May 16, 2010

City of Thieves

City of Thieves by David Benioff is about World War II: siege of Leningrad, Nazi and jews and more.

Sunday, April 25, 2010

hermit

hermit - a person who has withdrawn to a solitary place for a life of religious seclusion.

benign

benign - being kind

Tuesday, April 20, 2010

Monday, April 19, 2010

Eating Animals by Safran Foer

Factory farming is main focus of the book. It's about how factory farming money machine "produce" animals. Safran Foer tell us why factory farming must be stop.

Btw: Interesting fact that Hitler was vegetarian.

Eating Animals link on amazon

Friday, April 2, 2010

Cohort

Cohort
In statistics and demography, a cohort is a group of subjects who have shared a particular experience during a particular time span[1] (e.g., people born in 1950; Irish women born in 1970; truck drivers who smoked between age 30 and 40). Cohorts may be tracked over extended periods of time in a cohort study. The cohort can be modified by censoring, i.e. excluding certain individuals from statistical calculations relating to time periods (e.g. after death) when their data would contaminate the conclusions

cohort

Monday, March 22, 2010

Ruby Notes


[Output]
"puts" writes to the screen with a carriage return at the end
"print" does the same thing without the carriage return

[Reading from the Console]
$name = STRDIN.gets

[Functions]
def welcome(name)
puts "hi #{name}" # "#{}" evaluate the variable
end


[Call Functions]
welcome("Mike") or welcome "Mike"

Extra arguments are gathered into the last variable if preceded with a "*"
def test(a=1,b=2,*c)

[Variable]
- Global variables start with '$'
- Class variables start with '@@'
- Instance variable start with '@'
- Local variables, method names, and method parameters start with lower case letter
- Class names, module names and constants start with uppercase letter
- Variable are composed of letters, numbers and underscrores
- Method Names may end with:
'?' - imply a boolean operation
'!' - imply something dangareous, like strings being modified
- __END__ on its own line with no white space, are ignored
- Lines between =begin and =end are ignored

[Collections]
- mystuff = %w{tivo nokia ipaq} # make a string array
- select # populates a new array with members which meet a criteria

[Loops]
for i in 1..4

[Regular Expressions]
- /a/ =~ # find first "a" and return position
- %r{a} =~ # same thing as above
- /p.r/ =~ # matches any character

[Blocks]
Blocks are nameless chunks of code that may be passed as an argument to a function.
def whereisit
yield
end
whereisit {puts "where is the money?" }


where is the money?

- each # iterated through each item of a collection
- detect # returns the first item matching a logical expression
- select # returns all items matching a logical expression
- collect # returns an array created by doing the operation on each element
- inject # is the reducer function in Ruby. "inject" loops over an enumerable and performs an operation on each object and returns a single value

[File I/O]
- Read File into a string:
file = File.new("myfile.txt")
mytext = file.read


- Read an entire file into an array of lines
lines = IO.readlines("data.txt")

- Read a file line by line
file = File.open("file.txt")
while line = file.gets
puts line
end
ensure
file.close # ensure that file is close
end

OR
IO.foreach("data.txt") { |line| puts line }


- Read only a few bytes at at time
require 'readbytes'
file = File.new("myfile.txt")
while bytes = file.readbytes(80)
print bytes+"\r\n"
end
file.close

Saturday, March 20, 2010

Dead Horse Bay

Today is beautiful whether. First hiking trip of 2010 was to Far Rockaway with the stop in Dead Horse Bay

Friday, March 19, 2010

Billy Elliot (Broadway)

I saw Billy Elliot Broadway Show yesterday.

The shows include politics, music and dancing. Good show. Recommend

Ruby: Classes vs. Module

"Ruby Modules are similar to classes in that they hold a collection of methods, constants, and other module and class definitions. Modules are defined much like classes are, but the module keyword is used in place of the class keyword. Unlike classes, you cannot create objects based on modules nor can you subclass them; instead, you specify that you want the functionality of a particular module to be added to the functionality of a class, or of a specific object. Modules stand alone; there is no "module hierarchy" of inheritance. Modules is a good place to collect all your constants in a central location."

Require
require and load take strings as their arguments
[require "sinatra"]
[load "bicycle.rb"]


Include
accpet any number of Module objects
[include Enumerable, Comparable]

Every class ia a module, the include method does not allow a class to be included within another class.

Can mix in more than one module in a class. However, a class cannot inherit from more than one class.
Class names tend to be nouns, while module names are often adjectives.

Source #1
Source #2

Wednesday, March 17, 2010

bg, fg, ^Z, ^C

CTRL+Z (or ^Z) - suspend or stopped. To list of jobs and their state by running jobs -l.
CTRL+C (or ^C) - kill the process

bg - background
fg - foreground
jobs -l => lists jobs in background

+ flag on the output of jobs -l indicates the current job and the - flag indicates the previous job.
The %% and %+ names refer to the current job while %- refers to the previous job.

More Info: More Jobs

Tuesday, March 16, 2010

vim remove duplicate lines

g/^\(.*\)$\n\1/d

TR (bash)

Can use tr to remove all carriage returns and Ctrl-z ( ^Z ) characters from a Windows file by entering:

tr -d '\15\32' < winfile.txt > unixfile.txt

tr '\r' '\n' < web_to_print_compare-edited.csv > unixfile.csv


Note: cannot use tr to convert a document from Unix format to Windows

Thursday, March 11, 2010

sort and remove duplicates in file

sort and uniq will quickly and easily remove duplicates, lsit only the dupilcates or only the unique data.

sort myfile.txt | uniq

Wednesday, March 10, 2010

Metaphone or Double Metaphone

Methaphone / Double Metaphone is an algorithm to match words that are spelled differently, but sound the same. Its useful for avoiding duplicated names in a database.

VIM helpful commands

:sort u (remove duplicate line)
:g/pattern/d (delete line)
:g/^$/d (delete blank lines)
:%s/.*/\U&/ (UPPER CASE)
:%s/.*/\L&/ (LOWER CASE)

Friday, March 5, 2010

same origin policy

Aa web page served from domain1.com CANNOT normally connect to or communicate with a server other than domain1.com

POST


  • POST is safer than GET

  • No restrictions in size

  • No Format restrictions. Binary data is also allowed.

  • The browser ussually alerts the user that data need to be resubmitted.

  • multipart/form-data or application/x-www-form-urlencoded

GET


  • GET is less secure compared to POST

  • Data in the URL and URL length is restricted

  • GET requests are re-executed (Back button/re-submit behavior)

  • Only ASCII characters allowed

  • application/x-www-form-urlencoded

Tuesday, March 2, 2010

lads

a male person of any age between early boyhood and maturity.
Dicrionary: Lads

Friday, February 5, 2010

ergo

A Latin word meaning "therefore." In logic, ergo means the conclusion of a preceding argument.

Wednesday, January 27, 2010

Increase Load on Linux/Unix for testing purposes

[1]
echo "9999999999^999999" | bc
Performing calculation of large numbers. Heavy on CPU usage

[2]
- tool to impose load on and stress test systems
Example: stress --cpu 8 --io 4 --vm 2 --vm-bytes 4000M --timeout 30s
To install package on Unbuntu 9.10: apt-get install stress

ROFL

ROFL is an internet accronmym for Rolling On Floor Laughing
Urban Dictionary

Tuesday, January 26, 2010

notoriuos

–adjective
1. widely and unfavorably known: a notorious gambler.
2. publicly or generally known, as for a particular trait: a newspaper that is notorious for its sensationalism.
Dictionary

Wiki

Twiki:
http://twiki.org/

DokuWiki:
http://www.dokuwiki.org/dokuwiki

Monday, January 25, 2010

Antagonism

Antagonism is hostility that results in active resistance, opposition, or contentiousness.
http://en.wikipedia.org/wiki/Antagonism

Roger Wilco

Raining Morning in NY. Alec answer email as follows "Roger Wilco". Hm.. Who is Roger Wilco?

Roger Wilco - A phrase from two-way radio. It combines "Roger" (meaning "Received") and "Wilco" (meaning "will comply"

Sunday, January 24, 2010

verbatim

–adverb
1. in exactly the same words; word for word: to repeat something verbatim.
–adjective
2. corresponding word for word to the original source or text: a verbatim record of the proceedings.
3. skilled at recording or noting down speeches, proceedings, etc., with word-for-word accuracy: a verbatim stenographer

Best Classic Songs

I was listening opera yesterday and decide to come up with the list of best classic songs. Here they are:

Sunday, January 17, 2010

Netflix

I cancel my Netflix membership about 5 years ago. At the beginning of the new year - got it back.
It's really good service for that price. Watched "Lie to Me" (2 seasons). The show is about body language - person reaction on different things. Good acting and interested science.

Monday, January 4, 2010

DAWG - Directed acyclic word graph

DAWG - http://en.wikipedia.org/wiki/DAWG
Data structure solve anagrams (scrablle)