/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: Monad (Diagram).png (304x198, 13K)

Other urls found in this thread:

stackoverflow.com/questions/2429511/why-do-people-write-the-usr-bin-env-python-shebang-on-the-first-line-of-a-pyt#2429517.
en.wikipedia.org/wiki/LAPACK
en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms
en.wikipedia.org/wiki/GNU_Scientific_Library
en.wikipedia.org/wiki/Numerical_Recipes
math.ust.hk/~machas/numerical-methods.pdf
pastebin.com/mCze42gp
twitter.com/SFWRedditVideos

...

What does a Common Lisp programmer look like?

A retard

Homeless

obese

this

So, uuh, I was trying to do the clock with numbers that some anons did some threads ago, and I accidentally have done this. I've applied color to each number because looks cooler that way.
This is the relevant code:
for (int angle = 0; angle

took a while to convert to webm

Attached: 2018-08-13 07-52-45.webm (1920x1080, 2.79M)

>Throws a loop together without any logic behind it
>Surprise, surprise, it doesn't work
>Actually completing the challenge would require some thought
>Gives up, posts spazfest result and brainless code like anyone would care

>just got through the first section of How to Design Programs
yes yes YES YES 115 exercises completed.
I'M DOING IT I'M FUCKING DOING IT

Attached: 1477545108610.jpg (653x489, 82K)

sup Jow Forums

So I have a python script that is super useful for stuff I do at the moment, let's call it hello.py. It basically takes in a text file and outputs a text file that is structured differently, and I use this now on a semi-daily basis.

But it's getting boring having to put the text files in the same directory as the script hello.py, so I was wondering if there was a way to make it so that I can just do "hello file.txt" from the terminal instead of having to do invoke the python each time.

no bully. I've spent more than 6 hours thinking and didn't find a solution, user. I need help with algorithms.


At least it looks nice

reposting cause didn't see the thread.

Attached: 1534018659136.png (900x614, 555K)

why are there so many newfags lately
did school just end or something?

probably the opposite, school just starting soon

I'm back from like 2-3 months of 10 hour per say study, couldn't even open Jow Forums :(

You remember me right? The trap that shamelessly camwhores in /bst/. I know you missed me.

Attached: 156165896489.gif (500x250, 995K)

In Java can I create a 256-element array then define certain indices of that array all in the space of a constructor call?

nope

tits or gtfo

The only people who meme about javascript's equality table are scrubs who haven't used it. It's designed that way on purpose to enable metaprogramming by giving types common sense truthy values.

Ok so here's the deal.
I'm a fucking retarded dipshit faggot
What programming language should someone like me use?

If you are using *nix you can use alias. alias hello="python3 /path/to/hello.py". You can make your python script executable using this: stackoverflow.com/questions/2429511/why-do-people-write-the-usr-bin-env-python-shebang-on-the-first-line-of-a-pyt#2429517.

Also make sure ypur script uses os.getcwd() so that the paths always relative to the path you are running the script and not the path where the script is stored.

What's wrong with this Java code?
Each line that attempts to correspond a RoomType with a character produces three different meaningless errors.
The left error is "Syntax error on these tokens, delete these tokens" and the right errors are one asking me to add a ( and the other a ) thinking I'm trying to create a method (adding those doesn't sate it of course).

Attached: Capture.png (526x101, 7K)

en.wikipedia.org/wiki/LAPACK
en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms
en.wikipedia.org/wiki/GNU_Scientific_Library
en.wikipedia.org/wiki/Numerical_Recipes
Which one is the /dpt/ of linear algebra libraries?

Additionally, any recommendation for material on numerical analysis? I mostly do on lectures notes like math.ust.hk/~machas/numerical-methods.pdf

Obviously. Everyone knows that the Scheme programmer is the ubermensch.

/dpt/ is for minimally intelligent codemonkeys

try

/sci/ is undergrad shitposting. Also, whenever applied maths are involved, they chimp out and give the most convoluted, obscure, and undetailed answers.
To /sci/'s mind, "theoretical" and "abstract" mean big brain, "applied" and whatever involving a computer means brainlet.

Just stay out of the pure meth containment thread and start your own thread.

Attached: lispweenie.png (970x793, 40K)

What can I use to debug multithreaded programs? I would like something that makes me "step" through all active threads in one step, and I don't think gdb can do that.

>What are you working on, Jow Forums?
I have been working on finishing Tomb Raider Underworld. I beat that a few hours ago and am now looking for a new game. Besides the game of putting off programming of course.

Basically everything.
1- Dont declare a class named Set. Collides witj java.utils.Set interface.
2- Syntax in variable declaration.
If u want to initialize an array do it in the first line with bracket notation.
> private Whatever[] myWhateverArr = new Whatever[]{firstElement, secondElement};
Also array indexes are integers not fucking chars.
If u need chars as indexes a HashMap should be a better option. Is basically a key-value storage so '#'=RoomType.Void is a pair.

Yeah u fucking retard. Its a fucking constructor call not the declaration of the variables

Whoops, I had private before an already declared variable, turns out that was the issue.
Though now it's telling me that this isn't a valid way to declare a String array and must be followed with { :
private String[] roomNames = new String[256];

What are some big projects written in some dialect of Shell?
The only one I know (and contributed to) is the Alpine Linux package repository, but it's only ~7500 lines of POSIX sh.
Anything bigger?

Trying to write "proper" programs with shell scripts (or any dynamically typed language) is a terrible idea.
Shell scripts are much more suited to just glueing the functionality of different programs together.

So true.

good job user, we are proud, go far!

look into the program arguments

What gui library would be best suited for making a Jow Forums desktop client? Would it be possible to include css customization and other features from userscripts such as 4chanx?

>dependencies not working

Attached: man drinking vitamins.jpg (1920x1453, 119K)

can someone point me in the direction of a less shit way to pull out unique values from a hasmap than this?


//HashMap
ArrayList ownerList = new ArrayList();
for(object plate : this.owners.keySet()){
String owner = this.owners.get(plate);
if(!ownerList.contains(owner))
ownerList.add(owner);

Use a HashSet.

Set ownerSet = new HashSet(this.owners.values());

Is this C# or Java?

Yes.

What would take more time to implement from scratch:
1) A C++ compiler and C++ standard library
2) A C# bytecode compiler and .NET core

please make something simpler than either of these

Thank you

java in this context

When technology is advanced enough, some edgy cunt from this thread will create an evil AI just for fun or "ironically".
We'll all be fucked because some dude wanted to impress his discord friends or this thread.

I won't make either.
I'm simply asking which is less complex/complicated.

>java in this context
You're saying the same code would compile for both C# and Java?

oh
probably C++ then

my question was for a java problem, that's all.

Unless you want good optimizations like gcc or clang. Then c++ for sure. JIT compilers can cheat somewhat by looking at the runtime behavior not just predicting the runtime behavior.

Bumping for more thoughts on this

Attached: 418FP2QPA6L.jpg (336x475, 29K)

What do you guys think of statistical programmers and data science? Do you think that they're honourable, or do you laugh at them?

You can also talk about WIP stuff too. I'd like to hear that stuff too as an employer. Tells me how you plan, think, and you can talk about recent struggles. I suggest you wait until you get a little done. Something you can talk about. Then apply.

More than sure the 2nd option is the more time and effort consuming.. Though instead of C++, start with simple C, its way of variable declaration makes more sent..

As long as they don't call themselves engineers or pretend they are valuable on ways that they are not, I really don't care.

>having dependencies

Attached: plumbloom.gif (600x447, 2.54M)

It was a theoretical question
See

I was under impression that C# was less complex because it didn't have to support backward compatibility with C.
Also C# 5 ECMA standard (without .NET core, which doesn't have an ISO/ECMA standard) is 500 pages, while C++17 is 450 pages for language-only and 1000 pages for standard library and then it includes C standard library by reference which is 500 more pages).
I guess I was mistaken.

To add, I actually have been considering writing a c compiler. It would be simple as fuck. Probably zero optimizations.

Spreadsheet monkey

what languages are useful (for jobs) these days? i have used C# (mainly for windows CE), java/xml (android), html/javascript/angular JS (both for webpages / crossplatform mobile dev with ionic)

Do whatever man. I've worked on a local project in a small company where random patches were mostly acceptable (depending on expertise/reasoning).

If you're the boss, who gives a shit. Don't forget, you can always leave stuff commented out, or full on #if 0 #endif in C. We had to do all the diffing manually too, was tedious.

>debug multithreading
Rewrite or change your algorithm. It's probably not worth debugging unless it's less than like 30 lines.

Honestly if you have those you're pretty much set for most jobs. Maybe add Python

pastebin.com/mCze42gp

Never had a use for RSS or marquee's until this. Looks super sexy on a startpage

Attached: start.webm (1920x948, 1.37M)

i like learning new shit anyway though
python would be good
what about backend server stuff? php/nodejs?
i definitely should go over SQL again at some point although seeing as i havent used it in years but from what i remember its quite basic

react native

Attached: please_eat_my_legumine.png (1416x2004, 678K)

>marquee

Attached: 1491140093831.jpg (132x324, 21K)

#ifndef SOME_MACRO
#define SOME_MACRO
#endif

Attached: consider.jpg (600x600, 29K)

Holy fuck this general is deserted, what happened?

discord. discord happened.

Discord link?

can't. got banned for advertising last time.

>right arm longer than the left
Lisp programmers are Kaiser Wilhelm. Got it.

Attached: Kaiser-Wilhelm-II.jpg (357x530, 49K)

So post it in the IRC channel you witless goober

i have ditched irc for discord a long time ago.

It explains why they need braces

There's an IRC. How did I miss this? Post please

Marquee's are sexy. In fact, webpages with lots of moving parts are sexy. Prove me wrong.

discord is pure cancer and it's retarded and quite the paradox that so many gentoomen there with all the >muh privacy bullshit

THIS RUSTLES MY JIMMIES

>What is VPN?
>What is a container?

This, it really boggles my fucking mind why would any user would want to have anything to do with a closed-source non-anonymous website made for /v/tards. Even fucking reddit is better at this point.
>dude just do all this pointless shit so that you can safely run malware lol
Why don't you just go back.

>what is suicide?

What all discord users should do.

the api is open.
nowhere your real name is required.

An account with a pseudonym is required, that's as bad as reddit.

using freecodecamp and youtube to learn html+css+js so i can get a job as a junior web dev (hopefully) in 2019

anyone have any objections

>inb4 "go away, front end web dev isn't real programming"

oops just realized there's already /wdg/ sorry im a newfriend

>youtube
lmao
dont waste your time watching videos theres plenty of good text tutorials you can find

Anybody who tells you "x is not real programming" is probably a brainlet himself. The average C fuzzbizz gtard wouldn't do a fully featured web app if his life depended on it, don't listen to them.

yeah there are plenty of good text tutorials but i've found that watching videos helps me retain the information faster personally. obviously in combination with writing actual code

i dont understand
you retain information by thinking about how to write the code to fit your purpose and then writing it (repeatedly)
watching a video is just slowing you down

I could if I wanted to you brain damaged child, I just have fucking standards

You're confusing the meaning of real programming from programming. Webdev is indeed programming, but it isn't good programming, nor difficult, and it certainly isn't the traditional (usually POSIX) way of programming, thus it isn't considered real.

Writing code in a PL is not the same as implementing it.
C++ is much more complex than C# but implementing another buggy compiler for it is trivial if you are willing to spend time on all its gotchas.
Writing an IL compiler and .net core implementation is a non-trivial subject. You have to take care of memory management, platform and arch related issues (calling conventions/ABIs/support for instructions like avx which require both cpu and os support), native/managed dependencies, metadata and the final executable format and many other issues.
If you are looking for a .net ecma, search no more: ECMA-335
Don't expect the latest .net core features because it is bleeding edge unlike .net standard.
If you just want to implement an IL compiler(AOT), C# had that since ~2005. Take a look at NGEN and CrossGEN.
It just removes the startup overhead and JIT time.