Log in

Tue, May. 11th, 2010, 10:50 am
mySQL versions and features

mysql 3.23 (retired)

* the first version where innodb tables were included and turned on by default
* partial support for inner joins
* later versions added partial support for outer joins
* no union support

mysql 4.0 (end-of-life)

* full support for union
* full support for inner and outer joins
* upgraded myisam tables to replace isam tables
* query cache

mysql 4.1 (end-of-life)

* added support for per-table character sets and collations (but you absolutely need to use a later release in this series because early versions had some evil problems with multibyte character set support in certain functions)
* better password hashing
* subqueries (early versions in the 4.1 series did not allow some clauses inside subqueries, like LIMIT. this restriction was eventually lifted.)
* spatial extensions
* clustering using the ndbcluster in-memory tables

mysql 5.0 (current stable release)

* added support for per-column character sets and collations
* stored procedures
* triggers (in early versions of the mysql 5.0 and 5.1 series, triggers could not refer to any data other than the row that caused the trigger or run non-deterministic procedures. in later releases, this restriction was lifted and triggers can run just about any query from any table, and just about any procedure.)
* views
* HUGELY improved replication
* INFORMATION_SCHEMA database added (allows access to database objects via standard SELECT statements)

mysql 5.1 (beta)

* horizontal partitioning
* event scheduling (like a built-in cron)
* XML data manipulation in VARCHAR and TEXT columns
* disk based clustering

Wed, Nov. 25th, 2009, 01:25 pm
perl one liners

# run contents of "my_file" as a program
perl my_file

# run debugger "stand-alone"
perl -d -e 42

# run program, but with warnings
perl -w my_file

# run program under debugger
perl -d my_file

# just check syntax, with warnings
perl -wc my_file

# useful at end of "find foo -print"
perl -nle unlink

# simplest one-liner program
perl -e 'print "hello world!\n"'

# add first and penultimate columns
perl -lane 'print $F[0] + $F[-2]'

# just lines 15 to 17
perl -ne 'print if 15 .. 17' *.pod

# in-place edit of *.c files changing all foo to bar
perl -p -i.bak -e 's/\bfoo\b/bar/g' *.c

# command-line that prints the first 50 lines (cheaply)
perl -pe 'exit if $. > 50' f1 f2 f3 ...

# delete first 10 lines
perl -i.old -ne 'print unless 1 .. 10' foo.txt

# change all the isolated oldvar occurrences to newvar
perl -i.old -pe 's{\boldvar\b}{newvar}g' *.[chy]

# command-line that reverses the whole file by lines
perl -e 'print reverse <>' file1 file2 file3 ....

# find palindromes
perl -lne 'print if $_ eq reverse' /usr/dict/words

# command-line that reverse all the bytes in a file
perl -0777e 'print scalar reverse <>' f1 f2 f3 ...

# command-line that reverses the whole file by paragraphs
perl -00 -e 'print reverse <>' file1 file2 file3 ....

# increment all numbers found in these files
perl i.tiny -pe 's/(\d+)/ 1 + $1 /ge' file1 file2 ....

# command-line that shows each line with its characters backwards
perl -nle 'print scalar reverse $_' file1 file2 file3 ....

# delete all but lines beween START and END
perl -i.old -ne 'print unless /^START$/ .. /^END$/' foo.txt

# binary edit (careful!)
perl -i.bak -pe 's/Mozilla/Slopoke/g' /usr/local/bin/netscape

# look for dup words
perl -0777 -ne 'print "$.: doubled $_\n" while /\b(\w+)\b\s+\b\1\b/gi'

# command-line that prints the last 50 lines (expensively)
perl -e 'lines = <>; print @@lines[ $#lines .. $#lines-50' f1 f2 f3 ...

Tue, Jun. 30th, 2009, 01:08 pm
Design Patterns summary

1. Strategy:

Defines a family of algorithms, encapsulates each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients who use it.


2. Decorator:

Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.


3. Factory Method

Define an interface for creating an object, but let the subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.


4. Observer

Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.


5. Chain of Responsibility

Avoid coupling the sender of a request to its receiver by giving more then one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.


6. Singleton

Ensure a class only has one instance, and provide a global point of access to it.


7. Flyweight

Use sharing to support large numbers of fine-grained objects efficiently. A flyweight is a shared object that can be used in multiple contexts simultaneously. The flyweight acts as an independent object in each context; it’s indistinguishable from an instance of the object that’s not shared.


8. Adapter

Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn’t otherwise because of incompatibility interfaces.


9. Façade

Provide a unified interface to a set of interfaces in a system. Façade defines a higher-level interface that makes the subsystem easier to use.


10. Template

Define a skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithms structure.


11. Builder

Separate the construction of a complex object from its representation so that the same construction processes can create different representations.


12. Iterator

Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.


13. Composite

Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.

14. Command

Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.


15. Mediator

Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and lets you vary their interaction independently.


16.  State

Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.


17. Proxy

Provide a surrogate or placeholder for another object to control access to it.


18. Abstract Factory

Provide an interface for creating families of related or dependent objects without specifying their concrete classes.


19. Bridge

Decouple an abstraction from its implementation so that the two can vary independently.


20. Interpreter

Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.


21. Memento

Without violating encapsulation, capture and externalize an object’s internal state so that the object can be restored to this state later.


22. Prototype

Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.


23. Visitor

Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.

Mon, Aug. 29th, 2005, 10:35 am

Koders script from http://www.koders.com/info.aspx?c=tools#Firefox

Wed, Jul. 27th, 2005, 12:41 pm
Puzzle from one old mail.

Write a mathematical function which can count the number of '1' s in the binary represenation of a whole number.
f(1) = 1
f(2) = 1
f(3) = 2
f(8) = 1

Write f(n). Remember it should be a mathematical function. Also, find for what n, f(n) = n.

Wed, Apr. 20th, 2005, 04:10 pm
Paint >NET

If you haven't the license for Photoshop :)


Thu, Mar. 24th, 2005, 12:05 pm
Javascript: Closing child window from a parent window.

The method, access the handler and do a .close(): http://www.webreference.com/js/tips/000515.html

A more detailed reference, not much new tho' : http://www.webreference.com/js/tutorial1/reference.html

Wed, Mar. 23rd, 2005, 11:42 am
Submitting forms to different ASP.NET page from one.

ASP.NET forms can't be submitted back to the same page unlike in Classic ASP.