Pages

Friday, 25 December 2009

Hard Disk Size Measurement

Manufacturers and operating system measures hard disk capacity in different ways. That is, the binary gigabyte and the decimal gigabyte. When we install a new 160 GB (manufacturer measurement) hard drive, we see that operating system reports only 149 GB. Similarly, if we install a 4GB hard disk we get 3.72GB. This difference is because of the way in which manufacturers and software developers calculate the drive capacity. Technically, hard drive capacity is calculated by multiplying the number of cylinders, sectors, and heads time 512.

Capacity = Cylinders * Heads * Sectors * 512 (bytes per sector)

So a typical drive with 7752 cylinders, 16 heads and 36 sectors.
7752 * 16 * 63 * 512 = 4,000,776,192 bytes

Hard disk manufacturers use decimal megabyte to determine the size of their hard drive.
4,000,776,197 bytes / 1,000,000,000 = 4.0 GB

Whereas software makers use binary megabytes to calculate the drive size. A binary gigabyte is 1,073,741,824 bytes and a binary megabyte is 1,048,576 bytes. So we get 4,000,776,192 bytes / 1,073,741,824 = 3.72.

Port Forwarding with NAT

Internal IP addresses are only visible to the computers within an internal network. So computers on the internal network can not send data directly to a computer outside of the network. When a computer on the network wants to send data to a computer outside of the network, it sends the data to the gateway. The gateway is the internal ip address of the router.Then the router decides what to do on this data. But NAT (Network Address Translation) will take care of most of the work. There are some programs that NAT was not designed to work with, those are the programs we need to set up port forwarding for.

Port Forwarding simply tells the router which computer on the local area network to send the data to. When you have port forwarding rules set up, your router takes the data off of the external IP address:port number and sends that data to an internal IP address:port number.
1. Open the terminal under windows (Win+R->cmd), and run
ipconfig
2. Note down the IP Address of Ethernet adapter Local Area Connection.

3. Open the browser, go to 192.168.1.1 and log in.
4. Go to Advanced Setup->NAT->DMZ Host. This depends on the type of router. Anyway there will be a NAT option somewhere.

5. Enter the noted down IP Address from step 2 here.

6. Press Save/Apply

Windows 7 Remote Kernel Crash

"The bug trigger an infinite loop on smb{1,2}, pre-auth, no credential needed...
If netbios_header is 4 bytes smaller or more than SMB_packet, it just blow !"

Firewall is useless in this case. This is the part of the Server Message Block (SMB) which is a protocol of the Microsoft Windows Network to provide shared access to files and printers. There is no BSOD, just pull of the plug.

Read more at Laurent Gaffié Blog: Windows 7 / Server 2008R2 Remote Kernel Crash

Tuesday, 22 December 2009

Activate TECHMODE in w700i

1. Enter *585*0000# in standby mode and press send.
2. Now go to Settings->Connectivity->Mobile Networks->TECHMODE.

TECHMODE Format
-------------------------
GSM Channel
-------------------------
A BBB CC -DD EEEEF G
HHHH I JJJ K LL MM
NNN OO PP QQQ RR SSSS
TTT TT UUU UU VVV VV
WWW WW XXX XX ZZZ ZZ

Standby mode shows only bold marked parameters.

These can be interpreted as follows.
A - current type of service
B - Broadcast control channel
S - Standalone dedicated control channel
T - Transfer channel
F - Frequency Hopping
BBB - number of current channel:
    001...124 - GSM900
    512...885 - DCS1800
    974...1023 - EGSM900
    9999 - no signal
CC - Number of current channel on a current BS (Base Station), it depends of operator settings
DD - receive level(RxLevel): -40dBm...-117dBm (-40 is strongest signal)
EEEE - Cell ID
F - Cell sector number
G - DTX
HHHH - may be another channel
I - Timeslot number: 0...7
    One of the eight channels which are used to transfer TDMA traffic.
    On 0 channel is transferred control information: BCCH, SDCCH, etc. Other channels are used for traffic.
JJJ - Transmitter signal level, 0...34 dBm
K - Bit Error Rate - number of errors, 0...7.
    0 - No errors. When more than 5, sound is being lost frequently.
    RxQual table
        0---BER < 0.2 (%)
        1---0.2 < BER < 0.4
        2---0,4 < BER < 0.8
        3---0.8 < BER < 1.6
        4---1.6 < BER < 3.2
        5---3.2 < BER < 6.4
        6---6.4 < BER < 12.8 (Half of packets are lost here)
        7---12.8 < BER
LL -Timing Advance. 0...63.
    With this parameter it is possible to calculate distance to BS using the following formula:
    L=1.11 x TA/2, where L is the distance to BS, TA - Timing Advance.
    In GSM standard max distance from BS is 35.2 km, so one number here is roughly 550 m.
    Timing Advance: 0; 1; 2; 3; 4; 5...63
    Distance to BS: <550 m; 550-1100 m; 1100-1650 m; 1650-2200 m; 2200-2750 m; 2750-3300 m ... 35.2 km.
MM - no info (seems like its the number of lost packets)
NNN - rate of speech codec:
    HR - half rate
    FR - full rate
    EFR - enhanced full rate
OO - no info, range 0...95 (seems like RxQual)
PP - no info, range 0...83
QQQ - Network Country Code (NCC)
RR - Operator Code (MNC)
SSSS - Location Area Code (LAC)
TTT TT, UUU UU, VVV VV, WWW WW, XXX XX, ZZZ ZZ - numbers & receive of the best alternative channels

If we want to quit from the TECHMODE, just press and hold the Back key. But the TECHMODE menu is still available.
After restarted your phone the TECHMODE menu will disappear. Or Enter *585*0000# in standby mode and press send once again.

Firefox Hacks

Open the Firefox browser and type the following in the address bar.
about:config
Accept the a warning, and continue.

Backup prefs.js. If something goes wrong, we can restore it by replacing the corrupted file. In Windows XP you can find it under C:\Documents and Settings\{your username}\ApplicationData\Mozilla\Firefox\Profiles\{profilename-with-some-string}.default\prefs.js
If it is not getting restored via the backup prefs.js file, we can exit Firefox and issue the command firefox -safe-mode to bring up the Firefox Safe Mode screen. Select "Reset All User Preferences To Firefox Defaults".

Speed up firefox
Search for the following entries and give values as shown below:
network.http.max-connections = 96
network.http.max-connections-per-server =32
network.http.max-persistent-connections-per-proxy =16
network.http.max-persistent-connections-per-server = 10
network.http.pipelining = true
network.http.pipelining.maxrequests = 8 
network.http.proxy.pipelining = true
network.http.request.max-start-delay = 0
Experiment with other values too.
Now right click and Choose New->Integer. Give the name as below:
nglayout.initialpaint.delay
And set the Integer value as 0. This value is the amount of time the browser waits before it acts on information it receives.

Disable extension install delay
security.dialog_enable_delay = 0
Default is 2000.

Spell check in all fields
layout.spellcheckDefault = 2
By default, Firefox checks spelling only in multi-line text boxes.

Remove Statusbar in AIR apps build with Flex Builder 3

To remove status bar, add the following code in the main Application window.
showStatusBar="false"
When we create AIR apps using the Adobe Flash CS4 IDE, there doesn't appear any status bar. But using Flex Builder 3, all the AIR apps will have status bar turned on by default.

Code (with status bar)
<mx:windowedapplication xmlns:mx="http://www.adobe.com/2006/mxml"
    backgroundgradientalphas="[1.0, 1.0]"
    backgroundgradientcolors="[#FFFFFF, #000000]"
    height="281" layout="absolute">
</mx:windowedapplication>
To remove status bar add the following code in the main Application window.
showStatusBar="false"
The complete code will look like below
<mx:windowedapplication xmlns:mx="http://www.adobe.com/2006/mxml"
    backgroundgradientalphas="[1.0, 1.0]"
    backgroundgradientcolors="[#FFFFFF, #000000]"
    height="281" layout="absolute" 
    showstatusbar="false">
</mx:windowedapplication>
Screen (after hiding the status bar)

Monday, 21 December 2009

Google Public DNS

Google introduced a public DNS. It can be used instead of the default DNS provided by your ISP.

  • Configure your network settings to use the IP addresses 8.8.8.8 and 8.8.4.4 as your DNS servers or
  • Read configuration instructions.
If you decide to try Google Public DNS, your client programs will perform all DNS lookups using Google Public DNS.Google's spider crawls all websites.

By using Google Public DNS you can:

Tuesday, 24 November 2009

Delete Bash History

History of bash sessions are stored in the RAM and written back to ~/.bash_history when the user logs out of the bash session.

To delete the bash history:

1. Delete the .bash_history file:
rm -rf ~/.bash_history
2. Clear the current history stored in RAM:
history -c
Stop logging the bash histories

● Turn off bash history for all users
Append “unset HISTFILE” to /etc/profile:
echo "unset HISTFILE" >> /etc/profile

● Turn off bash history for a specific user
Append “unset HISTFILE” to /home/USER/.bash_profile:
echo "unset HISTFILE" >> /home/USER/.bash_profile 

Monday, 23 November 2009

Unicode Symbols

Unicode symbols can be typed using the combination of ALT key and the numbers on the NumPad.

Alt + 1
Alt + 2
Alt + 3
Alt + 4
Alt + 5
Alt + 6
Alt + 7
Alt + 8
Alt + 9
Alt + 10
Alt + 11
Alt + 12
Alt + 13
Alt + 14
Alt + 15
Alt + 16
Alt + 17
Alt + 18
Alt + 19
Alt + 20
Alt + 21 §
Alt + 22
Alt + 23
Alt + 24
Alt + 25
Alt + 26
Alt + 27
Alt + 28
Alt + 29
Alt + 30
Alt + 31

These symbols can also be used from the IME Pad when you turn on the Japanese/Korean input.



€ � ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ � Ž � � ‘ ’ “ ” • – — ˜ ™ š › œ � ž Ÿ ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ±

² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö÷ ø ù ú û ü ý
þ、 。 , , . ・ ・ ・・ : ; ? ! ゛ ゜ ´ ` ¨ ^ ̄ _ ヽ ヾ ゝ ゞ 〃 仝 々 〆 〇 ー ― ‐ / \ ~ ∥ | … ‥‘ ’ “ ”
( )〔 〕 [ ] { } 〈 〉 《 》 「 」 『 』 【 】 + - ± × ÷ = ≠ < > ≦ ≧ ∞ ∴ ♂ ♀° ′ ″
℃ ¥$ ¢ £ % # & * @
§ ☆ ★ ○ ● ◎ ◇ ◆ □ ■ △ ▲ ▽ ▼ ※ 〒 → ← ↑ ↓ 〓
∈ ∋ ⊆ ⊇ ⊂ ⊃ ∪ ∩ ∧ ∨ ¬ ⇒ ⇔ ∀ ∃ ・ ∠ ⊥ ⌒ ∂ ∇ ≡ ≒ ≪ ≫ √ ∽ ∝ ∵ ∫ ∬ Å ‰
♯ ♭ ♪ † ‡ ¶ ◯
0 Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ τ υ φ χ ψ ω
А Б В Г Д Е Ё Ж З И Й К Л М Н О П  Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я
а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш щ ъ ы ь э ю я
─ │ ┌ ┐ ┘ └ ├ ┬ ┤ ┴ ┼ ━ ┃ ┏ ┓ ┛ ┗ ┣ ┳ ┫ ┻ ╋ ┠ ┯ ┨ ┷ ┿ ┝ ┰ ┥ ┸ ╂
① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳
Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ
㎝ ㎞ ㎎ ㎏ ㏄ ㎡ № ㏍ ℡
≒ ≡ ∫ ∮ ∑ √ ⊥ ∠ ∟ ⊿ ∵ ∩ ∪
ⅰ ⅱ ⅲⅳ ⅴ ⅵ ⅶ ⅷ ⅸ ⅹ
Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ
¬ ¦ ' "
๏ ๐ ๑ ๒
๓ ๔ ๕๖ ๗ ๘ ๙ ๚ ๛ ₪ ₫

      fi fl ﬠ
שׁ שׂ שּׁ שּׂ אַ אָ אּ בּ גּ
דּהּ וּ זּ טּיּ ךּכּ לּ
מּנּ סּ ףּ פּ צּ קּרּ שּ
תּ וֹ בֿכֿ פֿ ﭏ ﭖ ﭗﭘ
ﭙ ﭺﭻ ﭼ

ﭽ ﮊ ﮋ
ﮎ ﮏ ﮐ ﮑ ﮒ ﮓ ﮔ ﮕ ﮤ
ﮥ ﯼ ﯽ ﯾ ﱞ ﱟ ﱠ ﱡ ﱢ
﴾ ﴿ ﷲ ﺀ ﺁ ﺂ ﺃ ﺄ ﺅ
ﺆ ﺇ ﺈ ﺉ ﺊ ﺋ ﺌ ﺍ ﺎ
ﺏﺐ ﺑ ﺒ ﺓ ﺔ ﺕ ﺖ ﺗ
ﺘ ﺙ ﺚ ﺛﺜ

ﺝ ﺞ ﺟ
ﺠ ﺡ ﺢ ﺣ ﺤ ﺥ ﺦ ﺧ ﺨ
ﺩﺪ ﺫ ﺬ ﺭ ﺮ ﺯ ﺰ
ﺱﺲ ﺳ ﺴ ﺵﺶ ﺷ ﺸﺹ
ﺺ ﺻ ﺼ ﺽﺾ ﺿ ﻀ ﻁ

ﻂ ﻃ
ﻄﻅ ﻆ ﻇ ﻈ ﻉﻊ ﻋ ﻌ
ﻍ ﻎ ﻏﻐ ﻑ ﻒ ﻓ ﻔ ﻕ
ﻖﻗ ﻘ ﻙ ﻚ ﻛ ﻜ ﻝﻞ
ﻟ ﻠ ﻡ ﻢ ﻣﻤ ﻥ ﻦ ﻧ
ﻨﻩ ﻪ ﻫ ﻬ ﻭ ﻮﻯ ﻰ
ﻱ ﻲ ﻳ ﻴﻵ ﻶ ﻷ ﻸﻹ
لم ﻺ ﻻ ﻼ

ن ه و ى يً ٌ ٍ َ ُ
ِّ ْ % ٤ ٠ ١ ٢ ٣ ٥٦

ヲ _ カ シ ニ
♠ ♣

█ ▌▐
░░▒▓
▓▒░░ ░░░▒▓
▓▒░░░
░▒▓
▓▒░ ▓▒░ ░▒▓
░░
▀▄▀▄▀▄▀▄▀▄
▄▀▄▀▄▀
٩ ホ 么 メ _ ャ `
Special, rare characters and symbols
Face: ㋡
Writing:✐✑✒ ⌨
Religion and beliefs: ☥ ☦ ☧ ☩ ☪ ☫ ☬ ☭ ✌
Chess black : ♚ ♛ ♜ ♝ ♞ ♟
Chess White: ♔ ♕ ♖ ♗ ♘ ♙
Hands pointing: ☚ ☛ ☜ ☝ ☞ ☟
Crosses: ☩ ☨ ☦ ✙ ✚ ✛ ✜ ✝ ✞ ✠
Flowers: ❀ ✿ ❁ ✾
Injection:┣▇▇▇═─
Music: ♪ ♫ ♩ ♬ ♭ ♮ ♯
Stars and snowflake: ☆╮✡ ۞ ★ ☆ ⋆ ✩ ✮ ✯ ✰ ❇ ❈ ❅ ❄ ❆
Weather: ☼ ☀ ☁ ☂ ☃ ☄ ☾ ☽
Poker black: ♥ ♦ ♣ ♠
Poker White: ♡ ♢ ♤ ♧
Miscellaneous:✈ ✂ ✄ ✓ ☮ ✌
Phones: ☎ ☏ ✆
Religion & belief: ☯ ✡ ☨ ✞ ✝ ☮ ☥ ☦ ☧ ☩ ☪ ☫ ☬ ☭ ✌
Risk radioactive and biological: ☢ ☣
Writing: ✉ ✍ ✎ ✏ ✐✑✒ ⌨
Butterfly: Ƹ̴Ӂ̴Ʒ
Skull: ☠
Dinner: ♨

Decorative symbols
۩ ۞
▂ ▃ ▅ ▆ █

★·.·´¯`·.·★
..♩.¸¸♬´¯`♬.¸¸¤
¤♥¤Oº°‘¨☜♥☞¤
♬ •♩ ·.·´¯`·.·♭•♪
»------(¯`
•(♥).•*´¨`*•♥•(★)
•☆.•*´¨`*••♥
╰☆╮¤°.¸¸.·´¯`»®
♥ⓛⓞⓥⓔ♥☜
●☆● ☆● ☆● ☆●
๑۞๑,¸¸,ø¤º°`°๑۩
.•°¤*(¯`★´¯)*¤°
..•.¸¸•´¯`•.¸¸.ஐ
(¯`•.ゃ_ゃ.•
¸.•♥•.¸¸.•♥•
••.•´¯`•.••
(¯`•._)
׺°”˜`”°º×
.•´¯`•->
-•=»‡«=•-
»-(¯`v´¯)-»
•ï¡÷¡ï•
.•¯(_.•¯(_.•¯

Update: Unicode emoticons are available from emojipedia.org

Wednesday, 7 October 2009

Virtual Inauguration

This is an app for an inauguration ceremony, which was organised by the (CESA) Computer Science & Engineering Students Association which is a part of the CS department of the college. It is customary to have a lamp lit for inaugurating events in this part of the world.

Clicking on the trigger makes the trigger as the mouse, and it can be used to light the lamp. Bringing the trigger back to the initial position releases the trigger to rest and reveals the mouse.

Screens




This program is written in ActionScript 3.0 and runs on Adobe Flash Platform.

Saturday, 29 August 2009

Virtual Jackpot

This is a nifty app made to simulate a jackpot race. After clicking the start button, the horses get loaded and a next button appears on the screen. Clicking the next button makes a dice to roll at random, and corresponding to the outcome of the dice, the horse is advanced one step forward. The step is repeated until one of the horse crosses the finishing line first. The horse which reaches the finishing point first is the winner and the game stops.

Initially, people purchase tickets for their horse of choice, and if this horse wins the person gets a handful of money, similar to a real jackpot. The outcome is unpredictable since it is based on pseudo-random numbers. This is done as a part of a mid-term 2009 event for my college. The dice rolling animation is done by one of my friend Anjoe, using Cinema 4D. The program is written in ActionScript 3.0 and run on Adobe Flash Platform.

Some Screens






Friday, 12 June 2009

Legendary Warriors

Legendary Warriors is a multi-platform 2D fighting game for computers, which works with Adobe® AIR™. Choose your arena, characters and engage in a never ending battle. This is my college mini-project, which is also my first game that I release. It is written in ActionScript 3.0. The intro animation is done using Adobe After Effects. Sound editing with Sony Sound Forge. The sprite sheet used is from StreetFighter and not my own.

Cheat keys
Delete key : to reduce the life of opponent
L : increase the life of the player

For better responsiveness decrease the character repeat delay under the keyboard settings. See the help section in the game menu. Sprites are from street fighter.

Screens








Download Legendary Warriors
Download Documentation
Softpedia Mirror: Download Legendary Warriors
Download Source Code from github.com

This program was available from Adobe AIR marketplace, which does not exist anymore.