« first day (1415 days earlier)      last day (1654 days later) » 

12:31
In a windows environment, I need to invoke a c# exe from a cop exe and get the result from it
is there any way to do that ?
What's a "cop exe"?
sorry cpp exe
nwp
nwp
Boost process, QProcess and fork+exec are options. None are particularly easy to use.
459
Q: How do I execute a command and get the output of the command within C++ using POSIX?

Misha MI am looking for a way to get the output of a command when it is run from within a C++ program. I have looked at using the system() function, but that will just execute a command. Here's an example of what I'm looking for: std::string result = system("./some_command"); I need to run an arbitr...

 
6 hours later…
18:24
Anyone here familiar with apache?
18:35
@earlyriser01 that's a vague question. I've used it, I've configured it. But I'm not very familiar with it
I know
I'm having a problem with a file path
So I'm able to access the login page just fine. But when I try to login, I get this error: "Failed to connect to server. Check your network connection and try again. url: /user/server-scripts/login-user.php data: [object Object]"
Now the actual file path for login-user.php is:
/var/www/html/user/server-scripts/login-user.php
did you try to send requests from the php code itself or seomthing?
No. I was given this web interface to add onto and I"m just trying to login to it
oh, it redirected you to the full path
isn't that what virtual host is for or something
I think so.
I've ran into this problem before I believe but that was last summer and I can't remember what I did to fix it.
18:38
well what did you set the DocumentRoot to?
In httpd.conf ? I'm not sure. Let me check
don't you nowadays usually have a seperate config for each site?
I'm not really sure. I inherited this project.
Okay, so this is what I have for DocumentRoot in httpd.conf:

DocumentRoot "/var/www/html"
Hey everyone. I believe that these two answers to different questions contradict each other. Could someone help me out?
1
Q: Pointer valid out of scope?

mrsinisterThere's a PDF I'm reading which says that a pointer is invalid after it passes out of scope. See slide #14 in the file below: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-087-practical-programming-in-c-january-iap-2010/lecture-notes/MIT6_087IAP10_lec05.pdf Now I wrot...

This follows it: #
# Relax access to content within /var/www.
#
<Directory "/var/www">
AllowOverride None
# Allow open access:
Require all granted
</Directory>
18:41
4
Q: Is returning a heap-allocated pointer from function OK?

alwaystudentWhen we return from function, if return value is a pointer, it must be define as static. Is this true for heap memory allocated pointer (such as new/malloc pointers),too? consider this example: #include"stdio.h" char * func() { char * X=new char[10]; X[0]='C'; x[1]='\0'; return ...

The two accepted answers contradict^
@Archer nope, not contradictory
one is using "new" to heap allocate and the other is returning a pointer to an array with automatic storage duration
Oh, I didn't know that using new heap allocates.
Thanks!
Should I change the serverRoot?
ServerRoot "/etc/httpd"
@earlyriser01 and there's no other apache configs for a different port or something? Does it mention the port elsewhere?
There is this:
Listen 80
There is this too:
#
# Relax access to content within /var/www.
#
<Directory "/var/www">
AllowOverride None
# Allow open access:
Require all granted
</Directory>
which that path is missing /html
But I' not sure if it is necessary
18:46
@PeterT So in C, arrays are always allocated on stack because it has no new keyword?
@Archer no, people use malloc to heap allocate in C
you could just try and see if this is the actual config that gets loaded by changing the port to something like 8070, restarting apache and see if you can reach the login page on that port
Okay. I tried changing it to 8070 but it cannot load the page
@PeterT What about a default declaration: int [] a = {1,2,3} ... This is surely going to be on a stack?
@Archer depends in which scope you write that, if it's inside a function, then yes
 
1 hour later…
jrh
jrh
20:00
If I initialize a class like this: TestClass testing = TestClass(24);, why doesn't it call the copy or move assignment operator on that =? Is there something special that happens for nameless temporaries?
jrh
jrh
20:22
Huh, if i set the copy consructor to be explicit it no longer compiles.
jrh
jrh
21:03
It seems like it's looking for a constructor like explicit TestClass::TestClass(TestClass other) but that's not a valid copy constructor, and I'm quite puzzled as to what constructor it's calling when the existing move and copy constructors are set to non-explicit (they don't seem to be executed at all on that line)
I'm also not sure why it couldn't just take a const reference (const TestClass&) to the temporary, instead of looking for an overload that took in TestClass
 
1 hour later…
22:26
Any reason that an AJAX call would fail with apache?

« first day (1415 days earlier)      last day (1654 days later) »