Search:

Type: Posts; User: Sfel

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    7,545

    I was using the FillPolygon function to draw...

    I was using the FillPolygon function to draw opaque polygons. I didn't know about the FromArgb function, that is what I was looking for.

    Thank you both!
  2. Replies
    4
    Views
    7,545

    How do I draw transparent polygons?

    Hello,

    Suppose I have two Point / PointF arrays P1 and P2. How can I draw two polygons on a panel, one from P1 and the other from P2, such that the two are transparent? Meaning, in case they...
  3. Replies
    21
    Views
    2,070

    The easiest way is to just add INT_MAX + 1 to all...

    The easiest way is to just add INT_MAX + 1 to all the numbers, thus making them positive and maintaining their relative order. Then just do if [x / y] = 0 => return y. Otherwise or if y = 0 return x....
  4. Replies
    21
    Views
    2,070

    True. My method only works if all the numbers...

    True. My method only works if all the numbers have the same sign.

    However, it is easy to check the sign bit and act accordingly: if all the numbers are either positive or negative, my method does...
  5. Replies
    21
    Views
    2,070

    if the numbers are non-zero integers we can do...

    if the numbers are non-zero integers we can do this:

    first, convert all the numbers to unsigned integers. This will get us rid of negative numbers.

    then, if floor(x / y) = 0, x < y

    then just...
  6. Replies
    26
    Views
    4,108

    Why would that give me 0% security? Outside of...

    Why would that give me 0% security? Outside of fopen(), as far as I can understand what nm does, I can just have a list of "what's allowed to show up in nm", which is all the C/C++ standard functions...
  7. Replies
    26
    Views
    4,108

    So basically, my best chances are: 1. run nm...

    So basically, my best chances are:

    1. run nm on the resulting executable and check for anything suspicious. Assuming I have an exhaustive list, how safe is this? if I remove all the windows.h etc...
  8. Replies
    26
    Views
    4,108

    I see, that should be easy enough to do then. I...

    I see, that should be easy enough to do then. I have a few more questions however.

    Can I compile the source on the host machine, send it to the virtual machine and run it there? Can I do some...
  9. Replies
    26
    Views
    4,108

    Wouldn't: #include unsigned int...

    Wouldn't:


    #include <stdio.h>
    unsigned int DeleteFileA(const char *aFile);

    int main()
    {
    printf("x = %d\n", DeleteFileA("c:\\boot.ini");
    return 0;
  10. Replies
    26
    Views
    4,108

    Limit process privileges

    Hello,

    I am working on a program that will be compiling user-sent C/C++ source code and running the resulting executable on a server. The source code is expected to solve an exact task, but...
  11. Replies
    15
    Views
    7,928

    This would only get you the length of the path....

    This would only get you the length of the path. But you can build the path by using the values in the distance matrix: we could only have gotten on one value from an adjacent value that is lower than...
  12. Replies
    15
    Views
    7,928

    Consider the following example, where 1 means...

    Consider the following example, where 1 means inaccessible cell and 0 means accessible:

    * 0 0 0 0
    0 1 1 1 1
    0 0 0 0 0
    1 1 1 1 0
    1 1 1 1 *

    You want to get from one "*" to the other.
  13. Replies
    15
    Views
    7,928

    You can use breadth-first search, but if you...

    You can use breadth-first search, but if you apply it directly on your given matrix, it will be O(XY). If you're given an adjacency list, then it'll be O(V+E).

    Consider a queue where you first...
  14. Thread: Size contest

    by Sfel
    Replies
    14
    Views
    6,818

    I'm not really a big fan of them either, I just...

    I'm not really a big fan of them either, I just thought this was a simple problem and it would be fun to try to squeeze into this limit. Doesn't serve any real purpose but...

    Also, it's a shame...
  15. Thread: Size contest

    by Sfel
    Replies
    14
    Views
    6,818

    EVOEx: ~180 characters is really nice, guess that...

    EVOEx: ~180 characters is really nice, guess that makes your solution the best so far :). Good job.

    IceDane: I know the PE problem, but there was no size restriction there. I think the problem is...
  16. Thread: Size contest

    by Sfel
    Replies
    14
    Views
    6,818

    Yes. For example: 7 1 4 5 2 3 You would...

    Yes. For example:
    7
    1 4
    5 2 3

    You would select 7 + 4 + 5 = 16, but this is invalid.
    The correct paths are: 7 1 5, 7 1 2, 7 4 2, 7 4 3, with the max being 7 + 4 + 3 = 14

    To find out if your...
  17. Thread: Size contest

    by Sfel
    Replies
    14
    Views
    6,818

    I'll try. You're given a triangle of numbers,...

    I'll try.

    You're given a triangle of numbers, let's take the second example:
    1
    1 2
    4 1 2
    2 3 1 1

    You start from the first element of the first row (1). You can go to the element below it...
  18. Thread: Size contest

    by Sfel
    Replies
    14
    Views
    6,818

    Size contest

    I recently stumbled across this problem: https://www.spoj.pl/problems/SUMITR/ and had a fun-yet-frustrating time solving it in C/C++ on the gcc compiler. I got my code to 253 bytes when all...
  19. Replies
    76
    Views
    31,895

    For those who are interested in the method, I...

    For those who are interested in the method, I used the sieve of eratosthenes in the following way:

    1. Figure out a maximum range (hi) such that the interval [lo = 2^31 + 1, hi] contains at least...
  20. Replies
    76
    Views
    31,895

    Here's mine. I hope I didn't break any rules;...

    Here's mine. I hope I didn't break any rules; according to the first post I should have only one function, and I have 2 (+main). If it needs any modifications to be accepted let me know.

    Runs in...
  21. Replies
    2
    Views
    1,889

    That works! Thanks.

    That works! Thanks.
  22. Replies
    2
    Views
    1,889

    Executing programs in your PATH

    Hello,

    I'm using C++ Builder and trying to run a program with CreateProcess. For example:



    if ( !CreateProcess("cmd", NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi) )
    MessageBox(NULL,...
  23. Replies
    4
    Views
    1,450

    Write my own simple server (a list of connected...

    Write my own simple server (a list of connected IPs and just basic text sending/receiving) and my own client... nothing fancy.
  24. Replies
    4
    Views
    1,450

    Yes, I know about the winsock library. I meant...

    Yes, I know about the winsock library. I meant something that makes things easier, like what indy does in C Builder.

    Those links are very useful however, thanks.
  25. Replies
    4
    Views
    1,450

    Free socket libraries

    Hello,

    I would like to get into windows socket programming, and I was wondering if anyone knows any good, free socket libraries that makes handling communications easier. I'm only interested in...
Results 1 to 25 of 50
Page 1 of 2 1 2