Tuesday, February 25, 2014

Turn on and off java cache, windows, command line


Settings are kept under %userprofile%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
and under registry HKCU\Software\AppDataLow\Software\JavaSoft\DeploymentProperties

When java cache is off then deployment.properties includes:
deployment.cache.enabled=false
reg add "HKCU\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
/v deployment.cache.enabled /t REG_SZ /d "false" /f
When java cache is on then deployment.properties excludes:
deployment.cache.enabled=false
reg delete "HKCU\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
/v deployment.cache.enabled /f
Check for java cache status
@echo off
setlocal EnableDelayedExpansion
ver | find "Version 5." > nul 2>&1
if !errorlevel!==0 (
set dp=%appdata%\Sun\Java\Deployment\deployment.properties
) else (
set dp=%userprofile%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
)
if not exist %dp% echo No customization found. Default config used instead. & goto end
type "%dp%" | find "deployment.cache.enabled=false" > nul 2>&1
if !errorlevel!==0 echo Java cache is disabled
if not !errorlevel!==0 echo Java cache is enabled 
endlocal
:end
pause
Turn on java cache. This only works if Java control panel is opened at least once.
@echo off
setlocal EnableDelayedExpansion
ver | find "Version 5." > nul 2>&1
if !errorlevel!==0 (
set dp=%appdata%\Sun\Java\Deployment\deployment.properties
) else (
set dp=%userprofile%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
)
if not exist %dp% echo No customization found. Default config used instead. & goto end
type "%dp%" | find "deployment.cache.enabled=false" > nul 2>&1
if !errorlevel!==0 (
type "%dp%" | find /V "deployment.cache.enabled=false" > "%temp%\java.deployment.properties.tmp"
move /Y "%temp%\java.deployment.properties.tmp" "%dp%"
reg delete "HKCU\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
/v deployment.cache.enabled /f
)
endlocal
:end
pause
Turn off java cache. This only works if Java control panel is opened at least once.
@echo off
setlocal EnableDelayedExpansion
ver | find "Version 5." > nul 2>&1
if !errorlevel!==0 (
set dp=%appdata%\Sun\Java\Deployment\deployment.properties
) else (
set dp=%userprofile%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
)
if not exist %dp% echo No customization found. Default config used instead. & goto end
type "%dp%" | find "deployment.cache.enabled=false" > nul 2>&1
if not !errorlevel!==0 (
echo deployment.cache.enabled=false>> "%dp%"
reg add "HKCU\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
/v deployment.cache.enabled /t REG_SZ /d "false" /f
)
endlocal
:end
pause
Related:
http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/jcp/properties.html

Process Monitor cartridges

This is cartridge for RegSetValue under HKLM
reg add "HKCU\Software\Sysinternals\Process Monitor" /v "FilterRules" /t REG_BINARY /d 0102000000779c0000000000000118000000520065006700530065007400560061006c007500650000000000000000000000879c000004000000010c00000048004b004c004d005c0000000000000000000000 /f
reg add "HKCU\Software\Sysinternals\Process Monitor" /v "EulaAccepted" /t REG_DWORD /d 1 /f

Cartridge for Java settings in for currently logged user
reg add "HKCU\Software\Sysinternals\Process Monitor" /v "FilterRules" /t REG_BINARY /d 0102000000779c0000000000000118000000520065006700530065007400560061006c007500650000000000000000000000879c000004000000015600000048004b00430055005c0053006f006600740077006100720065005c0041007000700044006100740061004c006f0077005c0053006f006600740077006100720065005c004a0061007600610053006f006600740000000000000000000000 /f
reg add "HKCU\Software\Sysinternals\Process Monitor" /v "EulaAccepted" /t REG_DWORD /d 1 /f

Reset to Process Monitor defaults
reg delete "HKCU\Software\Sysinternals\Process Monitor" /f
reg add "HKCU\Software\Sysinternals\Process Monitor" /v "EulaAccepted" /t REG_DWORD /d 1 /f
Related:
http://download.sysinternals.com/files/ProcessMonitor.zip

Sunday, February 23, 2014

Friday, February 21, 2014

List connected network printers in user session

This will list exact sharing name of printer. Complete network address of printer.
Useful to know before re-install user environment.

Files needed:
http://gnu.catonrug.net/grep.exe
http://gnu.catonrug.net/libiconv2.dll
http://gnu.catonrug.net/libintl3.dll
http://gnu.catonrug.net/regex2.dll
http://gnu.catonrug.net/sed.exe

list.cmd
@echo off
set s=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider\Servers
set path=%path%;~dp0
setlocal EnableDelayedExpansion

for /f %%a in ('^
reg query "%s%" ^|
sed "s/.*\\Servers\\//g;" ^|
grep -v "^$"') do (
for /f %%b in ('^
reg query "%s%\%%a\Printers" ^|
sed "s/.*\\Printers\\//g;" ^|
grep -v "^$"') do (
reg query "%s%\%%a\Printers\%%b\DsSpooler" > nul 2>&1
if !errorlevel!==0 for /f "tokens=*" %%c in ('^
reg query "%s%\%%a\Printers\%%b\DsSpooler" /v "url" ^|
grep -v "HKEY_LOCAL_MACHINE" ^|
sed "s/REG_SZ\|url//g" ^|
sed "s/^[ \t]*//g" ^|
sed "s/http://g;s/\//\\/g;"') do (
echo %%c
)

)

)
endlocal
pause
sed "s/.*\\Servers\\//g;" cut the output line content from line start till \Servers\
grep -v "^$" - remove empty lines
grep -v "HKEY_LOCAL_MACHINE" - remove lines which includes HKEY_LOCAL_MACHINE
sed "s/REG_SZ\|url//g" - deletes all REG_SZ and url
sed "s/^[ \t]*//g" - remove all white spaces and tabs at the start of line
sed "s/http://g;s/\//\\/g;" - deletes all http:; replace / with \

To list just the name use list.names.cmd
@echo off
set path=%path%;~dp0
reg query HKCU\Printers\Connections | sed "s/.*Connections\\//g;" | sed "s/,/\\/g;" | grep -v "^$"
pause

Related:
List locally installed printers on remote machine
Set group policy user logon or computer startup script to run locally

Wednesday, February 19, 2014

A system shutdown is in progress.(1115)

You used shutdown -m \\%1 -r -t 0 -f to restart remote machine and receive:

To ensure the computer are not restarted use psexec \\%1 net statistics server to look for boot time:
http://live.sysinternals.com/Tools/psexec.exe

If computer is not restarted try to kill winlogon service with pskill \\%1 winlogon
http://live.sysinternals.com/Tools/pskill.exe

If no success then determine which process takes memory with psexec \\%1 tasklist

kill the process for example with pskill \\%1 TrustedInstaller

Once you kill the right process the computer will go in reboot instantly cause you launch the shutdown command like hour ago.

In all examples replace %1 with your remote computer name.

Sunday, February 16, 2014

Have a bug

Friday, February 14, 2014

Create archive, detect duplicate files

7z version 7.20 supports duplicate file check.
If you make a copy of file,
rename to something else and
move into a sub directory
then the second files size will be not added to the whole size of archive.

Screenshot represents the one same file with different file names.
The size included in archive summary is counted only once. This is awesome.

This is huge advantage for 7-zip unless other archiver types include this option

If the archive is created from jpg or mp3 there is a possibility that also ISO CD/DVD image archive can beat such popular type as RAR.

Using ImgBurn this can can be implemented by selecting "Optimize duplicate files".


PeaZip can create 7z archive but the 7z libraries included in version 5.2.1 is in beta and do not support duplicate files
You need to update 7z.exe and 7z.dll in C:\Program Files\PeaZip\res\7z if want to support duplicate file solution.
Once you overwrite back the stable 7z.exe and 7z.dll with version 9.20 then also PeaZip 7z file type will support duplicate file check.

Tuesday, February 11, 2014

Credit card last digit calculator in c language, Luhn algorithm

American Express numbers all start with 34 or 37;
MasterCard numbers all start with 51, 52, 53, 54, or 55;
Visa numbers all start with 4

Another sign that credit card number is real by calculation of last digit:
#include <cs50.h>
#include <stdio.h>

// function to check for number with more than 1 digits.
// if found then sum the numbers
// 10 = 1 + 0, 11 = 1 + 1, 12 = 1 + 2, 34 = 3 + 4
int sumof2(int a);

int main(void) {
printf ("Input credit card number without last digit: ");
long long card = GetLongLong();
long long digit;
int sum=0,sw=1;

while (card > 0)
{
// take the laste digit
digit=card % 10;

// sw stands for switch.
// 1 means the digit needs to multiple by 2. 
// 0 means the digit is ready to add to the sum
if (sw==1) {
sum=sum+(sumof2(digit*2)); 
sw=0;
} 
else if (sw==0) 
{
sum=sum+digit;
sw=1;
}

// cut of the last number from credit card
card = card / 10;

} 

printf ("Last digit is %i\n", sum*9 % 10);

}

int sumof2(int a) {
if (a>9) return (a%10)+(a/10);
else return a;
}
Related:
https://en.wikipedia.org/wiki/Luhn_algorithm
https://d2o9nyf4hwsci4.cloudfront.net/2013/fall/psets/1/hacker1/hacker1.html

Mario problem set at computer science

Standard edition to implement the pyramid. Max height not greater 23
#include <stdio.h>
#include <cs50.h>

int main(void)
{
int i;
do {
printf("Give me some positive int not bigger than 23: ");
i = GetInt();
} while (i <= 0 || i>23);
int n=i;

do {
for (int j=1;j<i;j++) printf(" ");
for (int k=1;k<3+(n-i);k++) printf("#");
printf ("\n");
i--;
} while (i>0);

}
Successful output
./mario
Give me some positive int not bigger than 23: 8
       ##
      ###
     ####
    #####
   ######
  #######
 ########
#########
Hacker edition is to implement two pyramids and hole between them:
#include <stdio.h>
#include <cs50.h>

void charprint(char c, int i);

int main(void)
{
int i;
do {
printf("Give me some positive int not bigger than 23: ");
i = GetInt();
} while (i <= 0 || i>23);
int n=i;

while (i>0) 
{
charprint(' ',i);
charprint('#',2+(n-i));
charprint(' ',2);
charprint('#',2+(n-i));
printf ("\n");
i--;
};

}


void charprint(char c, int i)
{
for (int n=1;n<i;n++) printf("%c",c);

}
Successful output
./mario
Give me some positive int not bigger than 23: 4
   #  #
  ##  ##
 ###  ###
####  ####
Related:
http://cdn.cs50.net/2013/fall/psets/1/pset1/pset1.html
http://cdn.cs50.net/2013/fall/psets/1/hacker1/hacker1.html

Printer spooler always stops.
Remove the connection and driver from non-existing mapped printer

Printer spooler always stops.

Launch regedit and let the user type his credentials.

Move to HKEY_CURRENT_USER\Printers\Connections and delete the key who is not existing anymore.

You can also delete printer settings under
HKEY_CURRENT_USER\Printers\Settings

With administrative permissions restart printer spooler.

If no success then with admin permissions under regedit delete all connections under
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider\S-1-5-21-725345543-515967899-839522115-6576\Printers\Connections
Remove printer id key searched by printer driver name under
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider\Servers\server-name\Printers

Restart printer spooler

Extract oracle certificate from VirtualBox windows installer

download 7-zip libraries:
http://gnu.catonrug.net/7z.exe
http://gnu.catonrug.net/7z.dll

Create extract-cer.cmd
set vb=%temp%\vbtemp
mkdir "%vb%"
"%~dp07z.exe" x "%~dp0VirtualBox*-Win.exe" -o"%vb%"
"%~dp07z.exe" x "%vb%\*.iso" -o"%vb%"
xcopy /i /c /r /s /y "%vb%\cert\*.cer" "%~dp0"
Download VirtualBox latest installer VirtualBox-x.y.z-12345-Win.exe at
https://www.virtualbox.org/wiki/Downloads

Run extract-cer.cmd

Sunday, February 9, 2014

Flower dance

Saturday, February 8, 2014

How NES zapper works


When the two ducks are on the screen if you press trigger now
1) your screen gets blank to "establish secure connection" from tv to your zapper :D
2) then after ~0.016 seconds the first duck appears as white rectangle.
3) then again after ~0.016 seconds the second duck appears as white rectangle.

Here is how the targeting can be implemented
while (check1==black) (
if (check2==white && check3==black) first duck dies
if (check2==black && check3==white) second duck dies
)

Friday, February 7, 2014

Navigating through labels, create index, blogger.com

This is just an idea to navigate to index of tag via labels.
Once the label is clicked the JavasSript hide the post content.
This will show a index of all subjects.

Here is how to implement it:
Set the identifier to each posts div#date, div#header, div#post-body and div#post-footer
<div expr:id='&quot;date-header-&quot; + data:post.id' />
<div expr:id='&quot;post-header-&quot; + data:post.id' />
<div expr:id='&quot;post-body-&quot; + data:post.id' />
<div expr:id='&quot;post-footer-&quot; + data:post.id' />
Once you click the label the javascript detects "label" word at the address bar.
Now the javascript hide all post content except the titles of posts
<script type='text/javascript'>
  if (document.location.href.indexOf(&#39;/label/&#39;) &gt; -1)
{
document.getElementById(&#39;post-footer-<data:post.id/>&#39;).style.display = &#39;none&#39;;
document.getElementById(&#39;date-header-<data:post.id/>&#39;).style.display = &#39;none&#39;;
document.getElementById(&#39;post-header-<data:post.id/>&#39;).style.display = &#39;none&#39;;
document.getElementById(&#39;post-body-<data:post.id/>&#39;).style.display = &#39;none&#39;;
}
</script>
This is less useful if your post are pretty long.
Then you need also press "Older Posts" button

Count elements in string array, c language

#include <stdio.h>

int main(void)
{
char *array[] = {"Google","Facebook","Nexus","Awesome"};
int count=0;
while (array[count] != NULL) count++;

printf("The size of array is %i\n", count);

}

Repair Samsung Galaxy Y (GT-S5360)

Download all necessary files
https://drive.google.com/uc?export=download&id=0BxmEiwnrWfmmVTdnNUsyVDBfX1k

This package includes
Samsung-Galaxy-Y-(GT-S5360)-USB-driver.exe
16a043b4bd3dda500318503d795e619d
5a26b198c65d50488975fca7e1c879e8f1316101
BOOT_S5360DDKK1_REV05.tar
b9357e5396725337d6d5e73ee2b187d1
3a4d8d975e94f05d73ee7a7b127e9dfe6eb141ea
GT-S5360-MULTI-CSC-ODDKJ3.tar
551196fca3e44eae6c75b0399f62d366
c033b7d74631ac6b21f0e146610940a40b3cf0b3
MODEM_S5360DDKK1_REV05.tar
68aef2867ddd6c7603d789b0cc9db820
467a9100aeb39cdec50921ac6ad2b943fc2ef570
PDA_S5360DDKK1_REV05.tar
3578382c3006e8f6496c580ef289bad3
2868ff14af8865d289665437c22e72a85cbfda55

Now you phone is turned off.
Hold down Volume down + Home button + Turn on the phone
This brings you to screen:

Press Volume Up button. This will take you to ODIN mode

Now plug your phone to computer and open Odin3 v1.85.exe
Be sure the yellow rectangle is on. Follow instructions on picture

Source:
https://www.youtube.com/watch?v=Z7R7UzKHLqY

Thursday, February 6, 2014

Create more pages without date, blogger.com limit 20

In blogger.com there are limit to create static sections (pages NOT posts).

The main advantage that is that by default pages have not date showed.

I solved this by create the "date" heading tag inside div#date-header

By default
<h2 class='date-header'><span><data:post.dateHeader/></span></h2>
I replaced this with
<div id='date-header'><h2 class='date-header' ><span><data:post.dateHeader/></span></h2></div>

<script type='text/javascript'>
if (document.location.href.indexOf('2012/02') &gt; -1)
{
document.getElementById('date-header').style.display = 'none';
}
</script>
Now all posts which i will post in past just in any day in February 2012 will be showed without date.

Wednesday, February 5, 2014

Random function in c language

Basic:
#include <stdio.h> // for printf
#include <stdlib.h> // for rand
#include <time.h> //for time

int main(void) 
{
int max=150; // set the scope betwen [0,149]
srand(time(NULL)); 
int r=rand() % max;
printf("%i \n",r);
}
Create and call function
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int random(int a) 
{
srand(time(NULL));
return rand() % a;
}

int main(void) {
printf("Random integer for scope [0,179] is %i \n",random(180));
}
Random names using function:
#include <cs50.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#define number 3

int random(int a) { srand(time(NULL)); return rand() % number; }

int main(void)
{

char* names[number];

for (int i=0;i<number;i++)
    {
        printf("Whats the %i name: ",i+1);
        names[i]=GetString();
    }

printf("%s \n",names[random(number)]);
}

Three resolution profiles to extend advertisements, blogger.com

I have created three profiles to extend advertisements if the monitor has more than 1024 pixel width.

Level 1
The first profile is minimal view for monitors with 1024 width.
No additional advertisements are enabled. Only basic advertisements are showed

Level 2
The second profile i am aiming on 17" and 19" monitors (1280x1024) and
all wide screen laptops which at most has resolution 1280x800 or 1366x768

Level 3
Third profile i am aiming on 1600x900 laptops and standard full HD monitors which has 1920x1080

Basically if the Level 2 is active then Level 3 is inactive.
Inactive means the advertisement block is only hidden but running in background.
The block is prepared to show if the width reaches next level.

If the Level 1 is active then hide Level 2 and Level 3.

Here is how i implement it all
I create css setting
#if1280 {float:left;height:600px;position:fixed;margin:0px; z-index:1; display:none;}
#if1600 {float:left;height:600px;position:fixed;margin:0px; z-index:2; display:none; top:92px;}
Basic structure
load css
..
body tag starts
..
load first additional advertisement block, but hide it
..
load second additional advertisement block, but hide it
..
load main "div#root-section" tag
take the width value of main "div#root-section" tag and 
calculate new FIXED "style.top" and "style.left" position for #if1280 and #if1600.
calculate new padding parameters for "div#root-section" to push the whole "div#root-section"
to the left or right side
calculate if the browser windows width is bigger than 1200 then show level 2 advertisement block
calculate if the browser windows is bigger than 1450 then show level 3 advertisement block
if the screen is resized back to ~ 1024 width then hide level 2 and level 3 block

if you will miss the correct calculation you can easily get banned for adSense account or blog
cause your adds are over the whole content and that is completely bad and wrong and illegal
be accurate what you doing
..
..
..
..
..
activate JavaScript function to listen if the page has been resized/maximized
This needs again to
1. calculate the fixed position of each block
2. hide or show #if1280, #if1600 or booth blocks
To insert JavaScript here in blogger inside in main content (NOT into the "head" tag or just before "body" ends)
you need to convert JavaScript using
http://text-symbols.com/tools/escape-chars/

So here is how looks like the JavaScript. Place it just after (not before) the "div#content" starts. Place inside "div#content"!
&lt;script type=&quot;text/javascript&quot;&gt;
if ( document.documentElement.clientWidth &gt; 1250  ) {
document.getElementById(&#39;if1600&#39;).style.display = &#39;none&#39;;
document.getElementById(&#39;if1280&#39;).style.display = &#39;block&#39;;
document.getElementById(&#39;root-section&#39;).style.padding = &#39;0px 0px 0px 80px&#39;;
document.getElementById(&#39;if1280&#39;).style.width = &#39;165px&#39;;
    var leftmargin1280 = (document.documentElement.clientWidth - 960) / 2 - 138 + &#39;px&#39;;
document.getElementById(&#39;if1280&#39;).style.left = leftmargin1280;
}

if ( document.documentElement.clientWidth &gt; 1450  ) {
document.getElementById(&#39;if1280&#39;).style.display = &#39;block&#39;;
document.getElementById(&#39;if1600&#39;).style.display = &#39;block&#39;;
leftmargin1280 = (document.documentElement.clientWidth - 960) / 2 - 250 + &#39;px&#39;;
document.getElementById(&#39;if1280&#39;).style.left = leftmargin1280;
document.getElementById(&#39;root-section&#39;).style.padding = &#39;0px 220px 0px 80px&#39;;
document.getElementById(&#39;if1600&#39;).style.width = &#39;305px&#39;;
    var leftmargin1366 = (document.documentElement.clientWidth - 960) / 2 + 910 + &#39;px&#39;;
document.getElementById(&#39;if1600&#39;).style.left = leftmargin1366;
}

    if ( document.documentElement.clientWidth &lt; 1250  ) {
document.getElementById(&#39;if1280&#39;).style.display = &#39;none&#39;;
document.getElementById(&#39;if1600&#39;).style.display = &#39;none&#39;;
document.getElementById(&#39;root-section&#39;).style.padding = &#39;0px 0px 0px 0px&#39;;

    }

&lt;/script&gt;
960 is width for main content "div#root-section"

Paste the same calculation just before "body" tag ends, but this time insert it into the function windows.onresize
&lt;script type=&quot;text/javascript&quot;&gt;
window.onresize = function() {

...

    }
&lt;/script&gt;


For 250x255 adds us
&lt;script type=&quot;text/javascript&quot;&gt;

if ( document.documentElement.clientWidth &gt; 1250  ) {
document.getElementById(&#39;if1280&#39;).style.display = &#39;block&#39;;
document.getElementById(&#39;root-section&#39;).style.padding = &#39;0px 0px 0px 256px&#39;;
document.getElementById(&#39;if1280&#39;).style.width = &#39;255px&#39;;
    var leftmargin1280 = (document.documentElement.clientWidth - 960) / 2 - 144 + &#39;px&#39;;
document.getElementById(&#39;if1280&#39;).style.left = leftmargin1280;
}

    if ( document.documentElement.clientWidth &lt; 1250  ) {
document.getElementById(&#39;if1280&#39;).style.display = &#39;none&#39;;
document.getElementById(&#39;root-section&#39;).style.padding = &#39;0px 0px 0px 0px&#39;;
    }

if ($(window).height() &gt; 700) {
document.getElementById(&#39;third-ad&#39;).style.display = &#39;block&#39;;
}

if ($(window).height() &lt; 700) {
document.getElementById(&#39;third-ad&#39;).style.display = &#39;none&#39;;
}

&lt;/script&gt;

Tuesday, February 4, 2014

The program can't start because MSVCP100.dll is missing from your computer

The program can't start because MSVCP100.dll is missing from your computer. Try reinstalling the program to fix this problem.

To solve se issue install these packages:
http://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe
1801436936e64598bab5b87b37dc7f87
28c54491be70c38c97849c3d8cfbfdd0d3c515cb
http://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe
c9d9eebccef20d637f193490cec05e79
15d032d669078aa6f0f7fd1cbf4115a070bd034d

Include but exclude in url, JavaScript

Launch only if found in url /label/ but not /label/Meow.
Basic
<script type='text/javascript'>
if (document.location.href.indexOf('/label/') > -1 && document.location.href.indexOf('/label/Meow') < 0)
{
document.getElementById('post-show-<data:post.id/>').style.display = 'none';
}
</script>
Converted for blogger
<script type='text/javascript'>
  if (document.location.href.indexOf(&#39;/label/&#39;) &gt; -1 &amp;&amp; document.location.href.indexOf(&#39;/label/Meow&#39;) &lt; 0)
{
document.getElementById(&quot;post-show-<data:post.id/>&quot;).style.display = &#39;none&#39;;
}
</script>

Monday, February 3, 2014

Upgrade BIOS, AT489AV with 786G2 motherboard

http://www.piriform.com/speccy

This is BIOS update just exactly for version 786G2 motherboard:
http://ftp.hp.com/pub/softpaq/sp53501-54000/sp53698.exe

Remember to unload antivirus, disable windows update service, disable system center service.
Once you extract sp53698.exe launch
C:\swsetup\SP53698\HPQFlash\HPQFlash.exe

After this upgrade the 786G2 motherboard still NOT support 4GB RAM modules.
Only 2GB modules is supported which brings together possibility to install 8GB at max.
Just like in brochure: http://h10057.www1.hp.com/ecomcat/hpcatalog/specs/provisioner/05/AT489AV.htm

2014.04.10 updated:
VH648AA (HP 4-GB PC3-10600 (DDR3-1333 MHz) really works on this AT489AV machine.
2014.06.18 updated:
Also 4Gb BLS4G3D1339DS1S00 are welcomed!
and by default it uses 2Gb 8JTF25664AZ-1G4D1

Open *.264 video file, ProcessViewerPro

https://drive.google.com/open?id=0BxmEiwnrWfmmYUZPcTJQWmhBUzA
2232dc4ebd03e621358a188a8f92307d
3f20697e51989d37bddb21d281f8356a00399ba4

Rename to 7z and extract content

Screenshot:

Exact version:

Sunday, February 2, 2014

My first bubble sort in c language

#include <stdio.h>

// create a swap function
#define swap(a, b) do { a = b + a; b = a - b; a = a - b; } while (0)

// size of array length 
#define size 5

int main() {

int n[size]={4,3,2,1,-5};
// n stands for numbers

// set the pointer limitation to to the last pairs first number
int p=size-1;
// p stands for pointer

// output the first status of array now!
for (int j=0; j<size; j++) printf ("%i ",n[j]);
printf("\n");

while (p>0) {
for (int i=0; i<p;i++) {

// if found bigger number on the left side then swap variables
if (n[i]>n[i+1]) swap(n[i],n[i+1]);

// output the status of array now!
for (int j=0; j<size; j++) printf ("%i ",n[j]);
printf("\n");

}

// in bubble sort algorithm if the pointer reach the end of array and launch the swap function
// this means that the last element has now established the bigger value of all available
// no need to check for it next time
p--;
}

}
And here is how can group the string array in alphabetical order
#include <stdio.h>
#include <ctype.h>


// create a swap function for swapping two strings
void swap(char **t1,char **t2) {char *t; t= *t1; *t1= *t2; *t2=t;}

#define size 6

int main() {
char *names[size]={"Peter","Cory","Eve","Commondo","Ace","hello"};

int p=size-1;

for (int j=0; j<size; j++) printf ("%s ",names[j]);
printf("\n");

while (p>0) {
for (int i=0; i<p;i++) {

int l=0;

char l1,l2;

// find not equalent letter for comparing
do {

// define the comparing letter from first word 
l1=tolower(names[i][l]);

// define the comparing letter from second word
l2=tolower(names[i+1][l]);

// if found equalent letter then be prepared to compare next letter
if (l1 == l2) l++; 

// output the status of comparing
printf("%c, %c, %i\n", l1, l2, l);
} while (l1 == l2);

if (l1>l2) swap(&names[i],&names[i+1]);

// output the status of array now!
for (int j=0; j<size; j++) printf ("%s ",names[j]);
printf("\n");

}
p--;
}

printf("\n");
printf("The final status:\n");
for (int j=0; j<size; j++) printf ("%s ",names[j]);
printf("\n");

}
This will output
Peter Cory Eve Commondo Ace hello 
p, c, 0
Cory Peter Eve Commondo Ace hello 
p, e, 0
Cory Eve Peter Commondo Ace hello 
p, c, 0
Cory Eve Commondo Peter Ace hello 
p, a, 0
Cory Eve Commondo Ace Peter hello 
p, h, 0
Cory Eve Commondo Ace hello Peter 
c, e, 0
Cory Eve Commondo Ace hello Peter 
e, c, 0
Cory Commondo Eve Ace hello Peter 
e, a, 0
Cory Commondo Ace Eve hello Peter 
e, h, 0
Cory Commondo Ace Eve hello Peter 
c, c, 1
o, o, 2
r, m, 2
Commondo Cory Ace Eve hello Peter 
c, a, 0
Commondo Ace Cory Eve hello Peter 
c, e, 0
Commondo Ace Cory Eve hello Peter 
c, a, 0
Ace Commondo Cory Eve hello Peter 
c, c, 1
o, o, 2
m, r, 2
Ace Commondo Cory Eve hello Peter 
a, c, 0
Ace Commondo Cory Eve hello Peter 

The final status:
Ace Commondo Cory Eve hello Peter

Two hunters

Saturday, February 1, 2014

Arrays in c language

char alpha[4]; - create a character array that pre-reserve 4 boxes in memory.
later you can assign the value to alpha[0], alpha[1], alpha[2], alpha[3], but NOT alpha[4].

alpha[3]='r'; - assign character r as a forth element of character array alpha. Always use only single quotes to assign character.
alpha[3]="r"; - this is wrong.

int scores[3]; - be prepared to assign three integers.
int ages[3]={4,21,28}; - assign ages instantly.

char alpha[3]={'r','u','g'}; - create array and assign all elements to it instantly.
You can assign less elements than length of array like char alpha[3]={'r','u'};.
You can NOT assign more elements like char alpha[3]={'r','u','g','i'};.
The first element of arrays always starts with zero. For example alpha[0]=='r'

= in c means ASSIGNMENT
== is used to look for equivalent values

char* stringo[3]; - create array of strings that have 3 empty boxes.
char* stringo[3]={"Cory Williams","Grandma Rose","Hello"}; - install value assignment.

Example
#include <stdio.h>
int main(void)
{
char alpha[3]={'i','a','o'};
char* stringo[3]={"Cory Williams","Grandma Rose","Cat"};
int age[4]={6,7,13,31};
printf("My name is %s. I'm %i.\n", stringo[0],age[3]);
printf("One letter that describes my life is \"%c\"!\n",alpha[1]);
}
This will output
My name is Cory Williams. I'm 31.
One letter that sescribes my life is "a"!
%i in the printf means integer.
%s in the printf means string.
%c in the printf means char.
\" in the printf means ".

Since string arrays are created from character array you can output also single character.
char* names[3]={"Anna","Peter","Mark"};
printf("%c\n",names[1][2]);
This will output only third symbol from second name which is t.

Single character in computer science are coded with 8-bits. This value is number between 0 and 255.
Using ASCII table it is possible to check which letter have bigger value
if ('r' < 'T') ...
r is 114
T is 84

char x='t'-32; - this will convert small letter t to big letter T. Read more at:
Convert lower case letters to upper in c language

Related:
https://www.youtube.com/watch?v=ywWjcRaE8ZQ
http://cs50.tv/2013/fall/#about,sections