Wednesday 29 June 2011

How to change (in windows) the ip address (and so on) from command line

List the network connection and its settings
netsh interface ip show config
also
ipconfig
also 
ipconfig /all

Change a static address
netsh interface ip set address name="Wireless Network Connection" static 192.168.0.96 255.255.255.0 192.168.0.240 1
If you get the error The object already exists. check if other network connection has this ip address.

Change to DHCP
netsh interface ip set address name="Wireless Network Connection" dhcp

Change the DNS servers to static
cannot be done  by netsh !!! or with other easy way, You can change it with dnscmd command that is available in support.cab of you system’s installation cd. For more read http://technet.microsoft.com/en-us/library/cc778513%28WS.10%29.aspx (good luck... microsoft is there).
On the other hand, you may use one of the free dns servers (world wide, domain wide), read http://itfailed.blogspot.com/2011/06/free-public-dns-server.html.

change the DNS servers to DHCP
netsh interface ip set dns "Wireless Network Connection" dhcp

Free Public DNS Server

=> Service provider: Google
Google public dns server IP address:
  • 8.8.8.8
  • 8.8.4.4
=> Service provider:Dnsadvantage
Dnsadvantage free dns server list:
  • 156.154.70.1
  • 156.154.71.1
=> Service provider:OpenDNS
OpenDNS free dns server list / IP address:
  • 208.67.222.222
  • 208.67.220.220
=> Service provider:Norton
Norton free dns server list / IP address:
  • 198.153.192.1
  • 198.153.194.1
=> Service provider: GTEI DNS (now Verizon)
Public Name server IP address:
  • 4.2.2.1
  • 4.2.2.2
  • 4.2.2.3
  • 4.2.2.4
  • 4.2.2.5
  • 4.2.2.6
=> Service provider: ScrubIt
Public dns server address:
  • 67.138.54.100
  • 207.225.209.66

Thursday 16 June 2011

How to delete Temporary files, from internet and from other applications manually?


situation

Internet browsers are keeping a lot of files as cache. As you may clear this cache for their options, doesn’t do the entire job always. Also, if the system crashed and you want to transfer your data to another disk, these files are too many and completely rubbish. Here is a way to delete these files manually.
problem

How to delete Temporary files, from internet and from other applications manually? You may delete them safely!
difficulty level

0/10 :)))
compatibility

win xp, win vista, win7
solution

In xp systems
C:\Documents and Settings\<user name>\Local Settings\Temp
C:\Documents and Settings\<user name>\Local Settings\Temporary Internet files
C:\Documents and Settings\<user name>\Local Settings\Temp\Cookies (here are the cookies)
In Vista and win7 systems
C:\Users\<user name>\AppData\Local\Temp\
C:\Users\<user name>\AppData\Local\Microsoft\Windows\Temporary Internet Files

To delete these files permanently without moving them to recycle bin and waste a lot of time, hold the shift key down during the right click and delete. By this way the system will not transfer the files to recycle bin but will notifies you also that deletion will be permanently.

Monday 13 June 2011

Flex4, how to wait object to be completely initialized; how to give time to objects to be completely initialized


Suppose that you have an Object called Circus. This object is too complex (like a real circus). The follow init() function creates the circus it but in real programming world the Circus object is not prepared because the Circus must be render its components, update several graphics objects .

internal function init():void{
       //create my.. circus…
       myCircus=new Circus(“My X-circus");
       //initialize
       myCircus.x=10; myCircus.y=40;
       //play
       myCircus.play();
       myCircus.cashier.addMoney(100.50); //this might be wrong, as the circus in not ready yet!
}

This problem occurred on simpler objects also… like the Flex’s Label. If on “applicationComplete” you apply a value to “text” property of a Label a text (i.e. “hellow world”) and right after you try to get the “width” of the Label object, you might be get WRONG value, a not real width; this because the Label object is not yet prepared.
Well, how to get that an object is completed? With Flex’s Label, the event you must Listen is the “FlexEvent.UPDATE_COMPLETE” and not other “UPDATE_COMPLETE” because Flex offers and other from other Eventxxx classes. Note that this is working in Flex 4.0.

So… the Circus object must supports and dispatch once upon a time the “FlexEvent.UPDATE_COMPLETE” to continue in safe way the calculations with its properties.

But, what happen if the Circus doesn’t supports this event? Unfortunately this is happening in real world with several 3rd party components / object.

Bellow there is a solution that is not so professional but it is the only chance to make it work! ;) What I do here is that I am working for a while with Event.ENTER_FRAME, with this way I give some time to then whole application and its running objects to complete uncompleted calculations.

//this is my own counter to count the passed time.
internal var myWaitCounter:int;

internal function init():void{
       //create my.. circus…
       myCircus=new Circus(“My X-circus");
       //initialize
       myCircus.x=10; myCircus.y=40;
       //prepare and activate my listener pf ENTER_FRAME event
       myWaitCounter=0;
       addEventListener(Event.ENTER_FRAME,Handler_WaitForCompletion);
}

internal function Handler_WaitForCompletion (e:Event):void{
       //add to my counter the time
       myWaitCounter+=1000/ Object(FlexGlobals.topLevelApplication).stage.frameRate;
       //if, 500ms (0,5sec) passed, then call the start() after remove then listener
       //in general it is very important to remove the listeners where you don’t need any more
       if (myWaitCounter >=500) {
              removeEventListener(Event.ENTER_FRAME,Handler_WaitForCompletion);
              start();
       }
}

protected function start():void{
       //now you are ready to play with you circus safely!
       myCircus.play();
}


Saturday 4 June 2011

Flex, Determining which server/domain a SWF is hosted on


situation

Here’s a handy tip which can help you when deploying Flex applications on mulitple servers (such as a staging/production server). Basically you can listen for the Application tag to dispatch the applicationComplete event, grab the URL of the SWF using the loaderInfo.url property, and then use the URLUtil.getServerName() method to parse out the server name.
problem

adobe flex4 flex 4.0 AS3.0
Determining which server/domain a SWF is hosted on |
How to get the domain where the swf is hosted
----
> page: dn
difficulty level

0/10 :)))
compatibility

flex4, as3
solution

In prior version of Flex 4.0 use this:
URLUtil.getServerName(Application.application.loaderInfo.url);

In 4.0 use this: because Application is no longer available in 4.0 URLUtil.getServerName(FlexGlobals.topLevelApplication.url)

windows7; How to to disable Taskbar Thumbnail Preview in Windows 7 using the Registry |||| How to to enable Taskbar Thumbnail Preview in Windows 7 using the Registry

Introduction
A feature of Windows 7 is that it will show you a preview, or small thumbnail image, of the open windows for a particular program when you hover over it. For example, if you have 3 Internet Explorer windows open and hover your mouse cursor over the Internet Explorer icon on your taskbar, it will pop-up 3 small images of each of your Internet Explorer windows and allow you to select the one you want to make active. An example of this feature can be seen in the image below.

Example of the Windows 7 Taskbar Thumbnail Preview
Example of the Windows 7 Taskbar Thumbnail Preview