2/18/2014 - End-of-Book Hiatus 12/20/2013 - Calendars On Their Way 11/26/2013 - Tenth Anniversary Calendar plus Ornaments, T-Shirts 9/29/2013 - Ten Years of OOTS Frequently Asked Questions (FAQ)

 Order of the Stick 946 It's What's Inside That Counts Erfworld 163 The End of Book One Erfworld Now at Erfworld.com! RSS Feeds: OOTS

 The Duke's Wolf, Part Four by Amber E. Scott The Duke's Wolf, Part Three by Amber E. Scott The Duke's Wolf, Part Two by Amber E. Scott

 The New World, Part 9: Barbarians by Rich Burlew The New World, Part 8: Gnomes by Rich Burlew The New World, Part 7: Names and Cultures by Rich Burlew Looking for the Gaming Articles?

 Welcome back! Be sure you have read and understand the Forum Rules.

 Giant in the Playground Forums ProgrammersitP
 User Name Stay Logged On Password
 Register FAQ Members List Mark Forums Read End

 Friendly Banter Hellos, goodbyes, and other casual conversation goes here. Especially if it doesn't fit better into one of the other forums.

10-13-2012, 04:39 AM   Top  -  End  -  #61
akma
Barbarian in the Playground

Join Date: Jul 2007
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by Kallisti My most immediate project is a program that will take parameters for a given RPG's die system and output some statistical calculations--so you could ask how likely you are to succeed in a given opposed roll in nWoD or how many hobgoblins your ranger can kill before getting nat-20'd to death. Eventually I'd like to release it as a series of free apps--one for each system I end up supporting.
I made a dice rolling program, and I plan to expand it to include probabilities and more systems, although my general goals for that are much smaller then yours (I don`t plan to include calculations for opposed roles, I don`t want to make it user friendly, etc).

There is a formula which I think is correct for calculating the probability of a certain sum in a roll of a few dice, but I don`t remmember it exectly.
__________________
A world behind the mirror (stand alone plane)

(Wall) passer, a rogue variant

My not realy extanded homebrewer signature

Quote:
 Originally Posted by Grinner In a world ruled by small birds, mankind cannot help but wonder how this state of affairs came about.

10-13-2012, 09:55 PM   Top  -  End  -  #62
PairO'Dice Lost
Firbolg in the Playground

Join Date: Dec 2008
 Location: Malsheem, Nessus
Gender:
Re: ProgrammersitP

• Where are you and what are you doing in terms of programming? Employment, education or in your spare time?
I have a MS and BS in computer science and am working as a software engineer at a Big Data company.
• What language or languages are you using primarily at the moment? What's your favourite, and why?
Languages I'm using at work: C, C++, Python, and MySQL.
Languages I'm using for fun: Perl, PHP, and Java.
I love Perl's quirky syntax and built-in hashes and regular expressions, so I'd say that's my favorite right now.
• Where do you hope to go with your programming? Any plans for the future, or just waiting to see if anything of interest comes along?
No plans, really, I just like coding.
• Any projects, personal or otherwise, you're in the middle of? Anything you're really focused on?
I'm working on a D&D database for my group's use, basically a comprehensive SRD of all 3e material out there like dndtools or realmshelp, but that isn't missing anything and that has more powerful searching and sorting. It's all OCRing PDFs, parsing, formatting, scanning, stuff like that. I've also recently made a tower defense game with an AI that reacts to the player's choice of tower types, paths defended, etc.
• What environment do you work/prefer to work in? Netbeans/Eclipse/Command line and a text editor?
Linux terminal and vim for me, please. My work laptop is a Macbook, but the dev team works in a RHEL 6 VM.
Quote:
 Originally Posted by Kallisti My most immediate project is a program that will take parameters for a given RPG's die system and output some statistical calculations--so you could ask how likely you are to succeed in a given opposed roll in nWoD or how many hobgoblins your ranger can kill before getting nat-20'd to death. Eventually I'd like to release it as a series of free apps--one for each system I end up supporting.
Writing dicerollers and other gaming apps is a hobby of mine as well. I wrote a diceroller that handles conditional logic, exploding dice, rerolls, multiple rolls, and more. Some examples:

Spoiler

I also wrote a dice statistics program for arbitrary dice expressions:

Spoiler

...as well as a simulator for Star Wars Saga vehicle combat to handle massed attacks, condition track steps, shield reduction, and such. It made combats in my Rogue Squadron campaign ("72 TIE Interceptors and 2 Dreadnoughts? There's 12 of us, we can take 'em!") a lot easier to handle.
__________________
Better to DM in Baator than play in Celestia
You can just call me Dice; that's how I roll.

Spoiler: Sig of Holding

10-14-2012, 12:35 PM   Top  -  End  -  #63
TSGames
Bugbear in the Playground

Join Date: May 2005
 Location: control+apple+alt+8
Re: ProgrammersitP

For people into Python: I thought this was pretty neat.
__________________
Fantasy Map Digitization, the First Steps
Shakespear in the Playground
The Swarm Arrives
By Lix Lorn
Layout and pdf design by me.

10-14-2012, 05:13 PM   Top  -  End  -  #64
Miklus
Bugbear in the Playground

Join Date: Dec 2005
 Location: Denmark
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by Skami Pilno For people into Python: I thought this was pretty neat.
I don't get it... What does it do? Other than write "good job" in big red letters, obviously.

EDIT: On second look, it compiles the code you type in? that is neat in a redundant sort of way.

Might as well add a question of my own: Is everything classes and automatic garbage collection these days? I ask because we don't use that much where I work. The programs we make has to run real time, so I guess we have a wierd programming style.

I'm sitting here with a little hobby project and the garbage collected classes from microsoft and my own code does NOT want to play nice together. It does not really want to mix managed classes and my code. Should I just give in and make everything managed? Proformance is not too important in this little application.
__________________
Miko Miyazaki : Strip #120 - #464 : R.I.P.

Last edited by Miklus : 10-14-2012 at 05:28 PM.

10-16-2012, 05:44 AM   Top  -  End  -  #65
Miscast_Mage
Barbarian in the Playground

Join Date: Dec 2010
 Location: Ireland
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by PairO'Dice Lost Writing dicerollers and other gaming apps is a hobby of mine as well. I wrote a diceroller that handles conditional logic, exploding dice, rerolls, multiple rolls, and more. Some examples: *kersnip'd*
Ah, very nice; I've got a little dice program myself from ages ago that I've really been meaning to expand on. It asks you how many sides the dice you want to roll has, how many times you want to roll it, and returns the results of each roll, and the total value of all rolls combined:

Spoiler

Some things I want to add to it is having conditonal rolls(such as critical hits, nat 20s, nat 1s,), and automatically adding in modifiers, and possibly tying it to a database of weapons that would have damage, crit ranges, etc.

Once I get the dice program to a level I'm happy with, I'll try and use it for some other projects; I've been meaning to get a D&D character generator up and running, and I'm planning on doing it in netbeans forms, or possible some other form of GUI.

Quote:
 Originally Posted by Neftren Also, that silly moment when you realize sys.maxint returns a 64-bit number locally, but a 32-bit number on the deployment server. Yeah. That just happened to me.
It could be worse; try having an Arraylist(in java) of objects, and a method to take objects from it and give it to another Arraylist; I had:

Spoiler

And I was driving myself mad trying to find out why it taking the first card, then the third, then the fifth, when I wanted it take just the first each time; turns out I just needed to have the is as 0s, and it took longer than I'd like to admit for this piece of logic to click.

Quote:
 Originally Posted by Neftren I'm no expert in Java, but my hunch would be that calling toString() on an object without an overloaded toString() method would print the memory address or something similar to that degree.
Yeah, you would have to have an overridden toString(), and personally I find it just the same to have a printDetails() method, especially as I can have printCard(), printHand(), and printDeck() for different formats of printing.

Quote:
 Originally Posted by akma A note about the card class: I think it would be better if you used Enums instead of String values for Suit and Number. That way if you accidently insert incorrect values to the constructor, the program would fail instantly with obvious reasons instead of messing up things later. The way the toString method is implemented by default is by returning the class name and it`s address in hexdecimal format.
Ah, but I've designed it in a way that an incorrect value can't be put in for Suit or Number, so I don't have to worry about using an enum. Also, haven't covered enums yet, and I'm starting to get worried about the amount of stuff on my plate at the moment.

Also, something of note: I found a free online Introduction to Computer Science course from Harvard, if anyone is interested in signing up for it; it started yesterday, and goes on until the 15th of April.

Last edited by Miscast_Mage : 10-16-2012 at 05:45 AM. Reason: Spelling error. :3

10-16-2012, 06:36 PM   Top  -  End  -  #66
TSGames
Bugbear in the Playground

Join Date: May 2005
 Location: control+apple+alt+8
Re: ProgrammersitP

I only looked at the code in the second spoiler, but it looks like a good time to try out a for:each statement. I'm not sure if it's possible with the way your program is written, but if you can do it, it is usually a nice way to perform a set amount of operations to a list of objects.
__________________
Fantasy Map Digitization, the First Steps
Shakespear in the Playground
The Swarm Arrives
By Lix Lorn
Layout and pdf design by me.

 10-16-2012, 08:46 PM Top  -  End  -  #67 Neftren Troll in the Playground     Join Date: Nov 2006 Re: ProgrammersitP Ugh. x86 Assembler. __________________ Avatar by araveugnitsuga | Play by Post (Guide) | Steam Homebrewers' Extended Signatures Hey Look, a Summer Reading List!
10-17-2012, 02:43 AM   Top  -  End  -  #68
Miscast_Mage
Barbarian in the Playground

Join Date: Dec 2010
 Location: Ireland
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by Skami Pilno I only looked at the code in the second spoiler, but it looks like a good time to try out a for:each statement. I'm not sure if it's possible with the way your program is written, but if you can do it, it is usually a nice way to perform a set amount of operations to a list of objects.
Hmm, the thing is, I don't think a for-each loop would work out here(I have used for-each loops a bit, at this point); the method takes in the number of cards to take from the deck and to give to the hand. I can't see how you would do this in a non-messy way using a for-each loop. A for-each loop would go through every card in the deck, whereas I only want a specific number of cards from it(e.g. deal five cards to a hand).

10-17-2012, 01:40 PM   Top  -  End  -  #69
Miklus
Bugbear in the Playground

Join Date: Dec 2005
 Location: Denmark
Gender:
Re: ProgrammersitP

So our head programmer at work...just dropped dead last weekend! I'm not making this crap up. The funeral is next tuesday.

I wonder what part of his 1 million unfinished but highly business critial projects will land on my head? Well, now the power of careful documentation will come to it's fullest! Oh wait! We don't do paper! Our mantra is "The documentation is in the code", because documentation is for amaturs!

I'm not asking for detailed documentation for every little bit of code, but it would be nice if I knew, like, what the program was *supposed* to do.

*Sigh* I will miss his completely unmotivated outbursts of "WHAT?!" whenever his code did something unexpected, his constant clicking of ball point pens and violent sneeze attacks, all heard from two cubicles over.
__________________
Miko Miyazaki : Strip #120 - #464 : R.I.P.

Last edited by Miklus : 10-17-2012 at 01:43 PM.

10-17-2012, 02:38 PM   Top  -  End  -  #70
pendell
Troll in the Playground

Join Date: Dec 2006
 Location: Washington DC
Gender:
Re: ProgrammersitP

My sympathies :(. It's sad to lose a co-worker.

At any rate, this is why our project has several dozen, possibly several hundred, articles by me in the project wiki discussing every aspect of what I've done and why I did it.

Respectfully,

Brian P.
__________________
"Opportunities to do good are everywhere but the darkness is where the light needs to be".

-- Eliezer Yudkowski, author of "Harry Potter and the Methods of Rationality"

10-17-2012, 04:19 PM   Top  -  End  -  #71
Miklus
Bugbear in the Playground

Join Date: Dec 2005
 Location: Denmark
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by pendell My sympathies :(. It's sad to lose a co-worker. At any rate, this is why our project has several dozen, possibly several hundred, articles by me in the project wiki discussing every aspect of what I've done and why I did it. Respectfully, Brian P.
"Project wiki"?! You got to be kidding me. That sounds cool.

BTW, my coworker died from a heartattack of some kind. He had previously had a quardruble bypass. So at least he went quick. Man, what if he had dropped dead at work?!
__________________
Miko Miyazaki : Strip #120 - #464 : R.I.P.

Last edited by Miklus : 10-17-2012 at 04:20 PM.

10-17-2012, 04:37 PM   Top  -  End  -  #72
Neftren
Troll in the Playground

Join Date: Nov 2006
Re: ProgrammersitP

Quote:
 Originally Posted by Miklus "Project wiki"?! You got to be kidding me. That sounds cool. BTW, my coworker died from a heartattack of some kind. He had previously had a quardruble bypass. So at least he went quick. Man, what if he had dropped dead at work?!
For large code bases, it's not uncommon to have a Wiki or other established comment system (e.g. GitHub commit histories).
__________________

10-18-2012, 08:34 AM   Top  -  End  -  #73
pendell
Troll in the Playground

Join Date: Dec 2006
 Location: Washington DC
Gender:
Re: ProgrammersitP

Allow me to direct you to Assembla . They provide a repository, trouble ticket management system, a wiki, and a bunch of other stuff. There's a free version for students which provides something like :mumble mumble: storage space in 1 workspace. I've had occasion to use the paid versions, but for which companies and which projects I cannot say.

Respectfully,

Brian P.
__________________
"Opportunities to do good are everywhere but the darkness is where the light needs to be".

-- Eliezer Yudkowski, author of "Harry Potter and the Methods of Rationality"

10-19-2012, 01:09 AM   Top  -  End  -  #74
akma
Barbarian in the Playground

Join Date: Jul 2007
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by Neftren Ugh. x86 Assembler.
I`m thinking of trying to learn Assembly after I`ll be more satisfied with my skill in java (I want to try something not object oriented).
How bad is it? I know there are no classes, are there even method declerations?
__________________
A world behind the mirror (stand alone plane)

(Wall) passer, a rogue variant

My not realy extanded homebrewer signature

Quote:
 Originally Posted by Grinner In a world ruled by small birds, mankind cannot help but wonder how this state of affairs came about.

10-19-2012, 01:35 AM   Top  -  End  -  #75
factotum
Titan in the Playground

Join Date: Feb 2007
 Location: Manchester, UK
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by akma How bad is it? I know there are no classes, are there even method declerations?
Assembly is raw machine code instructions...it doesn't really have *any* language constructs you might be familiar with. As an example, this is a small piece of in-line assembly code I put into a C function to speed it up many years ago:

Code:
```			mov ecx, 0
mov ebx, width
mov esi, tempsrc
mov edi, tempdest

asm_loop:
cmp ecx, ebx
jnc end_asm

test ecx, 31

mov eax, DWORD PTR [esi]
bswap eax
shl eax, 1
jnc no_inc
inc BYTE PTR [edi]
no_inc:
inc ecx

test ecx, tbit
jnz asm_loop

inc edi
jmp asm_loop
end_asm:```
To give you a clue, the things at the beginning of lines ending colons are labels, anything starting with a J is a jump command that will jump to one of those labels depending on conditions (e.g. jnz = jump if non-zero). This might look like the most horrible spaghetti code you've ever seen, but this is the *only* way to code in raw assembler.

Last edited by factotum : 10-19-2012 at 01:38 AM.

10-19-2012, 04:23 AM   Top  -  End  -  #76
TSGames
Bugbear in the Playground

Join Date: May 2005
 Location: control+apple+alt+8
Re: ProgrammersitP

If all you know is Java, I would not waste my time trying to learn assembly: it will be next to impossible. To jump from one of the highest level languages in existence to assembly (the lowest level practical language) would take inordinate amounts of time, practice, and dedication.

It would legitimately be quicker to learn another language at a lower level and then try to learn assembly, than it would be to just jump to it from Java. At the very least you should know a language that is no higher level than C++ before you start assembly ( C would be even better). Then it may be easier to mess around with something like an Arduino, which can be programmed basically in C or in assembler, allowing you progress down into the assembly code as you are comfortable with (and you can actually see it do stuff which makes code verification easy).

If you want to go straight from Java to assmbly code, go for it; I'm just saying that there are much better ways to go about it that will take a lot less time and be a whole lot less frustrating.
__________________
Fantasy Map Digitization, the First Steps
Shakespear in the Playground
The Swarm Arrives
By Lix Lorn
Layout and pdf design by me.

10-19-2012, 04:32 AM   Top  -  End  -  #77
Teddy
Ettin in the Playground

Join Date: Mar 2009
 Location: Sweden
Gender:
Re: ProgrammersitP

It might also be prudent to start with another assembly language than x86. We had assembly programming as a part of a computer architecture course last spring, where we were taught MIPS assembly, which wasn't all too hard to grasp, at least not in my opinion.

I should also point out that the only languages I knew prior to that course were Java and SML (which is a functional language, and thus even further removed from assembly, which is imperative), and the same applied to most of my coursemates, so it's not impossible to learn assembly just because you know nothing like it. Actually, since we just had left SML, I found MIPS assembly to be sort of a relief, seeing how it let me put skills in imperative programming I'd learned in Java to use again.
__________________
I'm doing a Tour de Friends! Please drop by and tell me if you're interested in having me drop by for a visit this summer! :3

Clouddreamer Teddy by me, high above the world, far beyond its matters...

Spoiler: Banner by Vrythas

10-19-2012, 04:34 AM   Top  -  End  -  #78
Miscast_Mage
Barbarian in the Playground

Join Date: Dec 2010
 Location: Ireland
Gender:
Re: ProgrammersitP

@Miklus:

Oh dear, I'm sorry to hear of your loss. My sympathies to his friends, family, and coworkers.

Quote:
 Originally Posted by pendell Allow me to direct you to Assembla . They provide a repository, trouble ticket management system, a wiki, and a bunch of other stuff. There's a free version for students which provides something like :mumble mumble: storage space in 1 workspace. I've had occasion to use the paid versions, but for which companies and which projects I cannot say. Respectfully, Brian P.
Ah, I've actually been looking into setting up a wiki or database that would contain classes and methods I've that I thought were particularly useful; this looks like it could be just what I need. It seems a lot more complex than what I need, but still, learning something new never hurts.

Just to get a bit of a head start though, if all I want is essentially a database of small programs, and brief descriptions of what they do, all I would need for the moment is the git repository, right? And I would essentially be able to set it up like a wiki for myself and others(assuming I set it to public) to access? Or would I just be better off setting up something on wikispaces?

10-19-2012, 11:53 AM   Top  -  End  -  #79
akma
Barbarian in the Playground

Join Date: Jul 2007
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by factotum To give you a clue, the things at the beginning of lines ending colons are labels, anything starting with a J is a jump command that will jump to one of those labels depending on conditions (e.g. jnz = jump if non-zero). This might look like the most horrible spaghetti code you've ever seen, but this is the *only* way to code in raw assembler.
Seems scary. What was it supposed to do? What the bigger program is supposed to do?

Quote:
 Originally Posted by Skami Pilno It would legitimately be quicker to learn another language at a lower level and then try to learn assembly, than it would be to just jump to it from Java. At the very least you should know a language that is no higher level than C++ before you start assembly ( C would be even better).
From what I know of C++ syntax, it`s very similiar to that of Java. I don`t see how that could help significantly in learning assembly (anyways I`ll pick something easier then assembly after Java).

Quote:
 Originally Posted by Teddy It might also be prudent to start with another assembly language than x86. We had assembly programming as a part of a computer architecture course last spring, where we were taught MIPS assembly, which wasn't all too hard to grasp, at least not in my opinion.
When I`ll work on learning Assembly, I will work on learning the Assembly leanguage of the computer I`ll have at the time.

Quote:
 Originally Posted by Miscast_Mage Ah, I've actually been looking into setting up a wiki or database that would contain classes and methods I've that I thought were particularly useful; this looks like it could be just what I need. It seems a lot more complex than what I need, but still, learning something new never hurts.
I didn`t look at the website pendell posted, but Java has a built in documentation system - Javadoc.
Also, if your packages are organized well, it saves you a lot of bother. You could create a package named utility and put everything usefull there.
__________________
A world behind the mirror (stand alone plane)

(Wall) passer, a rogue variant

My not realy extanded homebrewer signature

Quote:
 Originally Posted by Grinner In a world ruled by small birds, mankind cannot help but wonder how this state of affairs came about.

10-19-2012, 01:31 PM   Top  -  End  -  #80
Neftren
Troll in the Playground

Join Date: Nov 2006
Re: ProgrammersitP

Quote:
 Originally Posted by akma From what I know of C++ syntax, it`s very similiar to that of Java. I don`t see how that could help significantly in learning assembly (anyways I`ll pick something easier then assembly after Java).
Sure, the syntax is pretty similar. It's a type-cased brackets-based language. Java does a lot of hand holding for you though. C/C++ really requires you to have a good working knowledge of memory layout, pointer usage, and so on. There are also a lot of different data structures in the standard library, and knowing which one to use when can be tricky.

Quote:
 When I`ll work on learning Assembly, I will work on learning the Assembly leanguage of the computer I`ll have at the time.
I'd strongly suggest you start with a simpler Assembly language (e.g. MIPS, as Teddy suggested). x86 makes me want to smash my head against the wall every night just trying to keep track of all the opcodes, jumps, conditional and unconditional branching, etc.

Miscast, at work, a lot of people had their own established (personal) codebases saved locally. For instance, my mentor didn't like the STL Vector class (think ArrayList in Java), so he wrote his own. It's not uncommon to keep small utility programs around. I do it for Python and C/C++, mostly for image processing. Centroiding and filtering are pretty common operations.

If you find yourself using a lot of the same initialization code, consider just putting together a template program. I have one for OpenCL runtimes, as 90% of the time it's the same cl::getPlatform(), cl::getDevices(&Platform) or something along those lines.

What you don't want to do is make a wiki and just post raw code snippets. Avoid writing a chunk of code and copy/pasting it every time you use it. Consider encapsulating it into an (inline) function if you use it frequently, then import the file.
__________________

Last edited by Neftren : 10-19-2012 at 01:34 PM.

10-20-2012, 05:19 AM   Top  -  End  -  #81
factotum
Titan in the Playground

Join Date: Feb 2007
 Location: Manchester, UK
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by akma Seems scary. What was it supposed to do? What the bigger program is supposed to do?
The code snippet there scans a line of input pixels and converts it to an array several times smaller with a count of pixels...so, if you wanted it to be 4 times smaller, you'd get back an array with values from 0-4 in it saying how many "set" pixels were in each 4-pixel block. It was part of a font rendering engine that created anti-aliased text by rendering it several times larger than it needed to be and then scaling it down. Those were the days before proper anti-aliased font handling was built into Windows, of course!

10-20-2012, 06:14 AM   Top  -  End  -  #82
DeusMortuusEst
Bugbear in the Playground

Join Date: Dec 2011
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by Neftren For large code bases, it's not uncommon to have a Wiki or other established comment system (e.g. GitHub commit histories).
Quote:
 Originally Posted by pendell Allow me to direct you to Assembla . They provide a repository, trouble ticket management system, a wiki, and a bunch of other stuff. There's a free version for students which provides something like :mumble mumble: storage space in 1 workspace. I've had occasion to use the paid versions, but for which companies and which projects I cannot say. Respectfully, Brian P.
Any thought on how Assembla compares to Trac? Me and a co-worker are planning a new project and we were thinking of using Trac and Git to sync everything.
__________________
Quote:
 Dumbledore is dead but had a horcrux so might still be alive to it being fake and him dead but not stopping her from using the having a horcrux on you letting you live from a killing curse.
Quote:
 Originally Posted by The Glyphstone Epileptic monkeys. Boxing gloves. Typewriters. That is all.

10-21-2012, 09:51 AM   Top  -  End  -  #83
pendell
Troll in the Playground

Join Date: Dec 2006
 Location: Washington DC
Gender:
Re: ProgrammersitP

Quote:
Originally Posted by Miscast_Mage
@Miklus:

Ah, I've actually been looking into setting up a wiki or database that would contain classes and methods I've that I thought were particularly useful; this looks like it could be just what I need. It seems a lot more complex than what I need, but still, learning something new never hurts.

Quote:
 Just to get a bit of a head start though, if all I want is essentially a database of small programs, and brief descriptions of what they do, all I would need for the moment is the git repository, right?
Correct. Git can store your code, and I supposed you could add documentation in the form of .rtf or text files to the repository as well. I prefer wiki articles for that, but if it's simpler to just use the repository that will work.

Quote:
 And I would essentially be able to set it up like a wiki for myself and others(assuming I set it to public) to access?
I believe so, yes. Certainly that's the way I've used it.

Or would I just be better off setting up something on wikispaces?
I can't say I've used Trac or wikispaces. Sounds like a homework assignment for me at some point.

Respectfully,

Brian P.
__________________
"Opportunities to do good are everywhere but the darkness is where the light needs to be".

-- Eliezer Yudkowski, author of "Harry Potter and the Methods of Rationality"

10-22-2012, 09:11 AM   Top  -  End  -  #84
Wookieetank
Bugbear in the Playground

Join Date: Mar 2010
 Location: Kashyyyk
Gender:
Re: ProgrammersitP

•Where are you and what are you doing in terms of programming? Employment, education or in your spare time?
I'm currently a Hospital Secretary (with a degree in geology no less) so no real programming work there. Taken a couple of classes in C++ and I've been teaching myself Python the past couple of years. Just started the cs50x class posted here so here's hoping something new sticks.

•What language or languages are you using primarily at the moment? What's your favourite, and why?

I'm currently using python as my main language (and favorite so far), although with the class I'm taking I'll be getting to use C, PHP, and Java. I also have experience with C++ but haven't used it in long enough that I'm on the farther side of rusty with it.

•Where do you hope to go with your programming? Any plans for the future, or just waiting to see if anything of interest comes along?

I'd like to one day be a freelance programmer and/or indie game programmer, both of which are sometime in the nebulous future.

•Any projects, personal or otherwise, you're in the middle of? Anything you're really focused on?

I've got a rougelike that I dable with from time to time, need to get back to working on that at some point. Other than that just working on learning as much about programming as I can.

•What environment do you work/prefer to work in? Netbeans/Eclipse/Command line and a text editor?

I generally just use IDLE for a programming enviornment. As for a text editor, I greatly enjoy the look and feel of Notepad++.

•Any problems that are driving you mad? A piece of code not compiling right, or being off by one, or one little syntax error in a sea of code? Not quite grasping the logic of a particular piece of code?

Biggest problem I have right now is making sure I don't have any typos or syntatic errors. I have a tendency to type obnoxiously fast, which causes case errors, and spelling errors more frequently than I would care for.

10-22-2012, 06:55 PM   Top  -  End  -  #85
Miklus
Bugbear in the Playground

Join Date: Dec 2005
 Location: Denmark
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by Miscast_Mage @Miklus: Oh dear, I'm sorry to hear of your loss. My sympathies to his friends, family, and coworkers.
Thanks. Speaking of assembler, I just remembered that he was the only one who knew how to program in that. There are functions programmed by him in assembler for speed. Let's hope they never need to be debugged or we are so screwed.

Now for my little hobby project: Managed code and my code fit like foot in glove. Seriously, help! I want to use the build-in components like treeview and such. They are all managed and will only work with other managed object. It is borderline harrasment. For example, the treeview has a "tag" property per node which is just a pointer. But it can only point to managed objects. you can't even cast it to the type you want.

It's the same for this list class I'm making. The head class (the form) is managed, so the list must be managed. The elements in the list must thus also be managed. And all the part of the element must also be managed, right down to a 2D vector. Really?

Is this really how it is supposed to be? Everything is on the garbage collected heap now and nothing on the stack?

I guess if you want to use a Microsoft product, you have to program the Microsoft way.
__________________
Miko Miyazaki : Strip #120 - #464 : R.I.P.

10-22-2012, 07:07 PM   Top  -  End  -  #86
Neftren
Troll in the Playground

Join Date: Nov 2006
Re: ProgrammersitP

Quote:
 Originally Posted by Miklus Thanks. Speaking of assembler, I just remembered that he was the only one who knew how to program in that. There are functions programmed by him in assembler for speed. Let's hope they never need to be debugged or we are so screwed. Now for my little hobby project: Managed code and my code fit like foot in glove. Seriously, help! I want to use the build-in components like treeview and such. They are all managed and will only work with other managed object. It is borderline harrasment. For example, the treeview has a "tag" property per node which is just a pointer. But it can only point to managed objects. you can't even cast it to the type you want. It's the same for this list class I'm making. The head class (the form) is managed, so the list must be managed. The elements in the list must thus also be managed. And all the part of the element must also be managed, right down to a 2D vector. Really? Is this really how it is supposed to be? Everything is on the garbage collected heap now and nothing on the stack? I guess if you want to use a Microsoft product, you have to program the Microsoft way.
What exactly is this for? I'm guessing .NET Framework?

Also, why are you using a vector in a list? That seems to defeat the purpose of putting together a list...

There's quite a lot that goes onto the heap now, and rightly so. For large data sets, you probably won't be able to fit it into the stack frame...
__________________

10-23-2012, 08:30 AM   Top  -  End  -  #87
Miscast_Mage
Barbarian in the Playground

Join Date: Dec 2010
 Location: Ireland
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by Neftren Miscast, at work, a lot of people had their own established (personal) codebases saved locally. For instance, my mentor didn't like the STL Vector class (think ArrayList in Java), so he wrote his own. It's not uncommon to keep small utility programs around. I do it for Python and C/C++, mostly for image processing. Centroiding and filtering are pretty common operations. If you find yourself using a lot of the same initialization code, consider just putting together a template program. I have one for OpenCL runtimes, as 90% of the time it's the same cl::getPlatform(), cl::getDevices(&Platform) or something along those lines.
Hmm, I suppose a template program would be handiest for what I want to do. At the moment I just copy and paste previous classes/methods from previous work that I think would be handy for whatever I'm working on at the moment. I'll have to see about looking into that, thanks.

Quote:
 Originally Posted by Neftren What you don't want to do is make a wiki and just post raw code snippets. Avoid writing a chunk of code and copy/pasting it every time you use it. Consider encapsulating it into an (inline) function if you use it frequently, then import the file.
Ah, I think I've spotted an issue with what I want to do, actually; I've been meaning to do two things, and I've been muddling them together:
• Having a database of my own useful methods/classes/etc for my personal use
• Having something to show other people in my course if they're having a problem

I was thinking of a wiki to have more an index of useful methods/classes, descriptions of what they do and how, what they take in/return, and what project I have them located in. The advantage to this would be it would useful for me, and for anyone if they wanted to see how snippets of my code worked.

However, now I'm just thinking of having a seperate way of managing my stuff for me, and having a wiki of useful snippets completely separate for other people to look at that would be more the tricky things that we'll have to be aware of in the exam like:

Spoiler

Quote:
 Originally Posted by akma I didn`t look at the website pendell posted, but Java has a built in documentation system - Javadoc. Also, if your packages are organized well, it saves you a lot of bother. You could create a package named utility and put everything usefull there.
Amen for organised packages; I organise mine by date(Y/M/D)-subject, e.g. 20121023Sample2DArrays or 20121014CharacterGenerator. It's annoying that there doesn't seem to be a tagging system or even a "ascending/descending according to date made/last edited" option; it makes it a pain to have a coherent yet expansive way of cataloging projects.

Lumping everything useful in one package does sound like a pretty convenient solution, even just for the moment where I don't really have anything huge yet.

Quote:
 Originally Posted by pendell Correct. Git can store your code, and I supposed you could add documentation in the form of .rtf or text files to the repository as well. I prefer wiki articles for that, but if it's simpler to just use the repository that will work.
Hmm, I think I'd prefer if it had some way of keeping the different sections of code inherently with documentation, as opposed to having it is as a separate file, which I can imagine getting messy or being a pain to keep updated.

 10-23-2012, 09:02 AM Top  -  End  -  #88 Leona Banned   Join Date: Aug 2012 Re: ProgrammersitP I'm in a C++ freshman course for my computer engineering degree, and basically for a scholarship I'm working with my professor on stuff outside the normal class things, including going into Python, cgi, and sqlite. It's pretty interesting! I'm working on one big program for the end of the semester that runs an HTML page where students can select a topic to practice coding on, where it'll pull a problem from an sqlite db and then take a form from the user. Then I guess I need to work on saving it as a .cpp file and compiling it through the command prompt (returning errors if there are any). So I may update you guys/ask for help :P
10-23-2012, 12:16 PM   Top  -  End  -  #89
Neftren
Troll in the Playground

Join Date: Nov 2006
Re: ProgrammersitP

Quote:
 Originally Posted by Miscast_Mage Hmm, I suppose a template program would be handiest for what I want to do. At the moment I just copy and paste previous classes/methods from previous work that I think would be handy for whatever I'm working on at the moment. I'll have to see about looking into that, thanks.
What I'm saying is that you shouldn't copy/paste at all. If it's a code snippet, it's short enough to retype, or regex/text-expand it. Typing it out will help you avoid mistakes (enter the logical fallacy of code found on the internet). If it's some sort of utility method (e.g. templated matrix multiply) that you use on a frequent basis, it should be documented and then compiled into a package.

Code that you use personally and code that you show other people shouldn't be any different. If you maintain a rigorous and neat programming style, your code should be easily understandable to anyone reading it. At that point, it's just a matter of "oh, here's my file, look at it and understand!"

As for some comments on your code... I know a lot of instructors provide cheat sheets on exams. I don't know if yours does the same though. Anyways ...

You should probably avoid performing mathematical operations within conditional statements. Your first code sample will fail if the given number isn't 5. Granted you probably already knew that part.

I'm surprised you (or other people you're helping) found int []y[]; tricky. Well, maybe it's the format you wrote it in. This is more of a pet peeve of mine more than anything else (going back to the Star (Pointer) Wars. It makes much more sense to rewrite that fragment as int[] y[]; (note the spacing). That way, you keep the data type with the container. An integer[array] (of) y[array_size]. Similarly, in C/C++, int* i makes much more sense than int *i, as you would read it as an integer pointer. If in doubt, refer to your style guide (most companies or managed code bases typically have one somewhere).

Also, for the last code example, Bubble Sort (and similar O(n2) algorithms)...? Why do you consider this useful?

Quote:
 Amen for organised packages; I organise mine by date(Y/M/D)-subject, e.g. 20121023Sample2DArrays or 20121014CharacterGenerator. It's annoying that there doesn't seem to be a tagging system or even a "ascending/descending according to date made/last edited" option; it makes it a pain to have a coherent yet expansive way of cataloging projects.
A tagging system in what? All modern operating systems can sort by file name and date. Or are you using some IDE?

Quote:
 Originally Posted by Leona I'm in a C++ freshman course for my computer engineering degree, and basically for a scholarship I'm working with my professor on stuff outside the normal class things, including going into Python, cgi, and sqlite. It's pretty interesting! I'm working on one big program for the end of the semester that runs an HTML page where students can select a topic to practice coding on, where it'll pull a problem from an sqlite db and then take a form from the user. Then I guess I need to work on saving it as a .cpp file and compiling it through the command prompt (returning errors if there are any). So I may update you guys/ask for help :P
Compiling via command line is pretty easy. You'll probably learn to use the GNU Compiler (gcc/g++). In Terminal (or shell of choice), you'll enter something along the lines of...

Welp. Forbidden post error. I had something written up here, but the forum won't let me post it (and no, I didn't use the word involving a cat (yes, that word) or a colon followed by two spaces anywhere).
__________________

10-23-2012, 12:17 PM   Top  -  End  -  #90
akma
Barbarian in the Playground

Join Date: Jul 2007
Gender:
Re: ProgrammersitP

Quote:
 Originally Posted by Miscast_Mage Amen for organised packages; I organise mine by date(Y/M/D)-subject, e.g. 20121023Sample2DArrays or 20121014CharacterGenerator. It's annoying that there doesn't seem to be a tagging system or even a "ascending/descending according to date made/last edited" option; it makes it a pain to have a coherent yet expansive way of cataloging projects.
There is another option - static variables, or maybe even a class with details about a package (if you are going to include one in every package, I recommend naming it \$).

Quote:
 Originally Posted by Miscast_Mage Hmm, I think I'd prefer if it had some way of keeping the different sections of code inherently with documentation, as opposed to having it is as a separate file, which I can imagine getting messy or being a pain to keep updated.
A class written with javadoc documentation: http://docs.oracle.com/javase/7/docs...g/Package.html
A package written with javadoc documentation: http://docs.oracle.com/javase/7/docs...e-summary.html
The entire API supplied with java, with much javadoc documentation (bookmark this one): http://docs.oracle.com/javase/7/docs/api/
__________________
A world behind the mirror (stand alone plane)

(Wall) passer, a rogue variant

My not realy extanded homebrewer signature

Quote:
 Originally Posted by Grinner In a world ruled by small birds, mankind cannot help but wonder how this state of affairs came about.

Last edited by akma : 10-23-2012 at 12:17 PM.