/wm/dpt/ - Well-Mannered Daily Programming Thread

It's like /dpt/ but polite. Give it a try.

Attached: wmdpt.jpg (542x537, 67K)

Other urls found in this thread:

twitter.com/espnW/status/1084520878803697664
lihaoyi.com/post/slides/Metascala-a-Tiny-DIY-JVM.pdf
stackoverflow.com/questions/7767431/java-quick-array-list
freelancer.co.uk/jobs/c-sharp-programming/
twitter.com/NSFWRedditGif

go to reddit

So is anyone working on something interesting?

Attached: 1546984302401.jpg (401x500, 32K)

what's the point of this
/dpt/ is never rude

lololol

I'm learning Python, and can't seem to learn when you use a "for structure" vs. a "while structure".

Like in my current project I need to do something for a while, and I'm stumped.

I hope vanilla gets it up the butt in volume 4

Attached: __vanilla_nekopara_drawn_by_sayori__cc10a171ce73c6dd935a538af1f13f6c.jpg (1920x1200, 1.01M)

Niggers

my nigga

also those panties are killing me

Allow me to demonstrate:

>>link to nowhere (this could be the last dpt or literally anywhere else)
You are wrong, brainlet. [stuff you like] will always be subhuman garbage.

shut up you NIGGER

or those juicy thighs

twitter.com/espnW/status/1084520878803697664

In general, use for if you know how many times or in what increments it loops, and while if you don't know when the loop will end or how it will progress.
There are exceptions, of course. For instance, running some for loop over a fixed amount of data, but using a check and break to end it early as if it were a while loop.

get out

Imagine them wrapped around your head. 2d can't do that.

3dpd get off my board

"while" should be able to do everything "for" can do. "for" has more built-in structure, which is convenient sometimes.

My wife is so cute.

your wife showed me her panties

len(['a', 'b'])

need help with a python question:

>Write a program that takes two lists and displays the number of items they have in common. ex: ["a","b","c"] ["a", d", "b", "b", "b"] would print 2 as the lists share "a" and "b" in common

I can't find any examples online that print out the number of what they have in common instead of just what actually is in common

Should I take time to learn a different more modern language or use the fact that im already a novice at C and just learn shit using C like algorithms, data structures , and more about how to program?

len(set(a).intersection(set(b)))

Link to example?

While is the easy way, here's another that breaks apart the individual steps:
list1 = ["a","b","c"]
list2 = ["a", "d", "b", "b", "b"]
inlist1 = set()
for i in list1:
inlist1.add(i)
count = 0
for i in list2:
if i in inlist1:
count += 1
inlist1.remove(i)
print(count)

hey. Cool solution user!~

It's good to know C but it is not a convenient language to write stuff unless you need the performance so I would learn something else, unless you really love C. If C were a great beginner language then people would teach beginners in C.

Thank you anons. What would you suggest for a student whose class hasn't gotten to sets yet?

The only other language I was considering/am interested and in that I have a lot of resources for is lua

I was planning to go through algorithms in C by sedgewick and lions book on Unix analysis. Or I can just start beginning lua.

I don't know.

Are you looking for an explanation of why/how they're useful?

No, what could be used in place of sets. We haven't been taught that yet so I wouldn't be allowed to use it now.

Conceptually, a set is a dictionary with keys but no values, or in which all values are True. You can use sets to tell if an element is in the set or not. If you understand dictionaries then you understand sets already.

You could just use a list in this case, but only if you first remove any duplicates within each list before processing them.
Sets are faster for lookups and only have one slot per unique item (skipping the in-depth explanation), but for small amounts of data lists should work fine.

If you're doing okay with C then you could continue with it. Many people have learned using C. I started with C. If you plan to get deep into programming then you will eventually delve into more languages. Python is a common beginner language today but it is also commonly used for lots of real work where people want to minimize the time they spend coding. I would consider it an option.

Got it, thanks a ton you guys!

So you're saying I'll be unemployable? How hard is it to transfer from C to something like Go?

I don't know much about Lua but if you have a good book for it then it could be an option.

What I meant is that exploring an extra language here or there tends to come with the territory.
Go is very similar to C.

Think of it this way, c is in many ways the archetype of many of the languages that came after it. It will ease you into c++ and make switching then to pick up higher level languages, like go an python, extremely easy. I've not used go but personally I feel I would have had more trouble becoming a better programmer if I had learned through python

Learning algorithms and data structures is much more important than learning any particular language.

What if I'm too dumb for C

>What if I'm too dumb for C
This is why people created other languages.

So you're saying I should give up?

No. Rather, if you find C hard to use then you're in good company. Is there a reason why you need to use C in particular?

No real reason other than having a bunch of interesting books on it

Attached: cat eye.jpg (650x520, 63K)

That's a very pretty eye

I see.

Dude... fine I'll give up on C

i dont know if anyone would care, but im coding a private server for a popular gaym, since i dont have any other ideas for what to code

What will you learn?

Lua or nothing I guess . Maybe I'm just not a programmer

OK, learn Lua. But know this as well: programming is hard for everybody!

Does it have spatulas?

Attached: spatula city.gif (500x267, 1.07M)

why are you making him learn lua

He says he's only interested in C or Lua.

I'm a writer interested in learning programming. Are there any specific programming languages I should learn for that purpose since I don't have a goal of being a programmer or software engineer?

I have tex knowledge so maybe something that interfaces with that?

Python is honestly the easiest programming language for starter, if your not serious about programming Python does a lot of the detailed stuff for you

+1 for starting with Python

If you google 'python tex', you'll see there are a bunch of libraries for integrating Python with TeX -- in both directions!

What language(s) do well-mannered programmers use?

Attached: parrot.jpg (352x233, 9K)

The one best suited to the task.

Unfortunately, that's against company policy.

There was this quote a while ago I saw. I don't remember exactly how it goes, but maybe one of you people can help me. It went a little like this:
"The verbosity of with the of "

I'm writing slides explaining an assignment to an intro to CS class. Marginally more exciting than doing nothing I guess.

Please don't start a language war in this thread

Okay.

Attached: smile at cats.jpg (850x1028, 145K)

I searched and found this.
lihaoyi.com/post/slides/Metascala-a-Tiny-DIY-JVM.pdf
>The Verbosity of Java with the Safety of C

Azuki's also a good choice for anal, her volume 2 H scene is already the most raunchy one so far.
As long as she fucking remembers to take a leak first for the love of fuck and their bedding

Attached: __azuki_nekopara_drawn_by_sayori__c12d8529c6626071d53c9c01e4ee162b.png (1580x1020, 1.64M)

Sorry to ask about Java here but i don't know where else:
ArrayList array1 = new ArrayList();

array1.add(new object(1); //1 is the parameter for the constructor
array1.add(new object(2);
array1.add(new object(3);
array1.add(new object(4);

array1.get(0).setValue(123456);
array1.get(1).setValue(123456);
array1.get(2).setValue(123456);
array1.get(3).setValue(123456);


Is there a way to do this more effectively?
I mean to modify multiple objects in the same line using setValue
What im asking is for the syntaxis to call multiple objects inside an arraylist if it exists

for

use a for loop

ty for answering but the objects inside the arraylist i need to modify are not suitable for a loop, i need to set each value by hand and i just wanted to know if there is a way to call objects in the same line, it's kind of a meaningless question but i wanted to know if it's possible

thanks

>Sorry to ask about Java
It's fine.

Attached: okay.png (480x480, 265K)

write a data table with all your values, then use a for loop to put them from the data table into the object

What do I do if I only know useless languages

From
stackoverflow.com/questions/7767431/java-quick-array-list
it appears you can do this:
ArrayList s = new ArrayList();
Collections.addAll(s, "a1", "str", "mystr");

what language is that?

You could use them to help you understand useful languages but then they wouldn't be useless. Is it worth the risk?

Wow, how did you come to learn that?

What would you like to accomplish?

Make livable money ie $30k at least
Only language I could tolerate

>J
>Only language I could tolerate
What qualities made it tolerable? What were your other options?

I didn't like python, c, java, and something about lisp wasn't clicking. Lua was ok not sure why I just sorta stopped. So I turned to arraye

Did you use it for something at the time?

That's the quote I wanted! Thanks man!

Attached: [2hu] futo-spin.gif (540x425, 86K)

>money
Java
C++
unfortunately that's where the money is.

Then you're too dumb for programming.

use a for loop newfriend.

I'm learning python and my overall goal is to make a tracker upload every time I finish an anime series or find hentai for me >:)

Attached: 1536804046799.png (1059x600, 418K)

please keep all rude posts in /dpt/

Keep learning C until you are intermediate, beyond beginner.

If you have a list of complaints, best-try solutions and a cookbook of common tasks, all that goes out the window in a new language. You will be a stupid know-nothing beginner again, but a beginner with experience... (hopefully)

Your work and study notes will be different in the new language and may or may not have much in common.

Then you aren't trying hard enough. It CAN be hard but you have to try harder, possibly with better teaching.

This may or may not help, probably not... freelancer.co.uk/jobs/c-sharp-programming/

There's this guy on Jow Forumsprogrammingchallenges who uses J all the time, that guy is annoying and belongs on Reddit.

Attached: 332dbfd3-6c68-43b7-98da-9e8b55d68b84..jpg (480x640, 101K)

One more bump before I go to sleep.

Attached: 1547057211529.png (418x433, 343K)