/dpt/ - Daily Programming Thread

Old thread: What are you working on, Sup Forums?

Other urls found in this thread:

clhs.lisp.se/Body/f_car_c.htm
twitter.com/NSFWRedditImage

first for Java is king

first for java

btw best spring tutorial aside from documentation which is not that bad but still a little too verbose ?

Please stop with this stupid programming trap meme.
It's not funny or endearing in any way.

No.

post more 3d traps

>3d traps

Fuck off, degenerate.

Just fixed a problem which has been bugging me for weeks.

Now onto the next big problem which will bug me for weeks.

Fuck off with your stupid forced meme.

Wish me luck lads.

...

python
this is my array
how do I remove purple ones?
I would call it every 3rd item I guess
its one I dont want, 2 I want, 1 out, 2 stay

final array should be without any purples, but will all the others

it feels like it should be trivial
like, enumarate for and checking if its divisable, but by what

then I am thinking, I am going to split that large array in to smaller chunks of 3 items, remove first item from each chnk and then put them together

but that sounds retarded plus spliting I am not sure how,

Try something like this:

list = [1,2,3,4,5,5,5,6]
filtered_list = [elem for elem in list if elem != 5]

Reposting my bullshit from the tail end of the last thread:

Anyone here ever work with a dysfunctional team? I've been on this team for about a month now, ~20 people randing from QA, Escalation, devs and a tech writer.

there is 3-4 senior devs but no one is the "top dog".

The product its self was inherited and is absolute fucking trash in terms of how it was built, talking 20k lines of javascript for the webclient.

everyone seems to agree that shit is wrong but nothing is being done about it, any advice? I don't want to bail (pay/benefits are good) but fuck am I stressed out after a month of this.

How do lisp/scheme macros work?

What's a good way to set up notifications that is not emailing?

I have some bot that is run by a crontab every half an hour, and I'd like to know when the bot posts something or when it encounters an error. However, I don't want to get a million emails. I was thinking to set up WhatsApp but it seems like I need a phone number that doesn't use whatsapp and not sure if they have an official API (and cba to keep maintaining when the unofficial API breaks)

What's something that notifies me everywhere (home, phone, work) I was also considering Slack but not sure, I only ever used it for work

maybe
d[ip_address1] = d.get(ip_address1, 0) + 1
if d[ip_address1] == 1:
print(...)

Hey! Working on a chunk of golang code that reads and writes to a MongoDB server. The DB responses are supposed to have a similar feel to a digraph.

filtered_list = filter(lambda x: x!=5, list)

Stroking my dicc to cute feminine boys

>muh functional pyton
list comprehensions are faster

Nothing as I don't know jack shit about programming.

>list comprehensions are faster
prove it.

Is that book a meme?
I keep seeing it a lot.

Also, where's that girl from?

Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix such that its sum is no larger than k.

Given matrix = [
[1, 0, 1],
[0, -2, 3]
]
k = 2

The answer is 2. Because the sum of rectangle [[0, 1], [-2, 3]] is 2 and 2 is the max number no larger than k (k = 2).

Note:

The rectangle inside the matrix must have an area > 0.
What if the number of rows is much larger than the number of columns?

>do my work for me

python -c 'import timeit; help(timeit)'

Himegoto
Not a meme

you still didn't prove it.

fuck off

cry more n00b

Yes. It sounds like your problem is poor project management and poor design criteria. Both things if not corrected for can easily doom a project in the long term. Weirdly though such projects can still sustain businesses for many years.

Chill out, don't take things too seriously. If your starting to get burned out with it see if you can work on something else (if they're the sort of place to be starting new projects), otherwise start looking around for a new job. It's not worth it being stressed in the long term since you can really fuck up your health.

In my experience unless someone takes the reins and brings about serious order, it's not going to happen by itself.

>girl
I have news for you

Also, I just finished up a twitter bot that posts images from danbooru and writes sporadic shit.

muh functional pyton is faster than list comprehension

cry more

at the end of the day only one of us is right doe ;]

you mean like this?

def remove_every_third_element(l):
return [e for (i, e) in enumerate(l) if i % 3 != 0]

summing of matrixes must have the same dimensions

bump

what about tweets?

That's actually smart and useful. Too bad I don't really use Twitter

39th for fuck Oauth2

just use a library mang

xmpp?

So is the general idea of "yield" in C# just "return here and if this method is called again restart execution after the yield instead of from the beginning"?

I want to learn something useful and new. I know Java and Python. What should I program as a somewhat beginner programmer? I know most data structures and how classes work and things like that.

That sounds like a good idea but what are some relatively popular modern cross-platform clients that use XMPP?

Pidgin for example
there's a lot of them

Im building my own duplicate image finder. I know these exist already but fuck that, its a fun challenge and fun researching about measuring color distance etc

>color distance
>not using convolutional neural networks and natural language processing to describe images and measure the similarity between descriptions
>not at least using machine learning to train a classifier on similar images and output confidence levels
>color distance

FizzBuzz

Its supposed to find images that are exactly the same, but maybe of higher/lower resolution or quality as well, therefore I can't just compare pixels for exact color matching.

How do I make this not go into double nested code?

if items:
for item in items:

u cant

Fuck your weaboo shit

Kill yourself weabfag

Macros take an AST and transform it into another (hopefully valid) AST. Basic lisp macro systems have it so that you explicitly provide a function that takes an AST (in the form of nested lists, as if you quoted an sexp) and returns an AST. This can cause issues with variable name collisions so typically lisps with this form of macro provide "gensym" or something like it, which generates symbols with unique names.

Scheme macros are a kind of "hygienic macro", which means it automatically does the name substitutions and shit for you, guessing from context where a name actually refers to. Scheme macros also have some pattern matching you can do in your macro, you don't just give a function that transforms ASTs. Scheme macros are harder to explain that ordinary AST transformers to maybe you should look it up.

So basically macros have some sort of code associated with them that will change the input syntax into the result syntax. If it's a compiler, it will need access to an interpreter at compile-time so it can expand macros.

(((pure coincidence)))

Bake yourself a nice cake weab-tan :3

Fuck off with your shit tier facebook faggotry

how come no one talks about swift or objective-c here?

Because both are shit.

> swift

there's a reason it's only two characters away from shit

This is Sup Forums it's going to be mostly Linux / windows developers

>inspect element
Go troll >>Sup Forums

>inspect element
>in a mobile app
Jesus Christ you're autistic

Yeah, because he can tell which medium your parents bought you you're using.

God damnit you're one autistic fuck. I bet your parents wish you were a blowjob instead.

I want to be as great as you fags at programming. How do I git gud?

Program.

Help please!!! I feel myself stagnating. Not learning anything. I want to work. I want to learn. I want to get good.

>phoneposter insulting anyone
you're a huge faggot

getting a job

Install git
echo -e '#!/bin/sh\necho git gud' > bin/git-gud && chmod +x bin/git-gud
git gud

Do you think you could train an LSTM to determine how shit a thread is?

Probably could be calculated just by weighing the number of insults in the thread. Typically the more times "Faggot, autistic, and fuck" appear in a dpt the more likely it is to be a cesspool until the next one starts.

Yeah just search for how many times the word Haskell is mentioned.

How do I resolve this?

Error:(14, 23) java: incompatible types: java.lang.String cannot be converted to java.net.URL

public static void main(String[] args) {
Scanner input = new Scanner(System.in);
URL archive = new URL("");
System.out.println("What board would you like to search?");
String query = input.next();
if (query.equals("pol")) {
archive = "archive.4plebs.org";
}
System.out.println(archive);
}
}

Also is there a better way to do this than to make if statements like this:

if(board.equals(a)||board.equals(b)||...||...||...

...

clhs.lisp.se/Body/f_car_c.htm

lol

Fuck off this programming fag meme

kys

You're trying to assign a String object to a URL object. Read the java.net.URL documentation to resolve this issue.

>Also is there a better way to do this than to make if statements like this:
Using a lookup table.

public static void main(String[] args) {
Scanner input = new Scanner(System.in);
URL archive; //

That sure showed him!

Wait a minute lads!!! I GOT IT!!

public class Main {

public static void main(String[] args) throws MalformedURLException {
Scanner input = new Scanner(System.in);
String url = null;
System.out.println("What board would you like to search?");
String query = input.next();
if (query.equals("pol")) {
url = "archive.4plebs.org";
}
URL archive = new URL(url);
System.out.println(archive);
}

Hash table? Dictionary? Anyway to make the code less cluttered? I'm assuming making the hash table a .txt file and creating it by reading in the .txt?
I did something similar.

>I did something similar.
there's no need to create a new string, but whatever

God, programming book covers are utter shit.

That doesn't work. You can't create a variable in an if statement, because the variable doesn't exist UNLESS the if statements conditions are met. I tried your version and it was wrong.

Error:(16, 28) java: cannot find symbol
symbol: variable archive
location: class com.company.Main

...

You mean

[x | x

> (You)
>That doesn't work. You can't create a variable in an if statement, because the variable doesn't exist UNLESS the if statements conditions are met. I tried your version and it was wrong.
just initialize archive then

URL archive = null; //

What's wrong with a silver fern? At least, I think that is what it is.
There isn't really much related to programming that you could put on a book cover, so people just put random shit.

>javascript
>programming

what is this? memeskel?

That is exactly what I did at first when it gave me my error..

top meme my man! keep it up

You mean Haskell? Yes

[x | x

explain the code you posted

can't undersartand shit

u cunt

for item in items or []:

Loop trough xs and take all x which has modulo (remainder of the division) 0.

It's high school maths, you.

It's just a list of numbers that were in the list xs that aren't a multiple of 3.

filter ((0/=) . (flip mod 3))