/dpt/ - Daily Programming Thread

Old thread: What are you working on Sup Forums?

Other urls found in this thread:

docs.oracle.com/javase/tutorial/java/data/numberformat.html
twitter.com/NSFWRedditVideo

Too early but at least it's anime edition

second for racket

...

stupid comic whoever wrote it was a cunt

Lol what a coincidence, I merged 2 datasets and they came out exactly at 250 items, I thought that there must have been something capping it at such a nice number.

golang is gonna be the only language in the future, and there's nothing you can do to stop it.

What color of striped socks improves your programming skills the most?

How do I set an arrays initial value to start at 20 in Java?

I mean, I could commit suicide to never see the day that came true

>implying all python shitcode is just gonna disappear

One on one leg one on the other leg

is there a penis under those skirts

Are there humans without penises?

Yes, there are. They're called a eunuch

Yes. They are called white males.

why is this not working?

the answer I was given was that there is no method displayBalance visible but I don't really know what he means by that

>image
I chuckled.

Name me stocks I should feed to my neural network as training data.

What's your programming environment?

Mine is generally just vim. I've been looking for a good font though.

>python doesn't have native boolean indexing

Question generation from a self-managing inference bank, as part of a Strong General AI.
You?

uhhh making fizzbuzz in javascript

It couldn't find its own?
How... old fashioned?

Oh.
I... see.
Toys.
Nice.

I see there's a method called "displayTransaction".

Does the method "displayBalance" exist in "Account"?

>TO DO: displayBalance

There is no displayBalance method, odds are you actually have to make it

>Strong General AI

aww fuck, you are correct yeah I didn't make one.

whoever made the OP: put the SICP cover on the monitor and make the mug the original cat mug

Much like the DJ/Producer of yesteryear, programming, aka "making apps" has become the latest must-have personality accessory.

How's that class going /dpt/?

how do I even go about doing that? I'm guessing he wants me to copy something similar to the displayTransaction one but I don't even know what half of these symbols and percentages do

I'm just messing around with Torch.

I could scrape some indice and download all .csv's with a shell script or something, but I'm being lazy right now

>passed phone interview

happy patty flipping my friendo

>javascript

>using the jewscript botnet
Learn two haskell brah

go back 2 matlab

Operating Systems is lame as fuck

but i came from R...

>I don't even know what half of these symbols and percentages do
I don't even familiar with Java but here have a read
docs.oracle.com/javase/tutorial/java/data/numberformat.html

>how do I even go about doing that?
How about printing out the current balance of the account

Has there been a PEP about it?
Write one.

The Moors weren't black...

(x for x in y if f(y))

I love the Eva OPs

>Moors weren't black
nigga

meant
(x for x in y if f(x))

they weren't you uneducated ape

%s
Is a string format.

\n
Is a new line.

%4.2f
It's formatting a float number to a specific way.

.format is basically telling it the indicated format then what's it supposed to show after the comma.

so you'd need to instance the balance class where the account number matches then retrieve the balance for that account.

i meant proper support for somethinglike
list1[list1 < 1], not a hacked-together list comprehension

>passed phone interview
>next stage is doing fizzbuzz in person

either you didn't make a method called displayBalance in the Account class

or its not visible where you are calling it, perhaps it is a private method?

I mean, the group we call the moors today is black yeah, but back then it was the muslims inhabiting the Iberian peninsula, which would have been a shade of bedouin brown since arabic conquerors are literally what they were.

What would be the effect of that statement?

It's just syntax suger.
[i for i in list1 if i < 1]

Should use Ada, the syntax is kind of similar to Python.

it's equivalent to:
indices = list1 < 1
subset = list[indices]


I know that. But for a language that supposedly prides itself on readability and simplicity, the lack of that syntactic sugar and the reliance on unnecessarily complicated list comprehensions for the same behavior in daily use is surprising.

And the typing is completely different.

But it does that the guy needs

I like Fira mono

I guess that makes sense but you could just use filter.

l1 = [-5, 2, 0, -3, 10, -23, 15, -7]
l2 = filter(lambda n: n < 1, l1)

List comprehensions are basically set-builder notation.

hmm I thought I added a picture

Is there a tool that allows to slowly play assembly code and see registers in linux? better if emulates arm.

thankyou thankyou IM SO CLOSE FUCK IVE BEEN DOING THIS FOR 6 HOURS NOW

WHATS THE SYMBOL FOR A DOUBLE EVEN GOOGLE WONT TELL ME

gdb binary
tui
stepi

I suppose I'm just used to list comprehension form that I don't see them as complicated.

I remember something like that when I was first studing microcontrollers, but was for windows.

>it's equivalent to:
That's not valid python.
I'm assuming that's valid in numpy.

Austin, post negresses.

Unless you want to give your double a specific format, you can use %s to convert it to a string.

Otherwise is the same as a float. if it's a balance i guess you'd want 2 decimals so "%.2f" would do.

I got no answers on stack overflow, but I really need help with this. I'd really appreciate some help with this.

Screens hots of my explication of the problem 1/2

It's R, user. Not everything that uses brackets is Python.

The reason why I want to do it is because I can then do things like filter on one list and apply it to another list of the same length.
for example:
list1[list2

bleh i missed a closing paren on the for header

2/2

Does anyone have any tips for refactoring old / absolutely insane code bases?

I've inherited a complete mess and a rewrite isn't on the table yet. Thick-client ASP.NET website with majority of the code in jquery/js, string manipulation to get HTML made. 3-4 40,000 line js files, and some shoe horned in angular where the last developer tried to "improve things".

Its not looking good (its really hard to maintain - moving the order of where a checkbox is instantiated (yes, its done in JS) causes the entire page to fuck up and not render properly.

Should I just quit and/or kill my self or is there some reasonable way to go about attacking this?

This might be a borderline retarded question to ask but how do you tell the level of a node by it's index in a binary heap?

I know the answer is probably simple but my brain just isn't working with me on this one.

Walk up the heap until you're at the root node and count the number of steps along the way?

what is the error?

also show that board object

if you want a gui you may like "visual", exists in ubuntu. Also in AUR if you use archlinux

>asp.net
>make everything in JS anyway

but why.

Thank you, it's finally fucking done. And just like that my module is finished

thank fuck

I know user, I know. This thing started 6 years ago by C++ devs as a hobby project that got shoved into production. majority of the internal libraries are abandoned as well, but stuck with them.

Someone, please try to defend dynamic typing

I hope your lack of knowledge required for classes will bite you in the ass sooner than later. I wish retards that helped you could tell the difference between guidance and spoonfeeding.

Actually, after playing with it some more I think I've come up with something that works and I'm satisfied with

for eachBase in seq1:
oldPosition = [y for x,y in zip(dnaForward,[0,1,2,3]) if x is eachBase][0]
seqNew = seqNew + dnaReverse[oldPosition]


I do still wish I could index with booleans without a third party package but this is ok too.

if you're not a shitty programmer it shouldn't matter whether typing is strict or not because you actually remember what types things are

I was spoon feeding my wife during the starting of the semester but quickly found out how much that was fucking her over. Had to throw her in the deep end and not help her at all the last month or so. She is a much better programmer because of it.

No. A good programmer know how to separate what a computer must do and what a human must do.

Is var pseudo dynamic typing?

I switched from Vim to Visual Studio Code. Fira Code with ligatures, Mensch or good old Consolas.

No. It's type inference.

I would say so, same with "any" in TypeScript. You can abuse the shit out of it.

I'll do these in a bit when I can

Hey, I'm a bit confused...

Why is it that in PHP, I can do something like

switch($i){
case ($i == "hello"):
//stuff
break;
default:
}


but not in C/C++? Cases are much nicer to work with than if-else.

Is there a way around this, to use logical operators in each switch case?
I also tried switch(true)
but I still get the error:
error: the value of I is not usable in a constant expression


Fuck, sorry. I forgot a slash...

Bullshit.


I want in.

isn't it like this?
switch(variabe){
case "hello":
//stuff
break;
}

What anime is it btw?

this was meant for you, heh I got dubs XD