Monday 31 January 2011

Flex4, event MOUSE_OUT is triggered for every MOUSE_OUT event of its children

problem:
Suppose you have a Group or Module named MainMenuItem, where you have several other childer components in it. You want when mouse gets of the MainMenuItem to colapse it, in order to create a pull down menu. The problem is that Flash runtimer returns the MOUSE_OUT event where ever this happen in the children of the MainMenuItem.

solution
Do not strangle with "bubbles" and "stop.propagation", I tried, they didn't work. In the implementations of the Listener, just check if the target of the event is children indeed; and if its not, do perfrom the action you want (the collapse in this example); because in real the mouse is not out but it is still over on your Group (or Module).

Thursday 27 January 2011

nod32 freezes when I enter the password (by paste or typing)

problem:
nod32 many times doesn't accept the key, as the egui.exe process freezes consuming 100% of the cpu.

solution:
do not wait... and do the follow
- kill the process from task manager
- run again the nod32 antivirus
- open it and go from its menu Setup -> Setup username and password
- enter now in this dialog the user name and the password; from this way the nod32 doesn't freeze.

nod32 antivirus key

problem: did you lost again your nod32 license key?


solution: use this one:
Username: EAV-40558097
Password: 4attcvp3p3
valid: till 14/1/2012

Tuesday 25 January 2011

how to disable the ctrl-d shortcut in excel

problem:
how many times have you lost data pressing accidentally the ctrl-d in excel??? the drop short is between save and find... it is very famous this kind of mistake if you are using the ctrl-f...

solution:
there is no way to disable it from the excel's options... you have to do create macro...
1. from ribbon go to "view" -> macros -> "view macros"
2. in the name field type: "disableCtrlD" without quotes and press the "create" button
3. in the this new code window will appear... delete all line and paste the follow 3 lines
        Sub disableCtrlD()
            Application.OnKey "^d", ""
        End Sub

4. close the entire application / window: "Microsoft Visual Basic for Applications"
5. you have finished, the ctrl-d should not work any more.

this is working with all excel's versions (till 2010) but the way you define the macros might be different

Monday 24 January 2011

Disable Crash Recovery Restore Session Option On Firefox

Situation:
When you develop in Flex.. Flash player debugger might freeze Firefox. In particular this is happening in Flex4 then you Debug and accidentally press the Run button while you Debug.

Problem:
When you reload the Firefox, maybe it will try to restore all previous pages without asking. If at your last crash you have loaded several times the application you develop, it is almost fact you are going for new crash. How may we avoid this auto restore session?

 Solution:
  1. Open Firefox
  2. Type: about:config in address bar
  3. Search for browser.sessionstore.resume_from_crash in the list (use the Filter field)
  4. double click on that field and set that to false
enjoy your new crashes...

Saturday 22 January 2011

how to delete calendar and contacts databases from windows mobile without (hard) reset

Situation
Windows mobile 5 & 6 are the most unstable mobile system. Windows mobile 7 is not a mobile system anymore... it is firmware for mobile phone devices. In the time I write these lines, it doesn't  support even the copy paste "feature" and it doesn't sync with pc computer (tada)!!! The most impressive is the fast reaction of menus... because all of these it is a simple (and poor) mobile phone and not mobile system anymore.
The windows pc also system has a lot of problems and ofter you need to immigrate to different computer or change system, format or change msoffice versions... and this crap keeps going on.


solution compatibility
This solution is working only for windows mobile versions 5 to 6.5. For god's sake, do not buy again windows mobile device... the dream is dead... there is no hope to develop something great... the windows mobile 7 is the worst ever version they made!


..the problem
What is happening witn sync??? pretty dirty!!! The poor ms sync cannot match records between your mobile and pc. As result, if you sync your device after a pc immigration you will have at your mobile double records in calendar, in contacts and where ever else you sync data between mobile & pc.

...the solution...
You have to delete the calendar and contacts database from your mobile. But how you may do this??? Microsoft officially doesn't provide utility or someway to delete specific database (i.e. contacts only).

You may do this with SKTools (google it) where great utility where every windows mobile user needs its to repair his/hers failed purchase of windows mobile device (including me!). Read more at the bottom of this post about the SKTools...

Lets do the work...
- Do a soft reset to your device... try to not load and application or quit any application that auto loaded.
- At pda go to -> Start -> SKTools-> Select from the bottom the "Category" view -> From the List select the "All" it is at the bottom -> find the tool called "Databases"... now....
- For each Database you want to delete do the follow steps:
    1. select tapping the database (do not check it)
    2. from the bottom select "Action"
    3. select the 1st option "Empty"
    - for contacts select "Contacts Database"
    - for calendar select "Appoitments Database"
( for other kind of database search by your own, be careful what you select because you may screw up your device at all. in general SKTools is dangerous tool if you do not know what are you doing, because of that use it gently! )

- The Deletion process is finished... precisely... you cannot (and you must not) delete the databases because the system is using them... but you may pretty and legal empty them.
- now you may create new partnership between you mobile and pc and do a sync.

SKTools registration
I suggest you to purchase the SKTools because it is very strong tools with a lot of benefits. We have to support these kind of software houses in order to have these worthy tools. In case now you just want to complete the procedure I describe above here is a way to "register"
        sktools version: 4.5.1.3
        device id: Dennis (change it for a while)
        serial number: 33595

Thursday 20 January 2011

/php/ debug script where logs debug info appending a file

description: quick code to log activities...

solution:
$file = fopen("dn_debug_log.txt", "a+");
fwrite($file,$queryscript."\n\n");
fclose($file);

note: the file is created in the directory of the called php any not in the directory of the php where contains the code! That means that if you place the code in a library that is called from another php script, the file will be created in the directory of the calling php and not of the library.


important note: do not leave this code active because then log will never stop growing!

Monday 10 January 2011

adobe, flex4, the whole Eclipse environment freezes with CPU at 99%

environment: adobe flex4 AS3.0 Eclipse ide

problem: the whole Eclipse environment freezes with CPU at 99% and never becomes normal


solution: 
it IDE's bug, if you have remarked text in the are of arguments of a function... move them somewhere else
i.e.
  public function newItem(
   /**HELP, creates a new item */
   name:String
  ){
    ....
  }

the red text indicates the wrong remarked text

adobe flex4 AS3.0, eclipse IDE, the code insight doesn't insights

environment: adobe flex4 AS3.0 with eclipse ide

problem: on design time, creating a object with "new operator", the code insight doesn't show the required arguments by the constructor of the class

solution: the arguments appeared when I removed the ":void" from the constructor… this is not so usual!

outlook express email files location (in winxp)

Outlook's email files located at:
c:\Documents and Settings\<user name>\Local Settings\Application Data\Identities\{7D43530B-D505-438E-8661-3C8CF2FF2540}\Microsoft\Outlook Express\
files have extention *.dbx


Outlook's Contacts file located at:
c:\Documents and Settings\<user name>\Application Data\Microsoft\Address Book\<user name>.wab
 

Microsoft Outlook default pst location:
c:\Documents and Settings\<user name>\Local Settings\Application Data\Microsoft\Outlook\

more help at http://support.microsoft.com/kb/270670


Sunday 9 January 2011

adobe flex, as3.0, getters and setters

in the follow code, the internalName is the internal variable of the class and the name is the variable that works like property of the class.

---full version--- this version is... human redable
  private var internalName:String;
  public function get name():String {
   return internalName;
  }
  public function set name(newName:String):void {
   internalName=newName;
  } 

---compressed version--- this is nothing more than all previous code in one line
private var internalName:String;   public function get name():String {return internalName;}   public function set name(newName:String):void {internalName=newName; }

--rapid develop with excel--- if you are going to develop so many getters and setters, use this excel formula, replacing the A1 with the cell address that has the name of the property (like the name previously)
="    /** getter/setter "&A1&" */   private var internal"&A1&":String;   public function get "&A1&"():String {return internal"&A1&";}   public function set "&A1&"(new"&A1&":String):void {internal"&A1&"=new"&A1&"; }"

examples
pet.name = "Andreas";
trace("pet.name");

Note: A get/set pseudo-variable can be made read-only by declaring a get method without declaring a set method.

use winrar for incremental backup

the follow little script may save you a lot of work, as it backups each time the files are under of the directory where is it, in different file names (according the date and the time of backup)

create a batch file called backup.bat, and drop these 2 lines:
@if not exist backups md backupincremental
@c:\progra~1\winrar\winrar a backupincremental\mybackup_%1_ -ag -r -dh -m5 -xbackupincremental 

progra~1 ?if you have win64 system, the winrar might me installed in c:\progra~2\... and not in c:\progra~1\..., so edit respectively.

syntax
        backup <description (without spaces) (optional)?
usage
        backup.bat before_destruction
file created:
       backupincremental\mybackup_before_destruction_20110109220848.rar

Saturday 8 January 2011

adobe flex AS3.0 Flex & php - how to make a string url compatible

environment: adobe flex AS3.0 Flex & php

problem: how to make a string url compatible, how to convert illegal and problematic characters

solution:

in actionscritp, use: escape() & unescape()
guide: http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary199.html
guide: http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary812.html
example: http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary812.html

in php, use: urlencode() & urldecode()
note!  you should encode or decode the whole url string but only areas where are contains incompatible string.

guide: http://php.net/manual/en/function.urlencode.php
guide: http://www.php.net/manual/en/function.urldecode.php

php, how to load URL content using php arguments and long url addresses?

urlLoad() Function for PHP - Fetch URL Content

I recently had to develop a small script that will fetch an XML file from the web. All I had to do is download a given URL and read its contents. To my great surprise I found that download the file using my jx Ajax library was much easier than doing it with PHP.
PHP make this very easy by including functions like file_get_contents() that has URL support. This code will get you the contents of an URL.
$contents = file_get_contents('http://example.com/rss.xml');
Unfortunately, this is a huge security threat - and many servers have disabled this feature in PHP. Also this is not the most optimized method to fetch an URL. Also, it is impossible to submit data using the POST method using this function.

Other Options - curl and fsockopen

PHP provide other two method to fetch an URL - Curl and Fsockopen. But to use this I have to write a lot more code.

adobe Flex4 AS3.0, Canvas component is abandoned!!! which is our new game?

Which component will replace the favorite Canvas?
Play with spark.Group container! I say "play" because you have to do some work.
Read how you can do the same things in flex4 and spark components.
Note!: this post doesn't cover components and general solution with skin-able components!

History:
Fact is that canvas was the favorite object for lo fex4 level programming. Now Adobe is messing up our code saying that will not support any more the Canvas object, instead will work with Group container object. The good news is whatever complex is Group, it is lighter and more flexible than Canvas.

Problem:
Which is the new component?

Solution:
There are 2 respectively components instead of canvas. The Bordercontainer is subclass of SparkContainer and it is skinable. But it is heave in swf size and it is not good for low level programming. 

The Group component:
  • is almost like a Canvas, 
  • more lighter in swf , 
  • it is not skin-able,
  • it doesn't scroll its contain
  • and by default the contained stuff is appeared also outside of its region!
To make the Group component to work like the old (and favorite) Canvas you have to do:

1. Set the Group property clipAndEnableScrolling to true, so the contents will be appeared on their parts in the region of Group.

2. Add scroll bars. Add a Scroller Component into your stage, and in Scroller  add a Group component, so the Group will be in the Scroller component. Set the vertical/horizontalScrollPolicy to true as you desire. Scroller component doesn't accept simple components like Label.

3. Visual Anchors / constraints of our container

on design time...
Group should have Width and Height the value "100%" (this value is accepted on design time). With this value, the group will always stretched in Scroller's maximu area its time.

Scroller may have any kind of Constraints or absolute x,y,width&height, the location of the Scroller will define the location of our Group.


...keep coding...

Friday 7 January 2011

how to start a virtualbox machine from command line ?

problem: how to start a virtual machine from command line ?    

solution: (only on windows) create a batch with the follow lines, replacing the agoraxp with the name of your machine

c:
cd "C:\Program Files\Oracle\VirtualBox"
VBoxManage startvm agoraxp"

more at:
VirtualBox

VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL). See "About VirtualBox" for an introduction.
Presently, VirtualBox runs on Windows, Linux, Macintosh and OpenSolaris hosts and supports a large number of guest operating systems including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista, Windows 7), DOS/Windows 3.x, Linux (2.4 and 2.6), Solaris and OpenSolaris, and OpenBSD.
VirtualBox is being actively developed with frequent releases and has an ever growing list of features, supported guest operating systems and platforms it runs on. VirtualBox is a community effort backed by a dedicated company: everyone is encouraged to contribute while Oracle ensures the product always meets professional quality criteria.

youtube, how to display a video in full mode in browser (not in full screen mode)

http://www.youtube.com/watch?v=Z2mf8DtWWd8        //classic view (windowed)
http://www.youtube.com/watch_popup?v=Z2mf8DtWWd8  //full view in the browser

how to hack/crack/cheat Teamviewer!!! (Success on v4 & v5)


in general

No doubt TeamViewer is one of the best, free remote access and remote desktop sharing software over internet.
Let’s say your friend is facing some computer issues and she does not know much about computers. It’ll be really difficult for you to guide your friend over phone as mostly she’d not understand what to do and your phone bill would run high as well !for
This is where TeamViewer comes in picture and works best. You can sit at the comfort of your house and help your friend who can possibly be sitting thousands of miles away (Make sure you have direct internet connection as TeamViewer does not work if it’s behind proxy).
TeamViewer is free for personal use, but you’ll have to buy a license if you are using it for commercial purposes. Off late I had a few readers e-mailing a common problem they had with TeamViewer.

Problem:

The common problem was that, even though these visitors were not using TeamViewer for commercial purpose they were getting the following message:
“Commercial Use Suspected”
In such case, my first suggestion is that you contact TeamViewer team and inform them about the problem and see if they can solve the issue.
However, there is a way to solve this, but this should be used only if you don’t get a reply from teamviewer and is a bit of technical process, so you have to dabble your hand in it only if you know what you are upto.

Solution:
<!--more-->
1> First Close Teamviewer, if it is running.

2> Click on Start –> Run –> type %appdata% –> delete TeamViewer folder

3> Delete registry folder:
HKEY_CURRENT_USER/software/teamviewer and
HKEY_LOCAL_MACHINE/software/teamviewer on win32 or
HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/TeamViewer on win64

4> Change the MAC Address of your LAN card read bellow how to do it.
- disable the nic
- change the mac address in the registry script located at the bottom of this text, where 0009 is the number of the nic as it is registered by the system in the registry
- execute the reg script
- enable the nic

5> Restart your Teamviewer and you should get a new ID and also should solve the “Commercial Use Suspected” problem.

How to change your MAC address
To change you mac addrress on specific nic, you have to add the key named "NetworkAddress" to specific nic in the windows registry.

Note: do not change the mac address from all nics of your system, but only one or two nics you may use.

An easy way to update the registry is to load the follow text as .reg file, please do correct the proper 4digit number where your nic is registered! In this example, this 4digit number is the 0009

To find the proper 4digit number, you have to find the nic you are using. All the nic of your computer are in 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\ 
folder.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0009]
"NetworkAddress"="0016D3EF9BD3"
 
in any case, if you are using teamviewer on about 5 hours per day, you will need to do this procedure every week; maybe then you have  to contact with them and solve he problem.

another solution: is to load the teamviewer in virtual machine... your license key will be activated as it was new computer; the nics are fewer and the cheat applied easiest

good luck


mail.live.com not loaded completely...

problem: microsoft live mail, hotmail page, not loaded completely... only these pages are not loaded completely. other pages like gmail.com or mail.yahoo.com are responded quickly and loaded completely.

reason: this is very rare but happens sometimes... there is no official report about this issue from microsoft... technically this might be happen when the server or other network center has turn you to low download speed, after an appropriate use of server or network. You might have virus or spyware and these kind of application hit the pages / servers you are using.


solution: change ip address restarting your router or reconnecting your router with your provider. if you have static ip address then you have really problem! the server doesn't forgives you after some hours. Check for viruses or spyware. 

If you are clean and the problem persist, check your pc with different internet connection, that means with other internet provider and router. if the problem then solved then problem is restricted on router or internet provider, otherwise you computer has another network problem (check hosts, dns etc (good luck)).

gray screen, blank screen after mIRC execution; how to reset mIRC application

Problem: after connection of mirc with server... gray screen, blank screen; you can't see anything, even the task bar.

Reason: possibly you downloaded and applied script or application that changed the settings of mirc in order to do not work! this is like virus or spyware attack


Solution:
0. to get out og the gray screen, just press alt-ctrl-del, select task manager, go to processes tab. select the mirc.exe process, press "end process" and yes to the next dialog. (there is no other way to unblock the mirc).
1. log on windows with windows user account that uses the mirc
2. open your "roaming" folder. Press start and on "search" field type: %appdata% and press enter, the roaming folder will be opened. otherwise go manually to C:\Users\<user name>\AppData\Roaming where <user name> is name of the windows user.
3. Delete the "mirc" folder; if you want to keep the conversation history, downloads and other files of you previous use, compress somewhere the entire "mirc" folder and its subfolders and be sure to delete (at last) the mirc folder.

there is no need to delete something from registry