I was writing a small personal accounting software for tracking all my money transactions. I decided to do it in vb.net
(my fav nd the easy one) . I used SQL compact edition to strore the data in local db file. Everything went fine and worked well, but when i testing the application against worst case scenarios i found i a bug. Its the overflow of integer (int64) when dealing with large money, also arithmetic of large money resulted in some strange results due to rounding problem in doubles, the available solution were using decimal type or SQL money type, but both were 64bit overflow problem persists, so decided to implement my own money class , here the integral part is stored in array of bytes representing each digit and a decimal type to represent the floating part, the main issue with this implementation is one byte is required to represent a digit. The class defines operators +,-,* all implemented pure paper pen work method, Since my app is very small and deals with small amounts i decided not to worry about the memory , If someone want to compact the memory more one easy way will be packing the digits like binary packed BCD . the class is attached below
Download
Thursday, November 12, 2009
Thursday, September 24, 2009
Game Explorer Offline PC Fix
If you are a windows visa/seven user you might have heard about Game Explorer. It is windows component which keep a small record off what type of games you play in your pc. It pull out the game rating and some info from the web. It is nice feature if the pc is under parental control where we need to block children from games having extreme violence or explicit contents. But the bad news is that game explorer can 't be disabled completely even if you have a SYSTEM account , the reason is there is no option to disable it. Off course you have a menu with options in game explorer where you can choose "NEVER check online updates or news, I'll do this manually" . I think Microsoft overruled the meaning of word 'NEVER', When you start any game (even if you disable the online check) for the first time game explorer try to report it to bill gates. This is not a big issue for a pc with internet connectivity. In an offline system what happens is that if game Explorer fails to find Bill gates it won't allow you start the game. It won't allow you play the game till it contact bill gates at least once. I found a method to bypass this we require a good process manger program, here I used my favourite Process Explorer
Start the game from start menu or where ever it is, If you get the game working on a offline machine you are lucky because Microsoft didn't understand that you are starting a game. else the game won't run and you may be prompted to dialup if you have one. Open the process explorer and make sure that there is a process corresponding to your game. Then Launch the game again there you go the game will start. But if you check the process explorer you can see two instance of the game . Kill the one which has rundll32.exe as child process( Here in my case it is Process with process ID 3896. Make sure to use option "Kill Process Tree (Shift+ del) " or you will have to kill the corresponding rundll32.exe manually if you allow rundll32.exe to run sometimes it will eat you cpu core, but if you finished your game and closed it, if you want to relaunch the game you don't have to do all this step it will load the game without any problem provided the corresponding rundll32.exe is still running
Start the game from start menu or where ever it is, If you get the game working on a offline machine you are lucky because Microsoft didn't understand that you are starting a game. else the game won't run and you may be prompted to dialup if you have one. Open the process explorer and make sure that there is a process corresponding to your game. Then Launch the game again there you go the game will start. But if you check the process explorer you can see two instance of the game . Kill the one which has rundll32.exe as child process( Here in my case it is Process with process ID 3896. Make sure to use option "Kill Process Tree (Shift+ del) " or you will have to kill the corresponding rundll32.exe manually if you allow rundll32.exe to run sometimes it will eat you cpu core, but if you finished your game and closed it, if you want to relaunch the game you don't have to do all this step it will load the game without any problem provided the corresponding rundll32.exe is still running
Subscribe to:
Posts (Atom)
