Tuesday, June 16, 2009
No plastic in kurkure
http://www.kurkure.in/FAQ.aspx
This url is from kurkure and in FAQ b. they have cleared it that kurkure doesn't contain plastic. Please just do a little search on internet before forwarding these kind of false mails.
Virat
Checking javascript using ie adressbar without file
I was surfing through the net and i there i tried to copy one url which was something like
http://music.guruji.com/redirects/mp3Redirect.php?target=%20http%3A%2F%2Fmobiblaze.mobiblaze.com%2FCompressed%20Mp3%2Fhindi%20mp3%2FN%2Findex.php%3Fdir%3DNew%20York%2F%26file%3DHai_junoon_%28remix%29_kk.mp3
now in this url i am not able to read the actual redirected url at first attempt as i have to unescape this url no make it human readable. I so recalled that i use to alert the javascript variable values from address bar at workplace.
so i tried this in addressbar javascript:alert(unescape("string to unescape"));
and it worked like charm. And if some want to read more complex examples one can visit.
http://mikeoff.blogspot.com/2006/07/javascript-in-address-bar.html
Virat
Sunday, June 14, 2009
My Scuba dive at Thailand and info about places to dive in india
I was thinking about writing this from long time, now i got a little bit time so here it is. I did scuba diving first time this year at Pattaya, Thailand alng with my brother. We booked a diving tour from padi instructor. It cost us some 4000 bhat[nearly Rs 6000] for 2 person [each 2 Dive]. They picked us from our stay next morning around 9 AM.
Some 30 minute later we were at the diving location already decided by our tour operator. There they told us about some theory about how to dive and what are the symbols we use underwater. What we will be doing there they some practice out side about balancing the pressure underwater. Yes this is very imp. i can tell from my experience, As one need to balance the water pressure with the body through ears and if one has cold please don't dive. I know how painful it can be if you are not able to balance the pressure (will tell you how that can be). We were five to dive that day 1 Dive instructor ,2 Dive buddies and we 2 brothers. Two dives were already planned for 45 minutes each. At first dive we learnt how to tell your dive buddy about oxygen outage,how to clean water from the eye glass, how to throw water out of mouth without removing the gas supply and use of the symbols. This dive was gr8 in overall learning and experiencing the underwater world.
For next dive we plan to just enjoy the sea life during full dive period. So no more learning only enjoyment. We didn't carry our digital camera on this dive as we were having a normal digicam and we were not sure how to carry it underwater [Later when we were doing some shopping we saw some plastic covers for digicam :( ]. Anyway we asked our tour operaor about clicking the images underwater trust me that doesn't worth because those image were so blur and low quality that i can't post those images here. Anyway we went for the dive with keeping in mind that atleast we should enjoy the dive. And here things started to get messy for me because my dive buddy was quiet novice and he took me down very fast, so fast that i wasn't able to balance the pressure and it was a great pain in my brain vains. anyway my dive instructor was quiet experienced that he figured out that something is wrong and he came behind us and took me up carefully and later he carried my dive buddy also :) . Anyway this wasn't that scary as it seems overall the dive was worthy and i would like to go again for diving. So i started searching where i can do diving in india. So here are some of the places in india where one can dive.
Goa [barracudadiving.com]
Netrani Island, Karnataka (near Goa) [ one can book dive from goa for netarni]
Lakshadweep [lacadives.com]
Andaman Nikobar [diveindia.com & diveandamans.com]
As i heard from people diving in Goa is not much great exp. as water is not clear but i heard there is a shipwreck which i feel will be pleasent to see. Along with that netrani and pigeon island also might be good places to dive. check this link http://www.barracudadiving.com/courses.htm for cost of the courses. I never had and discussion about lakshadweep and andaman scuba diving but i feel those should be much costly and much exciting than the goa's scuba diving.
Some important things before you go for scuba diving
1. Never dive alone
2. Don't touch anything underwater untill your dive instructor tells you to do so.
3. Don't dive if you have cold, going through heavy medication, have recently faced surgery, just came from a flight or about to catch one.
Virat
Friday, June 12, 2009
Checking camera used for clicking image
Two days back i was in discussion with one of my frd that how to confirm when image was taken which camera was used for clicking that image. After one hour of search i was able to find out some easy ways to do so. Actually this information for which we are looking for is stored in the image at metadata part and called Exif data for the image. Now a days this information is kept in the images from nearly all cameras in world. One can use following link for getting that info from images
http://camerasummary.com/ [For online check]
http://www.sentex.net/~mwandel/jhead/jhead.exe [For checking on desktop]
viewing this information is much easier in WinXP Without using any extra software. Check screen shot given below
Ok there are some other ways also with even using any specific software. One can open the file with notepad or anyother file openning software. And by reading some specific locations which were easily indentified by vieweing them. just have a look on below image as understanding depends on computer knowledge i left it on you. which mode you choose to open the file. yellow ring tell camera make. red ring tells camera model and pink rectangle tells the date image is taken.
Virat
Tracking ip using email, tracking email
Actually today when i was chatting to one of friend i got one request from XYZ@gmail.com to add as friend at Gtalk. I accepted that And then started i got some nude images from that XYZ. Now when i was getting these mails i was thinking to figure out who (s)he is ???
i tried to check the mail header but as everyone knows that google removes the sender information from the mail header so hopefully i didn't find any thing useful there. Now the real mystery begins but after one minute thinking i got fairly simple idea. i have one server for http://abc.com there i kept one image and then i embedded the link of that image in my email and sent to the XYZ@gmail.com and bingo!!! as soon as that fellow opened the mail i got the IP on my server's Access log and i know with whome i am dealing with. :)
One can get the server access log location at win server using following steps:-
1. type %SystemRoot%\system32\inetsrv\iis.msc in run box
2. then right click on default website
3. then at website tab check the enable logging option
4. then click on the properties in that option. which will open a new dialouge.
5. now in this new dialouge box one can see the log path. and just below the path log file name is also provided.
Now once you got the current log file open that
#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2009-01-29 20:25:04
#Fields: time c-ip cs-method cs-uri-stem sc-status
20:25:04 127.0.0.1 GET /images/12n2ous7jwh9x16dfo51.jpg 404
20:25:04 127.0.0.1 GET /images/usgeacviq89qexvvu3gd.jpg 404
here i have 127.0.0.1 as IP but once user open the mail you will get that same ip in log.
Virat
Wednesday, April 1, 2009
Group By on DataSet using DataView
public static DataTable GroupBy(DataTable table, string[] aggregate_columns, string[] aggregate_functions, Type[] column_types, string[] group_by_columns)
{
DataView view = new DataView(table);
DataTable grouped = view.ToTable(true, group_by_columns);
for (int i = 0 ; i < aggregate_columns.Length ; i++)
{
grouped.Columns.Add(aggregate_columns[i], column_types[i]);
}
foreach (DataRow row in grouped.Rows)
{
List <string> filter_parts = new List &l;string> ();
for (int i = 0; i < group_by_columns.Length; i++)
{
filter_parts.Add(string.Format("[{0}] = '{1}'", group_by_columns[i], row[group_by_columns[i]].ToString().Replace("'", "''")));
}
string filter = string.Join(" AND ", filter_parts.ToArray());
for (int i = 0; i < aggregate_columns.Length; i++)
{
row[aggregate_columns[i]] = table.Compute(aggregate_functions[i], filter);
}
}
return grouped;
}
And you should use something like
string[] column_names = new string[] { "number", "avg_price", "total" };
string[] column_functions = new string[] { "count(products)", "avg(price)", "sum(charge)" };
Type[] column_types = new Type[] { typeof(int), typeof(decimal), typeof(decimal) };
string[] group_by = new string[] { "order_id" };
DataTable grouped = GroupBy(data, column_names, column_functions, column_types, group_by);
Which will be the equivilant of the SQL command:
select order_id, count(products) as number, avg(price) as avg_price, sum(charge) as total from data group by order_id
it may need some extra handling to account for DBNull values in the columns that you are grouping by.
Synchronous process execution from VC++
Following is the Sample code for executing a process in VC++ synchronously. We can use System command also but that display a command propmt flash also. To avoid command prompt flash i have used earlier ShellExecute API but that runs a process Asynchronously.
ShellExecute(NULL,NULL,"C:\\Test.exe","Test Argument Param",NULL,SW_HIDE);
ShellExecute just returns the value 42 [If it fails return value is suppose to be <= 32] and program execution proceed to next line of code. This can create problem when one want ShellExecute to complete it's processing before it go to next line of code in program. Following is the solution i implemented for the same after avoiding ShellExecute and ShellExecuteEx APIs.
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW; // For enabling custon flags e.g. wShowWindow
si.wShowWindow = SW_HIDE; // For hiding the window of application
ZeroMemory( &pi, sizeof(pi) );
if (!CreateProcess( "C:\\Test.exe"," Test Argument Param",NULL,NULL,FALSE,0,NULL,NULL,&si,&pi))
{ printf("%s\n","ProcessFailed"); }
WaitForSingleObject( pi.hProcess, INFINITE ); // Wait until child process exits.
CloseHandle( pi.hProcess ); // Close process and thread handles.
CloseHandle( pi.hThread );
Please do comment if need anything furthur.