User Profile

Collapse

Profile Sidebar

Collapse
sandromani
sandromani
Last Activity: Nov 1 '11, 03:10 PM
Joined: Dec 14 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • sandromani
    replied to Static array in function
    in C
    Ok, makes sense, thanks for the explanation!
    See more | Go to post

    Leave a comment:


  • sandromani
    started a topic Static array in function
    in C

    Static array in function

    Hi,
    just wondering, why does it work when I create a static array with size unknown at compile time inside a function? I.e. small example:
    Code:
    #include <iostream>
    
    void cpy(int a[], unsigned n){
    	int b[n];
    	std::copy(a, a+n, b);
    	std::cout<<b[0]<<" "<<b[1]<<" "<<b[2]<<" "<<b[3]<<" "<<b[4]<<"\n";
    ...
    See more | Go to post

  • Thanks for your reply, unfortunately this does not work either. After further investigation I found http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx - from which I deduce that it's basically impossible to search before the system32 dir unless you put the dlls in the same folder as the executable... very ugly.
    See more | Go to post

    Leave a comment:


  • PATH env var precedences for module load on windows

    Hi,
    with a windows port of a pygtk, I've had some users having problems with the app loading some system-wide gtk dll they have on their system for whatever reason instead of the ones I've bundled with the program.
    I though I could make python search the apps bin directory before the other ones by prepending the corresponding path to the other ones in the PATH environment variable:
    Code:
    os.environ['PATH']=os.path.join(basedir,'gtklib','bin')+';'+os.environ['PATH']
    ...
    See more | Go to post

  • sandromani
    replied to std::vector of objects
    in C
    Thanks!
    sandro
    See more | Go to post

    Leave a comment:


  • sandromani
    started a topic std::vector of objects
    in C

    std::vector of objects

    Hi,
    here is something I am never quite sure about:

    Code:
    #include <vector>
    
    class MyClass{ .... };
    
    std::vector<MyClass*> v1;
    std::vector<MyClass> v2;
    
    v1.push_back(new MyClass(args));
    v2.push_back(MyClass(args));
    
    v1.pop_back();  // Memory leak, since not deleted?
    v2.pop_back();  // What here?
    Thanks...
    See more | Go to post

  • sandromani
    started a topic Recover source from binary with debug symbols
    in C

    Recover source from binary with debug symbols

    Hi,
    I was wondering, if I have a binary which was compiled with debug symbols, to what extent am I able to recover the source code of the various source files? And how? Usually crashing the program on purpose by passing bad pointers to the arguments allows me to view quite a lot of the source code in that specific section via gdb, but maybe there is a nicer way?
    Thanks!
    See more | Go to post

  • sandromani
    replied to Derived class mystery
    in Java
    Mh right, makes sense... Thanks!
    See more | Go to post

    Leave a comment:


  • sandromani
    started a topic Derived class mystery
    in Java

    Derived class mystery

    Okay so here is a tricky example from my lecture notes:
    Code:
    class Base {
        private int val;
        Base () {
    	val = lookup();
        }
        public int lookup() { 
    	return 5; 
        }
        public int value() {
    	return val;
        }
    }
    class Derived extends Base {
        private int num=10;
        public int lookup() {
    	return num;
        }
    }
    class Test
    ...
    See more | Go to post

  • Thank you both. I ended up running scripts as sudo from php exec statements, giving the http user sudo access to the scripts I use for the website.
    See more | Go to post

    Leave a comment:


  • Apache authentication and file/folder access permissions

    Hello,

    I am working at a webbased file browser, where users will be able to access, rename, delete, etc files and folders. My question is, what is the best way to handle permissions / authentication with apache in a *nix environment? Basically what I am searching for is something that works roughly the same as the windows integrated authentication, where the commands executed on server-side are executed as the user with witch the session...
    See more | Go to post

  • sandromani
    replied to Syntax-Coloring of a textarea
    Thanks for that link, the contentEditable property was exactly what I needed!
    See more | Go to post

    Leave a comment:


  • sandromani
    started a topic Syntax-Coloring of a textarea

    Syntax-Coloring of a textarea

    Hi all,
    I am writing a webbased notepad and want to include syntax-coloring. The approach I have used is to set the font color and background color of the textarea to transparent, and place the colored text in a pre behind the text area, so far so good. The code I use for coloring is the following one:

    Code:
    function colorize(){
    	var inTag=false, inAttr=false;
    	text=textarea.text();
    	colorarea.innerHTML=text.substring(0,selection.end).replace(/[(<>"'&]/g,function(m){
    ...
    See more | Go to post

  • sandromani
    replied to Move cursor in cin input
    in C
    Thanks for your answer, I googled a bit and found a code that does what I need based on the termio library. In case anyone else has the same problem, here is the code:
    Code:
    #include <stdio.h>
    #include <unistd.h>
    #include <termios.h>
    
    
    int getch(void)
    {
    int ch;
    struct termios oldt;
    struct termios newt;
    tcgetattr(STDIN_FILENO, &oldt); /*store old settings
    ...
    See more | Go to post

    Leave a comment:


  • sandromani
    started a topic Move cursor in cin input
    in C

    Move cursor in cin input

    Hello,
    I was wondering if there was a way (in c++) to move the cursor when pressing the arrow keys instead of getting ^[[C resp. ^[[D (left resp. right arrow) in the cin input - I am using linux. I guess this behavior is controlled by the terminal, therefore not modifiable, or does anyone have an idea? I thought of getting one character at the time, check it against the arrow codes, and in case print the ANSI codes for moving the cursor, but...
    See more | Go to post

  • sandromani
    started a topic ASP Move folder fails

    ASP Move folder fails

    Hello,
    I have a IIS 6.0 webserver (windows 2003 EE) and, working on an asp project, noticed that oddly the server refuses to move a folder from one drive to another. Take the following code:
    Code:
    <%
    Option Explicit
    On Error Resume Next
    Dim FSO
    Set FSO=Server.CreateObject("Scripting.FileSystemObject")
    
    FSO.GetFolder("C:\test").Copy "D:\test1"
    If Err.Number
    ...
    See more | Go to post
No activity results to display
Show More
Working...