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

  1.   (new thread)
  2. [ No File]
  3. (for post and file deletion)
/pr/ - Programming
  • Supported file types are: C, CSS, DOC, DOCX, GIF, H, JAVA, JPG, PDF, PNG, SVG, SWF, TXT, WEBM
  • Maximum file size allowed is 10000 KB.
  • Images greater than 200x200 pixels will be thumbnailed.
  • Currently 450 unique user posts. View catalog

  • Blotter updated: 2011-01-12 Show/Hide Show All

There's a new /777/ up, it's /selfhelp/ - You're Pathetic, We're Pathetic, We Can Do This! Check it out. Suggest new /777/s here.

Movies & TV 24/7 via Channel7: Web Player, .m3u file. Music via Radio7: Web Player, .m3u file.

WebM is now available sitewide! Please check this thread for more info.

Neckbearded Basement Dweller 15/02/09(Mon)20:00 No. 4688 [Reply]

File 142350844190.png - (38.44KB , 937x1033 , キャプチャ.png )

Sup /pr/.
In the image is a program for adding 400 to a variable and one for adding 2b to a variable. The one for the bottom adds 2000000000. This is with 32 bit ARM, so the bottom add needs to do extra work to add the larger number (op codes and registers take up some of the 32 bits for the instruction, so it needs to load the 32 bit number into a register and add the registers together instead of just adding like the add r3, r3, #400 instruction). If I have a 64 bit processor and a 32 bit operating system, can I make a compiler that uses the 64 bit word size to add for both of these programs in just the one assembly instruction or does the OS limit itself to 32 bit words?

Neckbearded Basement Dweller 15/02/12(Thu)04:46 No. 4689

bump for science

Neckbearded Basement Dweller 15/02/13(Fri)00:06 No. 4691

You can compile it, but unless ARM does some magic Intel doesn't you won't be able to run the program.
Every time the running thread changes the OS saves the registers in memory (as they will be used by the next thread). A 32-bit OS only needs to save the 32-bit registers. To make sure, you could test it in QEMU.
Disclaimer: I don't have much experience with ARM.

Neckbearded Basement Dweller 15/02/13(Fri)07:06 No. 4692

I was mostly thinking Intel since I don't have anything that's 64 bit ARM. I'm not sure how Intel does the machine code yet since they do some kind of variable length instruction magic. I guess my idea works better with fixed length instructions though, maybe there are some instructions for Intel that can use it, I'll try to find that out eventually.

Hello Hi 15/02/03(Tue)01:19 No. 4684 [Reply]

File 142292278771.png - (7.61KB , 200x240 , zbar_200.png )

I was wondering if anyone can give me insight on how to add the Zbar QR scanner into my Xcode. I have searched all over the place and I have only found tutorials on how to do it on older versions (Objective-C) Any help is greatly appreciated!

SQL ? Neckbearded Basement Dweller 15/01/24(Sat)13:34 No. 4680 [Reply]

File 142210287754.jpg - (259.39KB , 720x480 , 1350159034001.jpg )

SQL Bernds, please halp:

We have the table "Qualifications" with the following fields:
1. Class (1,2,3, .., 2)
2. Subject (English, Mathematics, Computer_science, ...)
3. Family Name (Anderson, Sullivan, Smith ..)
4. Nick Name (Mary, John, ..)
5. Score (9,10,4 ..)
6. Date (13.03.2014,02,04.2014 ...)

Write a SELECT statement that returns the highest score for each student in a given class, on a given subject, along with the date, when the score was obtained.
"Class" and "Subject" for selection are transmitted through host variables. (H-CLASS , H-SUBJECT)
Variable "H-SUBJECT" may contain the name of a subject or the word "All".
In this case the top scores for all subjects for all students of the given class will be listed.
These two cases (one specific subject and all subjects) will be managed in the same select statement.
Message too long. Click here to view the full text.

Neckbearded Basement Dweller 15/02/02(Mon)11:24 No. 4682

fuck databases, make games.
but it will probably be the stackoverflow result for a google query containing lots of databasy words like "sql select from max value"

Neckbearded Basement Dweller 14/12/28(Sun)07:39 No. 4656 [Reply]

File 141974875541.jpg - (131.39KB , 1280x720 , maxresdefault.jpg )

So, what do you think about Bret Victor?


Neckbearded Basement Dweller 14/12/28(Sun)18:32 No. 4657

he's standing in front of a macbook.
I doubt anything of value will come from his lips but let's see...

Neckbearded Basement Dweller 14/12/30(Tue)05:29 No. 4658

File 141991378135.jpg - (402.86KB , 2298x1725 , air2008.jpg )

Well, I had macbook (air) once too. It took me about a month to figure how to get linux there, but once installed, it was almost usable.

beard on face also, basement too cold 15/01/26(Mon)10:02 No. 4681

File 142226292938.jpg - (150.72KB , 1280x720 , WIN_20150126_015805.jpg )


I actually attended the conference from which the video was recorded.

I very much liked his talk, specifically I liked his attention on the ways information is represented.

"Perspective is worth 70 IQ points"
- A professor of mine

java help Neckbearded Basement Dweller 15/01/18(Sun)03:53 No. 4676 [Reply]

need help with a java project. I would like to fill an array with a class that has multiple data types.

for example

class student{
int age;
String firstName;
String lastName;

Then in another class something like

student[] stus=new student[4]{some way to initialize entire array}

let me know if you need any more info
Message too long. Click here to view the full text.

Nattajerk 15/01/18(Sun)14:04 No. 4677

this is nothing too difficult.


i dont have java installed to verify any errors i made, but all you would have to do in this is populate the array, i believe. however you want to do that is up to you.

Neckbearded Basement Dweller 15/01/18(Sun)18:42 No. 4678

I figured out what i needed. I knew how to create the array. i just didnt know how to fill the array without doing like
and so one i wanted to do it all basically inline with the constructor.
what i did was

student[] stus=
{new student("mark","jones",22),
new student("faith","hart",20),
new student("james","johns",22),
new student("spongebob","squarepants",20)};

an array of students filled with the constructor

Neckbearded Basement Dweller 14/12/09(Tue)02:47 No. 4641 [Reply]

File 141808962137.jpg - (81.15KB , 519x533 , 1416624224370.jpg )

What types of data should UDP and TCP handle, respectively, in an MMO server backend?

1 post omitted. Click Reply to view.
Neckbearded Basement Dweller 15/01/02(Fri)06:17 No. 4664

MMO Server by definition is a vague description.
If you're talking about a action mmo game, critical messages (spellcasting, chat, rule validation) should be all TCP. State synchronization such as positioning, rotation, view angle, all should be UDP.
Now, if your mmo server is a turn based game such as a card game, where state sinchronization is not required, TCP will do.

Neckbearded Basement Dweller 15/01/08(Thu)05:43 No. 4665

UDP - shit that doesn't absolutely have to be there
TCP - shit that absolutely has to be there

really, what were you expecting from us?

Neckbearded Basement Dweller 15/01/17(Sat)09:28 No. 4675

UDP - most of the time it's good for streaming data (audio, video) and inter-process communication

TCP - if you need 100% reliability in your data transfer (DB responses, business logic data, etc.. )

Neckbearded Basement Dweller 13/10/11(Fri)23:41 No. 4156 [Reply]

File 138152768546.jpg - (85.38KB , 587x551 , 138119478561.jpg )

Is... is it ok if I just skip C and move right on to C++?
I... seem to find it easier reading cpp code than C, without all those enums, links, arrow operators, and shit.

26 posts and 2 images omitted. Click Reply to view.
Neckbearded Basement Dweller 15/01/11(Sun)00:58 No. 4666

Haskell is what C++ should have been. Start with that.

Neckbearded Basement Dweller 15/01/11(Sun)16:54 No. 4667

>>4666 yes, start with haskell if you don't like programming and never want to be a programmer but would like to teach at universities.

Neckbearded Basement Dweller 15/01/11(Sun)17:51 No. 4668

>if you don't like programming and never want to be a programmer
All my enthusiastic programmer friends got into Haskell because it's really fun programming in it and because it teaches you to view programming in a completely different way.

Neckbearded Basement Dweller 14/12/27(Sat)08:01 No. 4654 [Reply]

File 4chan.txt - (989B )

Babby's First Program


Please, /pr/, you're my only hope: tell me exactly why this is the most offensive program you have ever looked at.

Neckbearded Basement Dweller 15/01/01(Thu)21:22 No. 4661

for a php script its alright, though it seems to magic number around 4chan's random board, when it could be expanded to download images from any board.

of course I could be just reading it wrong, I've been out of the loop for a while and haven't done regex in ages.

Nattajerk 15/01/01(Thu)22:14 No. 4663

more importantly your variable names should have some description to them, I don't know what dedup is and if ever there came a time to use it in the future, it would be difficult to discern what it does.

generalized variable names are a faulty practice in my opinion, even in small loops - because in the future that small loop could become bigger and our dedups and values can get lost in a sea of "What the fuck does this value do"

anonymous 14/12/30(Tue)12:46 No. 4659 [Reply]

i use devcpp to compile cpp programs but it seems to get some errors. is there someone that suggest me another softwARE?satin nydaym

Nattajerk 14/12/30(Tue)13:27 No. 4660

what errors are you getting? DevCPP is not a compiler but an IDE, it shouldnt be getting problems directly.

What exactly are you trying to do that is giving you an error?

I Before E Except After C Algorithm(Python) Neckbearded Basement Dweller 13/12/28(Sat)23:47 No. 4261 [Reply]

File 138827083071.jpg - (68.80KB , 620x880 , wrong ie.jpg )

So I was challenged today to prove this graphic I shared on Facebook and ended up disproving it by a lot with a simple python program. As with any good scientist, I would like some people to:
1. Try it with different (>100000 words) wordlists to see if my results hold up that when "I" and "E" are both in a word the I before E rule is followed roughly 75% of the time.
2. Make sure the algorithm is correct.
SOURCE: https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxoYXNlcmVubGFuZXNoZXJzdHVkaW9zfGd4OjUyM2YxYzU0YjZmYWE2N2U

4 posts omitted. Click Reply to view.
Neckbearded Basement Dweller 14/04/20(Sun)15:05 No. 4412

We almost wrote the same pieces of code.

(use (srfi 1 13)) (let ((words (string-split (with-input-from-file "en_US.txt" read-string)))) (map (lambda (pattern) (cons pattern (fold (lambda (h t) (if (string-contains-ci h pattern) (add1 t) t)) 0 words))) '("ei" "ie" "cei" "cie")))

Neckbearded Basement Dweller 14/08/09(Sat)06:53 No. 4548

So the 'except after C' part IS bullshit?

Neckbearded Basement Dweller 14/12/24(Wed)03:23 No. 4652

>>4548 nah because the wordlist must consist only of words where ie/ei should actually be "ee"

Delete post []
Report post