Search:

Type: Posts; User: Lux Perpetua; Keyword(s):

Page 1 of 10 1 2 3 4

Search: Search took 0.07 seconds.

  1. Re: calling functions whose names are taken as input from a text file

    Sure: dlsym returns void *, but the type of fn isn't void *: it's a function pointer type. We know (or think we know) that dlsym(handle, "testit") is actually a char *(*)(int, char*), which is the...
  2. Re: calling functions whose names are taken as input from a text file

    Your function pointer fn is still declared as void (*fn)(void), which is a function that takes no arguments and returns no value. This is inconsistent both with the actual type of the symbol you're...
  3. Re: calling functions whose names are taken as input from a text file

    Here's a minimal example I wrote a while ago showing how this could be done:
    /* Compile with gcc -ldl -rdynamic */

    #include <stdio.h>
    #include <dlfcn.h>
    #include <stdlib.h>

    void...
  4. Re: Ubuntu/Python/matplotlib barh weirdness

    You'll need to provide more context for that code. If possible, post a minimal but complete code example that demonstrates the issue.
  5. Re: Works in terminal, but not in makefile

    Works for me:
    % cat testings.cpp
    #include <iostream>
    #include <GL/glew.h>
    #include <GL/glut.h>

    void render();

    int main(int argc, char** args){
  6. Re: UNdefined reference to 'cv::function_name' sous ubuntu 11.10 avec openCV 2.4.2

    "Undefined reference" is a linker error. You may need to specify the location of your OpenCV libraries manually when you compile your package. Depending on your package's build setup, this may or...
  7. Replies
    1
    Views
    305

    Re: Postscript question

    Isn't it simply:
    dup length 2 sub 2 getinterval
  8. Replies
    6
    Views
    1,486

    [SOLVED] Re: Load a PNG with libpng12

    Obviously! This is the same problem I highlighted above, just the other side of the coin. You can't expect to give a function data in a format other than the extremely specific format it requires...
  9. Replies
    6
    Views
    1,486

    [SOLVED] Re: Load a PNG with libpng12

    GLuint
    Manager::loadTexture(const char *path, float &w, float &h) {

    int format,rowStride;

    void *buf = loadImage(path, w, h, format, rowStride);
    if(buf == NULL) {
    return 0;
    }
  10. Re: see if it is a change between two pictures

    I'm responding to the question I think you meant to ask, which is how to detect if a new object has entered the scene (for example). In general, this is a nontrivial computer vision problem, which...
  11. Replies
    6
    Views
    1,486

    [SOLVED] Re: Load a PNG with libpng12

    Are you sure the error isn't in the code that displays the image?
  12. Replies
    1
    Views
    627

    Re: Postscript toupper function

    I'm guessing that you have the following auxiliary functions (which are not in the PostScript standard, as far as I am aware):

    /over {
    1 index
    } def

    /rot {
    3 -1 roll
    } def
    Your tolower...
  13. Replies
    1
    Views
    1,633

    Re: Python PIL color codes?

    Here's a hack, which I lifted from the PIL handbook, to get the palette for a palette image:

    def get_PIL_palette(image):
    tmp = image.resize((256,1))
    tmp.putdata(xrange(256))
    return...
  14. Re: I think my terminal is broken...or my brain is.

    I hope every novice programmer reads the discussion in that thread. system("pause"); or any of its Unix equivalents appearing at the end of a program is the result of a failure to understand what one...
  15. Replies
    32
    Views
    1,990

    Re: Bad, bad Gnome

    :? I use XFCE 4.10/Thunar 1.4.0 on my Arch system, and it definitely has "open terminal here."
  16. Replies
    2
    Views
    337

    Re: c output issue

    '1' is not the same as (char)0x01 (a.k.a. '\x01'). Your red statement writes the three characters '\x01', '\x02', and '\x03' to its output, which are non-printing characters.
  17. Re: Am I the only one who misses screen savers?

    I specifically miss the old 16-bit "After Dark" screen savers from the mid-1990s (think Windows 95). Nirvana, Frost and Fire, Satori, Mountains, Penrose....
  18. Replies
    6
    Views
    2,214

    Re: ls implementation

    There are freely available implementations of 'ls' if you want to see how it's done in real life. Here are a few:

    From GNU Coreutils (canonical implementation for Linux users)
    From BusyBox...
  19. Re: Programming Challenge: Goldbach's Conjecture

    It should be easy, since your method is elementary. However, I'm stuck on part of your argument: near the top of page 9, you make the assertion that P_i*P_i' <= pi(sqrt(2*e))*sqrt(2*e). I agree that...
  20. Replies
    3
    Views
    1,145

    Re: terminal chat window

    The standard way to draw on a terminal is with the ncurses library. If you've ever used nano, vi, vim, less, or pretty much any other terminal application that does more than read input line by line...
  21. Replies
    21
    Views
    1,356

    Re: What Keeps Ruby Back?

    I've generally found Ruby's GTK2 bindings to be pretty painless to use. Surely that isn't considered out-of-date?
  22. Replies
    7
    Views
    655

    [SOLVED] Re: gets() does not append '\0'?

    This is partially correct, but it's important to note that it will only work if buf is allocated statically; it will fail horribly if buf is allocated dynamically. This trips up beginners all the...
  23. Replies
    27
    Views
    2,850

    Re: Beginners programming challenge #27

    In my opinion, the level of this problem is more intermediate than beginner. I'd love to be pleasantly surprised by a bunch of beginners rising to the challenge, though.
  24. Replies
    19
    Views
    1,793

    Re: UK "black boxes"

    If you mean that standard encryption methods have already been broken in secret, then there is zero evidence of this.
    I think you're confused. To profitably pull off a man-in-the-middle attack, you...
  25. Replies
    30
    Views
    1,698

    Re: Keyboard Challenge ,) GO

    60 WPM, 100% accuracy. :-)
Results 1 to 25 of 250
Page 1 of 10 1 2 3 4