/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: 1533349323300.jpg (1000x800, 179K)

I shall not support your attempt to sow discord

Discord? In Jow Forums ?
What the FUCK.

What do you think about testing with print statements?

irc or get out

Sometimes it's useful

Quads.
Very good idea, novice programmer just want debug or unit test whole fucking project instead of just critical points.

Excessive unit testing is a sign of poor programming ability

Fuck off.

Having fun with render targets in webGL
pic related is where I'm at

Attached: screen3.png (855x463, 385K)

depends on the language and what you're doing. No matter how good you are, some things just have too many edge-cases. So fuzzy testing is very useful.

What's it like working with people who are able to understand more than just basic Java?

Boy oh boy, I have another great C problem here guys:

tmp = 10;
for (--tmp; tmp >= 0; --tmp)
printf("Tmp: %i\n", tmp);


This does not stop when tmp < 0. WHY?!

uwotm8

hi again fantasy football user, as another user mentioned in the previous thread, having your data in some non-python file is the ideal solution here. a csv file is just a file in this very basic format:
"Antonio Hernandez", 8, 1900
"Evan Ingram", 8, 700

and so on.

BUT, to answer your question, what you want to do is also quite simple. in your main file, you'd just write
from tight_ends_file_name import tes


then you can use the "tes" variable in your giant concatenation of all the lists

and then you get people who've built their whole career doing that shit, slowing every dev team they work in to a crawl and doing damage to codebases that takes years to fully recover from

Nevermind, it was an unsigned.

I'm tilting guys, hold me.

>for (--tmp; tmp >= 0; --tmp)
excuse me

ah yes my favourite part of C, mutable data predecrementation from multiple places

If you use compiler warnings, it should tell you that you are comparing unsigned to >= 0 which is always true.

what are compiler warnings?

finally building my website with a full suite of all the features I've always wanted to build
Gonna include software development tutorials, starting from idea conception and drafting a design document to proper code formatting and comments

good luck user!

When you compile you can set flags so that the compiler can give you extra warnings about things. I like to use
-Wall -Wextra -pedantic

I should probably add them to the makefile...

I'll do it tomorrow mom.

>not using the "goes to" operator
int tmp = 10;
while(tmp --> -1) // tmp goes to -1
printf("Tmp: %d\n", tmp);

Attached: snapchat.png (986x840, 145K)

thanks user!
I'm going to start with Jow Forums's programming challenges for noobs

what about it my dude

I am so sad because i cant get a job or internships. Normies on fb are posting links to some stupid personal pages, and they probably are at least invited to interviews. I have github with a lot of shit ( mostly unfinished desu), but i wont beg for job on facebook, because people from uni would read and they would laugh at me that i am retard that did not build neural nets from scratch but dare to ask for internship. I am 22 years old but i just started uni in 2017. I just want to kill myself

wait until you're 29 with ten years of learning and education unable to get a job in DC while your asshole cousin got his job because he knew a guy in highschool

Or just paranoia.

nice

[1/2]
You'll have to forgive me for not entirely understanding most of your argument. I'm going to pick out a few particular things that don't make sense to me, and maybe you can explain yourself again.

>class is ad hoc
Of course it is, we are at this point trying to make a framework to categorize this guy's data, any solution is by definition ad hoc because there is no grander framework to fit ours into. Your dict is ad hoc. Building a barn to put your cows in is ad hoc.

>a bunch of stuff about information hiding, private vs public visibility
I don't think python has those features, though.

>All you need here is just a record
Ok, but that's all I have! This class doesn't do anything other than organize the information together, which, as you point out later...

>Tuple is good
I contend that what I have here is just a tuple that has named fields and knows how to sort itself. At this point in your two posts, I feel that either I haven't seen or haven't understood the crux of your argument against the class here. It sounds like you believe that if you aren't presently using inheritance or visibility in your class, the class is an over-engineered solution to the problem. Is that accurate? I ask because you do not say explicitly. I have two different answers to that argument, to be posted after this post.

>ordered map, or using a map at all really
Ordering the map means it can serve OP's purpose technically, but this is simply more complicated than using a list of records. I don't understand why we'd have even the remotest desire to use any kind of mapping at all, given that OP's program will never want to look up items by their name, or check for uniqueness, or anything like that. What is so special about the name? Conceptually, there can be two football players with the same name... If we had some kind of player ID, then sure, put it in a map. But I'd still have it be a map from player id to the player object itself.

Same. Not even a call or email back to reject me no matter how many calls I've made. The feeling is similar to being left on read.

It depends on how you do it, most components of a program should be treated like parts of a car, designed and tested before adding it to the project. give a known input set and get an expected output set. when you have a full program running without error but giving erroneous output you can use print testing to search for the bug.

please remember: an error prevents a program from compiling (compilation error) or running (runtime error) a bug means the program is running incorrectly or with unexpected results

Shitty obfuscation to circumvent app store policy aganst private api use.
It's worthy of ban if detected, but shows how basic is the static analysis used by Apple.
I guess it's the most interesting thing out of the snapchat source leak which just happened. I searched the source for some pearls, but overall it's pretty boring.

Is this a shin megami tensei reference?

Attached: IMG_20180807_133439.jpg (770x1024, 92K)

[2/2]
So my two arguments against "class is an overengineered solution" are

1)
As I mentioned, I don't think python has visibility on class fields or methods to begin with, though I might be wrong about that. The other value you seem to think classes have is inheritance, which I think is actually a mark in favour of using classes here because what OP really wants is a base "player" class that will have a name and a score with subclasses for different types of players that can contain the logic for instantiating players of those kinds.

2)
Even if we forget point 1) here and suppose that python has visibility and we are ignoring it (which might be true, i dunno) and suppose that we will never subclass our Player class...

What's the difference? If all I've done is recreate tuple, what's the problem with that? I think having the logic for ordering my tuple, and the tuple's field names, AND the logic for constructing an instance of my tuple (i.e. the point conversions) defined all in the same place is an upside. Now my question for you is, what's the downside?

you mean a jojo reference

I'm pretty sure SMT Strange Journey had some shit like that too

Attached: IMG_20180805_150434.jpg (1242x1531, 437K)

>Coulouris called his program em, or “editor for mortals,” which he had supposedly been inspired to do after Ken Thompson paid a visit to Queen Mary’s, saw the program Coulouris had built, and dismissed it, saying that he had no need to see the state of a file while editing it.

Golang confirmed best language.

It's more of a sign of a poor type system.

>em
>vim
>vi
>emacs
>gedit
>nano
>sublime text

all shit built for retards compared to cat and pipes

What's a good issue tracker for GNU/Linux cli? I want Github-like issues for local repos from cli.

i only use ed

A plain text file

Really? Can't imagine being half as productive in ed

Ken Thompson uses Sam now

it's the standard editor, what else would i use

arr[23.945]
>2018
>still can't subscript with floats
Why hasn't any language solved this problem yet? It would be very useful to have.

>t would be very useful to have.
[X] Doubt

Works in JavaScript

Plain text isn't sexy

Attached: unknown.png (659x236, 16K)

works in javascript, the only important language

what would you even use it for?
The only application is science shit, but i like to think they have their own solutions.

Quantum computers could use it to access arbitrary blocks of memory. E.g.
char qarr[8];
qarr[pi];
would retrieve the value of an sizeof(char)*8 subscripted by pi.

Yeah, it's called a fucking map. If you think this even makes sense you don't know what the fuck an array is. You javashit "array" isn't a real array either, fucktards.

Attached: 1523386635027.png (645x773, 23K)

This is an associative array, though. They probably hash the float and use it as a key.

Wrong. That would make sense, and this is shitscript we are talking about. It probably gets converted to a string or something equally inane.

Associative arrays are maps.

No shit, if you knew how computers worked then you'd know that's the only sensible way to do it.

If you maintain type consistency and avoid sparse arrays, then JS arrays will be JIT compiled to C arrays.

>and avoid sparse arrays
i.e. don't use float keys

There are implementation dependent optimizations, sure. Still ain't an array.

Not actually related, but good try.

Are there code of conducts in Euro projects or is it just a sexually repressed American thing

Arrays are exactly like objects in JS, with the exception of special optimizations paths for dense, sequential, numerical property access.
Do NOT use arrays for setting/getting properties other than those in the 0-2147483647 range inclusive.

>It's worthy of ban if detected
So it's over? It's finally over? Snapchat is dead?

What if you only want to index part way in to the next element in an array? Like if you make an array of my_struct and then take the 22nd element and then index sizeof(my_struct) * 0.945 of the way into the next one. Seems pretty helpful.

stop.

idk i can kind of appreciate it, a data structure that automatically lerps between entries is very interesting

Any other anons gonna get this when it comes out?

Attached: 91waWeUbM4L.jpg (1500x1932, 613K)

I'm interested in it, hopefully you will share your opinion on it once you get a grasp on it

>lerp
>live erotic role play
lewd

>What if you only want to index part way in to the next element in an array?
what does it mean to be partway between two elements of an array of characters or strings or function pointers or...

partway between function pointers is just partway between them in the jmp table
partway between two chars is partway between their ASCII/unicode values

I'll try to post about it after I've gotten around to working through it

take your meds

I plan on getting it.

Lads I have a confession to make.

I can't do tech stuff. I try really really hard and I cry all the time about it. I play with terminal and go through books but learning tech is honestly like a war for me. It's driven me to alcoholism and I drink Everytime I mess with terminal or try to code. I have no clue wtf I am doing and it kills my brain. I'm drunk and crying now but I won't give up ok?

Attached: 1533433504058.png (257x257, 8K)

>Lads
no lads here m8

did you get so drunk you forgot the last time you posted this

You can still do it bro.

Attached: elena-satine-2.jpg (634x909, 118K)

vegan curry is the best food for programmers

*last two times

maybe learn how to do tech stuff sober before trying to do it under the influence

idiot

Hi Jow Forums
I'm really struggling with:

[0, -1, 2, 5, -2, 7]
Pick any non-consecutive elements to find the max.
Eg: 7, 5 in this case. 7, 5, 0 would be equally acceptable. 7, 5, 2 would not because picking 5 disqualifies 2 and -2.

I am not sure really how to approach this.

nevermind I'm retarded. never been able to into dynamic programming. pajeet pretty much confirmed

lisp

idris

>*starts twerking*
Really, which one of you did it, confess.

which one

scheme

I don't understand

this is sort of interesting for interpolation i guess

Ive tried this i keep getting errors. Its not a huge deal as my editor lets me collapse most of the lines. I thought it would be as simple as importing but it never quite works. Ive tried different file types as well as the map function another user suggested

I think it has something to do with me trying to make them instances of a class. Ill keep digging tho im definitely enjoying the learning process

Perhaps formatting the individual players as tuples instead of lists within lists? Im not at my pc but maybe i should replace parentheses with brackets. That makes sense as tuples are immutable

>lads
this is /dpt/ there are only girls here

rust

what would this ever be helpful for?

kate is the best text editor
>cross platform
>built-in console
>easily configurable build/project manager
>extremely customizable because KDE does what KDE do

Attached: 1533524397952.png (1280x719, 818K)

This is the ideal programmer body. You may not like it, but this is what peak performance looks like.

Attached: 1425465873321.jpg (600x600, 24K)

I'm working on an analytics engine for Wikipedia. Things like how many sources have since 404'd. How many words, how many views, that sort of thing. It's all done in Java, mostly because i'm dusting off this old hobby horse project so I can get a job interview at this biotech company since they want code samples.

This is all done in Java and one of the problems i'm having is i'm not sure how I can begin parsing all the Wikipedia articles that currently exist. I could create a crude web spider program but i'm wondering if Wikipedia has an API or has otherwise made it easier for people to parse through their site systematically. For this idea to work I need to be able to access every Wikipedia page that currently exists in no specific order.