/dpt/ - Daily Programming Thread

Old thread: What are you working on Jow Forums?

Attached: rei.png (332x332, 138K)

Other urls found in this thread:

package.elm-lang.org/packages/elm-lang/core/latest/Task
package.elm-lang.org/packages/elm-lang/core/latest/Task#sequence
en.m.wikipedia.org/wiki/JavaScript
github.com/rootcoma/cclife
cs.ukzn.ac.za/~hughm/os/notes/ncurses.html
twitter.com/NSFWRedditImage

What are YOU working on, OP?
also first for haskell

Attached: dpt.jpg (575x69, 14K)

on an emulator for a system that doesnt exist

first for Java
more powerful and faster than Go

Ruby!

Making a hello world tutorial!

Ruby with type annotations!

When's JAI?

It's not gonna make it.

never ever that balding jew's language is most likely doa or never sees the light of day

How to get into data science?

Is there a book like "The C programming language" but for C++?

Attached: 1477938756985.jpg (267x267, 14K)

Get lobotomized.

Bjarne's book

Attached: 1400pagesofsepple.jpg (600x754, 317K)

yes

Attached: sepples.jpg (380x499, 19K)

last shitpost before a shitty online meeting with a bunch of IT fags

Attached: 155467425343254567.jpg (395x397, 27K)

>It's not in the Jow Forumsentooman library

Attached: 1480439467113.jpg (728x518, 208K)

gentooman library contains so much trash books but good books

How do I become a communist?

Attached: 1556378050489.jpg (544x604, 68K)

>tfw nobody wants to hire me in the city I want to move to even though I have experience
Should I move on to a different city or am I just unemployable?

learn Russian

stop eating

Attached: ass.png (1366x768, 859K)

Ignore history.

Burn all food in a pyre to Karl Marx.

Throw out all clothes; replace with jumpsuits.

Throw yourself off a building.

Program in Rust

>What are you working on Jow Forums?

Nothing right now. I need ideas and some motivation.

Not really faster and golang smashes it in memory usage. Java is a mem hog.

This is why we need Haskell

Is it better to sound over confident in a resume or underconfident? I made a resume using some online software that gave recommendations for things to say. I said I am capable of quickly mastering things. I would probably not call myself a master in anything but I don't want to downplay my abilities and say I am just "good" or something instead and then they throw my resume away.

How hard can it be to look at a piece of code in an specific language and being able to translate it yourself into another language.

Depends.

Why do that when you can just tell the computer to do it for you?

Add keyword every on the job application and in the company philosophy to your resume and cover letter. This will maximize your changes of getting past the HR bot.

Literal memes like FALSE and Jazzy probably have better prospects.

Sell all your food to buy a Rust compiler.

tfw professor discovered that I used another person's work partially for an assignment.
I hate myself, I'm so pathetic it almost makes me cry. I live in constant fear that people will discover that I'm actually a huge fraud, and today it happened.

Depends on the language, and the complexity of the code.
Translating advanced haskell, for example, to a C lang would probably be a project.
But an algol child to another algol/c lang would be trivial.

>tfw professor discovered that I used another person's work partially for an assignment.
What do you mean by this exactly? Most of programming is partially using other peoples work to suit your needs but you shouldn't straight up copy someone's code and claim it for your own.

I basically adapted a portion of my classmate's code to do the assignment. This professor makes assignments to deliver in 24 hours, and as I can't deal very well with pressure I got desperate and succumbed.
Now he will proceed to fuck me in the ass, because I'm a huge faggot. I honestly feel ashamed of myself and I don't know how I will be able to suceed in this subject.

is kanban shit?

You sound like you are too hard on yourself user. Software development is hard it takes a long time to learn it. I don't think it was a good idea to use your classmates code but you don't have to give up just because you didn't succeed. I sometimes feel like a hack fraud too but you just have to keep at it someday you may look at yourself and realize you aren't a fraud anymore.

>sticky
>only 40 posts
Jow Forums is dead.

Just make a compiler or os or 3D game engine and you’ll feel like a skilled haxor forever.

>tfw making an OS and still feeling unskilled
The feeling never goes away for some of us

Attached: 545818a3363e50c.jpg (650x406, 42K)

I know this will sound retarded, but to me Godot is increasingly starting to look like an okay option for a cross-platform C++ GUI library.

It's powerful enough to make the Godot IDE in and it's saner than QT.

It's less than one tenth of the bloat you would get from electron, so go for it.

Will r/dpt learn to accept that I’m a dog?

Attached: 7B550B3B-D258-4850-B50A-BB1C0ECC7701.jpg (750x1076, 91K)

Yes but I can't accept that you are gay user. God would not be pleased.

How can I sequence functions of type
T -> Promise (Maybe T)
In Javascript, without resorting to imperative style?

>trying to FP in JS
just use Elm

Best way to practice? I've been doing project euler with python after learning basic python stuff like variable, loops, functions etc. but project euler seems to be more about math than programming. Any other similar things or should I just learn more? I've been trying to practice the basic stuff before I keep studying.

I am working on a really simple program on x86 assembler. It's driving me nuts because for some reason my loops do not work.

Did you try rewriting it in JavaScript? JavaScript loops work pretty well and might be just what you need.

Monad transformers.

>babby FP
sure

Is this a fucking joke?

i mean it literally has what you're looking for
package.elm-lang.org/packages/elm-lang/core/latest/Task
package.elm-lang.org/packages/elm-lang/core/latest/Task#sequence
and it will be 1000x cleaner than any JS abomination.

en.m.wikipedia.org/wiki/JavaScript

No. I already did the thing on java, but that was only a guide to code it on assembler.

I know, it's poorly written but whatever.
public class sub{
public static void main(String[] args){
int x=0;
int y=0;
int res=0;
int which=2;
while (x

looks awful

ever heard of for-loops?

hey i have a question, i am trying to create an array of objects that act independently from each other.
so in my code below:
let arry=[];
let z ={a:10}
for(let a=0;a

Yes, but as far as I know there is no direct translation of a for loop on assembler.
So yeah, there is no point on using them over a while.

there's no while loop either. it's all jumps

A while loop is simpler than a for, though.

Which should make it easier to implement.

A goto is even simpler.

Is LLVM a meme, I want to compile C to wasm but I don't want to use emscripten would much rather use some form of gcc

Show me your Agda implementations of FizzBuzz.

>tfw instead of spending my precious time programming I have to apply for jobs
It takes more effort than writting code.

Runnable apply = (Job j) -> me.sendApplication(j);
Stream.of(jobs).forEach(apply.run());

Attached: When+you+make+a+post+and+there+are+no+replies+_b575d0d83c25cfd178f6b1c353373014.jpg (360x386, 30K)

llvm is not a meme
llvm is good and well made

What do you really need to know to design your own language? Aside from the obvious of writing a compiler for it I mean what about actually designing it?

ncurses is a pain to use. Where can i get good modern documentation for it?

trying to make a box and then fill it with blue and some red at selected places.

Format ur shit it is unreadable. Your code is shit in general. If you can't figure out what's wrong and you wrote it then it would take too long for me to do your work for you.

Just start over and format your code for gots sake.

Attached: 1484064072907.jpg (1024x640, 58K)

What language are you using? Here is an example in C FWIW. github.com/rootcoma/cclife

This tutorial looks pretty decent as far as running through what commands are needed. cs.ukzn.ac.za/~hughm/os/notes/ncurses.html

I would try an find a man page with all of the ncurses functions and then use an example to get started and when you get stuck trying to do something refer to the man pages or google.

Attached: 1498888447344.jpg (600x398, 49K)

general low level stuff about programming like how linking and object files work and whatnot
some level of linguistics
knowledge about the underlying hardware and assembly
how to read and write legal documentation

A clear and thorough purpose and use-case for your language.
What does your language have that others don't, or what does it offer that's better than existing langs?
Granted most first-made langs are probably going to be trashed. But it's good to write a design document of sorts to say what your language is about, what features it has, its purpose, etc. So you don't get lost or feature-creep it to death.

there is like 5 lines in there...
how could you not understand??
let z = {
a: 10
}
for (let a = 0; a

>how to read and write legal documentation
Is that because of licenses or something?

That makes sense. So would it also make sense to think about things you like and don't like about other languages?

Sounds like you want a 2d array and you only have a 1d array of ints.

A background in many other languages will help you know what worked and what doesn’t. You probably also want to have a specific purpose for your language. A general purpose language is pretty useless without a lot of support, at least a niche one might do a particular thing well enough.

Also name your iterator let i=0 for fucks sake like a reasonable human bean.

>So would it also make sense to think about things you like and don't like about other languages?
That's basically how all newer langs are made these days, so yeah. People having gripes with C/C++/Python/JS and want to use something they think is better. Hence Nim, Rust, D, Go, Jai, Elm and the plethora of compile-to-js langs.
Nim is -> Python but for systems
Rust -> C++ but safer
D -> a proper C++
Go -> brainlet C
Jai -> Not C++
Elm -> Haskell for the web

yeah, placing a bunch of a's in there before asking for help is like one of those troll mario levels.

I also didn't understand your question.
>each time i increase the value of a key in one element of the array
Isn't the key a? You have a key => value pair, how are you increasing the valuer of a key?

I read your code twice and the output is exactly what I'd expect. Do you want arry[i] to be an array? If so, make z an array and name your variables something sensible, like row/col for the arrays, and i or j for loop indexes.

My final project is due Thursday night and I don't know what I'm doing I'm a fucking fraud

Attached: 1475638886959.png (220x237, 100K)

>D
Huh that actually looks like a neat language. Is it popular?

What's it about?

Attached: L.jpg (625x415, 47K)

Completely dead and buried. Literally nobody is using it.

It's getting there, but it's on the /VERY/ slow and steady. Has some companies using it, but it lacks people and resources to shill like Rust.
It's great though, look up the free D book.

let arry = [];
let arry2 = [10, 10, 10, 10, 10]
let z = {
a: 10
}
for (let i = 0; i

>/VERY/ slow and steady
It has a single-digit number of users after like 15 years of trying. It's fucking dead, mate.

Do I have to know java before getting into kotlin? I'm a pure rubyist atm

Attached: 1515873921416.jpg (500x600, 60K)

For work, project to bootstrap Debian unstable from just an ansi c compiler in a way that's mostly reproducible.

As it turns out, this is usually a *very* manual process that only happens every time a new architecture is added, because Debian has the policy or requiring all binary packages to be buildable on the same architecture on which they're installed.

>>Is that because of licenses or something?
that + learning to read and write standards docs

Create a new z dict or map or w/e for each array element. You are reusing the same object and modifying a in that. Whereas arry2 has 5 different int "objects" that you are modifying separately.

You could try with z1, z2, z3, z4, z5 or something goofy just to make sure..

Attached: 1491881004368.jpg (500x587, 122K)

Probably wouldn't hurt. I've never touched kotlin, but learning what objects are available and how to compare strings and do other remedial tasks in Java is stepping into a new world of bullshit.

I imagine Kotlin is Java but with some nicer syntax sugar. You will still need to know that you cannot compare strings with == and that Arrays are not dynamic and things of that nature.

making app for android, my foreground service crashes after a few hours. Is there any way to find out why without having phone connected to pc?

Kotlin is quite tame from a Ruby perspective, but you still have to put up with Java's frustrating personality.

Maybe you can find some way to access logcat from the phone. Assuming the apk you have installed is the debug version. I would imagine that would have a stack trace at the end of it.

Maybe you can dump some state information in the onDestroy for your service and see if that fires?

Attached: droidstudio.png (1053x819, 96K)

There is also adb wifi that I saw for android studio. Not sure if that would be a solution for you. You would have to be in wifi range but at least you are not tethered to your computer.