User Profile
Collapse
-
Ok, makes sense, thanks for the explanation! -
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";
-
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.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']
-
-
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?
-
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! -
-
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
-
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.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... -
Thanks for that link, the contentEditable property was exactly what I needed!Leave a comment:
-
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){
-
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
Leave a comment:
-
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... -
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
No activity results to display
Show More
Leave a comment: