-  [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 393 unique user posts. View catalog

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

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 126679422338.png - (14.90KB , 904x538 , langGraph2.png )
8530 No. 8530 hide watch expand quickreply [Reply]
So I know nothing about programming, but I want to start somewhere.

I searched Amazon for some Java books and most of them assume at least some programming knowledge. Fuck that. Finally, I find some "complete idiot's guide" everyone's praising, except it was written 5 years ago. It instructs me to download some ancient IDEs from 404'd sites, the screenshots look nothing like the recent versions of the IDEs it wants me to download, and the programs it wants me to write assume some preexisting libraries/API I can't find for shit. The book dives right into the code, without explaining what the fuck are classes and other fundamental stuff.

So I said let's try Qt, everyone loves Qt, right? Except they state on the homepage that the documentation requires previous knowledge of motherfucking C++.

Then I visit the Wikipedia page for C++ and it says it's a broken mess of a language, outdated by today's standards and unnecessarily complex.

I head over to Microsoft's .NET site and I can't even find a starting place. There's ASP, Microsoft Azure, Visual Studio, MSDN and they seem to assume people who want to try .NET are just programmers who got bored of Java.

Any advice? Career advice like "programming is not for you" is accepted. Maybe this shit is too fucked up for me.
20 posts and 1 image omitted. Click Reply to view.
>> No. 8918
>>8917

I feel the need to restate that turing is NOT a good language.

it is slow, buggy and lacks a lot of features; but if you are new to programming its ease of use and beginners documentation can greatly help to teach you basic programming concepts; which will make it easier for you to learn the better, more complicated languages later on.
>> No. 8925
Learn French.
>> No. 8931
>>8557
Seconding this. I've been reading this lately and it covers most topics better than anything I've tried thus far.


File 126885000822.jpg - (254.78KB , 1152x864 , SHODAN.jpg )
8901 No. 8901 hide watch expand quickreply [Reply]
Hey /pr/.

I'm deeply interested in AI programming and would like your guidance as to where to begin.

I've programmed in Java, C++, and Python.

I've read in several places that LISP and Python are popular in AI programming, but what I would really like to know is which would be better suited for an introduction to the subject.

Thanks for the help.
2 posts omitted. Click Reply to view.
>> No. 8927
Op here,

Thanks for the input.
>> No. 8928
>>8911

actually, i find python better for things i wanna churn out fast. python is easier and faster to code, and many AI stuff won't need much of a performance, at least for fundamental things that people usually do to learn, which is what I think OP wants, so there's no problem in using a interpreted language.
>> No. 8930
>>8928
And there's Psyco/PyPy and friends, which can really speed it up.
I'd make a few experiments in Python first and then move to C/C++ when I know what may work.


File 126889867285.jpg - (81.74KB , 381x500 , mastering-regular-expressions.jpg )
8922 No. 8922 hide watch quickreply [Reply]
Dear /pr/ i need help with a regular expression. I am trying to make a python script that would return in a array all the urls it finds in CSS files.

Example:
file = "this is a fancy css file
there might be url('squirrelporn.jpg') kinda things and
say with double ulr(\"hotAriel.png\") yeah."
print re.findall(" url\($\)", file)
#then it would print
["'squirrelporn.jpg'","\"hotAriel.png\""]

How do i do that?
>> No. 8929
Solution:

import re help(re)



File 12688665946.gif - (16.17KB , 64x67 , remeerslash.gif )
8909 No. 8909 hide watch expand quickreply [Reply]
Does anyone here have experience with making games with Win32 API in C/C++?

My thread seems to pause or halt when I do any of the following things to the game window:
- left-click the titlebar to move the window
- right-click the titlebar to see the popup menu
- right-click the mnemonic in the taskbar to see the popup menu
- press Alt and then the space bar, arrows, etc
- minimize the window
- maximize the window

The problem lies within DefWindowProc. Therefore I can prevent my thread from pausing like that, but as of now, I sacrifice basic functionality like moving my window.

What is the best solution? I would prefer not to use multi-threading. If I happen to know of a game that doesn't exhibit this problem, how can I see how they handled it?
2 posts omitted. Click Reply to view.
>> No. 8913
(OP here again)
Also, if you want an example of an application that doesn't freeze up when you right click its titlebar, look no further than Firefox. Of course, I don't know whether it uses multi-threading to avoid the problem...
>> No. 8923
>>8913
It doesn't. Multithreading shouldn't be needed at all

You most likely have an error in your window proc. Try posting it
>> No. 8926
File simpleWndProc.txt - (481B )
8926
>>8923
I simplified my WndProc down to the bare bones and I still get the exact same problem, so I am just uploading this simpler version.

If there is a significant error, that error is "relying too much on DefWindowProc" The sad thing is, that function is supposed to behave itself nicely, but it is so hard to see what is going on inside of it whenever it doesn't do what you think it should.


File 126892255039.png - (37.33KB , 611x206 , php_vs_python.png )
8924 No. 8924 hide watch quickreply [Reply]
When you see it...


File 126877076544.jpg - (115.29KB , 1024x768 , Heidi Klum 2.jpg )
8893 No. 8893 hide watch expand quickreply [Reply]
/pr/ i need to run this code, but i dont do python. anybody know of an online service or a quick download i can use just to compile this?
(forgive me if i mess up the code tags)
#!/usr/bin/env python import hmac import hashlib pin = 'ffaa0000' # Device PIN [XXXXXXXX] app = '4.6.0.100 (233)' # OS Application version [n.n.n.n (n)] uptime = '12345' # Uptime in seconds duration = 30 # Duration for key to last [1, 3, 6, 15, or 30] lifetime = { 1: "", 3: "Hello my baby, hello my honey, hello my rag time gal", 7: "He was a boy, and she was a girl, can I make it any more obvious?", 15: "So am I, still waiting, for this world to stop hating?", 30: "I love myself today, not like yesterday. I'm cool, I'm calm, I'm gonna be okay" } secret = 'Up the time stream without a TARDIS' data = pin + app + uptime + lifetime[duration] hash = hmac.new(secret, data, digestmod = hashlib.sha1) key = hash.hexdigest()[:8] print key

3 posts and 1 image omitted. Click Reply to view.
>> No. 8905
Technically it's compiled into python-bytecode (.pyc), and then that is run on the virtual machine (just like Java).
>> No. 8914
dude if you serious about coding just use linux
>> No. 8921
>>8893
> but i dont do python
If you're serious about programming, just install Python from python.org.


File 126885528674.jpg - (268.04KB , 1920x1200 , 1268548549189.jpg )
8903 No. 8903 hide watch expand quickreply [Reply]
/*
CALCULATE AREA & PERIMETER OF A RECTANGLE.
*/

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


//Prototypes
void inputPrompt(int &width, int &length);
int calcA(int width, int length);
int calcP(int width, int length);
void show(int A, int P);

Message too long. Click here to view the full text.
2 posts and 1 image omitted. Click Reply to view.
>> No. 8907
File RectangleImplicit.txt - (1.13KB )
8907
Heres the other file.
>> No. 8919
File 126888234031.jpg - (125.27KB , 550x413 , what the fuck man.jpg )
8919
>>8906
>>8907
>> No. 8920
inputPrompt should be written as void inputPrompt(int& width, int& length)


File 126887876234.jpg - (826.11KB , 1024x768 , Desert.jpg )
8916 No. 8916 hide watch quickreply [Reply]
is it possible to make a screensaver in turing, or am I wasting my time?


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?
12 posts omitted. Click Reply to view.
>> No. 8887
>>8790
Mate, you're lucky as.
I'm 17 and I'm studying a Diploma in sys admin and network engineering.
I can't get a job anywhere, I have plenty of previous experience as well!
>> No. 8896
>ITT: lies

Any company worth its salt wants at least a bachelors.
>> No. 8899
>>8829 here.

>>8790
10 days and no 404 - 7chan is EPIC! :)

im going to get Bachelors in few months, do you know a place to apply for a job? except for google, microsoft and Sun. :)
Need to find a regular job ASAP, dear Anons. :)


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