2014년 1월 24일 금요일

How to get the hash of block header in bitcoin

This is example of how to get the hash of block header in bitcoin.




* Calculation of the hash of block header

How to produce the different block hashes for each other in bitcoin


Most of block header will be the same for all users.

There might be some minor variation in the timestamps.

The nonce will usually be different, but it increases in a strictly linear way.

"Nonce" starts at 0 and is incremented for each hash.

Whenever Nonce overflows (which it does frequently),

the extraNonce portion of the generation transaction is incremented,

which changes the Merkle root.

Given block header, people generate the exact same sequence of hashes

as each other and the fastest CPU would almost always win.

However, it is (nearly) impossible for two people to have the same Merkle root

because the first transaction in your block is a generation "sent"

to one of your unique Bitcoin addresses.

Thus, your block is different from everyone else's blocks.



https://en.bitcoin.it/wiki/Block_hashing_algorithm

How to calculate the difficulty and target from the bit of bitcoin block header.


The method of obtainig the difficulty of bitcoin.


* Difficulty:  a measure of how difficult it is to find a new block.

    - changed by every 2016 blocks.

    - difficulty = maximum_target / current_target.

    - maximum target in bitcoin is constant.

         ==> 0x00000000FFFF0000000000000000000000000000000000000000000000000000

    - lower current target makes Bitcoin generation more difficult.

       the maximum target is the lowest possible difficulty.

* Difficulty 1 is defined as 0x1d00ffff,

    - maximum target : 0x00ffff * 2**(8*(0x1d - 3))

       = 0x00000000FFFF0000000000000000000000000000000000000000000000000000

* The maximum difficulty:  roughly maximum_target / 1, (about 2^224)



2014년 1월 17일 금요일

How to install Apache Server, MySQL, and PHP using XAMPP for Windows 7.

Xampp for Windows 7 provides an easy to install all of the Apache Server, MySQL, PHP, and Perl.

Once Xampp for Windows is installed, It is possible to treat a localhost  like a remote host and support for a content management system (CMS) like Joomla or Wordpress.

Step 1. download Xampp installer from http://www.apachefriends.org/en/xampp-windows.html




Step 2. Once the download is complete, click the xampp installer program in your download folder. Then the below window will be appeared.


Step 3.  When you click the next button, the below window is appeared.

You must check the mysql and phpmyadmin and , the other is optional.




And if the next button is press, the installation is completed.

And You can find out the Xampp control Panel by pressing the start button and all program button of Windows 7.




Step 4. Start the XAMPP Control Panel, then the below window will be appeared.

And press the start button in the red box to start the Apache Server and MySQL DB.
Once the Windows is booted, you run the XAMPP Control Panel and start the  Apache and MySQL like that.




Step 5. Type the http://localhost or http://127.0.0.1 in your web browser.

And  If 'It works!' in your web browser will be appeared, the Apache server is running well.

'It works!' in your web browser is  appeared by running C:\xampp\htdocs\index.html.


XAMPP program is installed in C:\xampp directory.



The web page, index.html, must be located in C:\xampp\htdocs.




Thus Joomla, Drupal, or Wordpress directory need to be installed in C:\xampp\htdocs like the below picture.




설정 사항을 알고 싶은면 '시작'-'모든 프로그램'-'보조 프로그램'-'메모장'을 선택하여 아래와 같이 입력한다.

Using notepad of Window, type  <?php phpinfo(); ?> like below, and save it with info.php as file name. 



And If you type http://localhost/info.php in your web browser, the below is appeared. 



And you can find that the  HTTP_HOST is localhost in the same web page, like the below picture.



How to Reduce Fan Noise of Laptop on Windows 7

The below is the method for reducing the noise of laptop on Windows 7.



1. In Windows 7, press the 'Start' button and the 'Control Panel'. 




2. Press the 'Hardware and Sound'.



3. Press the 'Power Options'.



4. Press the 'change plan settings' in the 'Balanced (recommended)'. 


5. Press the 'change advanced power settings'.



6. Double click the 'Processor Power Management', after you take down the side bar.




7. Double click the 'System cooling policy' and select the 'Passive' in the 'On battery' and 'Plugged in' radio button.




8. Double click the Maximum processor state' and change the value of input box in the 'On battery(%)' and 'Plugged in(%)'.

I usually select the value of 70  ~ 90%.
And if you select the smaller value, the fan noise and maximum of CPU state is reduced.

That is, as the value is smaller, the CPU speed and fan speed is slower.

Thus, there's no such thing as a free lunch.