Jump to content

encik pot pet

moderator
  • Content Count

    1415
  • Joined

  • Last visited

Posts posted by encik pot pet


  1. tujuan double backslash ialah utk print hanya satu backslash. sebab backslash ialah special character contohnya utk \n, \r, dan sebagainya. kalau nak masukkan backslash dalam string, kena buat "\\".

    kalau tak silap aku, gini la kut

    system("REG add \"HKCU\\Software\\Microsoft\\Internet Explorer\\Main\" /v \"Window Title\" /t REG_SZ /d \"godam by pokemon\" /f");


  2. Sejak semalam aku baca thread ni, aku masih duk fikir the theory behind apa yg Power Root buat... and possible drawback yg kena pada hard disk kalau pakai teknik ni.. anyway nice discovery, tapi aku takde kesempatan nak try lagi. :)

    http://www.theinquirer.net/en/inquirer/new...rives-recovered

    aku rasa ni teknik pembuat harddisk utk sorok kapasiti sebenar harddisk sebab marketing purpose.

    aku pernah jumpa RAM yg declared as 512mb, tapi kapasiti sebenar 1GB. certain mobo yg lurus bendul akan detect 512mb, and mobo yg 'jahat' akan detect kapasiti sebenar.


  3. kalau guna computer x86 ni, int size dia cuma 32 bit jer, 0xFFFFFFFF bersamaan dgn 4 billion lebih. kalau nak kira nilai lagi besar kena code bignum library sendiri atau guna org lain punya seperti http://gmplib.org/

    btw, saya punya algo valid utk 1 -> infinity, will u derive it?

    hint: http://www-groups.dcs.st-and.ac.uk/~histor...hies/Gauss.html :)

    edit: aku biasanya pakai MIRACL http://www.shamus.ie/index.php?page=home


  4. Sebenarnya ni bukan programming sangat sebab kalau setakat nak kira hasil tambah 1+2+3+4+....+1000000 senang jer pakai komputer.

    contoh kalau sampai 100;

    int sum = 0;
    int i = 1;
    for (i = 1; i <= 100; i++)
        sum +=i;

    Kalau korang duk zaman tahun 1600(masa tu takde lagi komputer), agak2nya camner nak mengira hasil tambah dari 1 hingga 1M or 1B dengan cepat?

    Soalannya; sila terbitkan satu formula/algo utk mengira hasil tambah 1 hingga 1M.

    chow


  5. thanx para for the codes.

    tengah2 korek hdd tadi, jumpa this codes. looks pretty.

    //==========================================
    // LIBCTINY - Matt Pietrek 2001
    // MSDN Magazine, January 2001
    //==========================================
    #include <stdlib.h>
    #include <ctype.h>
    
    extern "C" long __cdecl atol ( const char * pstr )
    {
        // The current character.
        int  cCurr;
        // The running total.
        long lTotal;
        // Holds the '-' sign.
        int  iIsNeg;
    
        // Slide past any whitespace.
        while ( isspace ( *pstr ) )
        {
            ++pstr;
        }
    
        // Get the current character.
        cCurr = *pstr++;
        // Save the negative sign.
        iIsNeg = cCurr;
        if ( ( '-' == cCurr ) || ( '+' == cCurr ) )
        {
            // We have a sign, so skip it.
            cCurr = *pstr++;
        }
    
        // Initialize the total.
        lTotal = 0;
    
        // While we have digits, addem up.
        while ( isdigit ( cCurr ) )
        {
            // Add this digit to the total.
            lTotal = 10 * lTotal + ( cCurr - '0' );
            // Do the next character.
            cCurr = *pstr++;
        }
    
        // If we have a negative sign, convert the value.
        if ( '-' == iIsNeg )
        {
            return ( -lTotal );
        }
        else
        {
            return ( lTotal );
        }
    }
    
    extern "C" int __cdecl atoi ( const char * pstr )
    {
        return ( (int)atol ( pstr ) );
    }

×
×
  • Create New...