-  [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
  • Maximum file size allowed is 10000 KB.
  • Images greater than 200x200 pixels will be thumbnailed.
  • Currently 486 unique user posts. View catalog

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

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

WebM support has been added on a trial basis. Please check this thread for more info.

Newbie Thread patchouli!!SyAQpmZGyw 13/05/26(Sun)19:31 No. 3818 [Reply] Stickied

File 136958949722.jpg - (25.15KB , 293x324 , bjarne2.jpg )

What's this? Just a compiled list of resources silly!
(Also, check out the book thread, lots of lovely stuff)
Ask newbie/where to begin questions in this thread!

Language Agnostic:

http://www.codeblocks.org/ (great IDE for C/C++ and supports many libraries, cross platform)
http://notepad-plus-plus.org/ (good for scripting languages)
http://www.gnu.org/software/emacs/ (great editor with large learning curve)
Message too long. Click here to view the full text.

19 posts and 2 images omitted. Click Reply to view.
Neckbearded Basement Dweller 14/04/28(Mon)02:31 No. 4426

private static synchronized void initRNG() {
if (randomNumberGenerator == null)
randomNumberGenerator = new Random();


public double nextDouble() {
return (((long)(next(26)) << 27) + next(27))
/ (double)(1L << 53);
Message too long. Click here to view the full text.

Nattajerk 11/09/07(Wed)10:31 No. 6 [Reply] [First 100 posts] [Last 50 posts] Stickied

File Structure_and_Interpretation_of_Computer_Programs.pdf - (2.21MB , Structure and Interpretation of Computer Programs.pdf )

I heart /pr/

lets start with a book thread. I have some cached learning.

109 posts and 87 images omitted. Click Reply to view.
Neckbearded Basement Dweller 14/05/20(Tue)01:46 No. 4455

now that's what I'm talking about!

Implement Progressbar Neckbearded Basement Dweller 14/07/17(Thu)04:32 No. 4522 [Reply]

File 140556434123.jpg - (623.29KB , 2556x1767 , 1405550878260.jpg )

Hello, I come here in desperation to ask if anyone can help implementing a progressbar into my code. Before you post a link to a google search link, please keep in mind that I already tried that. I can easily put the bar, but the real challenge is making it so that it updates perfectly, and since the percentages are not ints, its hard to add an x amount of progressbar fill, eg: '#' if the percentages are not ints. Please Help, Im using python3 btw.

my code:

info about code:
its a program that downloads all the images from a set of given 4chan thread links, and its my goal to fill the progressbar based on the images downloaded / total images percentage, while making it so that it the fill never goes over the bar itself.

4 posts and 2 images omitted. Click Reply to view.
Neckbearded Basement Dweller 14/07/20(Sun)01:14 No. 4527

If you play around with the console you'll want to take a look at ncurses. Not sure if it supports Windows, though.

Neckbearded Basement Dweller 14/07/20(Sun)05:27 No. 4528

What exactly is your problem? When doing what you want to do(I assume it's keeping the progress bar to one line, since you rejected >>4523 's solution)
you need to know the Terminal window width, then you work with a min of 1 and max of width - 1(because you are a civilized person and put your neat progress bar between neat brackets). I assume you don't know how to that? Well, neither do I(under Windows).
wget uses this http://msdn.microsoft.com/en-us/library/windows/desktop/ms683171%28v=vs.85%29.aspx , which isn't really useful for you, but well, it exists. Maybe you can wrap it with Python(sorry, don't actually do that, I just had to make the joke)

There's PDCurses for Windows.

Neckbearded Basement Dweller 14/07/22(Tue)08:11 No. 4532

Yeah, I know the terminal widht, and also, I laughed at the 'wrap it with Python' string.
This looks promising since I was aiming to make something like this, but ended up writing two or more functions that gave no good results, anyways, thanks for the help, I'm off to incorporating it in my code.
Thanks for the recommendation, I'll look into it.

C/C++/C# Interactive Learning BobLobLaw 14/07/21(Mon)02:44 No. 4529 [Reply]

File 140590344841.jpg - (4.31KB , 271x186 , images.jpg )

I just want to learn something before my class on C# this fall, but I don't want to stare at a wall of text (which I've tried to do already). Does anything exist for the three languages that's more interactive like, say, http://www.codecademy.com/?

Neckbearded Basement Dweller 14/07/21(Mon)02:48 No. 4530

search for programmr. i think you may have to pay for it after a while, but it's good.

also, my favorite band is anal cunt meets caramelized booty sweat

Neckbearded Basement Dweller 14/07/21(Mon)05:28 No. 4531

>I don't want to stare at a wall of text
Maybe you should do something else then.

Neckbearded Basement Dweller 14/05/11(Sun)08:56 No. 4451 [Reply]

File 13997913875.jpg - (37.79KB , 418x467 , qt_kitty.jpg )

What would be the best resource to learn Javascript, /pr/?

MDN didn't work for me. Opera has taken their dev pages down. Codeacademy is ok, but it gets really annoying and tedious at times.

So far, I've found jQuery's "Javascript 101" section most helpful. So I was hoping you guys could direct me to something like that. thx

4 posts omitted. Click Reply to view.
ice!.RAPE.curg 14/07/14(Mon)12:56 No. 4514

if youve ever used javascript, youd know exactly what hes talking about
it can especially be an issue when it comes to making more complicated things work in multiple browsers, which is why things like prototype.js and jquery not only exist, but are used just about as often as people use a bunch of libraries in c (for all the shit c should have had already)

Neckbearded Basement Dweller 14/07/15(Tue)06:37 No. 4517

File 140539907679.jpg - (64.62KB , 500x256 , dennisritchie.jpg )

C should not have had more functionality that was none of its job to implement. It was meant to replace Assembly where possible, not Java. If it tried to implement everything under the Sun that bloated mess would have failed, and deservedly so.

Programming, a bad choice. James 14/06/16(Mon)20:28 No. 4468 [Reply]

File 140294329771.jpg - (72.97KB , 558x744 , 6386692301933492643.jpg )

So after 6 years, I've come to the realization I'm actually terrible at programming.

I find there's 3 main types of programmers:

-those who are completely unperceptive of people, takes all information into account before proceeding, always does things the right way the first time, the best programmers, they just get bored implementing.

-Then there's the walking encyclopedia peeps, analyzes data, talks out loud, easily taken advantage of, and will be fine just working..

-and then there's my type -_-, very visual, very perceptive, very fast, shoots from the hip, and doesn't even really know why shit works when it does.

The responsibility that has been given to me is nothing short of, put all the technology & processes in place to turn our company into a Corporation.. many peoples jobs depend on me, and I can't necessarily give up the highest payed job I've ever had. I don't know WTF I'm doing or what's the best most strategic way of doing this is.. Any Advice /pr/ ?

12 posts omitted. Click Reply to view.
Neckbearded Basement Dweller 14/06/29(Sun)06:05 No. 4498

lol i just spent literally 10-11 nonstop hours of sitting with a java book in front of my face. i have the drive, but its actually the amount that i can absorb that is the problem!!!

Neckbearded Basement Dweller 14/07/14(Mon)05:24 No. 4513

Yeap no OP. Firstly I firmly believe that you trying to shoehorn programmers into merely three distinct personality types is fucking stupid and shallow.

>I don't know WTF I'm doing or what's the best most strategic way of doing this is.
This is quite fine, usually. But it's your fucking attitude that makes it not fine. Don't know how something works? Well, you got it working in the first place, don't say fuck it it's done, read it again and try to learn how it works. Google anything you don't know and read about it at least once and us it as a stepping stone to learn something new, you lazy faggot. It's fine to make mistakes, especially if you know you're making them. And finding the 'best' solution to a problem *is* your job as a programmer, not something you read on the internet or recall from memory. Change your perspective and try to understand your position.

>I'm terrible at *
That's a shitty attitude to have no matter what you do.

Neckbearded Basement Dweller 14/07/15(Tue)18:23 No. 4520

Then there are the part timers/hobbyists, who have been assigned to implement something relatively simple and well contained on the basis they are the best there is available in-house.

They stampede around the existing code base like an elephant in a glass store, bash it with wildly inappropriate tools and plenty of search and replace, copy and pasting without time to fully learn the language or the framework, until they have something vaguely working done. With no understanding how much time the job should have taken, they feel their performance at least was sub par, so they hastily wrap it up omitting all code refactoring and usually the proper version management and commit procedures too.

Like so, I'm a welder and have been assigned to fix the company web page. Wont be pretty to look, when the best qualifications are like "I made a home page for my cat in 2003".

Neckbearded Basement Dweller 14/07/15(Tue)03:51 No. 4515 [Reply]

File 140538906987.png - (397.43KB , 1366x768 , 2014-07-14-165211_1366x768_scrot.png )

Hey /pr/, I was wondering if any of you could help me create my fap script in python3. What I basically want is to get a random video from the site xvideos.com, and input it in mpv, I already, can do it by putting the links in a list and inputting in a random link in mpv, but thats inefficient since one has to manually put in links in the list.

here is my code without the large list of links

seen = [] def no_repeat(l): seen.append(l) if len(sys.argv) > 1: if int(sys.argv[1]) > len(links): sys.arv[1] = len(links) if len(sys.argv) > 1: for i in range(int(sys.argv[1])): link = random.choice(links) while 1: if link in seen: link = random.choice(links) else: break no_repeat(link) link = 'mpv '+link os.system(link) else: link = 'mpv '+random.choice(links) os.system(link)

if any can help, it would be appreciated.

Neckbearded Basement Dweller 14/07/15(Tue)06:24 No. 4516

Use the [code][/code] tags. I didn't pay much attention to your code, but "seen" should be a set, not a list. Searching in a list takes O(n), whereas the search on a set should take O(log n). A set uses add to insert elements instead of append.
Also, I don't understand what exactly you want.

Neckbearded Basement Dweller 14/07/15(Tue)08:36 No. 4518

import os, sys, random def no_repeat(l): seen.append(l) if len(sys.argv) > 1: if int(sys.argv[1]) > len(links): sys.arv[1] = len(links) if len(sys.argv) > 1: for i in range(int(sys.argv[1])): link = random.choice(links) while 1: if link in seen: link = random.choice(links) else: break no_repeat(link) link = 'mpv '+link os.system(link) else: link = 'mpv '+random.choice(links) os.system(link)

What I want is to take a random video eg: a video from xvideos.com/tags/<insert tag here>. What I mean by 'take' is get the link for that video since the mpv video player can network stream videos from that site based on links.
So, based on the link xvideos.com/tags/latina,there seems to be links to videos, right? And I get the link for any of those videos eg: http://www.xvideos.com/video10095/alexis_amore_m3m_( a link in latina tag)
And then, I give this link as an argument to mpv, which will network stream the video for me.

Neckbearded Basement Dweller 14/07/15(Tue)08:44 No. 4519

I used the [code][/code] tags, I didn't know what happened, ill just post a pomf late since pomf is down now

is the matrix real neo 14/07/11(Fri)12:03 No. 4510 [Reply]

File 140507300127.jpg - (4.35KB , 160x212 , thmatrix.jpg )

are we living in an artificially simulated reality that is detached from the truth?

eep Pass-The-Cake 14/07/11(Fri)12:06 No. 4511

i am afraid that we are. i'd be okay with it as long as i can keep my memories of this life if i ever get out. i don't want to forget a certain person, or the lessons i've learned..

it's not probable, but it's very possible..

is there a real morpheus neo 14/07/11(Fri)12:29 No. 4512

someone who can point me in the right direction

Neckbearded Basement Dweller 14/07/03(Thu)05:32 No. 4501 [Reply]

File 140435837030.png - (141.51KB , 1178x583 , SDFDSFSDFSDF.png )

This author is really starting to piss me off. I paid 15 dollars for this shit, and I think I have picked out two huge errors he has made. Book is Java 7 for Absolute Beginners, by Jay Bryant.

First example:
On page 79, he says that

int a = 0;
int b = 1;
String s = "s";
String sToo = "s";
System.out.println(a == b);
System.out.println(s == sToo);

will generate the results "true" and "false" respectively. Eclipse begs to differ. Here's what it says:

Message too long. Click here to view the full text.

4 posts and 3 images omitted. Click Reply to view.
Neckbearded Basement Dweller 14/07/04(Fri)16:28 No. 4507

How the fuck is that technically correct?

Neckbearded Basement Dweller 14/07/04(Fri)16:31 No. 4508

His description of the ^ and | operators are literally the same. Read again.

daoluong 14/07/10(Thu)00:20 No. 4509

that book for Absolute Beginners
Absolute Beginners are some kind of retard never read the entire contents
like >>4506 said anyone can write a book
who know if writer is an elementary teacher

you can find another book
or code it yourself like you did
all I see are few typo, writer mixed from other books without checked

Neckbearded Basement Dweller 14/07/03(Thu)08:19 No. 4504 [Reply]

File 140436836012.jpg - (49.44KB , 360x264 , bubbo2.jpg )

So, I'm bouilding a web-site, and for the navigations and other site-to-site constants I see basically two types of solutions:

1) use header and footer scripts
2) reload the frontpage and fill the content are with appropriate distination-page

I'm kind of leaning just for headers and footers, but how do they work, if I'm going to use some content management system like drupal later on?

Then again, how does the centralized solution work with search engines?

>OP-inb4 don't code anything yourself / search engine optimization is so 2007

This is not a home page level. It will be something aiming for at least for self-sustenance if not small profit.

Delete post []
Report post