Posts

Showing posts from June, 2011

It's abt Brain F**K

It was a Boring Saturday again :P So jus started exploring Brain F**K an awesome weird programming language It has got just 8 alphabets + - < > , . [ ] that's it :) This is like Maagi of programming languages :D . - Prints the current byte + - Increments the byte pointed to - - Decrements the byte pointed to < - Moves to previous byte > - Moves to the next byte [ - Executes the instructions until ] ] - Executes the instructions from [ until the current byte carries 0 , - getchar() U wanna know the C representation of Brain F**K char array[30000]; char *pointer; That's it :) It has a global array of size 30000 with a pointer pointing to it :) So I'm curious and tried this one +++++ +++++ [>+>+++++++ >+++++++>++ ++++++ >>+++. >+++.+++.>++++++. >>+++. ---- . >>>+[[-] ,.------- --- ] So now UR curious? Jus Click the link to Execute this 1. Copy past...

Crisps abt Design Patterns

Problems are hard solve more than that, our solution should not make our appln disobey OCP (Open to extensions and Closed to Modifications) but what if they have a quality solution pre-existing :) That's what design patterns are :P They are generic reusable solutions for commonly occuring problems in S/W Design Design patterns are of various categories if u wanna know them in detail follow the link below Design Patterns :) I was just going thro some of the most commonly used Design Patterns in PHP and I wish to give them all a small introduction Singleton: A common scenario for this is a LOG BOOK. We might be recording various events at various times. So, whenever we need to record something we ll be declaring an object for the log book class and will be WRITING using some member functions of it. But what if we want a "GLOBAL LOG BOOK" for entire appln? Then choose singleton patterns. This pattern allows instantiation of object for a class only once. For Furthe...

all* abt PHP OO :P *conditions apply :D

Hi Folks spent a day with PHP in action Book An awesome book for developers :) Wanna share some useful tips out of it 0. When ISA (Inheritance)? When HASA (Composition)? Only way to decide it is relationship if it is going to be 1:1 go for ISA 1:Many go for HASA :) Cool but true :) 1. Predict what would happen $object1 = new base(); $object2 = $object1; in PHP 4 a photocopy of present appearance of the object1 is copied to object2, any changes in object1 later ll not affect the latter :D in PHP 5 it means shallow copy :) jus the reference is returned to object2 so changes on former or latter ll reflect on latter or former too :D wanna do the PHP 5 way in PHP 4 then do $object2 = &$object1; Explicit way :) But this has the difference with the PHP5 way, in this jus the symbol table is adjusted (Clever no) :) 2. Can abstract functions be private? Don't scold me if u know the meaning of abstract class :D The answer is NOOOOOOOOO obviously :) Becaus...

Google Facebook Fun

Jus a funny fact to start with Jus Search for "Google" @ http://www.google/com and "Facebook" in the same :) Search results found for Google 10,490,000,000 But for facebook 13,410,000,000 :D