/dpt/ - Daily Programming Thread

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

Attached: 76691324_p0.png (1358x1359, 1.06M)

Other urls found in this thread:

lmgtfy.com/?q=systemd&iie=1
nim-lang.org/faq.html
twitter.com/AnonBabble

First for Haskell!

>work as a C++ programmer
>they keep giving me jobs where I have to write SQL and Powershell scripts

Attached: 1566748120253.png (551x491, 261K)

First for Nim is best language

This doesn't look like a good design. I wonder how I can make this combo box text scrollable. Plus I need to find a way to put default values into them as well.

Attached: Screenshot from 2019-09-16 19-35-11.png (3840x2160, 611K)

sasuga hasklel

this took me almost 8 hours

Attached: Screenshot from 2019-09-16 18-14-37.png (1366x768, 566K)

Is there a better way to make my output consistent? My prof said it was good of me to actually add this when no one else did.

if (hour < 12 && minute/10 == 0){
printf("The equivalent 12 hour time is %d:", hour==0?12:hour);
printf("0%d AM", minute);
}

else if (hour < 12){
printf("The equivalent 12 hour time is %d:%d AM", hour==0?12:hour, minute);
}

else if (hour > 12 && minute/10 == 0){
printf("The equivalent 12 hour time is %d:", hour==12?12:(hour - 12));
printf("0%d PM", minute);
}

else{
printf("The equivalent 12 hour time is %d:%d PM", hour==12?12:(hour - 12), minute);
}

answer plz

Any of y'all use elastic search?

The C standard library has the function strftime specifically for formatting dates, but I guess they don't want you using random shit they didn't really teach you about for basic assignments.

Anyway, for what you're doing:
printf("The equivalent 12 hour time is %d:%02d %s\n", hour % 12, minute, hour < 12 ? "AM" : "PM");

what do you expect?
>does performance matter?
>no
python
>yes
c/c++
that covers all grounds

Php or python for back end?

Did they at all specify the fact you’d need knowledge in those fields? Seems silly for a job to randomly give you that if you’re titled as a C++ programmer

Please consider the printf manual page on flags and field width.
const char *half = hour < 12 ? "AM" : "PM";
printf("The equivalent 12 hour time is %d:%02d %s\n", hour?(hour>12?hour-12:hour):12, minute, half);

Actually, I realised I wasn't handling 12:00 AM and 12:00 PM properly:
printf("The equivalent 12 hour time is %d:%02d %s\n", (hour + 11) % 12 + 1, minute, hour < 12 ? "AM" : "PM");

since i started yesterday

does #Include means that the include says wich part of the DLL the whole programm is going to use as a navigation help? or did i understood it wronge?

Take your pills

very helpful, now fuck off

it means include standard input output header iirc

>studio
Heh. It's stdio, short for Std I/O, short for Standard Input / Output.
No, #include statements have no effect on how your program links and what libraries are used. You always get the whole C standard library, and the C standard library contains many headers.

nice trips. That's amazingly compact, thanks. What I don't get though is why this outputs :00, :01, :02, etc whereas without the special cases in my original code it would only output :0, :1, :2, etc

oh wait, the %02d right? I tried doing %2d originally but it wasnt doing what i wanted. crazy that %02d and %2d behave differently

are you having a stroke man? are you asking if the entire header file is included? its substituted where you write stdio.h

Yeah, the 0 is actually a separate "flag" in the printf format, and isn't considered to be part of the '2'.
You can see that better by doing something like printf("%0+3d\n", 10); // +01

>Heh.
Cringe

>10
1 I meant.

made a script for dumping mangarock's manga in python (i wish i had the time to code it in C/C++ with threading, it's closing soon)

Attached: 1549896432898.jpg (1157x1636, 168K)

Common Lisp is the most based programming language.

ok thanks, i will probalby learn all that later, just was on my mind right now, thank you.

also fuck microsoft for wanting scanf to be scanf_s

like i say i started yesterday, so i dont know what "header files" means, but i will learn,

thanks, thats something to look into. I tried modifying the input and i found it a bit odd that it outputs
+00
+01
+10
+100
+1000
+10000
I guess i didnt have as good a grasp of printf as i thought.

It's a surprisingly powerful function with a lot of different niche options.

a header file is just the declarations of functions but not their actual code
the entire file is just inserted wherever the #include is
this allows you to link against that stuff exists in another file or that's already been compiled as a static or dynamic library

Is there no one here who does anything besides trivial CLI stuff or non trivial low level OS stuff

I'm thinking about trying out one of those languages for faggots, like Rust, Nim, Julia, etc. Mainly because I am extremely bored and have nothing else to do. Help...

>non trivial low level OS stuff
Who's doing that here?

Attached: 1568171441562.jpg (585x552, 89K)

me

why do people assume that CLI stuff is trivial and that anything not CLI is non-trivial
opengl is very easy and there are tons of libraries to make and manage the state GUI applications
it's just that all of them suck major ass, writing the code to interact with them destroys your soul

Some anime poster

>why do people assume that CLI stuff is trivial and that anything not CLI is non-trivial
because it's true

I have to make the installer of some kiosk software that I helped write that also runs on windows
The job position was C++ dev but in my contract I'm just a software dev

god damn it, I'm done
No more looking at other people's code for inspiration/ideas/whatever other excuse
it only makes me not want to do anything because I don't understand their solution and then get scared to do my own version
from now on I come up with everything alone, using only available documentation

Attached: Sp46GSE.jpg (445x488, 47K)

>systemd is trivial

get good, why reinvent what you can steal

what the fuck is systemd

lmgtfy.com/?q=systemd&iie=1

Attached: 1519264861280.png (645x729, 62K)

SerenityOS wasn't an anime poster as far as I remember, and I don't think has posted about it jere in quite a while.
Unless you're referring to me, who's working on the Wayland compositor. That's strictly userspace, and doesn't count as OS-level development by my definition.

Excluding shit like web browsers, most GUIs are just shitty frontends to some CLI tool/library or are performing rather basic tasks.

Real code is complicated. It takes everyone not already not familiar with it ages to truly understand it.

Attached: 1567379989546.jpg (800x600, 49K)

techincally there's nothing about the interface that specifies how complex a program is but practically if you're writing a CLI application it's probably going to be basic shit
Incidentally I haven't seen you post in a while mr wayland compostor

It's not.
Graphics do not make a trivial program non-trivial and a lack of them does not make a non-trivial program trivial.
If I wrote a manually vectorized xml parser with minimized branching and a CLI utility based on that parser that converted xml to json, would that be trivial?
Likewise, if I wrote a simple image viewer for bitmaps, would that be non-trivial?

>If I wrote a manually vectorized xml parser with minimized branching and a CLI utility based on that parser that converted xml to json, would that be trivial?
yes

dumb yuno poster

Git gud, if you ever come up with a solution for something it'll be 80% similar to what the other guy did anyways.

Based Nimbro

>poop os

>Incidentally I haven't seen you post in a while mr wayland compostor
I haven't done anything in quite a while, but recently started working on it again.

>What are you working on, Jow Forums?
I've been working on reworking our removing our software cursor support for users, and reworking our hardware cursor interface to be simpler. It's was really getting in the way of other things I wanted to implement.
I recently got it working again on our DRM backend.

It's an extremely unimpressive demo, and it's something we've already had support for for years. The white box represents the real size of the hardware cursor.
Yes, it's a photo of a monitor. You can't take screenshots of things like this, unless the hardware has special support, which most doesn't.

Rude.

Attached: output.jpg (1000x750, 80K)

>for faggots
>Nim
Youre wrong

hahaha made me laugh
nothing wrong with pop os, user, Accept from their decision to change window snapping shortcuts and disabling hot corners.

Vanilla GNOME + close/max/min button on headerbar is the best desktop experience imo.

Lisp is the most powerful programming language.

Nim is an awkward language without a purpose or design philosophy
Looking at their ridiculous OOP substitute really makes you question the developers intelligence

I remember there was a good reason that I stopped using it after a few hours, but I forget what that reason is.

>Nim is an awkward language
Nice opinion
>without a purpose or design philosophy
Objectively false
>Looking at their ridiculous OOP substitute really makes you question the developers intelligence
If you dont like it, you can make your own, brainlet

>but I forget instead of I forgot
Just out of curiosity is it an Aussie thing? or just American/Aussie thing in general?

Haskell is for lesbians uwu

What's the purpose of Nim then exactly? I could make better language but that doesn't mean I'm going to

I'm a burger

Ok.Is that idiomatic burger?

"I forget" is present tense, it is gramatically correct

>What's the purpose of Nim then exactly?
nim-lang.org/faq.html
>I could make better language but that doesn't mean I'm going to
I didn't tell you to make another language. You can use metaprogramming in Nim to create your own OOP implementation.

I have forgotten is more correct, I'm not even white.

You're wrong. Stop trying to derail the thread, nigger

I don't need to do that when I have Common Lisp.

I'm glad I could answer your questions, sir. Have a nice day.

>You can use metaprogramming in Nim to create your own OOP implementation.
same shit
linking me to the Nim fact doesn't change the fact that's it's a fucking language without a purpose, as evidenced by the fact that nobody uses it

whitebois on suicide watch

Attached: Screenshot from 2019-09-16 21-38-13.png (1062x444, 71K)

>same shit
wrong
>linking me to the Nim fact doesn't change the fact that's it's a fucking language without a purpose
the FAQ states Nim's purpose. try opening the link and you would see that
>as evidenced by the fact that nobody uses it
wrong

What are the benefits of using Nim over Common Lisp?

It states what Nim IS, it doesn't state its design philsophy, because it doesn't fucking have one. Reading through the documentation is like, ok, this exists, but why? It doesn't fill a niche, it doesn't improve on another language

>Nim
Ah yes, great language, tons of undocumented features. I was going to use it but the gintro maintainer is a total fucking cunt and keeps refusing to provide an API reference. Straight to garbage

Stop hijacking every discussion talking about Lisp you fucking baby, nobody cares

no

People like you are a cancer upon this board. Like the Forth guy or the Ada guy, single people who won't shut up about their favourite language that nobody else cares about

To the user that told me to install docker to to get my hentai.
>it's an almost a 900mb exe
>i had to register to docker and authenticate before I could even get the download link
>had to activate a bunch of shit in windows 10 for it to work
>had to sign in and restart at least 3 times
>programme finally installed
>it does nothing
>click kitematic
>install
>login
>it's kinda like a repository
>error every time I use it
>it's showing that the downloader program I want is downloading (the down arrow in the cloud on the left hand side is moving) but it's like it's frozen
>powershell finally opens by itself
>enter code to build image (program I want) locally
>error
>enter command to download from website
>parsing errors red highlighted text everywhere
>send some more time reading
>try to substitute -u for url and a bunch of other stuff
>errors
>say fuck it
>wasted at least 2 and a half hours from first entering the docker url into browser
>left with nothing, not even smarter
Thanks for nothing cunts. All I wanted was to download like 11 pages from a site. And it took me 2 and a half hours of nothing, to still have nothing at the end. What a waste of time. I guess you guys are good at that here huh? Wasting time and accomplishing nothing.

Attached: 1566075346041.webm (336x256, 1.34M)

i'm glad i made this much of an impact on you
now shut up and learn Lisp

I will now learn Haskell.

And you think crab people are obnoxious
kek

I have never used Common Lisp so I'm not sure.
It's supposed to combine the simplicity of Python with the performance and portability of C. It's designed to be efficient, expressive, and elegant.

There's nothing to learn, it's literally the most basic programming language in existence which was made redundant by the 80s, yet here you are still talking about it

>redundant
That implies something exists to replace it, which is obviously false.

No transpiling language is efficient and there's nothing elegant about it either, it's extremely idiosyncratic, which can be ok if the language is actually good or useful but Nim is just like other languages except wierd so why would anyone bother

Met a really cute blonde who works at a FAANG company (software engineering team for a core product). I can't even imagine how much her team probably worships her... #lifeontutorialmode

Attached: girl.png (159x292, 93K)

It was replaced by every other programming language you see people using today

>tons of undocumented features
True, hopefully that will be fixed by the time 1.0 hits
>I was going to use it but the gintro maintainer is a total fucking cunt and keeps refusing to provide an API reference.
kek

nice uwu

are you this user?

>No transpiling language is efficient
But that's wrong. Efficiency isnt only measured by execution time.
>opinion opinion opinion
ok

Ah yes, you mean languages that appeal to the lowest common denominator. Why else would programming languages like Python be so popular?

>Efficiency isnt only measured by execution time
This is the kind of retarded shit only somebody with a slow language would say.

>But that's wrong. Efficiency isnt only measured by execution time.
that's exactly my point, compiling transpiled languages is inefficient for a variety of reasons, excuction time should be the same

Did you marry her?

Yeah I know it's you, the same guy, that kid who thinks programming is some hobby like playing video games or watching anime and not something people to do to actually achieve a task

>all of this cope
stay mad at a programming language lol

He's not mad at lisp, nobody really cares enough to be mad at it. He's only mad at you, bro.