/dpt/ - Daily Programming Thread

What are you working on?
Previous:

Attached: 1525850586746.png (1224x770, 270K)

Other urls found in this thread:

github.com/MattWindsor91/roslyn/blob/master/concepts/docs/csconcepts.md
youtube.com/watch?v=jnbVg6lFRfo&list=RDjnbVg6lFRfo&t=2
youtube.com/watch?v=iqyeq7iC5YY
youtube.com/watch?v=L-wr5HV0FqI
twitter.com/SFWRedditGifs

C#

>C-Shart

Why can't Ctards see the bigger picture? Why is their approach to a problem so mediocre, fragile and un-scallable?

This solution does not seem to count numeric characters, let alone non ascii runes. Does not handle if the file is not accessible, cannot scale histogram if the numbers are too big. Code is not reusable and does not let you choose orientation (vertical or horizontal) of the histogram.


C
See me after class.

Working on an Enigma Emulator in Haskell

Car car = new Car();

CarFactory carFactory = new CarFactory();
Car car = carFactory.makeCar();

>job postings
Or maybe it's because Javafags are more replaceable. Food for thought.

Java 10 is here. Get with the times.

var car = new Car();

var factory = new CarFactory();
var car = factory.makeCar();

>github.com/MattWindsor91/roslyn/blob/master/concepts/docs/csconcepts.md
Haskellers thoughts?
>inb4 muh three-letter words I know shit about

>Java 10 here
>Java 10
>Get with the times
>java 10
>var
AHAHHAHAHAHAHAHAHAH

Attached: nichijou-laughing-out-loud-at-someone-something.gif (500x280, 521K)

Javafags are more replaceable.
Java isn't

Attached: 1525776753265.png (767x747, 121K)

I like how C++ is leaning towards trait based generics (like Rust, of course) with concepts. Too bad STL isn't implemented that way. Same goes for optional type.

I've been programming for 4 years yet I cannot figure out quicksort from memory onto a white board.

What is wrong with me?

Adding search to my latest one-off project, wanted to test out Apache Cassandra and Docker.

I'm the same except I don't get merge sort.

object ProjectEuler {
def main(args: Array[String]): Unit = {
/*
* Project Euler 72:
* How reduced proper fractions are there with denominators less than one million?
*/

var totients: Array[Long] = new Array[Long](999999)
var sum: Long = 0

for (i

Attached: Scala-chan 2.jpg (1200x938, 167K)

*many

I mean, is that normal? Should we feel like retards?

Attached: 0080215dbb7d1.jpg (985x549, 42K)

yes. but bear in mind that everyone has weaknesses

I'm trying to get into a prestigious company, so I guess I just need to keep on going through drills.

I love how doing these programming assignments does not correlate much to how much you're able to contribute to a dev team.

Damn Scala looks awful.

Any advice would be greatly appreciated Jow Forumsentoomen. I have a database of monthly sales data. Currently all data is in one table, columns are sales value, sales volume. Each item therefore has 12 rows per year. Instead I will split the data into 2 tables (volume and value) so each item only has 1 row per table. Columns in new table will be the month eg 201801 for Jan 2018. So 10 years sales data will have 120 columns. Is this an advisable approach to SQL?

It has to accomodate to the jvm.

Car car;

No. The idea is to split up your data as much as possible and combine (join or group) it together with different views. In your example, your sales table should be one-sale-per-row and have < 10 columns. Then group the appropriate data by intervals of 12 months each.

Howdy /dpt/, putting together a git server, running Debian with all graphical and nonessential programs removed. Seems to work pretty well, its a tiny company and I just made accounts on the system for ssh access. It will remain on the local network, but I thought I'd see if any one has any security recommendations. Best practices for ssh access, public keys, local access, etc. Any info on making this thing secure is appreciated as I've never made a system from scratch with security in mind

>systemd
No

>tfw ES6
let car = new Car();

What's the systemd meme all about? Is it just bulky and obtuse?

C# is objectively better than Java.

Java is fucking disgusting and just the sight of it gave me cancer.

Thanks user, that's how the db is structured at the moment. Currently there are 750,000 rows, select query takes around 3 seconds. Would you consider this acceptable?

And you can't replace componenets easily even if you are sysadmin.
Every now and then some RHEL or google slave uncovers a really ugly """accidental""" bug.

No.

Help A brainlet out Jow Forums. I barely understand what I am doing. I just want to string functions together and get results.

from sympy import * # For solving out for the equilibrium price, etc. ,symbolically.
Q = Symbol('Q')

# the function solve() returns a list with one thing inside, but have 2 things if I mess up.
# I need to call this function many times in my program, usually inside other functions
# I dont want it to output a list in any instance
# Which of these is the least retarded solution to my problem
# I have zero low level CS understanding, but I eventually want to add a gui to my program and I dont want it to lagg because my code is garbage


# option 1

def Sol2str(func): # I was going to do this until I realized how bad it would be every time I used it on a function with more than one output: I have to call the function extra times which I am told is bad
def clearer(*args,**kwargs):
return int(func(*args,**kwargs)[0][0]),func(*args,*kwargs)[1]
return clearer

@Sol2str
def fix(j=100-Q):
x = solve(j,Q)
x2 = 101
print(x)
return x,x2

# option 2
def solve_1(j,Q): # I would write this once, But I am confused on how this would work in global vs local scope
x =int(solve(j,Q)[0])
return x

# option 3


x = int(solve(j, Q)[0]) # I would have to write this many many times

We have had this POO fight for like 1000 times now
Shut the fuck up shitlangs

Almost certainly using a DATETIME field makes more sense due to being able to work with dates within SQL (eg for validation, filtering, sorting, better handling of time quirks like DST and leap-things). Maybe there is some compelling reason to store it as a string but i can't imagine why.

I don't understand the rest of your description about splitting tables.

wow thats hard to read.

Lets try a screenshot

Attached: I am so smart.png (1513x702, 54K)

You can have a good looking language while compiling to JVM, that's not an excuse.

>python
Sasuga!

New to programming

I've been trying forever to get python and idle and everything working and I've literally spent the last hour trying to figure out how to change file extensions in windows 10. Holy shit windows 10 is insanely user UNfriendly. Like before you could just edit the file name and everything but they block it in properties and all of that. Fuck man fuck normies you idiots fuck em. They make it more normie and old person proof. I might legit just start programming on my old Ubuntu or something. Everything works right on ten tho fuck

Attached: 1526408973884.jpg (334x334, 15K)

>Graphmain
>GRAPHCUSTOM
>GraphFunc
>scratch_10
lol

dumb frogposter

lol

just use a VM if you don't want to install GNU+Linux desu

t-thanks.

there is literally nothing wrong with this.

std::unique_ptr car = std::make_unique();

A prigramming language that wants to offer lots of features on the jvm has to be makeup over java and you end up with abominations like scala.

How many stars does your github project have, user?

Attached: screen.png (248x40, 3K)

Naw man. I only am using a 250gb drive of SSD man. I need it for final fantasy.

Don't laugh man. I literally had to go to the file explorer and make it so I can see file extensions...like how the fuck are you supposed to know what it even fucking is? Normies are retarded.

Attached: 1526298713761.jpg (249x249, 8K)

Consistency is key in programming, so there's absolutely everything wrong with this.

Linux is legitimately more intuitive for python programming than windows. I'm a winfag but launch up kubuntu for python and web dev shit

That's not Win 10 specific, Win 7 also didn't show file extensions by default, probably Vista neither.

Attached: yoooouuu.png (1024x768, 1.24M)

How can an interpreted language fuck up so badly?

Sure, but I am deleting two of those in the next two hours.

Can you please help me in other ways?

3d renderer completely from scratch
now have camera controls, flat shading and near plane clipping working and also basic model mesh imports

Attached: output.webm (391x359, 379K)

>completely from scratch
No graphics API?

just the javascript 2d canvas api
rasterization and culling are very slow

>kubuntu
If all you're doing is python and webdev, you could probably just use the windows subsystem for linux.

Attached: 1519605898267.jpg (3200x2496, 421K)

>javascript
Nice work though.

Well, the reason I mostly use windows is for c# and a game I enjoy playing thats windows only and sucks on wine.

However, I understand Linux's file system better and I'm much better at working with bash and more familiar with linux applications

yeah I just did it because I was messing around and wanted to get started quickly
I am tempted to rewrite it in c now that I know what I'm doing. it would probably be 100-1000 times faster. it chugs at about 3 fps when rendering the 1000 polygon blender monkey

>3 fps
Jesus. A simple scene like that would run at thousands of FPS with OpenGL or DirectX.

Based
I got my python running on BOTH notepad++ and pycharm.

I'm the fucking MAN! Now what tho lol...I guess I should study how to use command line. I have very very very basic knowledge of Bourne again shell BASH but idek a thing about microsoft shell. Fug maybe I'll buy another hard drive to mess with idk

Attached: 430.jpg (699x485, 69K)

>Now what tho
Learn programming?

>Learn programming
>python

Amazing, hey I'm google, would you like a job?

Don't mind !
Come work for us at Amazon!

sepples has had auto for ages queer

Yes, that's what I said.

Do NOT pick on me..it did take me an hour though to fix my problem about the file extentions tho >.>

Like wtf microdick 10 get ya shit together girl.

Yeah..my sonic adventure 2 mod and knowledge of final fantasy 7 will be amazing trust me. Because I belieeeeevein myself

Attached: 1525410016131.jpg (1427x1421, 146K)

You're right, sorry.

std::auto_ptr car(new Car);

C++ and its consequences have been a disaster for the human race.

>var
javafag bragging about the new var keyword lmao

Attached: 1525987267634.gif (500x281, 231K)

Didn't know you were a consequence of C++

Needs more std::make_shared

There's a program called Grobid, for research article processing, which produces pretty fuckin' good results out of the box, however it outputs this autistic XML format.

To make it run better than it already does, I want to make it easy for people to generate training data for grobid... except the training data is in an autistic XML format.

How the hell should I go about this?
Is there like, a microservice that just spins up an XML editor and I can do REST calls and shit?

idk, y'all... i always thought C# was COOL.

c# is cool
ftfy

I'm finally on my way to being an epic programmer haha based.

What's your programmer drink and music? I got a protein drink and listening to one winged angel Nightcore.

Cheers mate I'm finally one of the boys

Attached: 1522556213669.jpg (548x550, 43K)

i see what you did there
>c# is cool
true
>ftfy
not

The C# programming language was born in 1999 at Microsoft. The original name was COOL for C-like Object-Oriented Language but it was later changed to C# (pronounced C sharp).

but what about J#

Attached: happyyea.jpg (447x548, 61K)

i drink sweet tea and listening to games and anime music.

nes game music in metal
youtube.com/watch?v=jnbVg6lFRfo&list=RDjnbVg6lFRfo&t=2

Attached: anime_music.jpg (960x540, 47K)

Abomination

Also trying searching for "Simple Managed C"

>original name was COOL
didn't know that, but i read Anders Hejlsberg's interview that he said c# was c++++. 4 + sign becomes # sign. what happened to that c# old logo? why did they abandon it? i think it's called andy (from anders' name).

youtube.com/watch?v=iqyeq7iC5YY

>Nes metal music
Based
youtube.com/watch?v=L-wr5HV0FqI

Can I reprogram NES games also?

Attached: 1525387046464.jpg (818x830, 575K)

It was retired. Mascots are not suitable for mature languages

that reminds me something. i just reinstalled pc last friday. haven't installed any emulators yet except DOSBox.

>if you know assembly and nes architecture, maybe

mature? that mascot had not been used since c# was still new.

Is it worth messing up your API design for performance? I have an adjacency list graph where I have to traverse all the edges in each node to get some statistics. At the same time I need to consolidate edges together because the source duplicates edge properties. Cleaning the data before traversing sounds like the cleanest option since it keeps the API more pure, however that adds an extra traversal in there. Doing both at the same time would require adding an extra parameter that may or may not always be required while traversing.

Stop samefagging, weeb manchild

C# wasn't exactly lacking when it was new.
Mascots are retarded and are especially so for a PL that aimed everywhere (and is now everywhere).

Good design leads to efficient code most of the times.

>Doing both at the same time would require adding an extra parameter that may or may not always be required while traversing.
Huh? Why?

The fact that I can't actually think of a good explanation as to when it wouldn't be required means I should probably just go and do it. Thanks.

Is there a good book to read about good modern Java practices and performance tips? The company I will work for in August uses it so I want to get better at it. Also something for JavaScript/Typescript

Attached: 1525903031786.jpg (640x426, 53K)

my memory scanner/editor

Attached: varedit.gif (1366x768, 95K)