[Home] [Manage]

Name
Email
Subject   (new thread)
Message
File 
Embed   [?]
Password  (for post and file deletion)
  • Supported file types are: GIF, JPG, PDF, PNG, RAR, ZIP
  • Maximum file size allowed is 1000 KB.
  • Images greater than 200x200 pixels will be thumbnailed.
  • Currently 286 unique user posts. View catalog
  • User Moderation is disabled

File: 122386683818.gif-(195.82KB, 183x245, dancing girl.gif)
834 No. 834 Stickied hide watch expand quickreply   [Reply] [Gallery]
I toasted this a while ago, but it has since disappeared, and I believe it's worth toasting again.

http://www.51cnnet.com/directory

If you would like to learn a programming language, or several, or any number of computer-related subjects, go to that site and find an e-book you like. There are several thousand to choose from.
16 posts and 3 images omitted. Click Reply to view.
>> No. 2243
http://www.cosmolearning.com/computer-science/courses?sort=newest

less langauge-oriented but good stuff. All videos I believe, documentaries and lectures. There's also physics/chem/bio/engineering/math and a bunch of other subjects on there.


File: 121410765664.jpg-(12.59KB, 344x226, 120212100161.jpg)
40 No. 40 Locked Stickied hide watch quickreply   [Reply] [Gallery]
Rules of /pr/
1. This is not /prog/
2. Do not be a faggot


File: 126817160881.jpg-(17.95KB, 570x326, gates0.jpg)
2376 No. 2376 hide watch quickreply   [Reply] [Gallery]
Hey guys, I've been having some trouble. I'm trying to learn to program in MIPS assembly language and I haven't got a clue how to make a program given a logic gate diagram. Anyone have any idea how to do this? For example, this diagram has one primary input X, one enable input E. They are supposed to return a 1 and a 0.
>> No. 2377
>>2376

I'm not sure what you're going for here. Are you asking how to convert a logic diagram into a boolean expression, or are you trying to take the MIPS architecture and use it to determine the MIPS assembly language?

That diagram doesn't make any sense at all unless the zero and one are not logical, but variables.

Please explain what you mean by "make a program given a logic gate diagram" in greater detail. Links to your professor's lecture slides would be nice, too.
>> No. 2390
>>2377
I think what he's trying to say is he needs to write a program based on the logic diagram.
So he should do logic diagram -> boolean expression -> program. Also I'm pretty sure zero and one are just the numbering system he's using for output, IE Out-0, Out-1, Out-2 or Q0, Q1, Q2...

As shown in his output ZERO = EX' ; ONE = EX.
So for mips from a quick reference it seems it's

and $zero, $E, $X';

of course he'd need to bitwise complement X' and store it in a register or something and then use it as a variable.
Also the other one would probably be something akin to

and $ONE, $E, $X;

I'm pretty sure you can't nest functionality like in higher level langauges like C would have: ZERO = ( E && !(X) );
Message too long. Click here to view the full text.


File: 126824675796.png-(22.56KB, 400x400, 125047439635.png)
2378 No. 2378 hide watch expand quickreply   [Reply] [Gallery]
/pr/, I'm having trouble with a programming assignment for my C++ class and was hoping you could help. First of all, the assignment was to write a program to ask the user the amount of their loan, the yearly interest, and their monthly payment, and it would tell them how many months it would take to pay off the loan.
Supposedly, the first month's interest would be the the interest the user entered divided by 12.
It would then deduct that interest amount from the monthly payment and that would be their principal payment. This would be subtracted from the loan and the remainder would be what you have left to pay. The second month, it would be the loan amount * the first month's interest. Then it would subtract whatever that is from the loan amount and so on until you reach 0. I tried writing a program, and if my explanation hasn't been enough, hopefully the code will be.

#include <iostream>
#include <iostream>
#include <iomanip>
using namespace std;

int main() {

double initLoan = 0;
double initInterest = 0;
double initMonthly = 0;

Message too long. Click here to view the full text.
5 posts omitted. Click Reply to view.
>> No. 2386
>>2383
system() calls are...well system dependant, only Faildows has a PAUSE command, use a standard function like cin.getchar() instead

Also you can work on whatever IDE you like, it's not like he'll be able to tell which one you used to edit your code.
>> No. 2387
>>2386

He's convinced that certain code written in Visual Studio won't compile with Dev-C++...
>> No. 2389
>>2387
Code that uses compiler-specific standards won't work on other compilers. By default Visual Studio uses the Microsoft's compiler (duh), and DevC++ uses MingW, so what compiles with one may not work with the other.
Also DevC++ sucks. Use Code::Blocks if you want a good/free IDE, or Notepad++ if you find that too bloated. Both (Visual Studio too, if I'm not mistaken) can use MingW as the compiler if you need/want to.

print the variables you use in the loop.


File: 126835470866.png-(19.45KB, 300x309, 125117762172.png)
2388 No. 2388 hide watch quickreply   [Reply] [Gallery]
Does the coding standard war between browsers make anyone else RAGE? Does anyone have a comprehensive list of the differences in CSS between IE and Firefox? Other layout standards would be nice, but I only give a shit about IE and Firefox.

On a side note, Firefox has some really stupid changes to CSS. First off... why the fuck would you use padding to expand the size of your DIV container? It should be used to push the content inside of the containers inward like in IE.


File: 126741082330.jpg-(11.30KB, 300x250, 09.jpg)
2351 No. 2351 hide watch expand quickreply   [Reply] [Gallery]
To the young programmers of the World!

The cry of the rebellion we launch here, in which we firmly implant our ideals alongside those of the Futurist painters, does not come from a little aesthetic minded clique but, on the contrary, expresses the violent desire that seethes in the veins of every creative programmer today.

We want to fight to the bitter end against the fanatical, thoughtless, and purely snobbish religious faith in the past, stoked by the nefarious existence of the academic journals. We are rebelling against the sluggishly supine admiration for old operating systems, old languages, archaic standards, and against the enthusiasm for everything bug-ridden, rotting with code bloat, and eaten away by obsolescence. And we judge unjust - criminal in fact - the habitual disdain for programs whose construction is different and original, new, throbbing with life.
4 posts omitted. Click Reply to view.
>> No. 2371
Talking about Big O Notation makes me feel powerful!
>> No. 2373
>>2370

Bullshit. Big-O notation is to computer science as gear ratios are to mechanical engineering. People aren't trying to be smug by using them--they're trying to actually convey information. Next time, if you'd like, I can say "constant-time", but I don't see how that's any better. My point is that OP is a dipshit, not that I'm a genius.

inb4 "Tip: want to feel like a big man? use similes."
>> No. 2384
I dislike it because it makes people insane for hash tables. "O(1) OMFG!!!!!!!" They become hash table happy and can always say "0(1)" to justify their lunatic behavior.


File: 126797383892.jpg-(173.43KB, 1000x1200, space-invaders.jpg)
2366 No. 2366 hide watch quickreply   [Reply] [Gallery]
Hello there any old programmers here?
I was wondering how they would program games back in the day, I mean today there are things like the event-driven model that automatically handles user input. A graphics library to draw sprites etc. Heck even easy multi-threading so that everything runs properly as they should.

How would you program back in the day? How does one handle user input? How do I draw those beautiful sprites? (On the screen pixel by pixel?) How do I do simple animation - without resorting to threads? Imagine you are programming for something like ummm I dunno a Commodore 64 with BASIC.

tl dr : Old game programmers tell us how you did those wonderful games in the 80's and manage to keep it damn small.

Pic Related
>> No. 2368
It might be instructive for you to look at the hardware specs on old game consoles. The NES is pretty interesting, because it hardware-based sprite-drawing.

Just remember that a lot of the things you're talking about (multi-threading, sprite-libraries) had to be coded at some point. That's basically how it was done in the bad old days, except that a lot of it was done by hand, over and over, and little counterintuitive "tricks" (like corrupting the value of a co-processor's register to allow part of the screen to scroll without the rest scrolling, in the case of the NES) were used instead of the clean, homogeneous interfaces of a library.
>> No. 2374
I used to program simple games on the C64 in Basic. As far as sprites go, you had a grid (can't remember the size, Maybe 8x8) and you'd put in lines of data which told the computer whether the boxes on the grid were empty or which color they were filled with. The C64 had I think 16 colours so you had 17 choices. We designed sprites by using an eyeliner pencil and drawing on a grid covered in clear plastic which could be wiped clean later. If you wanted sprites bigger than the grid, you'd use the grids as tiles and stick them together.

I think the command to fill in a sprite block was "poke" so your code that built the sprite would look something like

poke something 0,0,12,0,12,0,0,2,3,5,6,0

It's a long time ago so I can't remember the details.

The game engine was written in Basic and had a lot of "If x=y then goto 500" type commands. Basic included a lot of built in commands to do things like wait for input from the keyboard or a joystick so it wasn't like programming from scratch in assembler.

The Amiga was easier and used programs like Amos and Blitz that resembled C. They were both full of commands that made everything easier and you could draw your sprites in a paint program and tell your game to load it directly from the disk. There was a simple command for collision detection which was my number one headache on the C64. Simplicity in comparison.

I'm rambling so I'll stop.
>> No. 2375
>>2374
Oh please, keep rambling all you want.

>>then goto 500
lol


File: 126774693870.gif-(4.96KB, 258x248, functions.gif)
2364 No. 2364 hide watch quickreply   [Reply] [Gallery]
Hey /pr/, does anyone here work as a programmer?
I am looking to get a programming-related internship and I don't know where to start!
>> No. 2372
I've worked as a full-time programmer for about 10 years now. I also do the technical interviews at my current job.

If you want to get a job as a programmer you should apply to places that are hiring programmers.

Some places (SF, Boston) have tons of Web startups that are constantly hiring anything. Find a startup conference (Boston has WebInno, for example) and go network.

Other locations have a few large corporations with an obvious entrance point for the bottom rung.

Portland, OR, from what I hear, has no companies that will hire a programmer.

Expect to be paid, but not well at first.

Here's where I would start: make a resume and put some code on github. Join a few relevant Freenode channels (#haskell or #ruby or whatever). Go to conferences. Submit your resume, interview well, and negotiate properly.


File: 126600695221.jpg-(12.55KB, 400x349, 125000270723.jpg)
2314 No. 2314 hide watch expand quickreply   [Reply] [Gallery]
/pr/, I'm having some trouble with a program I'm writing. Only the first two functions in the sequence work...

Here is the code:

// Take an amount of money and convert it to dollars, quarters, dimes, nickels, and pennies.
// Programmed by DERP 02/12/2010.

#include <iostream>
#include <cstdlib>
using namespace std;

const double DOLLAR = 1.00;
const double QUARTER = 0.25;
const double DIME = 0.10;
const double NICKEL = 0.05;
Message too long. Click here to view the full text.
13 posts omitted. Click Reply to view.
>> No. 2361
>>2329 There is always an elegant way.

// Wanders in, does someone elses homework, wanders out.
// Remindes me of working in the lab on campus. ;P

#include <iostream>
using namespace std;

int intCents = 0;
double dblDollers = 0.00;

int main()

{

Message too long. Click here to view the full text.
>> No. 2362
Just noticed the date on the parent… probably already handed in the assignment… =/
Oh well, might be of use to someone.
>> No. 2365
>>2362

Yeah, I handed it in and as it turns out, I was supposed to convert the money amount to pennies... but he took the assignment and said it was fine.
I'm far ahead of the class in terms of experience and coding knowledge, but I never had a good structure in learning the language, so I decided to take the Intro class instead of testing out of it.

There are kids there who should just fucking drop the class... they're still struggling to understand basic I/O, whereas we're on File I/O at this point and things like more advanced output.
There are kids there that I see playing flash games when he's explaining things... and they wonder why they have trouble with the language?


File: 126733313885.png-(70.91KB, 701x372, tempconverter.png)
2350 No. 2350 hide watch expand quickreply   [Reply] [Gallery]
http://pastebin.com/fhfTmmqr

Hey /pr/, I'm self-taught using python, I only really learned from the python tutorial and from googling for specific commands. I don't have the patience to learn from a book, and I have no real goal or deadline to be proficient, I just do it for fun. I just wrote this last night, because I wanted some software to convert temperatures while offline. It's not 100% accurate, but it's close enough. It converts between Fahrenheit, Kelvin and Celsius.

Mostly what I wanted to know is, could it have been done in less lines? It just feels like what I've written is largely inefficient and could have been much simpler. However I feel that the inclusion of integer checking and restrictive menu selection is absolutely paramount. I don't want my code to be breakable, even by the most careless or inexperienced user. I generally write it in such a way that my mum should be able to use it without running into an error, like by entering "fifty eight degrees" instead of just "58" at the prompt.

Since I've never learned in a structured environment, I'm sure I've breached typical programming conventions numerous times. I just wanted to know what you guys thought. It's the first bit of code I've written to actually be a useful tool rather than just for practice.
1 post omitted. Click Reply to view.
>> No. 2357
You could put the temperature names in a dictionary/list and access them through that. This way you wouldn't need duplicate code to print "temperature in X".
>> No. 2358
Okay thanks guys, I'm also doing seperate ones for metric to imperial, ie inches feet miles, millimeters meters kilometers, and one for square/cubic inch/foot/mile/millimeter/centimeter/meter/kilmometer

I think I'll do a horsepower - kilowatt one first and try to include what you guys said, since having only two options hp/kw and kw/hp it's easier to keep track of. I also need to figure out a better way of only accepting floats from the user, as the current one doesn't seem to support negative numbers or non-whole numbers (ie 37.5)
>> No. 2363
>>2358
>non-negative floats from the user
All you have to do is figure out the value of CHANGE_HERE (it's a regular expression) on the code below:
import re def read_float(msg, errorMsg): while True: s = raw_input(msg) try: return float(re.match(CHANGE_HERE, s).group(0)) except AttributeError: # if we have no match then re.match will return None, and None.group(0) raises this exception print(errorMsg)


Remember that you can use "help(re)" to see it's documentation.


Delete Post []
Password  
[Mod]
Previous[0] [1] [2] [3] [4] [5] [6] [7] [8]