Saturday, April 19, 2008

Worlds largest Varpu in Cochin

The worlds largest varpu is in this shop in Kochi.

Monday, April 14, 2008

The wonderful world of server side programming

Server side programming is wonderful as it provides access to lot of resources that client side scripts cant dream of...Database access, files to read and write to, mail programs and other applications on the server...

But Server side scripts are notorious for there slow speed of execution also.So its always a combination of both that triumphs.. Here is a imple perl script to print hello world... and since its a serebvr side script.. after printing "Hello world" it realises that it has entered the world wide web and prints "Hello web" :)

#!/usr/bin/perl
print "Content-type:text/html\n\n";
$first="Hello World";#scalar variable
print $first;
print "<br >";#line break
substr($first,7,10)="eb";#realisation
print $first;

Friday, April 11, 2008

Passing values between Javascript and Vbscript

Very few applications are using Vbscript, but lot of old code exsists that use Vbscript. So its not very difficult to run into a situation where values have to be passed from one to the other. First i was thinking of using a hidden text box to pass values between the two... but its much easier. You can call variables from both, meaning variables are not specific to the scripting langauge as both are client side scripting langauges.

See the following code:

<html>
<body>

<script>
jvalue=confirm('Pass a value to Javascript');
</script>

<script type="text/vbscript">
document.write(lcase(jvalue))
<!--javascript variable used in Vbscript function -->

vvalue=ucase("vbscript here")
</script>

<script>

alert(vvalue)
</script>
<!--Vbscript variable used in Javascript function -->

<input type='hidden' name='passval'>

<!--no need of hidden text box-->

</body>
</html>


This example shows how one can use variables from javascript in vbscript and also vice-versa.
The situation is very different when values are to be passed between a client side script and a server side script.

Raganatitu bird santury-- yet to identify the birds

bird srirangapatanam
Ranganatittu

cranes rangantitu

Cranes


Thursday, April 3, 2008

Hard coding username and password

If you are thinking of hardcoding username and password.. pls dont do it. Here are some sane reasons not to do it:
  1. When the password expires, its got to be reset...if its hard coded, they have got to search where the elusive password has been coded. Add to this the fact that the password will be encrypted and hardcoded---they have to break the code to get to the password...
  2. Code is not the place to put ur passwords in.. For example i know of a very widely used business application which will work only with the vendor provided software....so how secure is your application?
  3. Hard coded paswords cant be changed with changing employes. So you never know..

Ok even after this if you want to hard code the password... please make sure you comment your code properly...

Sunday, March 9, 2008

Capuccino coffee

Leaf design on the coffee. It was capuccino coffee.capuccino cofeeAnd some funny new street lights that hey came up at the new lamp company.




Saturday, March 8, 2008

Cows and bulls practical

The correct guess to try in the practical version of cows and bulls encrypted is 6598. the number of cows and bulls are displayed in the alert box. The logic is simple....the RSA public key cryptography is used with a preset key of 17 and 3233. The example is taken right out of wikipedia. The guesses that are entered are taken and there position is appended to it(i.e, 1,2,3 and 4). This value is then encrypted and compared with the values stored in arrays 'a' and 'b', a has the values that are bulls and b has all the cows. The values are given below:
bulls
64-1577
53-652
92-2762
81-1485
cows
63-2909
62-1162
61-178
54-1978
52-3094
51-2985
94-205
93-456
91-3157
84-1820
83-3185
82-2661
The game in practicallity would have to have more number of such encrypted arrays. One of them would have to be choosen randomly. However, the randomess doesnt need to be hidden.If a higher degree of encryption is needed, the keys can be changed and the arrays and the function that is used to encrypt can be changed at the server side when the javascript is generated.