|
If you choose make, don't use recursive make. Everybody (including autoconf) does it, but it sucks in almost every way. Incomplete dependency graphs, slower builds, etc. The only benefit is that you don't have to type "pushd $project_root" before typing "make".mr_jim posted:Either way, it's worth it to avoid using Makefiles.
|
# ? May 10, 2010 18:54 |
|
|
# ? May 30, 2024 08:00 |
|
Dijkstracula posted:Scons looks neat; the next time I start a larger project I'll think about using it. If it handles building shared libraries sensibly in a platform-independent way, I'll be thrilled. Depending on your definition of "larger", Scons may be a bad idea.
|
# ? May 11, 2010 01:51 |
|
Well, that's pretty gross. It would have been nice if he posted his SConstruct and compared the overhead with make's, though.
|
# ? May 11, 2010 02:05 |
|
I'm wondering if his shell script scanned the input files for file dependencies, or if that information was hard-coded. That would explain at least some of the difference. Edit: Looking at the mailing list, it looks like all the "overhead" is in building and using a dependency graph. It's not surprising that a shell script would be faster when doing an initial build. Scons might have a bit of an edge for partial builds. mr_jim fucked around with this message at 03:37 on May 11, 2010 |
# ? May 11, 2010 03:26 |
|
Nevermind, I'm an idiot newbie that doesn't know how to read.
An Outland Dish fucked around with this message at 06:03 on May 12, 2010 |
# ? May 11, 2010 03:58 |
|
Okay, I've got invalid characters cropping up in some programs which causes some of them to crash when processing data. I've got two examples of the same data, one created in notepad, the other in notepad++. The notepad one is the one that looks screwed up with the invalid character on the end. Both of them have it - the notepad++ just handles it correctly. http://www.yourfilelink.com/get.php?fid=545372 (notepad) http://www.yourfilelink.com/get.php?fid=545373 (notepad++) Is there some way to process this file prior to kicking off my batch program to remove the invalid character? It happens at least once per 1250 records that come in where someone fucks up a street address.
|
# ? May 11, 2010 16:04 |
|
SiLk-2k5 posted:Okay, I've got invalid characters cropping up in some programs which causes some of them to crash when processing data. The problem is line endings. More specifically, np[invalid].txt has only LF (ie UNIX style), while np++[invalid].txt has CR-LF (ie Windows style). You can see this by showing all symbols in NP++ View->Show Symbol->Show all characters. At least that is the only difference I see.
|
# ? May 11, 2010 22:28 |
|
I took a look at this. What is happening is that when reading in the data it is throwing a line feed and loving up the file output. Any good way (C++/etc.?) to read in a string and replace the LF character?
|
# ? May 12, 2010 14:45 |
|
You should be able to knock up a script in any language fairly quickly to replace Char(13)(?) with nothing....
|
# ? May 12, 2010 16:35 |
|
SiLk-2k5 posted:I took a look at this. What is happening is that when reading in the data it is throwing a line feed and loving up the file output. Any good way (C++/etc.?) to read in a string and replace the LF character? dos2unix
|
# ? May 12, 2010 16:36 |
|
Based on the previous discussions on make environment I decided to go with scons since I'm planning to embed Python in my project anyways, so I might as well use it to build everything too. I think I still have some organizational issues for how to lay out source in a project and then put together the build environment for it. Let's say I have some subdirectories under my project's master source directory: sources/X, sources/Y, sources/Z. The division was organizational, although some of the code refers to code in other folders. As I am hacking around I want to be build small test programs from pieces of each, and then there's the big final program that chews everything up together. How should I approach this? I assume I would have build files in each subdirectory; then I replicate a lot of header and library paths. Is there a way with scons to include some basic project settings in one spot? Now let's say everything I really need to build X, Y, Z is all sorted out in their build files through whatever mechanism. How should the master project refer to them? Should I just invoke the build tool on each subdirectory's build file in turn? Consider for a moment that there's a technical problem here for sure, but I am wondering if I am even approaching this in a good, elegant manner. It's possible I could start throwing a lot of source files and directories at this, so I wanted to get the organization of the build environment correct before it becomes a huge mess. Edit: For those that haven't played with scons... if you know Python it's pretty easy to bullshit it to build stuff. Of course that can be a bad thing . . . Rocko Bonaparte fucked around with this message at 04:19 on May 13, 2010 |
# ? May 13, 2010 01:09 |
|
Rocko Bonaparte posted:Based on the previous discussions on make environment I decided to go with scons since I'm planning to embed Python in my project anyways, so I might as well use it to build everything too. I think I still have some organizational issues for how to lay out source in a project and then put together the build environment for it. Check the chapter on Hierarchical Builds in the Scons user manual. Basically, you'll have one SConstruct file in the project's root directory, and then a SConscript file in each subdirectory. The SConstruct file will call each of the SConscript files, which will do the actual building in each subdirectory. As for sharing environment settings, there's a section on that as well.
|
# ? May 13, 2010 14:11 |
|
I'm using C# .NET, and I'm just curious -- is there any way to set up a function where the variables being passed in are optional without setting up a bunch of overloads? Writing out function(), function(a), function(b), function(a,b) isn't bad, but if I've got like five variables that's, what, two dozen overloads to let users pass in whatever combination they want? I don't wanna do that, it's a pain in the rear end.
|
# ? May 13, 2010 17:18 |
|
C# 4.0 adds optional and named arguments for exactly that reason.
|
# ? May 13, 2010 17:29 |
|
CapnAndy posted:I'm using C# .NET, and I'm just curious -- is there any way to set up a function where the variables being passed in are optional without setting up a bunch of overloads? Writing out function(), function(a), function(b), function(a,b) isn't bad, but if I've got like five variables that's, what, two dozen overloads to let users pass in whatever combination they want? I don't wanna do that, it's a pain in the rear end. public void SomeFunc(int a, bool y = false, string n = "") a would need to be passed no matter what, but y and n could be ignored and these default values would be used. You could also pass them all. However, you cannot skip over y and pass something for n, you have to pass something for every parameter leading up to the one you want to pass for unless you use a named parameter, whereby in passing the value you prefix the value with the name of the variable in the function to which you are attempting to pass the value. Oh, and you can't have an optional parameter come before a required one. The following calls would be okay: SomeFunc(1); SomeFunc(1, true); SomeFunc(1, true, "string"); SomeFunc(1, n: "string"); http://weblogs.asp.net/podwysocki/archive/2008/10/28/named-and-optional-arguments-in-c-4-0.aspx
|
# ? May 13, 2010 19:42 |
|
I wonder how they handle overload resolution for that (I wonder because I want to do the same thing in my babby language).
|
# ? May 13, 2010 19:47 |
|
Avenging Dentist posted:I wonder how they handle overload resolution for that (I wonder because I want to do the same thing in my babby language). Say we have three method declarations: void SomeFunc(int a) {} void SomeFunc(int a, int b =4) {} void SomeFunc(int a, int b = 4, int c = 10) {} Calling SomeFunc(5) will call the first because the compiler goes for whichever one the given parameter list fits that doesn't have optional parameters. MSDN posted:If two candidates are judged to be equally good, preference goes to a candidate that does not have optional parameters for which arguments were omitted in the call. This is a consequence of a general preference in overload resolution for candidates that have fewer parameters. Now, if there is not definition for void SomeFunc(int a) and just the latter two, calling SomeFunc(5) will throw a compile-time error.
|
# ? May 13, 2010 20:06 |
|
What's "better," programming on a Linux or OSX box? My undergrad research professor/adviser loves Mac and everything about it, and I'm about to start graduate school and and my graduate research. Right now I have a Dell laptop with both Windows 7 and Ubuntu on it (switching over to Ubuntu for programming purposes), but my sister was thinking about getting the new MacBook Pros that just came out so she's selling her older MBP (came out last year). I don't need a new laptop but I really do like how small and light MBPs are and if my research adviser, a professor who does the same research that I am getting into, prefers a Mac over a Linux box then there's got to be a reason right? The languages I'll be using would be Fortan and C. Edit: Computing power isn't that big of a deal because everything that requires a lot of processing power would be offloaded to a dedicated computer in the lab or a cluster.
|
# ? May 15, 2010 00:36 |
|
Does anyone know how to define a method for a record type in F#? The language reference says it's possible but doesn't say how and I can't figure the syntax out.
|
# ? May 15, 2010 01:51 |
|
Ziir posted:What's "better," programming on a Linux or OSX box? I presume you'll be using GCC? Runs fine on both platforms. What do you feel the most comfortable editing text files on?
|
# ? May 15, 2010 02:12 |
|
Ziir posted:What's "better," programming on a Linux or OSX box? Unless you want to deal with B.S. like wondering why OpenGL won't work on your hardware or why wireless or other crap just don't work, or if you don't like shittily made software, or if you like your browser to run fast, or if you hate freedom or feel the need to express your femininity through your computer and have a lot of extra money to spend, get a Mac. Otherwise get a Thinkpad, install Debian, GHC, XMonad, and bask in the freedom.
|
# ? May 15, 2010 05:00 |
|
Ziir posted:What's "better," programming on a Linux or OSX box? I wouldn't assume that your advisor has a good reason to prefer one over the other, you should decide yourself. But if you have the same setup as your advisor, that will probably make working together easier. And never underestimate the benefit of having someone familiar with a new OS nearby to help with the little things. Both of those reasons are great ones to guide you.
|
# ? May 15, 2010 07:25 |
|
Seriously, programming on a Mac is way better than programming on Linux. There's one target that everybody's worrying worry about, and poo poo generally just _works_. Personally I'm only willing to write software on my new Ben Nanonote with its copyleft hardware because anything else would be unethical :V
|
# ? May 15, 2010 07:32 |
|
shrughes posted:Seriously, programming on a Mac is way better than programming on Linux. Could you please elaborate?
|
# ? May 15, 2010 08:12 |
|
Ziir posted:Could you please elaborate? There's one target that everybody's worrying worry about, and poo poo generally just _works_.
|
# ? May 15, 2010 08:18 |
|
Ziir posted:Could you please elaborate? The OS X platform is significantly more homogenous than the Linux/PC world, which for better or worse means that both development for it and use of it is going to be less fraught with problems (at the cost of choice/openness). That's not to say that Linux these days is somehow bad for either of those things, but there's no way that an open source ecosystem targeting a myriad of possible hardware/software configurations is going to exhibit the same level of polish and ease of development/use as one produced by a single company targeting its own, comparatively tiny number of hardware and software configs. In my experience, what it boils down to is your opinion of Apple's policies and/or the level of your desire to control the software you're using. For a lot of open source developers over the last 5-10 years, the "don't have to gently caress with anything to make things just work" aspect of OS X combined with the fact that its underlayer is a fairly traditional Unix has made it the ideal platform. The only software I've ever seen that is Linux exclusive is, as you might imagine, related to the Linux kernel itself. (Apple's apparently-totally-awesome set of APIs for native application dev is also a major draw, even moreso nowadays with all the mobile junk going on. And even with the strides Ubuntu has made in OSS usability, it's still not quite there yet.) Which is all just a or way of expanding on what shrughes is saying.
|
# ? May 15, 2010 14:14 |
|
What text editors do you guys use with your Macs? I really like Notepad++ for Windows and I'm starting to get the hang on Vim on Linux.
|
# ? May 15, 2010 18:50 |
|
You guys are all terrible at advice. Notice where he says:Ziir posted:Edit: Computing power isn't that big of a deal because everything that requires a lot of processing power would be offloaded to a dedicated computer in the lab or a cluster. If you think it's likely that you'll be programming stuff that gets put on a cluster, use whatever OS the cluster uses (or as close to it as possible). Do you really want to deal with weird compiler issues because of Apple's customized (and frequently outdated) version of GCC?
|
# ? May 15, 2010 18:54 |
|
I use MacVim for most things. XCode is kind of a piece, especially if you're coming from a real IDE like VS, so a traditional editor will serve you best IMO.Avenging Dentist posted:If you think it's likely that you'll be programming stuff that gets put on a cluster, use whatever OS the cluster uses (or as close to it as possible). Do you really want to deal with weird compiler issues because of Apple's customized (and frequently outdated) version of GCC?
|
# ? May 15, 2010 18:57 |
|
Dijkstracula posted:Yeah, I noticed this, but I've never had any issues porting code I've developed on my Mac to a Linux cluster so I didn't comment on it. We regularly have issues making stuff work on Linux and Mac at my job. Usually because Mac does some bizarre thing like making CC point to gcc instead of g++.
|
# ? May 15, 2010 19:00 |
|
Avenging Dentist posted:We regularly have issues making stuff work on Linux and Mac at my job. edit: ah, I was only doing Fortran or vanilla C work, so I wouldn't have enountered the g++ issue. Dijkstracula fucked around with this message at 19:20 on May 15, 2010 |
# ? May 15, 2010 19:01 |
|
Avenging Dentist posted:If you think it's likely that you'll be programming stuff that gets put on a cluster, use whatever OS the cluster uses (or as close to it as possible). Do you really want to deal with weird compiler issues because of Apple's customized (and frequently outdated) version of GCC? Yea, I didn't read very closely. I do usually recommend people develop on their target platform when possible, it just makes the most sense. On the other hand, depending on exactly what's going on, a Mac may still be the best workstation platform and you can just use VMs for more easily targeting the deploy environment. Best of both worlds. Ziir posted:What text editors do you guys use with your Macs? I really like Notepad++ for Windows and I'm starting to get the hang on Vim on Linux. I use Vim (not MacVim...terminal vim) on my Mac, but I'm a weirdo who likes the fact that his editor behaves 100% the same regardless of whether his terminal is open to a local tty or a remote one. Most Mac-using developers I know or know of, use Vim or Emacs (either native or console versions) or TextMate, which is not free but is pretty darn tootin' for the price. (Just...don't try opening any large files in it. )
|
# ? May 15, 2010 19:16 |
|
Ziir: I'm a big fan of TextWrangler- it's free and highly customizable.
|
# ? May 15, 2010 19:24 |
|
He could use SSH and SSHFS so that he can edit with his local machine's tools & compile on the servers. Or if he's going to end up using vim, then there's little reason to do anything but SSH into the university's servers and do all development on them.
|
# ? May 15, 2010 19:25 |
|
I'm trying to make a small utility for the new 2010 version of Dwarf Fortress, and I'm having a problem, namely: I need to find the pattern between memory addresses for each dwarf on the embark screen, so if I have more than 7 dwarves, I can easily find each new dwarf in memory and be able to edit it. I'm not sure if I said that correctly, but eh. e: Right now I'm using a basic memory editor to find each address for each dwarf
|
# ? May 15, 2010 21:48 |
|
Avenging Dentist posted:We regularly have issues making stuff work on Linux and Mac at my job. Usually because Mac does some bizarre thing like making CC point to gcc instead of g++. CC is supposed to point to gcc instead of g++; CXX is the variable for the system C++ compiler. This is not some crazy Mac thing; this is the regular defined behavior of make going back N years. What crazy make environment are you using that makes CC a C++ compiler by default?
|
# ? May 15, 2010 22:45 |
|
I don't mean the environment variables, I mean the commands. CC the command, when it exists, should be a symlink to the system C++ compiler. Though I guess this has to do with case-insensitive filesystems on Mac?
|
# ? May 15, 2010 22:59 |
|
Avenging Dentist posted:I don't mean the environment variables, I mean the commands. CC the command, when it exists, should be a symlink to the system C++ compiler. Though I guess this has to do with case-insensitive filesystems on Mac? Yeah, that convention is clearly unsupportable on case-insensitive filesystems. I'll admit to never having heard of it before, but apparently it's common among the stately old commercial UNIX vendors. I can see why that would be annoying for a build system that's trying to autodetect the system C++ compiler.
|
# ? May 16, 2010 02:14 |
|
I'm pretty sure it's related to the old convention of having .c files be C source and .C files be C++ source, hence the cc and CC commands. Due to the melee in which it was initially developed and spread, C++ has a broad range of file types associated with it: code: .C .cc .cpp .cxx headers: .H .h .hpp
|
# ? May 16, 2010 02:34 |
|
|
# ? May 30, 2024 08:00 |
|
rjmccall posted:Yeah, that convention is clearly unsupportable on case-insensitive filesystems. I'll admit to never having heard of it before, but apparently it's common among the stately old commercial UNIX vendors. Welcome to autotools.
|
# ? May 16, 2010 03:00 |