marți, 3 noiembrie 2009

Kaze no Gekido

Wind's Fury, the translation of xunrage is written as "Kaze no Gekido" in Japanese. 

luni, 19 octombrie 2009

Hello world!

Blogger supports scripted forms:

duminică, 11 octombrie 2009

Javascript object functions runs on creation

Consider the code bellow:

function myfunction(){
document.write("I was executed.");
}
var f = new myfunction();

The function myfunction is used as a class for the object f, and is also executed at creation time.

The code produces this result:

Static variable in a Javascript object function

Consider the code bellow:

function myfunction(){
var myvariable=19.21;
this.mymethod = function(){ return myvariable; };
this.increase = function(amount){ myvariable+=amount; };
}
var f = new myfunction();
document.write("initial value is " + f.mymethod());
f.increase(0.80);
document.write("<br/>new value is " + f.mymethod());

Because the function myfunction is used as a class for the object f, the local variable myvariable is considered static, although it can be accessed only by member functions like mymethod and increase. Therefore this code produces something like this:

sâmbătă, 10 octombrie 2009

Test Java Presence

To detect if Java is enabled on your computer use the following code:
if(navigator.javaEnabled()){ ... }

Therefore you on your computer.

marți, 22 septembrie 2009

Detecting Internet Explorer version with Javascript


This post contains JavaScript.

I have found on the Internet the following function for detecting Internet Explorer version:

function vIE(){return (navigator.appName=='Microsoft Internet Explorer')?parseFloat((new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})")).exec(navigator.userAgent)[1]):-1;}
  • The property navigator.appName returns something like:
  • The property navigator.userAgent returns something like:
  • The function returns the conditional result of the expression <logical> ? <value_for_true> : <value_for_false>
  • Constructor RegExp creates a new object and defines a regular expression as: [0-9] defines a character set formed by any character in the range 0-9; {x,} defines the minimum x number of occurrences used in the match; () creates a subexpression.
  • RegExp.exec(string) returns an array of the matches of the regular expression in the given string or null if no match is found. The returned array contains both matches for the regular expresion as well as for present subexpressions. For this reason, the second element in the array is parsed to a float value and returned by the function.
Therefore your Internet Explorer version is:

Note: You may get a wrong version for Internet Explorer 8 if you use Compatibility View, as at the time of this writing Blogspot domain is in the Compatibility View List (more information at this page). Check the list by typing in the Internet Explorer 8 address bar: .

miercuri, 2 septembrie 2009

DKU-5 Driver

Although the Nokia DKU-5 cable is rather old, there is not a fair practice to not support it on Vista. After a few searches on the web, I have found a third party driver for this cable that works with Windows Vista SP2. I put it on MediaFire.

If you have a Nokia 3100 phone like I have, it's recommended to use Nokia PC Suite 6.84 with it because the latest version crashes when I try to install java applications.

This phone supports only MIDP-1.0 and CLDC-1.0 for java applications, 128x128 color display with 4096 colors and MIDI poliphonic sounds.

marți, 25 august 2009

Registry value types

Name

Type

Data

(Default)
BigEndian Value
Binary Value
DWORD Value
Expandable String Value
LittleEndian Value
Multi-String Value
None Value
String Value

REG_SZ
REG_DWORD_BIG_ENDIAN
REG_BINARY
REG_DWORD
REG_EXPAND_SZ
REG_DWORD
REG_MULTI_SZ
REG_NONE
REG_SZ

xunrage 
0xff000000
32
0x00000020
A text here
0x00000100
"Line One" "Line Two"
10 00 00
A text here

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\xunrage]
@="xunrage"
"BigEndian Value"=hex(5):ff,00,00,00
"Binary Value"=hex:32
"DWORD Value"=dword:00000020
"Expandable String Value"=hex(2):41,00,20,00,74,00,65,00,78,00,74,00,20,00,68,\
00,65,00,72,00,65,00,00,00
"LittleEndian Value"=dword:00000100
"Multi-String Value"=hex(7):4c,00,69,00,6e,00,65,00,20,00,4f,00,6e,00,65,00,00,\
00,4c,00,69,00,6e,00,65,00,20,00,54,00,77,00,6f,00,00,00,00,00
"None Value"=hex(0):10,00,00
"String Value"="A text here"

Automatic logon script for Windows XP

I have created a command line script for setting the windows registry values to logon automatically in Windows XP. To set these values manually go to a previous post here.

@echo off
echo Automatic Logon in Windows XP

if exist "%SystemRoot%\system32\reg.exe" (
 echo REG.EXE was found...
 goto :runscript
)
goto :exitfail

:runscript
if /i "%1" equ "set" (goto :activelogon) else (if /i "%1" equ "unset" (goto :unactivelogon) else (goto :exitfail))

:activelogon
set /p theuser="Default User Name:"
set /p thepassword="Default User Password:"
echo Running REG.EXE to set the required values...
echo. 
echo Setting DefaultUserName...
"%SystemRoot%\system32\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DefaultUserName" /t REG_SZ /d "%theuser%" /f
echo.
echo Setting AutoAdminLogon...
"%SystemRoot%\system32\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoAdminLogon" /t REG_SZ /d "1" /f
echo.
echo Setting DefaultPassword...
"%SystemRoot%\system32\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DefaultPassword" /t REG_SZ /d "%thepassword%" /f
set theuser=
set thepassword=
goto :exitnormal

:unactivelogon
echo Running REG.EXE to delete the required values...
echo.
echo Deleting AutoAdminLogon...
"%SystemRoot%\system32\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoAdminLogon" /f
echo.
echo Deleting DefaultPassword...
"%SystemRoot%\system32\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DefaultPassword" /f
goto :exitnormal

:exitfail
echo.
echo Failed.
goto :eof
:exitnormal
echo.
echo All operations completed successfully.

You can also download it from the box.

luni, 24 august 2009

Some tweaks for Windows XP

To disable the sending of unique player ID for Windows Media Player modify or create the following value:

[HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Preferences]
"SendUserGUID"=hex:00

You can use the reg command for this as follows:

reg add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "SendUserGUID" /t REG_BINARY /d "00" /f

Set the value back to 01 to send the ID again.

To protect against SYN attacks: From this documentation results that the minimum settings required is as follows:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"SynAttackProtect"=dword:00000002
"TcpMaxPortsExhausted"=dword:00000005
"TcpMaxHalfOpen"=dword:000001f4
"TcpMaxHalfOpenRetried"=dword:00000190

These values are not present on a fresh installed system.


Disable Remote Registry service using the sc command (also discussed here):

sc stop RemoteRegistry
sc config RemoteRegistry start= disabled

Set the default back with:

sc config RemoteRegistry start= auto
sc start RemoteRegistry

Twitter Updates