The Joys Of Programming

Bonus_Eruptus wrote:

I love you, Python. In the span of 2 hours today, I went from zero to an executable one of my product managers can use to generate DDL (or just plain build the DB) from an Excel file structured in a specific way, complete with primary keys, foreign keys, and indices. Handles dependency ordering and py2exe makes it self-contained, so he doesn't even have to install Python, though I'm not sure why he wouldn't want to.

Now he can stop bitching about the lack of tools and get me my schema.

Wow, thanks for the tip on py2exe. A couple of members on my team are bitching about having to install python in order to use the build scripts I wrote (they continue to build and deploy manually every. single. time.) One of them is the primary admin, so getting him on board is kinda important.

Gunner wrote:

Wow, thanks for the tip on py2exe. A couple of members on my team are bitching about having to install python in order to use the build scripts I wrote (they continue to build and deploy manually every. single. time.) One of them is the primary admin, so getting him on board is kinda important.

Pssh, I don't trust build scripts, can't read them (I know I could learn but the only time I actually need to write them is very rare). That's why I let some ide do that stuff for me. Actually, we have a person whose sole job is to build things. Programming is so much simpler than building.

I don't trust some IDE to do what I want, so I write Makefiles. :p

(Also, some IDE almost always makes it inconvenient to use my favored text editor, so if I don't want the build capabilities or the editor and am comfortable with grep, why bother? ;>)

Hypatian wrote:
RolandofGilead wrote:

What do you mean by "memory that you expect to have a pointer in it"?

If you have a 16-byte chunk of memory that's occupied by two 8-byte pointers, then you have to follow each pointer. If you have a 16-byte chunk of memory that has one 8-byte pointer and two 4-byte unsigned integers, you only have to look at the pointer. If you have a register that contains an integer, you don't need to follow it, but if it contains a pointer you do. If you have a freshly allocated 8-byte space that [em]should[/em] contain a pointer and is currently reachable, then you need to follow it. But if it hasn't been initialized yet, you can't follow it because it could be pointing at anything. So you need to make sure it's zeroed out (assuming the GC doesn't follow null pointers) or set to a valid pointer before the GC ever sees it. That means there's a period in which it has been allocated from the heap (so its memory is not available) and is known not to be garbage (so it doesn't get collected prematurely), but it's still not quite a root because you shouldn't follow the pointers in it. One very simple way to accomplish that is to not allow new allocation while the GC is running. (i.e. a global lock on allocations while the GC is in progress.) A more fine-grained approach is possible, but involves more complexity and more synchronization between the GC thread and other threads which are allocating memory (i.e. all of them).

Oh, gotcha.

That's a constant factor. O(n) = O(2n). Also, I can't think of any context where a "2" would come into play here. You can do it while only walking the live pointers once (unlike mark/sweep, where live blocks get visited twice.) I imagine you must mean "read" + "write", which really doesn't matter because read and write operations don't cost the same.

I was talking space, you were talking time; and much laughter was had. Also, for those following at home O(n) = O(2n), I was just pointing out the 2n cause I thought you were talking space and obviously (n) < (m+n) but mark and sweep doesn't use as much space as copying.

Hypatian wrote:

I don't trust some IDE to do what I want, so I write Makefiles. :p

Makefiles, ugh, try installing any 10 random projects from the web. Which make do I need this time? Which breaking feature or syntax does it have that I can't use it consistently across everything that I want? Should I use amake, bmake, cmake, dmake, emake, fmake, qmake, pmake? Oh, what? You don't use MAKE at all? You use Ant?

f*ck that sh*t.

SixteenBlue wrote:
tboon wrote:

I <3 TeamCity myself.

New job is using TeamCity. Hoping to find out why you love it.

My love of TeamCity comes from how easy it was to set up, and how easy it is to manage and upgrade. Since one of my many hats is build manager, ease of use (that supports all of our builds of course) is something I greatly appreciate. I used to used Cruise Control (bleah). When I got sick of that, I spent a week comparing CI servers before settling on TC. That was about 5 years ago and I haven't had to look for anything else. And TC keeps adding more cool stuff with every release.

SixteenBlue wrote:

On a related note (if I remember right), I'm switching to IntelliJ from Eclipse and couldn't be happier.

Lot of people love IntelliJ; I picked it up when they had their 75% off sale over the holidays. There's a lot of cool stuff in there but I haven't really had time to use it enough to get used to it. At $200 for a personal license though, it would generally be too rich for my blood. NetBeans does pretty much everything I want it to for Java dev (especially its Maven integration, which is fantastic). I picked up WebSphere during that sale and it is fantastic for Javascript, CSS, and HTML editing, though.

So far everything I have ever used from JetBrains (except IntelliJ - the jury is still out on it for me) has been fantastic. I'm thinking of checking out their bug tracker; what we are currently using (Trac) is just not what I would like it to be.

RolandofGilead wrote:
Hypatian wrote:

I don't trust some IDE to do what I want, so I write Makefiles. :p

Makefiles, ugh, try installing any 10 random projects from the web. Which make do I need this time? Which breaking feature or syntax does it have that I can't use it consistently across everything that I want? Should I use amake, bmake, cmake, dmake, emake, fmake, qmake, pmake? Oh, what? You don't use MAKE at all? You use Ant?

f*ck that sh*t.

Yeah. It's much easier to figure out what IDE someone uses so you can install all of those for the different packages instead.

The important rules, IMO, are: If there's a standard set of tools for your environment, use it. (We use autotools* for UNIX C stuff, setup.py files for Python, etc.) More importantly, document what needs to be done to build and install in detail in the README. (And if the documentation isn't self-contained or needs a YouTube video, that's a major failure right there.)

If things are for internal use only, there's more flexibility, but when it's shared with the wider world, you have to do whatever work is needed to make things as convenient as possible for someone who doesn't know if they need your software yet. If they have to do a ton of work before they can even see it running, that's a problem.

(* autotools is the devil. Ugh. But so is everything else.)

Mark&sweep collectors need to stop the world so that pointers in areas it's already scanned don't change during scanning. In some cases this could make it collect something that's actually live. Incremental GCs don't need to stop the world but as a trade off they need to be notified of reference changes. There is a mark&sweep GC that doesn't stop the world during scanning--it marks pages of memory as write-only so if they're touched it will know to re-scan them. I believe there's a paper on this at Hans Boehms website. The "mostly parallel" GC.

complexmath wrote:

Mark&sweep collectors need to stop the world so that pointers in areas it's already scanned don't change during scanning. In some cases this could make it collect something that's actually live.

You're changing up your verbs mid-sentence. Could you restate this with replacing 'scan' with mark and/or sweep? I'm not sure which phase you're talking about when you say 'scan'.

RolandofGilead wrote:
complexmath wrote:

Mark&sweep collectors need to stop the world so that pointers in areas it's already scanned don't change during scanning. In some cases this could make it collect something that's actually live.

You're changing up your verbs mid-sentence. Could you restate this with replacing 'scan' with mark and/or sweep? I'm not sure which phase you're talking about when you say 'scan'.

Marking is the scanning step. IIRC

tboon wrote:
SixteenBlue wrote:
tboon wrote:

I <3 TeamCity myself.

New job is using TeamCity. Hoping to find out why you love it.

My love of TeamCity comes from how easy it was to set up, and how easy it is to manage and upgrade. Since one of my many hats is build manager, ease of use (that supports all of our builds of course) is something I greatly appreciate. I used to used Cruise Control (bleah). When I got sick of that, I spent a week comparing CI servers before settling on TC. That was about 5 years ago and I haven't had to look for anything else. And TC keeps adding more cool stuff with every release.

SixteenBlue wrote:

On a related note (if I remember right), I'm switching to IntelliJ from Eclipse and couldn't be happier.

Lot of people love IntelliJ; I picked it up when they had their 75% off sale over the holidays. There's a lot of cool stuff in there but I haven't really had time to use it enough to get used to it. At $200 for a personal license though, it would generally be too rich for my blood. NetBeans does pretty much everything I want it to for Java dev (especially its Maven integration, which is fantastic). I picked up WebSphere during that sale and it is fantastic for Javascript, CSS, and HTML editing, though.

So far everything I have ever used from JetBrains (except IntelliJ - the jury is still out on it for me) has been fantastic. I'm thinking of checking out their bug tracker; what we are currently using (Trac) is just not what I would like it to be.

I thought you were using IntelliJ but I must have based that on not using Eclipse. I haven't used NetBeans since 2009 so it's hard for me to compare it with IntelliJ but I can say IntelliJ >>>>> Eclipse.

The license is why I never tried it either, but I guess I could've tried the free version. Company is paying for my license, so doesn't matter for me now.

Yeah I have really grown to loathe Eclipse over the years. I am sad that the ScalaIDE is written using it as a base; just firing it up makes me slightly less happy with the world.

I am going to use IntelliJ on some side-work I recently picked up, maybe that will get me to use it enough to have an opinion on it worth having.

One thing I discovered today that is awesome is the Spring plugin can determine configuration problems that are usually not visible until run time. If you try to @Autowired something that can't be auto wired, it will tell you immediately. I imagine the other framework plugins have similarly cool features.

It's Perforce integration is the first time I've used an IDE's VCS features rather than use the system directly.

DanB wrote:
RolandofGilead wrote:
complexmath wrote:

Mark&sweep collectors need to stop the world so that pointers in areas it's already scanned don't change during scanning. In some cases this could make it collect something that's actually live.

You're changing up your verbs mid-sentence. Could you restate this with replacing 'scan' with mark and/or sweep? I'm not sure which phase you're talking about when you say 'scan'.

Marking is the scanning step. IIRC

Yep. Sorry about that. I use "M&S" to describe the strategy but different labels for the actual execution. Here's the link on the mostly parallel collector. I think some variant of the Boehm collector for C/C++ cam be configured this way. There are a lot of good introductory papers on Hans Boehm's website if you're interested, too.

As for how things can get lost of the world isn't stopped, let's we have the following code, with a collection running in parallel:

MyClass a = new MyClass("X"); MyClass b = new MyClass("Y"); // 1. now the collector marks the reachable data through reference 'a', and so marks instance "X" as live a = b; b = new MyClass("Z"); // 2. now the collector marks the reachable data through reference 'b', and so marks instance "Z" as live // 3. collection finishes and memory is freed a.doSomething(); // disaster!

If we assume that collection is interleaved with the execution above as indicated by the comments, the collector ends up collecting instance "Y" even though 'a' holds a valid reference to it. The "mostly parallel" collector fixes this by doing an initial mark phase without stopping the world, then stopping the world and performing a second, ostensibly minimal mark phase on the memory blocks that had been touched during the first phase.

I need some advice.

I want to get back into programming. I would like to set up a Ubuntu box and play with C/C++ and GTK. What is the recommended IDE?

Thanks,

Greg

You might want to try ZeroBugs for debugging. I've used DDD as well, though most often just use GDB or the GDB integration in Emacs or SublimeText2 (my preferred editor). I don't think there's "one IDE to rule them all" for C++ on Linux. Eclipse may be worth a shot as well.

I've heard Code::Blocks is really good. I've played with it a bit and it looks pretty decent, but I don't use C++ much, so I'm not in a position to evaluate it personally.

complexmath wrote:

I don't think there's "one IDE to rule them all" for C++ on Linux. Eclipse may be worth a shot as well.

For my sins I use nedit.

Ok that's not even remotely an IDE but it is a great text editor with syntax highlighting somewhat like notepad++. So if you're coming from a windows environment it will be a VERY gentle introduction.

If you are absolutely convinced that you MUST have an IDE then KDevelop is pretty good. Very much in the netbeans/eclipse style and supports quite a few languages out of the box.

Kate and Gedit are also ok although they are both less of an IDE and more of a very advanced text editor (like nedit and notepad++).

Both Eclipse and Netbeans have excellent C/C++ support. If I had to do some serious C projects at work I'd would probably switch to them because we are already all over Netbeans for our java work.

Lots of people like Code::Blocks, haven't used it myself though but it's specifically a C/C++ IDE

I have heard of Geany but I couldn't tell you anything about it.

http://blogs.msdn.com/b/mvpawardprog...
C# I like you even more. I already knew about async and use the libraries to do the same in previous versions, but Caller Information is nice.

Speaking of Caller Information, anybody know of a good way to automate creation of trace logging in C++, like a plug-in for Visual Studio 2010 or something?
Other than going back and writing in such a thing for every method inside hundreds of files.
Even better would be one that creates logs even when the program crashes (and doesn't leave behind a dump file for Doctor Watson to look through).

Aspect-oriented programming (AOP) would be perfect for that, though I haven't heard much about it recently. Though now that I'm thinking about it I'm inclined to look it up. It would be handy at work for me as well.

complexmath wrote:

Aspect-oriented programming (AOP) would be perfect for that, though I haven't heard much about it recently. Though now that I'm thinking about it I'm inclined to look it up. It would be handy at work for me as well.

The lispers call that sort of thing advice, and smugly point out that they've had it for decades.

Walken Dead wrote:

and smugly point out that they've had it for decades. :)

They do that for everything though.

tboon wrote:
Walken Dead wrote:

and smugly point out that they've had it for decades. :)

They do that for everything though. :)

You come for the parentheses but you stay for the smugness.

tboon wrote:
Walken Dead wrote:

and smugly point out that they've had it for decades. :)

They do that for everything though. :)

And we ignore them, because they use Lisp.

Ada 2012 added aspects if you want an alternative to Lisp. (I haven't used Ada since my early college days, but I still get a twinge of nostalgia when I see a headline about it.)

DanB wrote:
RolandofGilead wrote:
complexmath wrote:

Mark&sweep collectors need to stop the world so that pointers in areas it's already scanned don't change during scanning. In some cases this could make it collect something that's actually live.

You're changing up your verbs mid-sentence. Could you restate this with replacing 'scan' with mark and/or sweep? I'm not sure which phase you're talking about when you say 'scan'.

Marking is the scanning step. IIRC

Here's an easy to understand article about garbage collection in Ruby.

It talks about the mark & sweep approach used in Ruby 1.9, and the bitmap marking approach that is replacing it in Ruby 2.0.

This is just the best collection of development joke images ever: http://devopsreactions.tumblr.com/

Mixolyde wrote:

This is just the best collection of development joke images ever: http://devopsreactions.tumblr.com/

That's a fantastic tumblr - I've enjoyed their content for some time now

While the gifs can be filesize-huge, you've gotta love a tumblr that has everything from Rocko's Modern Life, Star Trek, Lost in Translation, etc.

Bonus_Eruptus wrote:

I love you, Python. In the span of 2 hours today, I went from zero to an executable one of my product managers can use to generate DDL (or just plain build the DB) from an Excel file structured in a specific way, complete with primary keys, foreign keys, and indices. Handles dependency ordering and py2exe makes it self-contained, so he doesn't even have to install Python, though I'm not sure why he wouldn't want to.

Now he can stop bitching about the lack of tools and get me my schema.

Another couple hours, and it now just generates Elixir models for me to use, loads them into memory, and uses that to trigger Elixir's DDL generation. Much cleaner and smaller.

http://devopsreactions.tumblr.com/po...
Try debugging it. Our coding standard does enforce self-documented code, but that only gets you individual functions. I had to debug one of our whoozits and how it interacts with one of our whatchamabobs and I found the complete specification for the product, and all the documents related to its production and all the notes from all the meetings. I could have built one if I had the parts. What was in there about its software or how it interacts? Nothing. One guy wrote that, and that wasn't me.