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.
<b>bold</b> <i>italics</i>
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.
>>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.
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?
chimpmonk fart soundboard for mac and iphone would make you very wealthy.
A new operating system. It will be a lot of pain, but you'll learn much
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?
BAMP for interest can sm1 answer by telling monthly wage?
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??
>>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.
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.
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.
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.
>>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
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
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.
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.
Julian Edelman is such a tool.
/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.
Actually, it seems it wasn't 7chan that wordfiltered it. 99chan did. I posted my question there, too.
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>
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.
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?
what language are you using?
*(void*)0x00000000 = (void*)0xdeadbabe;
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
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.
sage myself for forgetting to sage, but use [code] tags, and this board isnt for having your homework done for you
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); } } }
>>8825 This.
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.
use a pencil and some paper
>>8818
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.