Search:

Type: Posts; User: flp1969

Page 1 of 19 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    180

    Well... a better approach: /* Changed...

    Well... a better approach:

    /* Changed 'decimalPlaces' to 'unsigned int' to avoid 'negative'
    values. Notice this value can still be very big, which will cause
    problems! Still. This...
  2. Replies
    33
    Views
    847

    Maybe you find this more useful: 15837

    Maybe you find this more useful:

    15837
  3. Replies
    17
    Views
    522

    There are lots of fonts for Japanese: $...

    There are lots of fonts for Japanese:


    $ apt-cache search font | grep Japanese
    dvi2ps-fontdata-three - Font data of Adobe Japanese fonts (futomin, futogo, jun101)
    fonts-aoyagi-kouzan-t -...
  4. Replies
    17
    Views
    522

    Well... I have no idea what 'noto' is. I can only...

    Well... I have no idea what 'noto' is. I can only suggest installing the other fonts...

    I am brazillian and just think the ideograms are cute. I don't understand the language, awsdert-san!
  5. Replies
    17
    Views
    522

    Then, check your file with 'hd' and see if you...

    Then, check your file with 'hd' and see if you get the sequence E2 BA A2 for '⺢'.... And, is this what you get?

    $ echo -n '⺢' | hd
    00000000 e2 ba a2 ...
  6. Replies
    17
    Views
    522

    OBS: There is no portable way to get the actual...

    OBS: There is no portable way to get the actual terminal encoding support. On Linux you can do:

    $ locale charmap
    Or see one of the LC_ environment vars (or LANG)... You can try, on any terminal...
  7. Replies
    17
    Views
    522

    Your terminal must be able to decode UTF-8 as...

    Your terminal must be able to decode UTF-8 as well. Take a look at this file:

    Test: αγητ
    In Linux (usualy uses UTF-8) and Windows, this is encoded as:

    $ hd test-linux.txt
    00000000 54 65 73...
  8. Replies
    6
    Views
    260

    $ pkg-config --list-all | grep ^glib Will give...

    $ pkg-config --list-all | grep ^glib
    Will give you the correct "package" name to use with pkg-config. The --cflags and --libs options gives you the options to use with gcc/clang.
    Install pkg-config...
  9. Replies
    17
    Views
    522

    Probably this is your text file encoding. Are you...

    Probably this is your text file encoding. Are you trying to print this on Windows? On WINDOWS-1252 encoding this character isn't possible:

    The test.c (utf-8/unix) file:

    char str[] = "⺢";
    ...
  10. Replies
    6
    Views
    260

    Linux? $ pkg-config --list-all | grep ^glib...

    Linux?

    $ pkg-config --list-all | grep ^glib
    glib-2.0 GLib - C Utility Library
    $ pkg-config --cflags glib-2.0
    -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
    $...
  11. Replies
    26
    Views
    690

    Ok... forget everything about it then... good...

    Ok... forget everything about it then... good luck!
  12. Replies
    26
    Views
    690

    bwahahahahahahahahahaha!!!! :)

    bwahahahahahahahahahaha!!!! :)
  13. Replies
    26
    Views
    690

    Notice I didn't call a libm function. No extra...

    Notice I didn't call a libm function. No extra libraries needed to be linked... No round() call... which is a little bit faster.
  14. Replies
    26
    Views
    690

    Ok... assuming all values are positive there is...

    Ok... assuming all values are positive there is an old trick: If you want 2 decimal places as "precision" you could do:


    f = (( t - i ) + 0.005)*100;
    Here t is double, f is int and i is int (or...
  15. Replies
    4
    Views
    220

    PS: Python operator % will give you the modulo: ...

    PS: Python operator % will give you the modulo:


    $ python -c 'print -6%5'
    4
  16. Replies
    4
    Views
    220

    Yep... In integer division 6/5 = 1 and you get 1...

    Yep... In integer division 6/5 = 1 and you get 1 as remainder (not "modulo")...
    6%5 gives you the remainder... here's a test... -6 mod 5 = 4 (positive) because the range is 5. As in:

    0,1,2,3,4 -...
  17. Replies
    26
    Views
    690

    Nope chistop... A little test, shall we: ...

    Nope chistop... A little test, shall we:


    #include <stdint.h>

    int64_t f( double x ) { return x; }

    int g( double x, int64_t y ) { return (x - y) * 100; }

    With this you'll get:
  18. Replies
    26
    Views
    690

    15831

    15831
  19. Replies
    26
    Views
    690

    I have this policy to never use floating point if...

    I have this policy to never use floating point if I can... Here's why... A simple approach to this "conversion" would be:

    #define _GNU_SOURCE
    #include <stdint.h>
    #include <inttypes.h>
    #include...
  20. Replies
    3
    Views
    127

    A simpler function: int factorial( int x ) {...

    A simpler function:

    int factorial( int x )
    {
    int r = 1;

    while ( x > 1 )
    r *= x--;

    return r;
  21. Thread: OpenGL

    by flp1969
    Replies
    10
    Views
    444

    15828

    15828
  22. Replies
    1
    Views
    143

    See here...

    See here, on Window Styles.
  23. Replies
    4
    Views
    257

    A more "complete" example: /* winapp.c.in */...

    A more "complete" example:

    /* winapp.c.in */
    /*
    Windows App template, in C.

    To compile (on Linux, using MinG64), substitute the @vars@ first (for example):

    $ sed...
  24. Simple code for using libcurl easy interface:...

    Simple code for using libcurl easy interface: url2file.c
  25. Replies
    6
    Views
    201

    unsigned char.... 8 bits value...

    unsigned char.... 8 bits value...
Results 1 to 25 of 474
Page 1 of 19 1 2 3 4