Monday, September 12, 2011

Mashroom Peas Alu curry

http://www.youtube.com/watch?v=weeSy4mfjJo

meen Kozhumbu

  • Shallots – 1 cup (or 1 large red onion)
  • Coconut – ½ a coconut
  • Tamarind – lemon size
  • Tomato – 1
  • Corriander powder – 4 Tbsp
  • Chilli powder – 2 Tbsp
  • Turmeric powder – ½ tsp
  • Salt
  • Fish – 750 gms
  • Fenugreek seeds
  • Curry Leaves
  • Sesame oil – 3 tbsp

Peel and chop the onions except 6 of the small onions. Is using a big onion chop it to medium size and reserve ¼th of them. Grind the coconut, tomato and the reserved onions to a fine paste. To this add the powders and grind again. Extract the tamarind juice and mix it with the ground paste. Clean the fish and rub it with turmeric powder and salt. Heat 2 Tbsp of sesame oil in a pan. Any oil can be used, in Tamil Nadu sesame oil is used to get a unique flavour. When the oil is hot add the fenugreek seeds (this gives a wonderful aroma) and add the curry leaves and onions and fry until the onions turns colour. Then add the ground paste with some water. This has to bubble of for atleast 20 mins. Use more water if the curry is thick. Then add the fish of your choice. King Fish goes very well for this recipe. Cook the curry till the fish is cooked. Pour over the remaining sesame oil on the curry and close it with a lid and enjoy. I have tried some other fish curry recipes as well, but none is as good as this one. The Kuzhambu taste even better the next day.

Saturday, June 11, 2011

Sunday, January 23, 2011

loading the cert/ keystore

setting the cert/keystore before service calls

System.setProperty("javax.net.ssl.trustStore", "C:/dev.keystore");
System.out.println(System.getProperty("javax.net.ssl.trustStore"));

Monday, January 10, 2011

Understanding JEXCEL : jxl


FAQ

http://jexcelapi.sourceforge.net/resources/faq/

Monday, December 27, 2010

TODO On PHP

1. stdclass
2. magic methods
3.Class/Object Functions.
4.namespace
5. overloading
6. comparing objects

Saturday, December 25, 2010

Php tit bits

Configuring logging in php :
1. open php.ini file located under XAMPP/xampp/php/php.ini
2. set the following attributes
display_errors
Log_errors
error_log



Global key word:
The variable declared global will be accessible through out the entire php and also other php files that are included . it will also be accessible inside function provided they are resolved using the global keyword

Session variables not getting propagated ?
Add the following line of code in all phps
session_start();

Understanding $this :
The methods in a class can be invoked in two modes one by creating an instance for the class and invoking the method through that instance. The second way would be invoke the method in static mode with out creating an instance. $this represents the instance on which the method is invoked. similar to the "this" key word in java. The difference being as shown in the example below

Class A {
variable data = "class A";
method tellClass() {
echo data;
}

}

Class B {
variable data = "class B";
method callClassA () {
A:: tellClass()

}
}

objB = new ClassB();
objB-> callClassA();

Output :
ClassB

Static keyword

1 . static variable can be accessed without creating an instance using the scope resolution :: operator
2. non static variables cannot be accessed using the scope resolution operation they can onlybe accessed by creating instances
3. non static functions can be accessed using the scope resolution operator. though this is deprecated. will raise E_STRICT warning
4. $this cannot be used inside a static function to resolve other static /non static variables. use 'self' ex self::$bar. Note self can only be used to access static properties you will not be able to access non static properties using 'self' keyword
5. You will have to use $this or the self keyword to access class level properties directly using the variable name will not resolve to the class level property.
6. non static variables cannot be accessed inside a static function
7. you will not be able to access static properties using an instance of the class. Note: though this will not result in an error the value will be empty/null
8. you can call a static function using an instance of the class.

Access Specifiers in PHP :
public : methods/properties can be accessed from all the classes through an instance.
protected : methods/properties can be accessed within the same class and also all the inherited classes
private: methods/properties can be accessed only with the same class

String :
1. single quoted string does not print the values of the variable in them. It will also print special characters as they are .

ex $data = "CAT";
echo ' this is the $data';
ouput:
this is the $data

2. double quoted stings prints the values of the variables in them. they also interpret escape sequences.

3. heredoc - <<<"label" : this is similar to double quoted string except that it prints ' " ' without any need for escape sequence

4. nowdoc - <<<'label' : this is similar to single quoted string except that it prints "' " without a need for escape sequence.

Thursday, November 11, 2010

Understanding Callback functions in Jquery

Callback and Functions

A callback is a function that is passed as an argument to another function and is executed after its parent function has completed. The special thing about a callback is that functions that appear after the "parent" can execute before the callback executes. Another important thing to know is how to properly pass the callback. This is where I have often forgotten the proper syntax.

Callback without arguments

For a callback with no arguments you pass it like this:

 $.get('myhtmlpage.html', myCallBack);

Note that the second parameter here is simply the function name (but not as a string and without parentheses). Functions in Javascript are 'First class citizens' and so can be passed around like variable references and executed at a later time.

Callback with arguments

"What do you do if you have arguments that you want to pass?", you might ask yourself.

Wrong

The Wrong Way (will not work!)

 $.get('myhtmlpage.html', myCallBack(param1, param2));


This will not work because it calls

myCallBack(param1, param2)

and then passes the return value as the second parameter to $.get()

Right

The problem with the above example is that myCallBack(param1, param2) is evaluated before being passed as a function. Javascript and by extension jQuery expects a function pointer in cases like these. I.E. setTimeout function.

In the below usage, an anonymous function is created (just a block of statements) and is registered as the callback function. Note the use of 'function(){'. The anonymous function does exactly one thing: calls myCallBack, with the values of param1 and param2 in the outer scope.

$.get('myhtmlpage.html', function(){
myCallBack(param1, param2);
});

param1 and param2 are evaluated as a callback when the '$.get' is done getting the page.




source :http://docs.jquery.com/Tutorials:How_jQuery_Works#jQuery:_The_Basics

Converting Jquery to DOM

Converting a jquery object o DOM object

var nodeObjsArray = $(".NodeClass").get();

The above script will fetch all DOM objects whose class name matches "NodeClass"
Note that it returns an array. To fetch each DOM element you will have to iterate through it. This hold good even if there is only one match you would get an array
with one DOM object in it


var nodeObjs = $(".NodeClass").get(0);

same as

var nodeObjs = $(".NodeClass")[0]


In the above script we are fetching the DOM object directly unlike the previous case

Converting DOM to JQuery Object

var domObj = document.getElementById("elementID");
var jqObj = $(domObj );

Reference
http://api.jquery.com/get/

Thursday, October 28, 2010

Setting up Env For PHP

Eclipse Settings:

1. Install Eclipse
2. In Eclipse help>InstallNewSoftware in the drop down select "All Available sites" -> under "programing language" select "Php Development tool" and install
3. In Eclipse click new > others > php project
4. In Eclipse click on the project created new > php file

XAMPP Settings :

1. Download XAMPP from http://www.apachefriends.org/en/xampp.html
2. Install XAMPP
3. Start XAMPP. Click on Start button against the apache on the XAMPP panel
4. It should show a green indicator with text "running" in it
5. try to hit this link http://localhost/ using the browser a XAMPP local home page should load if not your there is some problem with you apache start up

Apache start up error

1. If you do not see a green indicator with text "running" or you are unable to load the XAMPP home page using the http://localhost/ . your ports may be blocked.
2. Click on the Port-Check button on the panel. and see if port 80 is free or being used by some application. If its not free terminate the application using the port
3. Restart XAMPP and try step 1


XAMPP Config :

1. Navigate to the following installation path \xampp\apache\conf and open the httpd.conf search for attribute "DocumentRoot" and replace the path with the workspace path where the project resides . This has to be replaced at two places in the same file

Access Denied Error :

1. Navigate to the following installation path \xampp\apache\conf and open the httpd.conf search for attribute "DocumentRoot" and replace the path with the workspace path where the project resides . This has to be replaced at two places in the same file


Setting up Password for MySql:

1. Start MySql using the button on the XAMPP panel .
2. Click on the Admin button on the XAMPP panel.
3. Create Database using the phpMyAdmin ui
4. Set password for the DataBase created
5. close the browser . Navigate to the following installation path \xampp\phpMyAdmin
6. open file config.inc.php and change the following

'auth_type'] = 'http';
'AllowNoPassword'] = false;
provide the user/pwd details in the same file

7. Restart MySql and Apache using the XAMPP panel and click on the Admin button .
8. Provide the log in credentials to log into the database

Tuesday, October 19, 2010

Serializable

Code :>

Class A {
public string data;

}

Class B implements Serializable{
public ClassA objClassA
public String str
}

Class C {
//set values in objClassA
//set values in str
// tries to serialize class B
//print task complete

}

Output :>

java.io.NotSerializableException: Class A




----------------------------------------------------------------


Code :>

Class A {
public string data;

}

Class B implements Serializable{
public ClassA objClassA
public String str
}

Class C {

//set values in str
// tries to serialize class B
//print task completed

}

Output :>

Task complete

Monday, October 11, 2010

Jtest

# For "License Server Host", enter sjc-eng1-lic
# For "License Server Port", enter 2002 (it's the default)

Monday, September 6, 2010

manga pachadi

ngredients:

Raw magoes (skin removed and cut into 2 inch cubes ) – 4 cups

Jaggery – 1 cup

Salt – 1/4 tea spoon

Peanut oil – 1 tea spoon

Dry red chillies – 2

Coriander leaves – 1 Sprig

Mustard + Jeera seeds – 1/2 tea spoon

Asfoetida – 1 pinch




How to make it ?

In a thick bottomed vessel put the raw mango pieces and add 1/2 cup of water and cover it with a lid. Let it cook for 7- minutes or until the entire thing becomes mushy. Sprinkle the salt over it and add the jaggery now. In one or two minutes the jaggery will melt nicely and get blended with the mango. Give a taste and if u want it more sweeter add little more jaggery. Switch off the stove.

In a thick bottomed small vessel add the peanut oil and once hot add the mustard and jeera seeds. Once they pop add the asfoetida, curry leaves and split red chillies. Mix in low flame for 10 – 12 seconds and pur it over the mango mix. Mix well and serve with rotis or rice and dal.

Thursday, July 8, 2010

Log 4j appender issue

log4j:ERROR Attempted to append to closed appender named [null].

The above error results when you have the same appender type referenced multiple time in the same log 4j prop/xml file or across mulitiple prop/xml files.

Thursday, June 10, 2010

Vegetable Biriyani

Serves : 2

Ingredients :

Set 1:

Onion cut long - 1
tomato - 1
ginger - 1tbs
garlic - 1tbs
garam masala - 2 tbs
cinnamon for flavour
green chilly - 3
ghee

Set 2:
carrot chopped long - 2
cauliflower - half a cup
peas - half a cup
toasted bread - 2
potato - 1

coriander - for flavour fine chopped

Set 3
rice - 2 cups
wash the rice in water ; drain the water and let it dry for 15 mins.


Steps :

1. fry Set 1 in ghee
2. Add set2 and fry
3. Add rice and then water . rice to water ration is 1 :1.5
4. pressure cook for one whistle
5. before serving add toasted bread crumbs.




courtesy MOM :-)

Tuesday, June 8, 2010

Chicken Gravy

1. Marniate the chicken pieces with the ginger-garlic paste,poppy seed paste,turmeric powder,garam masala powder & salt.

2. Now, Heat the oil in a pan & add fennel seeds,c
innamon,cloves & bay leaves fry till gloden brown.

3. Then, add the chopped onion & fry till golden brown & add chopped tomato now and cook the tomato till the oil comes seperate from onion & tomato.

4. And now, add the marinated chicken,1/2 cup water & cook it for 15 to 20 minutes in medium heat.

5. After that add the coriander powder,chilli powder & curd.Cook this for 10 minutes in medium heat.

6. Garnish the chicken with the coriander leaves & keep the flame in low heat & close the pan for 5 minutes till the oil comes seperate from the chicken.

7. Serve the chicken with Rice,Roti,Puri & Paratha.




Courtesy :http://deepa-cooks.blogspot.com

Thursday, June 3, 2010

Ant Build Script

Setting property


<property name="component.version" value="1.0.01"/>



<property name="src.dir" value="./src"/>


Referring to a property

This prints the value set in the property dist.dir

<echo>${dist.dir}</echo>



Deleting a dir

<delete dir="${dist.dir}" verbose="false"/>



Creating a dir

<mkdir dir="${dist.dir}"/>



Thursday, May 27, 2010

Test pad : Regex

Make sure you select the chk box which says ("Regular Experssion") before you start processing your file


. . Any single character. Example: h.t matches hat, hit, hot and hut.
[ ] [ ] Any one of the characters in the brackets, or any of a range of characters separated by a hyphen (-), or a character class operator (see below). Examples: h[aeiou][a-z] matches hat, hip, hit, hop, and hut; [A-Za-z] matches any single letter; x[0-9] matches x0, x1, …, x9.
[^] [^] Any characters except for those after the caret “^”. Example: h[^u]t matches hat, hit, and hot, but not hut.
^ ^ The start of a line (column 1).
$ $ The end of a line (not the line break characters). Use this for restricting matches to characters at the end of a line. Example: end$ only matches “end” when it’s the last word on a line, and ^end only matches “end” when it’s the first word on a line.
\< \< The start of a word.
\> \> The end of a word.
\t \t The tab character.
\f \f The page break (form feed) character.
\n \n A new line character, for matching expressions that span line boundaries. This cannot be followed by operators ‘*’, ‘+’ or {}. Do not use this for constraining matches to the end of a line. It’s much more efficient to use “$”.
\xdd \xdd “dd” is the two-digit hexadecimal code for any character.
\( \) ( ) Groups a tagged expression to use in replacement expressions. An RE can have up to 9 tagged expressions, numbered according to their order in the RE. The corresponding replacement expression is \x, for x in the range 1-9. Example: If \([a-z]+\) \([a-z]+\) matches “way wrong”, \2 \1 would replace it with “wrong way”.
* * Matches zero or more of the preceding characters or expressions. Example: ho*p matches hp, hop and hoop.
? ? Matches zero or one of the preceding characters or expressions. Example: ho?p matches hp, and hop, but not hoop.
+ + Matches one or more of the preceding characters or expressions. Example: ho+p matches hop, and hoop, but not hp.
\{count\} {count} Matches the specified number of the preceding characters or expressions. Example: ho\{2\}p matches hoop, but not hop.
\{min,\} {min,} Matches at least the specified number of the preceding characters or expressions. Example: ho\{1,\}p matches hop and hoop, but not hp.
\{min,max\} {min,max} Matches between min and max of the preceding characters or expressions. Example: ho\{1,2\}p matches hop and hoop, but not hp or hooop.
\’ Matches either the expression to its left or its right. Example: hop\’hoop matches hop, or hoop.
\ \ “Escapes” the special meaning of the above expressions, so that they can be matched as literal characters. Hence, to match a literal “\”, you must use “\\”. Example: \<>