Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
hey mom its 420
May 12, 2007

I have a question about Visual C++ 2008 Express. My project files were generated by cmake. When I go to Build -> Build Solution everything builds nicely. But since I do most of the editing in gvim anyway, I'd rather build my project from the command line instead of having Visual C++ open just to press F7. Is there an easy way to see how Visual C++ is doing the building so that I can do the same in the command line?

Adbot
ADBOT LOVES YOU

Bonfire Lit
Jul 9, 2008

If you're one of the sinners who caused this please unfriend me now.

Bonus posted:

I have a question about Visual C++ 2008 Express. My project files were generated by cmake. When I go to Build -> Build Solution everything builds nicely. But since I do most of the editing in gvim anyway, I'd rather build my project from the command line instead of having Visual C++ open just to press F7. Is there an easy way to see how Visual C++ is doing the building so that I can do the same in the command line?

You can run devenv <solution> /Build <configuration> to achieve that. (Or use msbuild, which is the preferred way of building now, but I'm not sure if that was available in 2008.)

ToxicFrog
Apr 26, 2008


Rocko Bonaparte posted:

I'll try to ask this question I crammed into the end of an earlier post again: does anybody here understand FLTK layout and how resizing affects components? I see something about a resizable bit that affects thing, but that only one component in a group can do it. So how does one cause, say, two text fields to both resize when a window is made larger? Does each field need a group to itself?

Well, according to the first google hit for "fltk resize":

Marc R.J. Brevoort posted:

- to make things more predictable, it helps to fill groups with
widgets only in one direction: either horizontally or vertically.
(this also helps explain the following hints).

- If you need to fill groups both horizontally and vertically,
fill a group WITH GROUPS in one direction, then those 'sub'groups
in the other direction.

- In a group, at most one widget can be set to "resizable".
Attempts to setting several widgets to 'resizable' causes
only the last one to be marked resizable.

- Setting a widget to "resizable" means that that widget can be
resized BOTH horizontally and vertically, not that it is the
only resizable widget in the group.

- all other widgets in the group may resize along proportionally to
the size of the group, but only in one direction (if the group
is populated horizontally, 'nonresizable' widgets only resize
vertically, only the 'resizable' widget resizes in both directions.

- if a group is only resizable in one direction, only the resizable
widget will resize, all other widgets will stay the way they are.

In short, the expectation is that your layout will consist of nested horizontal and vertical groups of widgets, each one with one widget marked resizeable. If you widen a group (increasing the width of a vertical group or the height of a horizontal one), all of the widgets in it will expand along that axis; if you lengthen it (increasing the width of a horizontal group or the height of a vertical one), only the resizeable widget will expand.

code:
+--+ +---+ +--+
|  | | R | |  +
+--+ +---+ +--+

Widen:
+--+ +---+ +--+
|  | |   | |  +
|  | | R | |  +
|  | |   | |  +
+--+ +---+ +--+

Lengthen:
+--+ +-------+ +--+
|  | |   R   | |  +
+--+ +-------+ +--+

The Letter A
Nov 8, 2002

I've tried google to answer this question but I can't seem to find the answer I need.

I'm trying to call a python script from my PHP page and display the output. How can I do this? Currently I'm trying

code:
<?php
	$cmd = "python googleDirections.py {$_POST['fileName']} {$_POST['cmbRouteList']}";
	print $cmd;
	$output = `$cmd`;
	print $output;
?>
The proper command prints out, but the actual script output does not. I know next to nothing about PHP so I apologize if I'm being a dumbass. Thanks in advance guys.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
You probably want exec(). Also holy god I think you are entering new, unexplored worlds of security vulnerabilities.

The Letter A
Nov 8, 2002

Avenging Dentist posted:

You probably want exec(). Also holy god I think you are entering new, unexplored worlds of security vulnerabilities.
That's okay. This isn't for anything professional, it's mostly for learning purposes anyway.

Anyway, exec didn't work either; the $output variable is completely empty upon return of exec(). The script is just printing out to the console, is this what I want?

edit: for the record, shell_exec behaves similarly. That's why I'm wondering if I'm understanding something incorrectly.

edit 2: Okay, so it seems like because the script takes a while to execute (~10-15 seconds maybe) the output isn't displaying. I wrote a little test script that just prints out a single line and exec() caught it. I assume this means that the browser is timing out. Do I have any options?

The Letter A fucked around with this message at 16:46 on Apr 22, 2010

fankey
Aug 31, 2001

chocojosh posted:

In my .NET programs I've been increasingly using "helpers" to handle part of the code that goes into code behind. For example, our WPF application supports a "flick", such as that you find in the iPhone. To do a "flick" requires some code on mouse down, mose mouve, mouse up. Instead of storing that code inside the control itself, I create a "FlickHelper".
Do you mean using attached DependencyProperties to modify behavior instead of deriving a new class? I haven't seen a formalized term for this approach but most of the examples I've see use *Helper - and since that's what Bea Stollnitz calls them that's what I do as well.

I agree that this sort of approach seems nice and elegant. I started out with more of a C++ approach but since C# doesn't support multiple inheritance using mix-in classes doesn't work. Once I wrapped my head around DependencyProperties my life became much easier.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



The Letter A posted:

That's okay. This isn't for anything professional, it's mostly for learning purposes anyway.

Anyway, exec didn't work either; the $output variable is completely empty upon return of exec(). The script is just printing out to the console, is this what I want?

edit: for the record, shell_exec behaves similarly. That's why I'm wondering if I'm understanding something incorrectly.

edit 2: Okay, so it seems like because the script takes a while to execute (~10-15 seconds maybe) the output isn't displaying. I wrote a little test script that just prints out a single line and exec() caught it. I assume this means that the browser is timing out. Do I have any options?

Keep checking until you can be sure you hit the end of the output:
php:
<?
$pipe = popen("somecommand $someArgument", 'r');
$result = '';
echo "\n<br><pre>&gt; ";
do{
    $temp = fread($pipe, 1024);
    echo str_replace("\n", "\n&gt; ", $temp);
    //optionally flush your output to see it updated in semi-real-time
    $result .= $temp;
}while(!feof($pipe));
pclose($pipe);
echo "<br></pre>\n";
//see what you got back in $result to make sure it's what you were expecting
?>
e: I talk English good yes

Munkeymon fucked around with this message at 22:11 on Apr 22, 2010

hey mom its 420
May 12, 2007

Isilkor posted:

You can run devenv <solution> /Build <configuration> to achieve that. (Or use msbuild, which is the preferred way of building now, but I'm not sure if that was available in 2008.)
Where do I find this devenv?

No Safe Word
Feb 26, 2005

Bonus posted:

Where do I find this devenv?

This is VS2008 Team Edition, but:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE

hey mom its 420
May 12, 2007

Mine is Express, I don't have devenv in that folder :qq:

csammis
Aug 26, 2003

Mental Institution

Bonus posted:

Mine is Express, I don't have devenv in that folder :qq:

Search your hard drive? devenv.exe should be the IDE process, it must be somewhere.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

ToxicFrog posted:

Well, according to the first google hit for "fltk resize":
Thank you. I was trying combinations with resizing and layout and getting all kinds of wild stuff. It looks like FLTK does layouts that in other tool kits would be basically horizontal and vertical layouts.

Ularg
Mar 2, 2010

Just tell me I'm exotic.
I'm really getting fustrated, I can't even get Eric4 to install properly.

So at the moment I've:

Downloaded:

Eric4
Python2.6.5
PyQT
QScintilla
QT

Installed:

Python2.6.5
QT

And the Readme file says:

quote:

Installing eric4 is a simple process. Just execute the install.py script

Well, they never defined where exactly to run that. The install.py file when opened flashes a Command prompt on the desktop for a split second, opening and closing it but doing nothing.

Going into Python2.6.5 and typing in "Python Install.py" gives me a incorrect Syntax or a "name 'Install' is not defined" error.

I have no clue how to install this.

MrMoo
Sep 14, 2000

Case sensitive, you probably need open a shell and run "sudo python install.py" in whatever directory it is.

(edit) not on Unix.

MrMoo fucked around with this message at 10:10 on Apr 23, 2010

gibbed
Apr 10, 2006

The Letter A posted:

I've tried google to answer this question but I can't seem to find the answer I need.

I'm trying to call a python script from my PHP page and display the output. How can I do this? Currently I'm trying

code:
<?php
	$cmd = "python googleDirections.py {$_POST['fileName']} {$_POST['cmbRouteList']}";
	print $cmd;
	$output = `$cmd`;
	print $output;
?>
The proper command prints out, but the actual script output does not. I know next to nothing about PHP so I apologize if I'm being a dumbass. Thanks in advance guys.
I'd suggest adding 2>&1 to the end of the command to redirect stderr to stdout.

Avenging Dentist posted:

You probably want exec(). Also holy god I think you are entering new, unexplored worlds of security vulnerabilities.
Execution Operators

Ularg
Mar 2, 2010

Just tell me I'm exotic.

MrMoo posted:

Case sensitive, you probably need open a shell and run "sudo python install.py" in whatever directory it is.

For some reason I've downloaded Python 2.6.5 and the latest 3.1.x and neither has come with a shell, so I must be missing something.

Lorem ipsum
Sep 25, 2007
IF I REPORT SOMETHING, BAN ME.

Ularg posted:

For some reason I've downloaded Python 2.6.5 and the latest 3.1.x and neither has come with a shell, so I must be missing something.

I think maybe you shouldn't be using so many modules if you can't figure this out

I am assuming windows so start->run->cmd, type the path to your python install (cd c:\python26) and type python

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Lorem ipsum posted:

I think maybe you shouldn't be using so many modules if you can't figure this out
though in his defence, he's clearly on windows and people are telling him to use sudo, so it's not like we're on the whole giving him useful advice here

Ularg
Mar 2, 2010

Just tell me I'm exotic.

Lorem ipsum posted:

I think maybe you shouldn't be using so many modules if you can't figure this out

I am assuming windows so start->run->cmd, type the path to your python install (cd c:\python26) and type python

Well I really wish there was a whole "If you want to learn programming, you should learn a poo poo ton more about this first" but I guess that's my fault, I had fun doing stuff in Blitzplus and I went from that and tried to learn something else (Being that I thought 60$ was bullshit) and I have learned next to nothing about command prompt or other languages because I can't get anything to work

yatagan
Aug 31, 2009

by Ozma

Ularg posted:

Well I really wish there was a whole "If you want to learn programming, you should learn a poo poo ton more about this first" but I guess that's my fault, I had fun doing stuff in Blitzplus and I went from that and tried to learn something else (Being that I thought 60$ was bullshit) and I have learned next to nothing about command prompt or other languages because I can't get anything to work

Try buying a beginner's book on a language you're interested in. Make sure it has at least one chapter on getting started. The internet may have that advice too, but rarely in as consolidated a format.

MrMoo
Sep 14, 2000

Dijkstracula posted:

though in his defence, he's clearly on windows and people are telling him to use sudo, so it's not like we're on the whole giving him useful advice here

:haw: oh, "Command prompt".

I only see Windows mentioned in the testimonials page. Although from http://www.toadz.dk/2008/07/install-eric-python-ide-on-windows/ I'd guess is because he's only just installed Python and needs to reboot first for the path to update in order for Python to work.

MrMoo fucked around with this message at 10:17 on Apr 23, 2010

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

gibbed posted:

Execution Operators

Really? They really had to take that one feature from Perl that only makes sense in a shell-scripting environment? :ughh:

spiritual bypass
Feb 19, 2008

Grimey Drawer

Avenging Dentist posted:

Really? They really had to take that one feature from Perl that only makes sense in a shell-scripting environment? :ughh:

For some reason this makes me feel inspired to write a browser based virtual terminal with AJAX. Maybe this weekend will find me installing some virtual machines :unsmigghh:

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Little GUI question: What would you call a divider that is, say, between two vertically stacked text boxes such that when you click and drag on it, you can make one of the text boxes larger by taking space from the other? I'm trying to figure out how FLTK might manage that but I've realized I don't even know what to call that. Preferably when clicked upon the icon changes to reflect how things get reoriented--in this case a vertical line with arrows on either end.

gibbed
Apr 10, 2006

Splitter?

zynga dot com
Nov 11, 2001

wtf jill im not a bear!!!

A dossier and a state of melted brains: The Jess campaign has it all.
I'm not sure if this belongs here or the C thread, but I'm having trouble with some fork() concepts. Specifically, I'm supposed to read input performing a blocking read operation. I know that means I have to wait() or waitpid() for the child process, and that part is working. However, I'm pretty sure that the point of that instruction isn't to then keep the child open for parsing that input since that should be the parent's job. The only way I can think of is to store the input in the environment variables or something so the parent can read it but that seems like such a hack. Am I missing something big here?

shrughes
Oct 11, 2008

(call/cc call/cc)

Flashdance posted:

I'm not sure if this belongs here or the C thread, but I'm having trouble with some fork() concepts. Specifically, I'm supposed to read input performing a blocking read operation. I know that means I have to wait() or waitpid() for the child process, and that part is working. However, I'm pretty sure that the point of that instruction isn't to then keep the child open for parsing that input since that should be the parent's job. The only way I can think of is to store the input in the environment variables or something so the parent can read it but that seems like such a hack. Am I missing something big here?

Yes. You aren't communicating your question in any comprehensible manner. Also, you can't communicate between existing processes by having them set their own environment variables.

spiritual bypass
Feb 19, 2008

Grimey Drawer
Could you open a pipe?

zynga dot com
Nov 11, 2001

wtf jill im not a bear!!!

A dossier and a state of melted brains: The Jess campaign has it all.

shrughes posted:

Yes. You aren't communicating your question in any comprehensible manner. Also, you can't communicate between existing processes by having them set their own environment variables.

Ok, let me try again. Is there an easy way that I am missing for parent and child processes to talk to each other other than IPC (which we haven't gotten to yet)? If I have a parent wait() for a child to finish reading input and return, it seems pointless because the parent doesn't have access to the child's input. I'd have to use that initial fork and have the child run the rest of the program, including more forks, only returning to the parent to free memory and exit. This seems like I'm overcomplicating things.

Also, re: the environment variables, you're saying that the child gets its own copy of the parent's shell environment variables as well?

rt4 posted:

Could you open a pipe?

Yeah, see above. We're going to be covering IPC stuff soon, but the fact that we haven't yet suggests that it isn't necessary to fix my current problem.

pseudorandom name
May 6, 2007

Without any IPC, basically the only thing you can do is have the child process return an error code (main()'s return value, or exit()'s parameter).

zynga dot com
Nov 11, 2001

wtf jill im not a bear!!!

A dossier and a state of melted brains: The Jess campaign has it all.

pseudorandom name posted:

Without any IPC, basically the only thing you can do is have the child process return an error code (main()'s return value, or exit()'s parameter).

That's the conclusion I had come to, and I just wanted to make sure I wasn't being dumb and missing anything. Thanks for the response.

Reaction Cat
Jun 24, 2008

Rocko Bonaparte posted:

Little GUI question: What would you call a divider that is, say, between two vertically stacked text boxes such that when you click and drag on it, you can make one of the text boxes larger by taking space from the other? I'm trying to figure out how FLTK might manage that but I've realized I don't even know what to call that. Preferably when clicked upon the icon changes to reflect how things get reoriented--in this case a vertical line with arrows on either end.

Looks like that thing is called a sash.

shrughes
Oct 11, 2008

(call/cc call/cc)
You could have the child process write to a file before exiting, or allocate and touch a large amount of memory (so the parent process can inspect its behavior through /proc or something?) or max out the user's filehandle limit or some other system resource's limit and then release it, in some morse-code-like manner, or wait until the number of seconds on the system clock is even (or odd) before exiting, or send a signal, or open a TCP socket while the parent waits on a port, or play a loud sound to the speakers while the parent process reads from the microphone, or allocate a bunch of memory, and then write to it, and then release it, and then let the parent process allocate a bunch of memory, and hopefully some of the uninitialized memory will contain the child process's message (or does the OS zero out the memory? I don't know), or it could take an open file descriptor and use lseek to move the file pointer around.

Whilst farting I
Apr 25, 2006

We're supposed to draw a Hermite spline, but I'm terribly confused. This has helped me a lot (http://www.cubic.org/docs/hermite.htm) but still leaves a lot of gaps.

1.) The four parameters are defined by the user (startpoint, endpoint, starting point tangent, ending point tangent). But how does one find the tangent of a set of points?

2.) What is "s"? It says "Vector S: The interpolation-point and it's powers up to 3:" but that doesn't mean anything to me because at no point is a numerical value assigned to it, nor does it explain how it could be. It also defines it as

code:
float s = (float)t / (float)steps;    // scale s to go from 0 to 1
but now I don't know what t is, or what steps is and what would define it.

3.) Another thing that's really confusing is the way it deals with points as vectors.

code:
vector p = h1*P1 +                    // multiply and sum all funtions
             h2*P2 +                    // together to build the interpolated
             h3*T1 +                    // point along the curve.
             h4*T2;
What is one supposed to get from this? 4 new points? If so, how are they used? How is the tangent incorporated when drawing from start point to endpoint?

This is just so confusing to me and no matter how much time I spend looking up information, I don't learn anything because so many crucial gaps are unfilled. All I want to do is draw a drat Hermite curve. :psyduck: This is something I could probably understand in like 5 minutes if I had a proper and full explanation. :smith:

e: I just realized this is probably better suited to the graphics thread and have posted it there as well. :nyoron:

Whilst farting I fucked around with this message at 00:50 on Apr 25, 2010

BigRedDot
Mar 6, 2008

Whilst farting I posted:

1.) The four parameters are defined by the user (startpoint, endpoint, starting point tangent, ending point tangent). But how does one find the tangent of a set of points?
You don't find it, you specify it. You can choose it to be whatever you want it to be.

quote:

2.) What is "s"? It says "Vector S: The interpolation-point and it's powers up to 3:" but that doesn't mean anything to me because at no point is a numerical value assigned to it, nor does it explain how it could be. It also defines it as
Maybe it would have been clearer if they'd just called it "x". It is just the independent variable. The only difference is these curves are scaled so that the domain is always in [0,1]. So they call it "s" instead of "x".

Opinion Haver
Apr 9, 2007

rt4 posted:

For some reason this makes me feel inspired to write a browser based virtual terminal with AJAX. Maybe this weekend will find me installing some virtual machines :unsmigghh:

This exists, and it can capture a positively scary amount of key sequences from the browser.

spiritual bypass
Feb 19, 2008

Grimey Drawer

yaoi prophet posted:

This exists, and it can capture a positively scary amount of key sequences from the browser.

What's even scarier is I could deploy this application on the servers at my workplace and easily convince our idiot sysadmin that it's a convenient replacement for puTTY

Ceros_X
Aug 6, 2006

U.S. Marine
OK, not exactly Programming per se, but I saw some MS Access questions in the main forum so maybe this will be acceptable..

I'm working in Excel and trying get some cell formats to display what I want them to...

OK, basically, I am trying to get the cell to evaluate the contents of the cell and then display the number and one of three suffixes depending on the decimal place.

IE, 1 would be displayed as "1 GP"
.1 would be displayed as "1 SP"
.01 would be displayed as "1 CP"

Right now I've got it displaying the appropriate suffix but can't get it to pass the number without the decimal and 0s.

This is what I'm using:

code:
[<0.1]"CP";[<1]"SP";"GP"
I've looked around the web and messed with conditional formatting (which seems to be geared only to color coding). Any help?

yes, this is for DnD

Adbot
ADBOT LOVES YOU

chocojosh
Jun 9, 2007

D00D.

fankey posted:

Do you mean using attached DependencyProperties to modify behavior instead of deriving a new class? I haven't seen a formalized term for this approach but most of the examples I've see use *Helper - and since that's what Bea Stollnitz calls them that's what I do as well.

I agree that this sort of approach seems nice and elegant. I started out with more of a C++ approach but since C# doesn't support multiple inheritance using mix-in classes doesn't work. Once I wrapped my head around DependencyProperties my life became much easier.

Not exactly. We use DependencyProjects for our UserControls, but I haven't fully wrapped my head around the details and haven't even really looked into Attached Properties. WPF is huge and it feels like every month for the past six I've been learning new parts of it.

A helper is simply a separate class to handle the details of codebehind code. Our main window (different developer) got to 3000 lines of code, with several parts having duplicate code. In my own app I didn't want this to happen, so I started making separate classes to handle any codebehind logic that was more than 50 lines, or that uses member variables (I hate seeing a member variable that only applies to two functions out of 30!).

chocojosh fucked around with this message at 05:19 on Apr 26, 2010

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply