-  [WT]  [PS]  [Home] [Manage]

Name
Email
Subject   (new thread)
Message
File
Password  (for post and file deletion)
  • Supported file types are: GIF, JPG, PNG, TXT
  • Maximum file size allowed is 5120 KB.
  • Images greater than 200x200 pixels will be thumbnailed.
  • Currently 374 unique user posts. View catalog

  • Blotter updated: 2009-07-22 Show/Hide Show All

Donate to 7chan to keep us going another month: Goal $0/200 Due 3/31 Check IRC for Paypal info
Or donate using Alertpay
Amount (USD)

File 125872185188.jpg - (280.28KB , 942x1449 , 1181208617331.jpg )
6289 No. 6289 Stickied hide watch expand quickreply [Reply]
Hi guys, I'm crossposting >>/b/389653 here to get /pr/'s help on this issue for the new /local/ board idea I'm working on, but still don't have a really concrete way to approach this using PHP. I'd appreciate some input on a good way to approach this, from a programming standpoint.
34 posts and 1 image omitted. Click Reply to view.
>> No. 8738
<b>bold</b> <i>italics</i>


File 125962830970.png - (82.75KB , 256x256 , 124406518613.png )
6612 No. 6612 Stickied hide watch expand quickreply [Reply] [Last 50 posts]
I've been reading through the recent thread about collaboratively learning a language, and it piques my interest. It gave me the idea to organize this shit to actually help /pr/ learn a new language.

Basically, people post assignments in this thread for the language we're trying to learn. Those assignments will be coded in a file called answer(question number).txt, uploaded here. Once the answer to a given assignment is confirmed correct, the assignment will be officially CLOSED and all other answers to the assignment after its closing (identified by a post by me indicating the assignment is closed) will be deleted.

Follow me so far?

For example, Assignment #1 is to display the words Hello, World. You would then post answer1.txt with the correct code and if it was verified correct I would post about it.

----THREAD RULES----
#1 - This thread is a no-troll zone. All completely off-topic posts will be deleted and may result in a ban.
#2 - DO NOT post your code in the Message section of the post. All answers go in the accompanying .txt file.
#3 - Names/tripcodes are urged in this thread to clear up any confusion.
#4 - The language we are going to be doing assignments in is C. That was the overall consensus I got. If you disagree with this and want to do another language, don't worry, other languages will be included in this later on.
#5 - Remember, we are learning a language here. Hints and tips on the assignment post are allowed and encouraged. Also, no extreme-difficulty assignments allowed. I'll be in charge of what is okay and what is not okay.

Message too long. Click here to view the full text.
57 posts and 23 images omitted. Click Reply to view.
>> No. 8649
>>8567

I think most of the files here will prove pretty useful to you if you scan over the attachments. We've covered memory management and OO style programming which will make you a better C++ programmer as well.

Coding GUI applications is not the easiest of tasks, which is actually why I started covering openGL because it provides a way to not only make games, but to make more portable (read: cross-platform) applications for distribution.

You can write some code for drawing a button of a size at a location, and a function for comparing mouse input (using GLUT) to the positions of your interface objects. If that's what you would all like to do, we can postpone the game thing for a bit (I haven't had much time for writing game code recently...) and write a simple GUI app using OpenGL...

There are, of course, the native APIs for the operating systems, but then you have to learn those, an get the compilers and headers for those as well as having an installation for testing... kind of a bitch...

There is QT4 by Nokia which is a wonderful API...but I'm not sure how many of you really want to go that route.

Also, Linux is not shit for programming (since almost all of the programming languages in existence were developed under (and for) a *NIX system... With the exception of the odd ++'s that Microsoft owns, and the obvious example of LISP which was intended for a computer architecture entirely separate from the von Neumann model all together.

If you can come up with a (reasonable) proposal for a GUI app you'd like to work on, I'd be more than happy to help divide the project so that everyone can work on a module, and have a good learning experience simultaneously.
Message too long. Click here to view the full text.


File 126837259648.jpg - (21.32KB , 350x350 , 1poor.jpg )
8849 No. 8849 hide watch quickreply [Reply]
Over the past few years I've done some pretty large (personal) projects. I would like to think that I'm a pretty competent programmer.

What would /pr/ suggest as something that I make/market/use to help make ends meet?
>> No. 8851
chimpmonk fart soundboard for mac and iphone would make you very wealthy.
>> No. 8854
A new operating system.

It will be a lot of pain, but you'll learn much


File 126801760859.png - (1.45MB , 1280x853 , 1257570754028.png )
8790 No. 8790 hide watch expand quickreply [Reply]
Huge interview tomorrow. "Over Dinner."
I'm 20. I've never made more than $20k/year freelancing. If I'm not mistaken, this kinda gig pays 45+. WTF Do I say when this guy sees that I'm 20?
6 posts omitted. Click Reply to view.
>> No. 8847
BAMP for interest
can sm1 answer by telling monthly wage?
>> No. 8852
I got hired by some shitty python web company for a while. They paid 30k a year :( ... But I'm 20 and I didn't have any degrees or certificates or experience. I quit so I could stay home and freelance making roughly 0 dollars a month! But who needs money, right??
>> No. 8853
>>8790
>WTF Do I say when this guy sees that I'm 20?

Nothing. Ask him why he thinks older people are better at developing, and assure him you can do just as good a job, if not better.


File 126817189295.jpg - (17.95KB , 570x326 , gates0.jpg )
8827 No. 8827 hide watch expand quickreply [Reply]
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.
1 post omitted. Click Reply to view.
>> No. 8831
Here's exactly what it says(it uses the diagram in the picture, though):

Write a function ONETWO to simulate a 1-to-
2 decoder (shown below) with one primary input X, one enable input E, and
two outputs ZERO and ONE.
>> No. 8832
What's so hard about it? Just google the MIPS mnemonics and do it. If you can't create a program as complex as a logic gate maybe you should get an arts degree.
If what you haven't understood are the instructions, then he seems to want you to do the same thing to two registers that logic gates does to x and e. That can be done with very few instructions.
>> No. 8848
>>8828
Its not a strange homework assignment. Its how computers work. If you are going to any college that isnt shit they will cover it.
http://en.wikipedia.org/wiki/Arithmetic_logic_unit


File 126810808863.gif - (2.63MB , 350x197 , 1263623829278.gif )
8813 No. 8813 hide watch quickreply [Reply]
Would /pr/ mind taking a quick look at my assembly function (its a short one) and checking whether its efficient? Is there a better ordering of jumps I havent considered?

http://pastebin.com/FD1XwnXQ
>> No. 8833
File 126819033171.gif - (184.62KB , 320x259 , euclids.gif )
8833
http://en.wikipedia.org/wiki/Greatest_common_divisor#Calculating_the_gcd
Read the Euclid's algorithm, it's extremely easy and MUCH better than your naive approach.

Protip: first find a good algorithm, then make sure it's good enough, then write the code, and only after you're sure it works try to optimize it.
>> No. 8834
I read the wiki article on it. Unfortunately Im writing this as an assignment, with specifications on the algorithm to be used. So my question isnt for the efficiency of the algorithm, but of its implementation.

When I go to write programs for my own ends, I will certainly do my own research on possible algorithms.
>> No. 8846
Julian Edelman is such a tool.


File 12682663321.png - (22.56KB , 400x400 , 125047439635.png )
8839 No. 8839 hide watch expand quickreply [Reply]
/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.
3 posts omitted. Click Reply to view.
>> No. 8843
Actually, it seems it wasn't 7chan that wordfiltered it. 99chan did. I posted my question there, too.
>> No. 8844
I also noticed that <iostream> is included twice for some reason... something went funky when I copied and pasted it. That was supposed to be <cstdlib>
>> No. 8845
I don't like how the variables are set up. You could do

double initLoan, initInterest, initMonthly;

etc. No need to set it to zero or have it all be a separate line. Not really dramatic or anything, but I like the way it looks and it save time.


File 126808017840.gif - (134.16KB , 584x467 , anger.gif )
8806 No. 8806 hide watch expand quickreply [Reply]
Hi /pr./ I'm doing a 'video poker' assignment for school, and I've hit a bit of a snag. the teacher wants me to make it so that the person can play infinitely, but without reshuffling the deck with each hand. This has led to a bit of trouble, because the program will deal out 10 5 card hands, one 2 card hand, and then stop. (I have a 2d bool array to see if a card's been played before)
TL: DR-
Is there any sort of method or technique I could use to reset the values of an array when a certain number of its elements equal the same thing?
1 post omitted. Click Reply to view.
>> No. 8819
what language are you using?
>> No. 8835
*(void*)0x00000000 = (void*)0xdeadbabe;
>> No. 8838
It's java...

Use an extra array and variable:
Card[] deck=new Card[52];
int position;
public void reset(){position=0;}
public Card next(){return deck[position++];}

Assuming you are programming with the class card. Else make Card to int, or how else you save your cards.

You will have to generate the whole array first. You can forget the boolArray then.

Good luck


File 12680526886.png - (101.03KB , 230x171 , sesamestret.png )
8799 No. 8799 hide watch expand quickreply [Reply]
Hey guys, will this run?


import java.util.Scanner;

public class Question_3

{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in) ;

System.out.println ( "Is the Child Male or Female?" );
System.out.println (" Type 1 for Male or 2 for Female" );

Message too long. Click here to view the full text.
1 post omitted. Click Reply to view.
>> No. 8824
sage myself for forgetting to sage, but use [code] tags, and this board isnt for having your homework done for you
>> No. 8825
if ( MorF = 1 ) -> if (MorF == 1), same with MorF == 2
You're doing a lot of extra typing - try
import java.util.Scanner; public class something { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Is the child male or female?"); System.out.println("Type 1 for male and 2 for female"); int MorF = scan.nextInt(); System.out.println("Please enter child's father's height"); int father = scan.nextInt(); System.out.println("Please enter child's mother's height"); int mother = scan.nextInt(); if (MorF == 1) { System.out.println((mother * 13/12 + father)/2); } else if (MorF == 2) { System.out.println((mother * 12/13 + father)/2); } } }

>> No. 8837
File 126819625198.jpg - (1.26MB , 2560x1712 , 006.jpg )
8837
>>8825
This.


File 126799712748.png - (53.38KB , 774x620 , Picture 1.png )
8787 No. 8787 hide watch expand quickreply [Reply]
I'm a whiny faggot, so I decided to start keeping a diary.

That's just my day job - in my spare time I also work as a security researcher. Needless to say, I'm a paranoid mother fucker, and I don't like the idea of my innermost thoughts chilling out in some gay ass cloud.

My first idea was to store the text file in an AES encrypted volume on a thumb drive, but I would be writing on uni lab computers ~50% of the time, so I wouldn't be able to use truecrypt on them.

The second was to type the entries in Vim on my uni timeshare account, and use a python script to encrypt/decrypt them, but frankly that's just a pain in the ass.

I figured someone here might have come across a similar issue and found an easier solution?

Right now I'm leaning towards encrypting/decrypting ascii text files w/ a python script, but maybe someone has a better idea? It's sufficient, but just feels really ass backwards.
4 posts omitted. Click Reply to view.
>> No. 8818
use a pencil and some paper
>> No. 8821
>>8818
>> No. 8822
Totally seconding previous ideas, but still:

FreeOTFE is a free windows program to manage encrypted volumes. It comes in a portable flavour that doesn't need privileges, and it is possible to create a volume that will also work with dmcrypt, so you can share your encrypted volumes between windows and GNU/Linux machines.

Under GNU/Linux, however, you DO need privileges (unless root was so kind as to make a custom fstab entry), so depending on your environment this may not be what you need.


Delete post []
Password  
Report post
Reason  
Previous [0] [1] [2] [3] [4] [5] [6] [7] [8]