-  [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 491 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.

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.

6 posts and 2 images omitted. Click Reply to view.
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.

Neckbearded Basement Dweller 14/07/28(Mon)06:44 No. 4533

You'll need to add a if () console cmd

John+Smith 14/08/08(Fri)08:21 No. 4545

I'm sure TKinter should have some method of implementing a progress bar.
Find out how many images have been downloaded out of the total number of images, and make use it to control a TKinter bar.

C++ Input Data Neckbearded Basement Dweller 14/05/04(Sun)07:47 No. 4436 [Reply]

File 139918243382.jpg - (46.20KB , 600x586 , CHILI.jpg )

I'm a newfaggot programmer more or less. I'm writing a simple guessing game. The user guesses a random number within a range. The only problem I have is accepting multiple data types. The user needs to guess an integer, but I want them to also be able to be able to submit characters such as '?' or 'EOF' into cin to do something like bring up a help menu or quit guessing. Anyone here who can/wants to teach me which method I should use to accomplish this?

I'm not sure if this is a shitpost here or not so if it is, tell me to fuck off, thanks in advance.

3 posts omitted. Click Reply to view.
Neckbearded Basement Dweller 14/05/11(Sun)08:42 No. 4449

what anon says. pretty simple, methinks.

Nattajerk 14/05/17(Sat)11:05 No. 4454

For your purposes you can use stringstreams to play with the data types. Managing strings with C++ can be a major pain at times, even for simple things. stringstreams will give you the ability to accept multiple data types by converting them on the fly.


alternatively, you could use C's atoi function. I think recent versions of C++ also have better string support? I'm not positive.

Neckbearded Basement Dweller 14/08/01(Fri)13:43 No. 4540

if not ? or EOF in string then parse string as int

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

5 posts omitted. Click Reply to view.
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.

Neckbearded Basement Dweller 14/07/30(Wed)18:26 No. 4538

ive been looking for jon duckett javascript and jquery but no torrents for that book , i would say his books are the best at teaching this stuff

Python/Raspberry Pi Neckbearded Basement Dweller 13/06/20(Thu)21:56 No. 3905 [Reply]

File 137175820336.jpg - (34.97KB , 580x358 , raspberry-pi-python-1-580x358.jpg )

Hello /pr/, I am here for the first time as I am interested in programming. I didn't know where to start, if you guys find this thread cancerous or anything then please say.

Anyway, I'm 13 and I really want to get into Programming. I got a Raspberry Pi (as a gift) and I was wondering what could I do it with - perhaps turn it into a CCTV? Anyway, I would love to get to learn programming with Python (as it seems to be a very easy/friendly language), and to test my skills out on the Pi.I tried codeacademy but I always get disrupted while learning, and the longest streak I ever had was 2 days. What keeps you guys motivated and not bored/discouraged when coding?

Also, I made a game in JavaScript ages ago, and barely anyone ever tested it out. The link for the game is here: https://mega.co.nz/#!DcligIQb!MiMA2DcKi9Q83sgl0M4LC0O3CBgscoyvOEcGkK6aTh8 (It's a HTML File, about 1Kb)

3 posts omitted. Click Reply to view.
Neckbearded Basement Dweller 13/07/01(Mon)17:10 No. 3937

Python, a slow language, when ran on a slow budget-computer, is a VERY SLOW language

Nattajerk 13/07/02(Tue)03:05 No. 3939

for big projects perhaps, but ive yet to have any issues.

Not+A+Douche 14/07/30(Wed)08:59 No. 4537

I am kind of tired of hearing that Python, Java ect is a slow language. I concede the point that it is not the fastest language that does not override the fact that Python is an excellent language for learning how to program, which is the point of the entire Raspberry Pi Project. The Raspberry Pi project is aimed at getting young people into the Computer Science program of study. The OP at 13 is the target audience for this project. The Raspberry Pi is a remarkable piece of hardware for its price. OP program whatever you can on your Raspberry and above all share. The other languages are not going anywhere. Besides I don't see Boy Scouts automating R/C tanks with C++.

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.

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)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.

bitcoin payments Neckbearded Basement Dweller 14/06/24(Tue)06:20 No. 4496 [Reply]

File 140358361039.png - (157.40KB , 1366x746 , 1392159329343.png )

if anybody has the slightest clue how to accept bitcoin payments through a website post all up in this thread because i need yo help

willing to pay

Neckbearded Basement Dweller 14/06/26(Thu)01:21 No. 4497


Delete post []
Report post