Thursday, February 28, 2008

Cross domain Ajax call

The JSONP approach is necessitated, as I mentioned by the browsers' SOP (Same-origin policy) which prohibits XMLHttpRequests from crossing domains.

There are three ways to make cross domain calls
1. Using Local Proxy : We send the request to another service side page(like php,jsp etc) that makes a request from the server to the web service. But this ultimately result in double bandwidth and latency
2. Flash : NEED Flash
3. Script tag (JSON with Padding. JSONP approach) injection: I am only left with this approach of creating script tag dynamically and setting src attribute to a web service API call. It can be considered as security risk.

Yahoo Using same approach
Article: http://developer.yahoo.com/common/json.html#callbackparam
Example request: http://api.local.yahoo.com/MapsService/V1/geocode?appid=dantheurer&location=la&output=json&callback=getLocation

Delicious is also using JSONP approach
http://feeds.delicious.com/feeds/json/bob/javascript+hack?jsonp=delicious_callbacks%5B12345%5D

Google also uses same approach. I read it in this thread.
http://groups.google.com/group/Google-Maps-API/browse_thread/thread/1e1cecf679dd7c5a
So, google api also uses JSONP(i.e the same script tag hack) approach

Labels: ,

Post a Comment(0 comments)

Friday, February 22, 2008

Genuine Windows Validation Test

Have you ever thought how Microsoft perform test to find weather copy is genuine or not......

good guess!!!!! one and only LOGIC registry :)

Hardest LOGIC they can ever think

they find the Product key from registry and compare with "V2C47-MK7JD-3R89F-D2KXW-VPK3J" if matches
validation fails

then they fixed it:(

BUT by adding another key "FCKGW-RHQQ2-YXRKT-8TG6W-2B7Q8"

then "Q6TD9-9FMQ3-FRVF4-VPF7Y-38JV3"

Finely they come up with solution :(


by keeping and updating database of pirated keys :) LOL

so if you know any single product key which is not in their database you can make your copy original

More info
Post a Comment(0 comments)

Handle Active Tab and Screen Capture in IE6 & IE7

SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass();

IntPtr activeWindowHandle;
mshtml.IHTMLDocument2 myDoc;
mshtml.IHTMLDocument3 myDoc1;
activeWindowHandle = GetForegroundWindow();
IntPtr myIntptr = activeWindowHandle;
int hwndInt = myIntptr.ToInt32();
IntPtr hwnd = myIntptr;
IntPtr hwnd1 = IntPtr.Zero;
hwnd = GetWindow(hwnd, GW_CHILD);
StringBuilder sbc = new StringBuilder(256);
IEnumerator windows = new SHDocVw.ShellWindowsClass().GetEnumerator();
while (windows.MoveNext())
{
if ((windows.Current is SHDocVw.IWebBrowser2) && ((windows.Current as SHDocVw.IWebBrowser2).HWND.ToString() == activeWindowHandle.ToString()))
{
((windows.Current as SHDocVw.IWebBrowser2).Document as IOleWindow).GetWindow(out hwnd);

if (IsWindowVisible(hwnd))
{
break;
}
}
}
myDoc = ((windows.Current as SHDocVw.IWebBrowser2).Document as mshtml.IHTMLDocument2);
myDoc1 = ((windows.Current as SHDocVw.IWebBrowser2).Document as mshtml.IHTMLDocument3);

Labels:

Post a Comment(0 comments)

Find Actice TAB in IE7

if (sbc.ToString().IndexOf("TabWindowClass", 0) > -1)
{
StringBuilder childsb = new StringBuilder(100);
IntPtr hChildWnd = GetWindow(hwnd, GW_CHILD);
while (IntPtr.Zero != hChildWnd)
{
GetClassName(hChildWnd.ToInt32(), childsb, 100);

if (childsb.ToString().Contains("Shell DocObject View"))
{
IntPtr visWin = FindWindowEx(hChildWnd, IntPtr.Zero, "Internet Explorer_Server", IntPtr.Zero);
if (IsWindowVisible(visWin))
{
hwnd = visWin;
break ;
}

}
hChildWnd = GetWindow(hChildWnd, GW_HWNDNEXT);
}

Labels:

Post a Comment(0 comments)

Get inner browser window in IE6 and IE7

int hwndInt = myIntptr.ToInt32();
IntPtr hwnd = myIntptr;
while (hwndInt != 0)
{
hwndInt = hwnd.ToInt32();
GetClassName(hwndInt, sbc, 256);

if (sbc.ToString().IndexOf("TabWindowClass", 0) > -1)
{
hwnd = FindWindowEx(hwnd, IntPtr.Zero, "Shell DocObject View", IntPtr.Zero);
hwnd = FindWindowEx(hwnd, IntPtr.Zero, "Internet Explorer_Server", IntPtr.Zero);
break;
}

else if (sbc.ToString().IndexOf("Shell DocObject View", 0) > -1)
{
hwnd = FindWindowEx(hwnd, IntPtr.Zero, "Internet Explorer_Server", IntPtr.Zero);
break;
}
hwnd = GetWindow(hwnd, GW_HWNDNEXT);
}

Labels:

Post a Comment(0 comments)

Wednesday, February 20, 2008

AMR to mp3

Here is a code that you can use to convert AMR file to various other files:

Pre-requisites

Emerge sox, Vorbis-tools and lame. Build the the 3GPP reference converter files (compiled with these changes: make file without -DETSI and add #include "sp_dec.h" to decoder.c).

Convert AMR to OGG Vorbis

File: /usr/local/bin/amrtoogg

#!/bin/bash
 
# By Aquarion - Aquarion@Aquarionics.com
# Do what you want with it, it's not rocket science.
 
##Change these:
#Wherever you put encode and decode when you compiled them:
CODEC=/usr/local/bin
 
#Temporary directory. Chances are you've already got this set
TEMP=/tmp
 
#Where do the final MP3s go?
FINAL=/home/user/media/siemens/ogg
 
for file in *.amr; do 
        FILE=`echo $file | sed -e "s/.amr//"`; 
        echo -n "$FILE [AMR] -> [RAW]"
        $CODEC/decoder $file $TEMP/$FILE.raw > log.std 2> log.err; 
        echo -n " -> [WAV] "
        sox -r 8000 -w -c 1 -s $TEMP/$FILE.raw -r 44100 \
               -w -c 1 $TEMP/$FILE.wav > log.std 2> log.err; 
        echo -n " -> [OGG] "
        oggenc $TEMP/$FILE.wav -q 5 -o $FINAL/$FILE.ogg --quiet \
               -t "$FILE" -a "Sanda" -l "Anul nou" -d `date +%Y`
        echo  " :-) "
        rm $TEMP/$FILE.wav;
        rm $TEMP/$FILE.raw;
done

Convert AMR to MP3

File: /usr/local/bin/amrtomp3

#!/bin/bash
 
# By Aquarion - Aquarion@Aquarionics.com
# Do what you want with it, it's not rocket science.
 
##Change these:
#Wherever you put encode and decode when you compiled them:
CODEC=/usr/local/bin
 
#Temporary directory. Chances are you've already got this set
TEMP=/tmp
 
#Where do the final MP3s go?
FINAL=/home/user/media/siemens/mp3
 
for file in *.amr; do 
        FILE=`echo $file | sed -e "s/.amr//"`; 
        echo -n "$FILE [AMR] -> [RAW]"
        $CODEC/decoder $file $TEMP/$FILE.raw > log.std 2> log.err; 
        echo -n " -> [WAV] "
        sox -r 8000 -w -c 1 -s $TEMP/$FILE.raw -r 44100 \
               -w -c 1 $TEMP/$FILE.wav > log.std 2> log.err; 
        echo -n " -> [MP3] "
        lame $TEMP/$FILE.wav $FINAL/$FILE.mp3 --preset standard --silent \
               --tt $FILE --ta Sanda --tl Anul\ Nou --ty `date +%Y`
        echo  " :-) "
        rm $TEMP/$FILE.wav;
        rm $TEMP/$FILE.raw;
done

Labels: , ,

Post a Comment(0 comments)

Microsoft DreamSpark - Get free microsoft softwares

"DreamSpark is simple, it's all about giving students Microsoft professional-level developer and design tools at no charge so you can chase your dreams and create the next big breakthrough in technology - or just get a head start on your career. "

But it doesn't work for India at all. Only China is listed in Asia.

Microsoft DreamSpark
Post a Comment(0 comments)

Free Good Icons

Post a Comment(0 comments)

Step by Step example - All manual

"You might have encountered interactive demos created with screencasting and screengrabbing software that explain an interface to users in a step-by-step manner. This is exactly what this script does for web sites.

When you loaded this page and all went well you'll have seen the examples, download and first paragraph section being highlighted and a small panel with information showing up in succession. This is done with this script."


Step by Step uses the Yahoo User Interface library, and pulls in most of its dependencies automatically


Step by Step example - All manual
Post a Comment(0 comments)

Tuesday, February 19, 2008

Images to index in search engines

Graphic and flash images are no doubt attractive to the eye, and are pleasing to look But did you know that search engines do not index them at all?

Here’s a method you can use to get all of your images and artwork indexed by the search engines:

Just make sure you include the “alt” tag in your img src tags. It’s as simple and helpful ! !!!

Labels: ,

Post a Comment(0 comments)

JavaScript Libraries

There are some good options available for JavaScript framework and it become harder to decide which JavaScript framework to use.

Here is the comparison of the open source framework. May be this would be helpful for some of you.

Source:
http://www.lostechies.com/blogs/sean_chambers/archive/2007/12/16/choosing-a-javascript-framework.aspx


http://www.ja-sig.org/wiki/display/UP3/Javascript+Toolkit+Comparison


http://www.sitepoint.com/article/javascript-library


http://junal.wordpress.com/2007/10/16/comparing-scriptaculous-
jquery-mootools-and-yui/



http://www.zenperfect.com/2007/08/11/javascript-frameworks-compared/


http://www.zenperfect.com/2007/08/11/javascript-frameworks-compared/



http://www.zenperfect.com/2007/08/11/javascript-frameworks-compared/


http://wiki.freaks-unidos.net/javascript-libraries#comparison-chart


http://wiki.freaks-unidos.net/javascript-libraries#comparison-chart

Here is the screenshot of what others result shows.













Labels: , ,

Post a Comment(0 comments)

Sunday, February 17, 2008

CookThink - I like the both, design and website idea



"There is absolutely no shortage of recipe sites on the web with often very little between them. Along with the rich search and feature set, Cookthink promises that every recipe on the site has either been tested in-house or by one of the members of the “Cookthinktank,” a confederation of food bloggers and cookbook authors whose recipes are searchable at Cookthink. Basically they aren’t suggesting recipes that haven’t been tested by someone related to the site."

Labels: ,

Post a Comment(0 comments)

Saturday, February 16, 2008

Lowest Priced Notebook

India's third largest PC vendor Acer India has broken the laptop price barrier by launching the cheapest entry-level notebook - Aspire 3680 series - at Rs 19,999.

Acer claimed Aspire 3680 series is the lowest-priced notebook from a major MNC vendor and is targeted at offering the common man with complete computing technology at an affordable price.

Acer Aspire 3680 series uses a Celeron M 430 (1.73 GHz) and above; system memory of 256 mb; and a 14.1" widescreen and combo drive, but runs on Linux operating system.

http://infotech.indiatimes.com/Personal_Tech

Labels: ,

Post a Comment(0 comments)

Free royality free images

Post a Comment(0 comments)

FaceBook Like Input Box

Post a Comment(0 comments)

Stoneware webOS - Demo Windows XP Interface




Simlar to the one we were trying to do. But this one is much more polished.

Remember www.osonweb.com

https://webnetwork.stone-ware.com/servlet/com.stoneware.servlets.LoginServlet?loginName=xpuser&password=stoneware

Labels:

Post a Comment(0 comments)

Wednesday, February 13, 2008

File format supported by flash and quicktime

Flash can handle many of the major audio formats available, including the more common formats listed here:

MP3,WAV,QTA,MOV,AIFF

The following file formats are supported QuickTime 7 is installed:


AMR, AIFF, WAV, DV,MP3,AVI, MOV, WMV , ASF

Labels: ,

Post a Comment(0 comments)

Tuesday, February 12, 2008

Catalog name overwriting (SqlServer)

For generated code by llblgen Tool, it can sometimes be necessary to use the generated code with a catalog with a different name than the catalog the project was created with. As LLBLGen Tool generates the catalog name into the code, it might be necessary to specify a way to rename the catalog name in the generated code at runtime with a given name. LLBLGen Pro supports multiple catalogs per project, so you can specify more than one rename definition.LLBLGen Tool offers a way to rename multiple catalogs in one go. The renamed data is stored in static hashtables which assure that the Dynamic Query Engines (DQE) for SqlServer and Sybase ASE use the right catalog names without losing any performance.

To setup the renaming of catalogs, follow these steps.

1: In the configuration tag in the .config file has to be the configSections tag. In there, place a section definition tag as shown in the example below:

ionHandler" />


2: Set New Catalog Name

Note :

For ASP.NET applications, the section declaration has to contain in the type attribute the full type with version and culture, otherwise you'll get an exception at runtime. The specific type declaration is specific for the .NET version you're using and you can find examples how to specify it from the

machine.config file in %WINDIR%\Microsoft.NET\Framework\version \CONFIG.

For example for .NET 1.1, SqlServer specific:

FileSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a

5c561934e089" />

Post a Comment(0 comments)

Microsoft Going open source for dotnet framework library??

Andy Mulholland posted about this important piece of information, which I think will be very significant for .NET programmers and also for the world at large:
.NET Framework Library Source Code now available
you’ll be able to dynamically load the debug symbols for .NET Framework libraries and step into the source code. VS 2008 will download both the symbols and source files on demand from the MSDN reference servers as you debug throughout the framework code.
This is a very different move from the usual MS strategy of keeping the code to themselves.
think that enabling source code access and debugger integration of the .NET Framework libraries is going to be really valuable for .NET developers. Being able to step through and review the source should provide much better insight into how the .NET Framework libraries are implemented, and in turn enable you to build better applications and make even better use of them.
I would like you all to comment out on this one as it is a significant developement in the future of dotnet technologies.
Post a Comment(1 comments)

This would be a good news for dotNet fans out there.

I also think it would be very helpful if it really happens. From the developer perspective its cool that I would be able to fix or add some new features/methods to the framework.

But from a client perspective "WHO CARES :)"

Although it looks a good step towards dotNet growth.

EXTJs Showcase

Must see this amazing demo from EXTJS. Very clean and nicely done.

Showcase2 Application
Post a Comment(0 comments)

Monday, February 11, 2008

How to convert AMR file to WAV file

Use this, to convert AMR file to WAV file

Mobile AMR Converter uses Sony Ericsson AMR converter to convert WAVE files (*.wav) to AMR (Adaptive Multi-Rate Codec, *.amr) and vice-versa. The program is very easy to use.

1) Launch Mobile AMR Converter.
2) Click on AMR to WAVE light button (below green picture: phone to PC).
3) Next, specify your input AMR filename: click on the first Browse light-button, select your amr file and click OK.
4) Click Convert .

http://www.hdmail.co.uk/MobAmrCon14-setup.zip

Labels: , ,

Post a Comment(1 comments)

Amit- the link is broken.

Going crazy with iPhone


Software: PocketGuitar Lets You Kick Out Riffs With Your iPhone

I am going crazy thinking how COOOOOL this is. I don't hold an iphone right now but wish I had one here.

If someone tried this one, please tell me how good it is???
Post a Comment(0 comments)

Sunday, February 10, 2008

Green Tip of the Day!!

Most of us in the IT field, used to do one thing before leaving for the day from office,
Press Ctrl+Alt+ Del and leave to home happily. That means your PC is still on..
One normal PC in the sleeping mode (Hibernation) will consume 35 watts/hr.
Based on this we will do a small calculation.
For one week 24 * 7 = 168 Hrs
Of this if we consider that we are working for 68 hours, then
the PC is in sleeping mode for 100 Hrs a week. For one month 4 * 100 = 400 Hrs
In a normal IT office, if we assume approximately 250 PCs are there,
250 * 400 = 1,00,000 Hrs (Sleeping Mode)
So the power wasted in an office in a month is,
100000 * 35 = 3500 KWH or units.
If the charge per unit is Indian Rs. 6, then totally the wastage value is approximately 21000 Indian rupees.

Here the sad thing is not the money loss to the company but the power loss to the country. (Hope no company is bothered about this procedure of keeping the system in sleeping mode)

Apart from the loss to the country we need to think of the efforts people are putting for producing the power in the Mines, Thermal Stations, Hydro electric Stations, etc. If this is to continue, the cost of unit power will go up & at one stage we will not get power even if we are ready to pay any cost.
So before leaving to home take some time to shut down the PC and do some favour to the country and the organisation.
If you feel that this point is to be considered forward this to all your friends.

*** Do it once it will become a Habit... Good Habit... be a good citizen of India.....
Post a Comment(1 comments)

I like this idea. Probably all of us should not leave the machine in sleep mode. Except server nothing should be on when we leave for home in the evening.

Saturday, February 9, 2008

Syntax to Call API through C# code

[DllImport("advapi32.dll", CharSet = CharSet.Unicode, EntryPoint = "RegQueryValueExW", SetLastError = true)]
static extern int RegQueryValueEx(
IntPtr hKey,
string lpValueName,
int lpReserved,
out uint lpType,
System.Text.StringBuilder lpData,
ref uint lpcbData);

Syntex to use:

uint pvSize = 1024;
System.Text.StringBuilder pvData = new System.Text.StringBuilder(1024);
uint pdwType = 0;
int success = RegQueryValueEx(regKey, "AKeyName", 0, out pdwType, pvData, ref pvSize);


[DllImport("advapi32.dll", SetLastError=true)]
static extern int RegCloseKey(
IntPtr hKey);
Syntex to use:

Microsoft.Win32.RegistryKey.Close() Method.


DllImport("advapi32.dll", SetLastError=true)]
static extern int RegCreateKeyEx(
int hKey,
string lpSubKey,
int Reserved,
string lpClass,
RegOption dwOptions,
RegSAM samDesired,
SECURITY_ATTRIBUTES lpSecurityAttributes,
out int phkResult,
out RegResult lpdwDisposition);


[Flags]
public enum RegOption
{
NonVolatile = 0x0,
Volatile = 0x1,
CreateLink = 0x2,
BackupRestore = 0x4,
OpenLink = 0x8
}

[Flags]
public enum RegSAM
{
QueryValue = 0x0001,
SetValue = 0x0002,
CreateSubKey = 0x0004,
EnumerateSubKeys = 0x0008,
Notify = 0x0010,
CreateLink = 0x0020,
WOW64_32Key = 0x0200,
WOW64_64Key = 0x0100,
WOW64_Res = 0x0300,
Read = 0x00020019,
Write = 0x00020006,
Execute = 0x00020019,
AllAccess = 0x000f003f
}

public enum RegResult
{
CreatedNewKey = 0x00000001,
OpenedExistingKey = 0x00000002
}

use :-

Microsoft.Win32.RegistryKey.CreateSubKey


[DllImport("advapi32.dll", SetLastError = true)]
static extern int RegSetValueEx(
IntPtr hKey,
[MarshalAs(UnmanagedType.LPStr)] string lpValueName,
int Reserved,
Microsoft.Win32.RegistryValueKind dwType,
[MarshalAs(UnmanagedType.LPStr)] string lpData,
int cbData);

use it :-
My.Computer.Registry.SetValue(KeyName, valueName, value, valueKind)
with signature:
keyName As String
valueName As String
value As Object
valueKind as RegistryValueKind

http://pinvoke.net/default.aspx/advapi32.RegSetValueEx#

Labels:

Post a Comment(0 comments)

Out of the box 1.1.3 iPhones now software unlockable



Out of the box 1.1.3 iPhones now software unlockable - Engadget

That's cool now you can get 1.1.3 out of box unlocked... when i think of this boy I am little worried about him cus he is the only hacker he is always in the picture and known to everyone. I wish apple don't sue him this time.

Labels:

Post a Comment(0 comments)

SATA to USB adapter is a must-have for any technician

Post a Comment(0 comments)

Friday, February 8, 2008

Google and Microsoft War

Google is introducing an online business software package designed to make easier for people in the same organization to share documents and information.

The free "Team Edition" software, represents the Internet search leader's latest attempt to attract more users to free applications, which poses a potential threat to rival Microsoft highly profitable word processing, spreadsheet, presentation and calendar programs.

The launch marks the second time Google has upgraded a business program this week — a week when Microsoft awaits a response to bid to buy Yahoo in an attempt to undermine Google's dominance of Internet search and advertising.The war has began lets checkout who wins!!!!!!

http://www.msnbc.msn.com/id/23048252/

Labels: ,

Post a Comment(0 comments)

Thursday, February 7, 2008

40+ Excellent Freefonts For Professional Design

Post a Comment(0 comments)

Creating a crazy cool logo

Post a Comment(0 comments)

Wednesday, February 6, 2008

Microsoft Keyboard



The Microsoft Ultimate keyboard is wireless and has rechargeable functionality.The wireless keyboard features Bluetooth connectivity and can be used from a 30 foot range great feel the freedom. Yet not decided to buy the same....Strange?

http://www.fastcursor.com/gizmos/microsoft-ultimate-keyboard.asp

Labels: ,

Post a Comment(3 comments)

This post has been removed by the author.
What a great deal only microsoft can launch this type of product great!!!!

one question are they also selling special glasses to see screen of computer from 30 foot :)
What a great deal only microsoft can launch this type of product great!!!!

one question are they also selling special glasses to see screen of computer from 30 foot :)

Car I am using these days



Toyota Corolla

This is what I am driving.

Labels: ,

Post a Comment(0 comments)

Tuesday, February 5, 2008

Micro Pc of Sony Vaio



The Sony Vaio UX 50 weighs 520 grams. That's cool.Centrino 1.06 Ghz processor inside. It runs on Windows.

The screen is a 4.5 inch one, and you get a resolution of 1024 X 600. provide real good resolution and plus, there is a quick zoom which can help you enlarge the screen quickly for a better reading experience.

The Sony Vaio VGN UX50 MicroPC has a startup time of 5 seconds! That is real fast for running Windows XP. If you are in a country where you have GPS driving directions and navigators available, there is a Bluetooth GPS unit which will turn it into a driving companion.

http://www.fastcursor.com/sony-vaio-VGN-UX50-microPC.asp

Labels:

Post a Comment(0 comments)

Sunday, February 3, 2008

Web 2.0 Next Generation



This diagram shows the web 2.0 technology of next generations its usage application and new trends in the world it provide all information and easy understanding of web 2.0 technology world

http://web2.socialcomputingmagazine.com/review_of_the_years_best_web_20_explanations.htm

Labels:

Post a Comment(0 comments)

Friday, February 1, 2008

Microsoft offers $44.6 Billion for Yahoo



"Microsoft just announced what has been rumored forever: a formal offer for Yahoo. Microsoft's proposal to Yahoo's board of directors represents $31 per share (a 62% premium over yesterday's closing price) or about $44.6 Billion. Steve Ballmer, CEO and big fan of developers, says, "We have great respect for Yahoo!, and together we can offer an increasingly exciting set of solutions for consumers, publishers and advertisers while becoming better positioned to compete in the online services market." Apparently, the deal was laid out in a letter sent by Ballmer to Yahoo's board just yesterday. Seriously. The letter confirms that the two giants have been discussing the topic since late 2006."

http://www.engadget.com/2008/02/01/microsoft-offers-44-6-billion-for-yahoo/

Labels: ,

Post a Comment(0 comments)