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
KUBaNPhillipay
Jul 16, 2004
I'm in the process of learning QT and I have a question about installing and building qt from source. I just installed the QT SDK and it came with some precompiled versions of QT (4.8.1). My plan is to build a static and a dynamic version of QT 4.8.2 (either using MVSC or MinGW or both) directly from the source code. When I download the source from here I have to install the library before I can compile it. My question is can I build multiple versions from one install? I didn't see a way to do this because whenever I compile it builds the files in the default directory specified by the install path. If I compile it with different options it overwrites the previous build. The way I'm getting around this now now is to install it multiple times but that doesn't quite seem like the best way to go about it. Is there a way just to obtain the files I need to compile without having to do an install? How do I go about building different versions with one copy of the source?

Also, after each build the directory is huge (2-5 GB). Is there any way to remove the unneeded files after compilation? My QT directory is already 20GB and I haven't even written any programs yet. I'm a little confused about all this so I would appreciate any clarification!

Adbot
ADBOT LOVES YOU

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


SirPablo posted:

I'm interested in doing some research on determining a person's worldscope. By worldscope I mean the rough physical area of the earth that their life covers (work, play, living, etc.). For example, Joe's worldscope is confined to 30 miles within the center of Oklahoma City, OK - he lives and works there, seldom leaves, and most of his friends/family are there. Now I'd like to write some code to do figure this out for me, my question isn't really with the code but with what kind of data could I use and how do I get it. A couple of ideas would include analyzing a person's Facebook friends list, their check-ins via Facebook/Foursquare, and locations that they tweet from. However, I have very little idea how to obtain those data, if it is even possible.

The application for this is to figure out how large of an area a person cares about what weather is happening. The hypothesis is they would only care about what is happening within their worldscope, so figuring out what that is would be highly useful for communicating weather information.

Alternatively, you could show them weather forecasts at given distances/directions from their current location and learn what they care about that way.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

code:
doSomething(int a, int b, int c, boolean optionXorOptionY)
or would you prefer:

code:
doOptionXSomething(int a, int b, int c)

doOptionYSomething(int a, int b, int c)

nielsm
Jun 1, 2009



Thermopyle posted:

code:
doSomething(int a, int b, int c, boolean optionXorOptionY)
or would you prefer:

code:
doOptionXSomething(int a, int b, int c)

doOptionYSomething(int a, int b, int c)

Latter.
The two functions could then share some common helper functions, but my own experience with that kind of boolean switches for a function's function is that it quickly gets out of hand.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
There's no hard and fast rule, but the second option will often result in methods that are themselves shorter and simpler.

Zhentar
Sep 28, 2003

Brilliant Master Genius
You're going along, reading some code in a method. You come across doFrobAndGrobOrYob(myVar, 3, true, false). Quick, are we Grobbing or Yobbing?

het
Nov 14, 2002

A dark black past
is my most valued
possession
That depends on if I'm supposed to read that as "Frob and (Grob or Yob)" or "(Frob and Grob) or Yob"

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
het: obviously we should solve this by permitting parentheses in identifiers.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Congratulations, you guys picked the right answer (aka, the one I prefer).

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Thermopyle posted:

code:
doSomething(int a, int b, int c, boolean optionXorOptionY)

This isn't as bad if you have named parameters.

code:
doSomething(15, 2, 4, optionX=false)

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Zhentar posted:

You're going along, reading some code in a method. You come across doFrobAndGrobOrYob(myVar, 3, true, false). Quick, are we Grobbing or Yobbing?

doFrobAndGrobOrYob(myVar, 3, DO_FROB | DO_GROB);

Zombywuf
Mar 29, 2008

The correct answer is obviously dependency injection.

het
Nov 14, 2002

A dark black past
is my most valued
possession

Internet Janitor posted:

het: obviously we should solve this by permitting parentheses in identifiers.
No, we just make Boolean expressions in function names prefix or postfix, obviating the need for parentheses. now doFrobGrobAndYobOr and doFrobGrobYobOrAnd are clearly distinguished in a logical fashion obvious to the casual observer.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

pokeyman posted:

This isn't as bad if you have named parameters.

code:
doSomething(15, 2, 4, optionX=false)

Does a language like Obj-C change the answer? Where the message is:

code:
 [self doSomethingWithANumber:15 anotherNumber:2 aThirdNumber:3 shouldDoOptionX:YES] 
(granted the earlier statement about smaller, nicer methods by splitting them up still stands.)

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I call those named parameters for the purposes of this discussion :-)

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

I need to make an installer for a Windows program, some DLLs, and a device driver. Last time I made an installer was something like 8 years ago. I used the tools included with Visual Studio that time, and I remember it being somewhat of a bitch. I imagine things have changed somewhat since then. What is the best toolkit/installer creator to use these days?

MrMoo
Sep 14, 2000

I'm using CPack (CMake) and NSIS, luck has it there has been work on a 64-bit fork recently too.

WiX looks like way too much work, although Google seem have got it integrated with Gyp.

MrMoo fucked around with this message at 17:59 on Jun 20, 2012

stubblyhead
Sep 13, 2007

That is treason, Johnny!

Fun Shoe
I'm getting an http 405 error (method not allowed) using an application's REST inferface. I'm trying to POST, which the API guide says is allowed, and POST is included in the Allow header of the error page I get. As a developer, is the onus upon you to implement all the methods you want a resource to handle, or does that header get built automatically from the implemented methods? Basically I guess I'm asking if I'm doing something wrong (very possible) or if the devs didn't actually implement POST for this resource, despite all other indications (also very possible).

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

MrMoo posted:

I'm using CPack (CMake) and NSIS, luck has it there has been work on a 64-bit fork recently too.

WiX looks like way too much work, although Google seem have got it integrated with Gyp.

I do need to support 64-bit windows as an install target, but do I actually need a 64-bit installer for that?

Is the Windows Installer (.msi) stuff a bad way to go? Or do the 3rd party install systems use Windows Installer under the hood? (I am totally dumb about installers)

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


NSIS is a totally separate system from the Windows installer framework. It's free, it has very little overhead, and it comes with a more robust programming language than most other installers (as of a few years ago, anyway). It's definitely worth taking a look at.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I'd highly recommend using the Windows Installer framework. NSIS does not handle upgrades that well; Windows Installer has a versioning system for various resources (files, registry keys) that just works. It will delete stale resources (by default) if they're no longer in the bundle, NSIS won't.

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

I was also looking at Innosetup, but it does not use the Windows Installer framework either. Anyone used Advanced Installer? It gets some positive mentions on SO and uses Windows Installer framework.

MrMoo
Sep 14, 2000

taqueso posted:

I do need to support 64-bit windows as an install target, but do I actually need a 64-bit installer for that?

You need a 64-bit installer for registry keys not to be re-routed to WoW6432Node.

http://en.wikipedia.org/wiki/WoW64

nielsm
Jun 1, 2009



MrMoo posted:

You need a 64-bit installer for registry keys not to be re-routed to WoW6432Node.

http://en.wikipedia.org/wiki/WoW64

I'm quite sure you can do something to explicitly get a process marked as "WoW32-aware", which means that all the redirection stuff is disabled.

OnceIWasAnOstrich
Jul 22, 2006

I have a (large) set of objects that is spread out in one dimension. Each has a stop and start coordinate. I've just got them in an array (or sometimes an ordered python dictionary) right now, but to select every objects with coordinates that overlap a certain region on the axis is an O(n) operation, just checking every object until I find one on the far side of the region, which is starting to seriously slow things down. I am having trouble thinking of a data structure I'm familiar with that will let me easily do this, or else a search method that would be faster. Is there something I just haven't heard of that would be right for this?

Moos3d
Apr 6, 2008

OnceIWasAnOstrich posted:

I have a (large) set of objects that is spread out in one dimension. Each has a stop and start coordinate. I've just got them in an array (or sometimes an ordered python dictionary) right now, but to select every objects with coordinates that overlap a certain region on the axis is an O(n) operation, just checking every object until I find one on the far side of the region, which is starting to seriously slow things down. I am having trouble thinking of a data structure I'm familiar with that will let me easily do this, or else a search method that would be faster. Is there something I just haven't heard of that would be right for this?

Interval tree or segment tree.

OnceIWasAnOstrich
Jul 22, 2006

Moos3d posted:

Interval tree or segment tree.

This is perfect, I'm really looking forward to taking an actual programming course above my high school classes in grad school so I can [hopefully] be exposed to more stuff like this.

ToxicFrog
Apr 26, 2008


ultrafilter posted:

NSIS is a totally separate system from the Windows installer framework. It's free, it has very little overhead, and it comes with a more robust programming language than most other installers (as of a few years ago, anyway). It's definitely worth taking a look at.

It is really loving sad that NSIS, with its scripting language that "combines the best elements of PHP and assembler" (in the words of the developers), is one of the better options out there.

Unless they've overhauled the scripting environment to be less of a total clusterfuck since last time I looked at it?

nielsm
Jun 1, 2009



ToxicFrog posted:

It is really loving sad that NSIS, with its scripting language that "combines the best elements of PHP and assembler" (in the words of the developers), is one of the better options out there.

Unless they've overhauled the scripting environment to be less of a total clusterfuck since last time I looked at it?

I haven't actually used NSIS, but from the installers I have seen made with it, it's horrible.
InnoSetup has sane defaults and you only need to use its scripting (Pascal dialect) if you need to do unusual checks or things like conditional upgrades.

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Is there any way when I run a git diff (or any other git command for that matter) to have it print out everything? Right now if your diff goes on for too long it makes you hit a key to continue. I would like to not have to do that.

Doctor w-rw-rw-
Jun 24, 2008

Strong Sauce posted:

Is there any way when I run a git diff (or any other git command for that matter) to have it print out everything? Right now if your diff goes on for too long it makes you hit a key to continue. I would like to not have to do that.
Dude. Top google result for "git diff don't less".

http://stackoverflow.com/questions/2183900/how-do-i-prevent-git-diff-from-using-a-pager

Strong Sauce
Jul 2, 2003

You know I am not really your father.






Couldn't figure out what to Google for. Thanks.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
Large complicated diffs are one of the very few things for which I use a GUI program. You can use git diftool with something like kdiff3, or a full-featured program like SmartGit.

I really liked SmartSVN in the distant past, and I occasionally fire up SmartGit for its interactive conflict solver.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
I have a directed graph (don't confuse me for a smart person, I picked the terminology up from Wikipedia) and I need to jump to a node and go on every outward-facing edge and run a function on that node and do the same thing to that one. I get the idea of running a recursive function on each node, but I don't know how to deal with cycles. It would be a simple special case, but I don't know how to detect cycles.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Sinestro posted:

I have a directed graph (don't confuse me for a smart person, I picked the terminology up from Wikipedia) and I need to jump to a node and go on every outward-facing edge and run a function on that node and do the same thing to that one. I get the idea of running a recursive function on each node, but I don't know how to deal with cycles. It would be a simple special case, but I don't know how to detect cycles.

Store a boolean for each node. Initialize it to false, and when you first visit the node, set it to true. Don't recurse if it's true when you get there.

Doctor w-rw-rw-
Jun 24, 2008

Sinestro posted:

I have a directed graph (don't confuse me for a smart person, I picked the terminology up from Wikipedia) and I need to jump to a node and go on every outward-facing edge and run a function on that node and do the same thing to that one. I get the idea of running a recursive function on each node, but I don't know how to deal with cycles. It would be a simple special case, but I don't know how to detect cycles.

If the objects can be keys, keep a set of them around (let's call it "seen") and check them. Note that this is stateful.

EDIT: the above solution makes just as much if not more sense.

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Lysidas posted:

Large complicated diffs are one of the very few things for which I use a GUI program. You can use git diftool with something like kdiff3, or a full-featured program like SmartGit.

I really liked SmartSVN in the distant past, and I occasionally fire up SmartGit for its interactive conflict solver.

It's not even necessary very large diffs, git makes you press a button even if the diff is less than a page. Just annoying cause I often forget and it messes with my typing.

pseudorandom name
May 6, 2007

Strong Sauce posted:

It's not even necessary very large diffs, git makes you press a button even if the diff is less than a page. Just annoying cause I often forget and it messes with my typing.

Either you're not using less, or you've set the LESS env var to something that doesn't contain F.

Mid_Ben
Apr 10, 2008
I have this little program that currently outputs files in an ASCII format. However, the customer that this was designed for is now asking that the results are outputted to either .XPS or .PDF, so the files could be sent out and be at less risk of tampering.

My question is thus: is there an easy way to print to .xps from within the dos prompt? I've tried the most basic print commands, but it looks like it just sends the text file to the printer's 'spool' (my C: drive)

Thanks for the help!

Adbot
ADBOT LOVES YOU

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





stubblyhead posted:

I'm getting an http 405 error (method not allowed) using an application's REST inferface. I'm trying to POST, which the API guide says is allowed, and POST is included in the Allow header of the error page I get. As a developer, is the onus upon you to implement all the methods you want a resource to handle, or does that header get built automatically from the implemented methods? Basically I guess I'm asking if I'm doing something wrong (very possible) or if the devs didn't actually implement POST for this resource, despite all other indications (also very possible).

At a raw http level, you can shove whatever you want in the Allow header. I could claim my endpoint implements the 'PARTY' method. At a framework level you'd hope these would have some sort of constraint placed on them that verifies the Allow header in a 405 return isn't a filthy liar, but most frameworks are crap. In short, it's probably the API devs, not you.

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