Wednesday, August 13, 2008

Action Figuring...


When try to think back my secondary school life, my bro use to buy me modelling like gundams, cars and other action figures... But i don really like to assemble it, cuz take too much time to do it...

Usually i ask my bro to assemble for me la... hoho... i know i'm lazy la... haha.. i only like the final out come of the modelling, yet my bro really likes to do this thing de la... hehe...

Anyway, recently i found out one of my colleague really like action figures/modelling. He shows tons of action figures from the internet and those modelling figures he bought from the internet. Well no doubt, this has caught me back into modelling/Action figures... So i did googled for the price list of gundam action figures, it really cost a lot!! So untill now, i haven buy one yet... haha... -.-'''

Well on the process of googleing for cheaper modelling figures, i found an alternative way on modelling action figures. I found gundam paper models. It looks really cool on paper model as well... Never expected to have that nice out come using paper.

This has caught me falling into paper modelling. Recently i hav started to model a gundam using paper.... The model of the gundam is SD MUSHA GUNDAM... From PS2 Gundam Mosou... It's still in the process of developing. I'll upload the pictures soon... hehe ^.^

Monday, May 26, 2008

Where is my Print Screen Button ?? -.-'''


Yo... Long time no blog... haha..

Previously, i have mentioned that i faced problem with Apple Mouse's right click issues in Windows environment. Well, this time i faced another problem with the shortcut key in Apple keyboard... -.-

There is no Print Screen short cut key in Apple keyboard, instead, it have "F13", "F14", and "F15" button... haha.... -.-

Below are the codes, that i have researched and tested. It's quite useful to me when doing software Report with Print screen. Hope that these coding is useful to u too.. hehe....

<>
Public Declare Function BitBlt Lib "gdi32" Alias "BitBlt" (ByVal hDestDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal dwRop As Integer) As Integer

Public Declare Function GetWindowDC Lib "user32" Alias "GetWindowDC" (ByVal hwnd As Integer) As Integer

Public Declare Function ReleaseDC Lib "user32" Alias "ReleaseDC" (ByVal hwnd As Integer, ByVal hdc As Integer) As Integer

Public Const SRCCOPY As Integer = &HCC0020

Public Shared Sub CreateBitmap()
Dim gDest As Graphics
Dim hdcDest As IntPtr
Dim hdcSrc As Integer
Dim hWnd As Integer '= Control.Handle.ToInt32
Dim bmp As Bitmap

hWnd = Process.GetCurrentProcess.MainWindowHandle.ToInt32
bmp = New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
gDest = gDest.FromImage(bmp)
hdcSrc = GetWindowDC(hWnd)
hdcDest = gDest.GetHdc
BitBlt(hdcDest.ToInt32, 0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, hdcSrc, 0, 0, SRCCOPY)
gDest.ReleaseHdc(hdcDest)
ReleaseDC(hWnd, hdcSrc)

Dim a As SaveFileDialog
Dim loc As String = ""
a = New SaveFileDialog
a.Filter = "Image .PNG file *.PNG"
a.ShowDialog()
loc = a.FileName()
bmp.Save(loc)
Shell("c:\windows\system32\mspaint " & loc, AppWinStyle.MaximizedFocus) 'Use msPaint to open the Print screen image.

End Sub

Sunday, April 13, 2008

RIGHT MOUSE CLICK ON APPLE MOUSE ?



Few days ago, the keyboard and mouse i usually used my at office computer have spoilt cause by the frequently elecrticity break out at here. I was force to use alernate keyboard and mouse where there are no more spare keyboard and mouse left at the office. SWEAT -.-'''

At the end, i found the write off apple computer's keyboard and mouse. Well, honestly, i really happy to get these devices, it looks cool. hehe... ^.^ The keyboard is very nice, where it is nearly silent when i'm typing on the keyboard. This make my boss cant catch me on doing other thing else... hehe... nice le ? haha...

But the problem arise, when i use the mouse. I have just found out, that, apple mouse has only 1 click button!! Where the hell is my right click button?? -.-'''

I have been shaking head for fews days, trying to get myself to get use to 1 mouse buton. But, i failed to getting familiar with it. So, i have came out a solution to solve the right click issues on my apple mouse. By coding a program to call WinAPI to convert the left click to right click while pressing left shift button. Bellow are my codings on calling WinAPI and swapping the mouse button and get keyboard entery status.

Coding

Declare Function SwapMouseButton Lib "user32.dll" _
Alias "SwapMouseButton" (ByVal bSwap As Integer) As Integer
Private Declare Function GetKeyState Lib "user32.dll" _
(ByVal nVirtKey As Long) As Integer

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

If GetKeyState(160) > -10 Then

SwapMouseButton(0)

Else

SwapMouseButton(1)

End If
End Sub

Friday, April 11, 2008

Restoring Microsoft SQL database file


There is a time i faced Microsoft SQL Server database log file corruption problem on the POS machine i worked on. I googled many sites for different sources on restoring the corrupted log file for few days. At the end, all the sources i found is not applicable to the problem i faced. Sweat -.-'''

Well, some how, i was able to find a site for restoring the log fle. This solution help me restore the MSSQL server log file and the database is working fine after restoring the log file.

Bellow are the steps on restoring the log file :-

RESTORING MS SQL SERVER LOG FILE
1. Create a new database with the same name and same MDF and LDF files

2. Stop sql server and rename the existing MDF to a new one and copy the original MDF to this location and delete the LDF files.

3. Start SQL Server

4. Now your database will be marked suspect

5. Update the sysdatabases to update to Emergency mode. This will not use LOG files in start up

Sp_configure "allow updates", 1
go
Reconfigure with override
GO
Update sysdatabases set status = 32768 where name = "BadDbName"
go
Sp_configure "allow updates", 0
go
Reconfigure with override
GO
6. Restart sql server. now the database will be in emergency mode

7. Now execute the undocumented DBCC to create a log file
DBCC REBUILD_LOG(dbname,'c:\dbname.ldf') -- Undocumented step to create a new log file. (replace the dbname and log file name based on ur requirement)

8. Execute sp_resetstatus

9. Restart SQL server and see the database is online.
Hope these steps helps you to restoring the corrupted log file.

Tuesday, April 1, 2008

Hi Hi!!

Hi Hi!! Everyone... it's been a long time din log in and update my blog dy... hoho... more than 3 months dy lo... haha... sorry for dissapear for quite awhile ^.^

Last 2 month i have start working at a company as a analyst programmer dy lo... hoho...

when 1st day working, they assign me a project on rounding mechanism for their POS system. This is a standard set by government, where every transaction end if 1,2,8 and 9 cent, will be round down to nearst 10 cent, while 3,4,6 and 7 cent will be round to 5 cents.

Well, this is not the big challenge, the biggest challenge for this project is to create a security shrinkage to the POS system. Too much security loop holes found out hoho... ^.^ easy to illegal income oh... haha... Anyway my project is done dy and is currently been used by all branch company... i think most of the cashier who always try to do illegal action on the system really don like me, cuz i'm the one who suggest and implement the security shrinkage... muhaha... don care la... as long as i did my job... haha...