- When using Vidalia 0.1.15, Tor 0.2.1.19 and Privoxy 3.0.6, use the proxy 127.0.0.1:8118. The port 8118 is the default in Privoxy.
- In VirtualBox to access the shared folders:
net use x: \\vboxsvr\shared /persistent:yes
To remove such a shared folder:
net use x: /delete
2009-12-24
Quick Tips
2009-12-16
Philosophy through IT
- A context is an existential environment with a set of binding rules.
- An environment is a space that may contain objects.
- An existential environment is an environment that has a conglomerate of factors that supports existence.
- Existence is a sequence of events in a time line, a space and abiding by a set of binding rules, thus existence is a sequence of events in a time line and a context.
- An object is a conglomerate of elements that exist in a context and are tied together by a set of binding rules.
- A persistence is an existence without a time frame.
- A time frame is a well defined portion in a time line.
- An event is a manifestation in a time line.
- A coincidence is an alignment of several events without a programmatic schedule.
- Life is a coincidence, while the universe is not.
Life was possible because a sum of events aligned to make it happen. Because life manifests in a time line and an environment, if we assume the lack of a scheduling force, it is a coincidence. Arguably, but without any strong evidence, some assume the presence of a scheduling force (that is a deity) and thus the life is created by the force and not by random events that aligned successfully, resulting that the life is not a coincidence.
2009-11-25
Script Integration Test
2009-11-21
MinGW Developer Studio 2.05 cu MinGW 5.1.6
MinGW Developer Studio 2.05 de la Parinya Software are inclus o versiune de MinGW mai veche (posibil incepand cu 3.1.0-1 si mai mica decat 3.4.5, pentru ca __MINGW32_VERSION este 3.7, iar __W32API_VERSION este 3.2). In MinGW 5.1.6 __MINGW32_VERSION este 3.15.2, iar __W32API_VERSION este 3.13. Cele doua valori se gasesc in fisierele _mingw.h si w32api.h din directorul include. De fapt suita este interesata de prezenta fisierelor g++.exe, gcc.exe si gdb.exe in directorul bin din cadrul directorului MinGW. GCC este o colectie de compilatoare, iar G++ este compilatorul pentru C++ din cadrul acestei colectii. In versiunea de MinGW care vine impreuna cu suita, compilatorul are versiunea 3.4.2, iar in MinGW 5.1.6 are versiunea 3.4.5. Pentru a afla versiunea se foloseste comanda:
gcc -dumpversion
Daca se doreste instalarea noii versiuni se descarca de pe situl http://www.mingw.org/ fisierul MinGW-5.1.6.exe. In momentul rularii, acest fisier va descarca pachetele necesare instalarii:
- mingwrt-3.15.2-mingw32-dev.tar.gz,
- mingwrt-3.15.2-mingw32-dll.tar.gz,
- w32api-3.13-mingw32-dev.tar.gz,
- binutils-2.20-1-mingw32-bin.tar.gz,
- gcc-core-3.4.5-20060117-3.tar.gz,
- gcc-g++-3.4.5-20060117-3.tar.gz,
- gcc-g77-3.4.5-20060117-3.tar.gz,
- gcc-ada-3.4.5-20060117-3.tar.gz,
- gcc-java-3.4.5-20060117-3.tar.gz,
- gcc-objc-3.4.5-20060117-3.tar.gz,
- make-3.81-20090914-mingw32-bin.tar.gz.
Ne intereseaza numai G++ din cadrul GCC, prin urmare daca nu vom selecta si alte compilatoare atunci pachetele respective nu vor mai fi descarcate (G77, Ada, Java, Object C). Dupa instalare vom descarca gdb-5.2.1-1.exe din ramura GNU Source-Level Debugger, subramura Current Release_ gdb-5.2.1. Vom instala acest pachet in acelasi director unde am instalat si MinGW. Pentru MinGW Developer Studio nu este necesar sa fie instalat si pachetul care contine executabilul make.exe, asa cum este necesar pentru NetBeans. In general nu se recomanda amestecarea pachetelor MSYS cu cele MinGW. Daca este necesar executabilul make.exe, o solutie ar fi redenumirea fisierului mingw32-make.exe in make.exe, desi Netbeans nu a functionat fara executabilul din pachetul MSYS.
Pentru a seta MinGW Developer Studio sa foloseasca noua versiune a compilatorului se va merge in meniu la Edit -> Options..., se alege tabul Compiler si apoi se introduce calea catre MinGW.
Daca programelul de mai jos se compileaza si se construieste fara probleme, atunci instalarea a avut succes. Este necesara o linie libera la urma pentru a nu avea o avertizare.
#include <iostream>
using namespace std;
int main(){
cout << "Hello world!"; }
2009-11-03
2009-10-19
2009-10-11
Javascript object functions runs on creation
| 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
| 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()); |
2009-10-10
Test Java Presence
if(navigator.javaEnabled()){ ... }
Therefore you on your computer.
2009-09-22
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 expression 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.
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: .
2009-09-02
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. |
2009-08-25
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.
2009-08-24
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
2009-08-08
Search Engines in Opera
To set search engines in Opera 9.24 go in Tools -> Preferences... and then choose the Search tab. Now you can click the Add... button to add a new entry or use the Edit... button to edit an existing entry. Of course to delete an entry you have the Delete button. Let's assume you want to add the new search engine from Microsoft, Bing. You put Bing in the Name field, choose an unused letter like b in the Keyword field, and finally the important part, put http://www.bing.com/search?q=%s in the Address field. The %s is replaced with the string you type in the search box. You can also write something like b search_text in the address bar of the browser to invoke a search for search_text on Bing.
Name | Keyword | Address |
| Bing | b | http://www.bing.com/search?q=%s |
| UTrace | u | http://en.utrace.de/?query=%s |
| Hallo | d | http://hallo.ro/search.do?d=en&l=ro&type=both&query=%s |
| Merriam-Webster | m | http://www.merriam-webster.com/dictionary/%s |
| WebDEX | x | http://www.webdex.ro/online/dictionar/%s |
2009-07-27
House MD

După ce am văzut House MD, sezonul 1, am rămas în cap cu câteva cuvinte noi
:
- seizure = a sudden attack (as of disease) ; especially : the physical manifestations (as convulsions, sensory disturbances, or loss of consciousness) resulting from abnormal electrical discharges in the brain (as in epilepsy)
- nausea = a stomach distress with distaste for food and an urge to vomit
- spirochete = any of an order (Spirochaetales) of slender spirally undulating bacteria including those causing syphilis and Lyme disease.
Powered by Merriam-Webster.
2009-07-06
What is better?
What is better between an antivirus that removes files wrongly classified as suspicious or the lack of the antivirus at all?
The antivirus from Comodo Internet Security 3.10.102194.530 is seeing Heur and unclassified mallware everywhere, even when heuristic scanning level is at the lowest. When the incidence of false alarms is so high, the user may be at a real risk of running a virus on his/her computer. At this point turning off the heuristics is the only solution for this suite. I hope they will fix this major flaw, or I will be forced to switch to other products.
2009-07-01
Some new words
- endeavor = strădanie, forţare, efort
- sophomore = student in anul doi [univ.]
- allegation = afirmaţie (nedovedită), declaraţie
- racking = de specula, sfâşietor
- foreclosure = prescriere (a unei ipoteci) [jur.]
2009-06-23
Remove Windows Messenger
rundll32 advpack.dll,LaunchINFSection %windir%\INF\msmsgs.inf,BLC.Remove
2009-06-13
CAD-KAS Dividers and Ruler 1.0
Zirkel und Lineal, the name its developer gave it, was given away June 13, 2009 on www.giveawayoftheday.com.
It is somewhat portable I think, because it could be used without being installed. Indeed it is a very basic application. One thing about it bothers me: it doesn’t support antialiasing when exporting to bitmap. According to developer's site, the company has a lot of experience in printing software and when I was printing to PDF file using PrimoPDF (free printer software available at www.primopdf.com), the resulting pdf was antialiased. Then you can import the pdf in Inkscape (available for free at www.inkscape.org) and save the picture as SVG. At that point you have a vector format for your drawing.
But further testing of today's offering helped me discover some major issues a software costing $79 should not have:
- The dimension of the ruler, protractor and dividers can't be modified (i.e. the ruler always have 570 mm);
- The ruler, protractor and dividers don't repaint when the rubber is used;
- The background of the drawing area is always white;
- Curves are not considered objects (can't be moved and modified), only lines and rubber;
- Rubber instead of deleting existing objects adds a lot of white cicles in front of the existing lines and curves, but under the text;
- Text is always in front in the object order, but doesn't repaint either when the rubber is used;
- Text clipping for italic fonts is smaller than needed;
- Lines objects can't be edited;
- Using pencil creates a very large amount of lines;
- There is no UNDONE for operations;
- Total lack of features like object grouping, ordering and snapping; lack of antialiasing and exporting to more raster (only bitmap is supported) and vector formats; lack of the precision in many operations; lack of layers;
2009-05-26
Remove a service from Windows Registry
To remove a service from Windows registry use the following command at a cmd console (in Windows Vista run the console as Administrator):
sc delete <service_name>
2009-05-21
Some more JavaScript
Some quick tips:
- To continue a string on the next line in JavaScript, use the \ operator like this:
var s = "A long text \
that continues on the next line"; - Create on the fly functions like this:
function functionAssembler(operatorSign){
return new Function("a","b","return a" + operatorSign + "b;");
}
Use it to create functions:
var add = functionAssembler("+");
var substract = functionAssembler("-");
var multiply = functionAssembler("*");
var divide = functionAssembler("/");
Use the function as always:
document.write(add(10,5));
document.write(substract(12,6));
document.write(multiply(5,3));
document.write(divide(125,5));
Functions in JavaScript
document.write(f.add()); // The result is 11
document.write(f.add()); // The result is 30
this.prototype[name] = func;
return this;
};
document.write(f.add()); // The result is 205
2009-05-08
Problema cu monedele
2009-05-05
Valori versus Drogati
Originally posted on Aedoh forum (fragments):
Sunt de acord ca nu acordam atentia cuvenita oamenilor importanti care au trait in Romania, insa propria decadenta ne impiedica sa recunoastem valorile. In schimb sa afirmi ca in ziua de azi persoanele valoroase sunt pe cale de disparitie este foarte hazardat. Massmedia e prea preocupata cu isterizarea populatiei ca sa se mai preocupe de lucrurile cu adevarat importante. Este imprumutat modelul de stiri american, in care o stire despre ceva pozitiv nu este stire ci doar ceva negativ reprezinta o stire. Parerea mea e sa ne dea voie si cu arme ca sa putem sa ne impuscam de spaima (i.e. in USA anual 10K oameni mor prin impuscare). In aceste conditii ce se percepe de la televizor e o Romanie negativa. Prin urmare trebuie sa fii concentrat ca Chagdud Tulku Rinpoche (http://www.tibetantreasures.com/tthtml/ctr.htm) ca sa prinzi vagile stiri pozitive. Atunci afli ca avem valori in box, judo, inventii, chiar si retail. O alta solutie este sa mergi sa vezi lucrurile pe viu. De exemplu dupa cate stiri negative auzi despre Bucuresti ai crede ca sunt cam 2 infractori pe metrul patrat si in realitate cobori din tren in Gara de Nord si lucrurile sunt ok, nu te ataca nimeni in secuda numarul doi (de fapt multimea asta de stiri nasoale despre capitala mi se pare o palida incercare de a mai tempera migratia).
Sa polemizez impotriva tehnologiei din cauza unor ciumpalaci care nu o folosesc corespunzator sau isi fac rau folosind-o, nu o s-o fac niciodata. Ma doare in cot de oamenii care se distrug singuri. Daca ar fi dupa mine as lasa lumea sa se drogheze si sa moara. Tratarea drogatilor pe banii oamenilor platitori de taxe e ca naiba. As vrea o lume in care sa pot sa aleg daca sunt solidar sau nu. Eu nu as fi, iar celelalte specii existente pe planeta nu sunt nici ele solidare. Deja incit la violenta ca Mircea Badea si conform noii legi a lui peste fac inchisoare ca indemn la jihad, desi asa mujahid cum sunt nu am nimic cu nimeni.
2009-05-02
Ce au cu calculatorul?
Originally posted on Aedoh forum:
M-am saturat sa aud oamenii ca au ceva impotriva "calculatorului". Nu tehnologia este "evil", ci oamenii o folosesc adesea fara discernamant. Din punctul meu de vedere romanii habar nu au de tehnologie. Priveste pe situl http://www.ted.com/ si convinge-te.
Tinerii din ziua de azi sunt "a new breed", oameni fundamental globalizati si democratici. Internetul a ajutat la stergerea partiala a granitelor, cunoasterea este disponibila in cantitati uriase... Realizezi destul de repede ca nu poti sti si nu poti citi nici macar o zecime din cat exista (i.e. poti petrece cativa ani citind doar situl http://www.howstuffworks.com/). De aceea oamenii de maine se bazeaza pe infrastructura informatica, pe baze de date create automat de motoare de indexare, pe accesul oricand si oriunde la retea. Din toata masa aceasta de informatie trebuie sa alegi ce este relevant pentru tine... Invatamantul clasic, evident, nu face fata nevoii de "customization" a informatiei pentru fiecare individ.
"And there is real Romania", romanii (in proportie mai mare cei tineri) sunt foarte ancorati in Internet pentru ca: massmedia traditionala esueaza dramatic in a furniza continut pentru ei, cu exceptia catorva posturi de muzica si cateva emisiuni cu intindere numarata in secunde, lipsa banilor nu permite vizitarea pe viu a unui loc sau obiectiv, si altele mult mai subtile si complexe. Internetul devine astfel o fereastra spre lume, creaza viata paralela in care inegalitatile par sa fie nivelate. Migrarea asta bineinteles ca enerveaza pentru ca regulile sunt schimbate brusc; multi tineri lipsesc din viata reala, s-au virtualizat; astfel nu mai poti sa ajungi la ei cu produsele tale atat fizice, cat si intelectuale; nu mai participa haotic la munca pe viata pentru un camion de caramizi (i.e. o casa) sau o tona de tabla (i.e. o masina), tot ce au nevoie e apa, paine si bandwidth.
Nu pot sa fiu mai in dezacord de atat cu mentalitatea de genul: Toti copii sunt interesati de droguri si alte tampenii in loc sa se preocupe de ce e specific varstei.
In primul rand este mult prea generalizat toti copiii... Cam cat inseamna acest toti? Lipsa de incredere in tineri nu ajuta la nimic, insa adanceste si mai mult "gap"-ul dintre generatii. Drogurile sunt o problema, dar nu este extinsa la toata generatia, iar in ce priveste tampeniile, cel putin maturii au demostrat ce le-a putut capul in tara asta (i.e. razboaie, comunism, rasism, furt). Apoi este evident ca ce era specific varstei acum 20, 100, 1000 de ani nu mai este specific unei anumite varste acum.
Time has changed, therefore it's time for youth to claim equlity in rights.
Endnote: Cei care vor zice ca am scris intr-o limba neromana, sa considere faptul ca limba romana este o mixtura de toate limbile peste cele cateva sute de cuvinte dacice, asa ca tundeti iarba in alta parte.
2009-04-14
Security tips Windows XP
Two security tips for Windows XP:
1. Disable administrative shares:
Modify the key
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters]
by adding or modifying the value:
"AutoShareWks"=dword:00000000 .
2. Disable remote registry access:
Method 1: Go to Start->Run and type services.msc and then find Remote Registry service, right click it and choose Properties, then change under Startup type the value to Disabled. You can also stop the service right away.
Method 2: Disable Remote Registry service using the sc command:
sc stop RemoteRegistry
sc config RemoteRegistry start= disabled
Set the default back with:
sc config RemoteRegistry start= auto
sc start RemoteRegistry
2009-04-11
String pad function in JavaScript
I've found this mind blowing function for padding a string in JavaScript:
String.prototype.pad = function(l, s, t){
return s || (s = " "), (l -= this.length) > 0 ? (s = new Array(Math.ceil(l / s.length)+ 1).join(s)).substr(0, t = !t ? l : t == 1 ? 0 : Math.ceil(l / 2))+ this + s.substr(0, l - t) : this;
};
Let's break it in pieces :
- The construction String.prototype.pad = function(l, s, t) extends the functionality of the String object adding a new method called pad, which is a function that has three parameters.
- Parameters of the function stand for: l=maximal length of the string, s=padding string and t=type of padding (0=left, 1=right and 2=center).
- An expression which contains an enumeration is evaluated to the last member of the enumeration, therefore the second expression in the return clause will be the result of the function.
- A logical OR expression is evaluated until a member is true, therefore the expression s || (s=" ") actually means: if s contains something then it is true and left alone, otherwise s will contain exactly one space.
- Expression (l-=this.length) makes l contain the number of needed characters for the string to have the required length (if the length of the string is 7 and we want it padded to 20 characters, now the l is 13).
- Is well known the expression like <logical> ? <value_for_true> : <value_for_false>.
- If new l is greater than 0, then computations are required, otherwise the string (referenced using this) is returned as it is.
- Math.ceil(<value>) gives the closest upper integer value of the given value.
- join(<separator>) creates a single string value from the array it is applied to using the given separator string.
- The expression s=new Array(Math.ceil(l/s.length)+1).join(s) creates a new array with a number of elements equal to the number of times s is required to repeat for the string to be padded, plus one (because there are -1 separators involved in such a join), then the empty values are joined using s as a separator. The new value is now assigned to s. For example, if we want the string "xunrage" padded with s="{}" to the left (t=0) for a total length of l=20, first l became 13, and now l/s.length=13/2=6.5, therefore Math.ceil(l/s.length)=7, following that a new array with 8 elements will be created. When joined, only 7 separators forms the result, therefore s="{}{}{}{}{}{}{}".
- substr(<start>,<length>) returns a portion of a string that the function is applied to starting at the given position and having the given length.
- Expression substr(0, t=!t ? l : t == 1 ? 0 : Math.ceil(l/2)) contains two ?: expressions and an assignment in the second parameter of the substr function. The first expression is !t ? l : <the_rest> and the second expression is t==1 ? 0 : Math.ceil(l/2). The value of the entire expression at the end is assigned to t. In our example t=0, therefore !t is true and t=l=13, resulting a string like "{}{}{}{}{}{}{" that will be added to the result.
- Finally, if something left to be added is added at the end, using substr again. For left padding (t=0) there is nothing left to be added because t=l=13 and l-t=0, resulting in "{}{}{}{}{}{}{xunrage". For right padding t=1, we have t=0 initially (t==1 ? 0 : ...) and l-t=13 at the end, resulting in "xunrage{}{}{}{}{}{}{". For center padding t=2 and we have t=Math.ceil(l/2) which is t=Math.ceil(13/2)=Math.ceil(6.5)=7, finally l-t=13-7=6, resulting in "{}{}{}{xunrage{}{}{}".
Now you can see how amazing this one line of code is.
2009-04-10
Stop autorun.inf from running in Windows
Put the following into the registry:
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf]
@="@SYS:DoesNotExist"
Note: @ stands for (Default) value.
2009-03-29
Fox Pro - Cateva comenzi
2009-03-17
Problema din Biletul 11
2009-03-10
Language issue
- Click Start, then go to Control Panel.
- From there choose Regional and Language Options.
- Then go to the Advanced tab and choose Romanian under the long label "Select a language to match the language version of the non-Unicode programs you want to use:"
That's it. Now I can watch the subtitle as they should be displayed.
2009-02-27
Porturile folosite de Yahoo Messenger 9.0.0.2136
Pentru a afla porturile folosite de către o aplicaţie în Windows XP, se introduce de la consolă comanda:
Comanda afişează PID-ul (Process Identifier) aplicaţiei. Pentru a afişa toate aplicaţiile care rulează împreună cu PID-ul lor se introduce comanda:
Astfel se descoperă că Yahoo Messenger foloseşte porturile:
2009-02-23
Septica
Jocul are urmatoarele reguli:
- sunt 32 de carti (opt figuri): 7, 8, 9, 10, J, Q, K si A, fiecare figura avand 4 carti;
- fiecare jucator primeste initial patru carti, alese la intamplare;
- jucatorii pun jos cate o carte, alternativ;
- implicit, cartile de jos sunt luate de primul jucator;
- daca al doilea jucator pune un 7, sau o carte cu aceeasi figura ca si cea initiala, atunci el va lua cartile;
- primul jucator poate obiecta in cazul de mai sus, dar doar daca pune de asemenea un 7 sau o carte cu aceeasi figura ca si cea initiala;
- daca primul jucator nu obiecteaza se ridica cartile;
- dupa ridicarea cartilor, se primesc noi carti pentru ca fiecare jucator sa aiba 4 carti in mana;
- 10 si A se considera puncte (in total sunt 8 puncte);
- castigator este cel care a acumulat cele mai multe puncte la sfarsitul jocului.
Automatic logon in Windows XP
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DefaultUserName"="<user>"
"AutoAdminLogon"="1"
"DefaultPassword"="<password>"
where <user> is the desired user to logon and <password> is the password for that user.
2009-02-19
Problema in FoxPro
| Prietenul Octavian va fi probabil interesat. |




