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

Delete multiple rows with variable number 'ID's to delete Neckbearded Basement Dweller 14/09/21(Sun)12:26 No. 4588 [Reply]

File 141129520030.jpg - (413.11KB , 533x400 , Pineapple.jpg )

So i have an application Im writing and I have an input with checkboxes that will send an array of names to the application. The application is then supposed to delete rows that have the names in a column as the names in the array sent by the checkboxes. I can use a loop in the application to run through the array, but is there an SQL way of doing this. I am using SQLite for now, but a Postgres dialect answer will help though.

Not+A+Douche 14/09/23(Tue)03:18 No. 4589

DELETE FROM table_name
WHERE some_column=some_value;

C++ Quiz Neckbearded Basement Dweller 14/09/19(Fri)20:14 No. 4586 [Reply]

File 141115047244.png - (43.99KB , 462x261 , play.png )

http://q.viva64.com/ - C++ Quiz: are you a code guru?

Neckbearded Basement Dweller 14/09/07(Sun)23:19 No. 4580 [Reply]

File 141012474693.jpg - (11.01KB , 225x209 , mrS3f1BVoz6qoQOv5UJdgBQ.jpg )

I was told to make a new thread.
I want to make my own cipher machine, like the Enimga.
What language will be better for this?
I want something like this: http://www.users.globalnet.co.uk/~andlaw/engindex.htm
A simple graphic interface where one imputs the setting, encode and decode.

patchouli!!MxLwWzZ2L4 14/09/11(Thu)05:55 No. 4581

I am assuming you are new.

There are boundless options for you; as >>4579 said.

That being said, I would try out OCaml, it is really neat and it has quite a nice gtk wrapper.

It is considered a functional language, akin to Lisp and Haskell, and if you have already got used to imperative languages: C, Java etc, it might be tough to start out, but don't get discouraged. You can overcome anything with a bit of practice.

Good luck!

Neckbearded Basement Dweller 14/09/14(Sun)01:53 No. 4584

I have no previews experience in programming.
Can I jump straight to OCaml or should I learn something else beforehand?

tilda tabs nigger 14/08/29(Fri)03:40 No. 4572 [Reply]

File 140927640081.png - (183.90KB , 1366x768 , 2014-08-28-194015_1366x768_scrot.png )

how to get rid of those ugly tabs in the tilda program in the top?

Terminology and ranger i need halp 14/08/08(Fri)03:09 No. 4544 [Reply]

File 140746015548.png - (35.14KB , 1366x768 , 2014-08-07-190518_1366x768_scrot.png )

Hey guys, I have a problem and I know is not /pr/ related but I have nnowhere else to go to.

The problem is that my file manager ranger won't display images on my terminal called Terminology, even though i set it in the rc.conf to preview images.
w3m-img does work in Terminology as show in pic related, I don't know what is the problem even though it works in other w3m-img friendly terminals like xterm, xvt, kterm, etc.

Please halp.

sage sage 14/08/14(Thu)04:56 No. 4561

go back to niggertits, /g/ would love to help you

Neckbearded Basement Dweller 14/08/23(Sat)19:42 No. 4568

Have you set draw borders to true?

3,5 Bucket Problem Noah Fischel 14/06/21(Sat)03:09 No. 4492 [Reply]

So I'm in the running to get an internship with Zappos, and the guy I interviewed with said that I had to write a program (ANY CODING LANGUAGE) to solve a problem (that I can't even solve on paper). It's sort of like the 3,5 Bucket problem. But there's more to it. Instead of getting 4 gallons in the 5 gallon bucket, I have to get 31 in the 86, 41 in the 75, and 59 in the 309. Theres only 3 legal moves:
Fill the Bucket
Empty the Bucket
Pour Bucket X into Y.

Could anyone maybe help me figure out this problem?

here's the link to the website that describes it, along with the prompt at the bottom.


Neckbearded Basement Dweller 14/06/21(Sat)10:13 No. 4493

Why do you want a job you're not qualified to perform?

By the way, I find this degree of sophistication surprising for a website about fucking shoes.

Neckbearded Basement Dweller 14/06/21(Sat)10:31 No. 4494


Yes, we could help you figure out this problem.

You start with the fact that there is no solution in this particular case, because none of the three buckets end up being empty nor full in the end, which means that “magic happens” and magic is not allowed.

Now you simply have to write something that will prove it. And no, no code; you are required to write that one and it would be a disservice to do that for you.

Neckbearded Basement Dweller 14/08/23(Sat)04:33 No. 4567

Couple of hints :
You can only produce volumes that follow the form n*gcd(v1,v2) where v1 and v2 are the bucket volumes.
This means that target volume must be
t_v mod gcd(v1,v2) = 0.
From there the only moves that make sense are filling B1 up if it's empty, emptying B2 if it's filled and if none of the above transfering B1->B2.
Same thing for the other route(B2->B1)
Run both cycles alternatively until one of them hits the solution and you've got it in O(2*short path).

I know this is outdated as hell but someone could use the reference.

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

Delete post []
Report post