/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1555875425013.jpg (985x863, 194K)

Other urls found in this thread:

youtu.be/fdLCuJcS2Aw
man7.org/linux/man-pages/man2/eventfd.2.html
twitter.com/NSFWRedditImage

Please do not use an anime image next time. Thank you.

yuno is a retarded art student, not a programmer
post someone who is actually cute next time like nene

nth for Nim!

Attached: 1552995669300.jpg (1440x810, 230K)

So I've got a programming exam soon and we're allowed to bring our computers.
Obviously opening the browser and googling shit is not allowed, and opening PDFs isn't allowed either. BUT they do use bloated IDEs so anything that can be done inside it I assume it's fair game
What would you do to make this easier for yourself, dpt? Any feature I can exploit inside an IDE?

Software developer for Boeing. Guys, I think I may have fucked up

Finished the 'tracking' part of my vehicle tracking app backend. The arduino also sends positions and they get properly stored in the db.

Now onto the frontend.

Attached: Captura de pantalla (12).png (2560x1440, 452K)

I just want to know which database I'm connecting to so I can see whether or not I need to migrate the schema but all I have is a bunch of IDesignTimeDbContextFactory's.
Was dotnet a mistake?

yuno is perfection

Attached: 1454724890751.png (720x480, 208K)

The only feature I can see being helpful for a newbie is autocompletion, but aside from that there's no feature that will program for you. Study.

Making a tabbed container widget for my operating system. I'm just doing the basic tabbing functionality first, then I need to make them look more like tabs and less like buttons. :)
I got a job offer yesterday that I think I might say yes to. It's gonna cut into my OS madman hacking time, but it'll be good to get some income for a while.

Attached: Screenshot at 2019-05-05 02-28-59.png (1920x1080, 1.1M)

Emacs is an operating system and will let you google for stuff. You don't have enough time to learn emacs before your exam though.

>I got a job offer
We lost a good comrade today.

;_;

Attached: DxoOQn1UUAAQZ5w.jpg (680x383, 40K)

>I got a job offer yesterday
was nice knowing you user

You should add in snapping user-editable panels ;)

Attached: snapping.gif (745x385, 104K)

hmm, maybe it is prettier to just return Either then, but that's a sidenote I suppose.

I'm still a bit lost though. I can't bind the empty map in the do syntax right?
This also does not work.
data Nucleotide = A | C | G | T deriving (Eq, Ord, Show)

updateValue :: (M.Map Nucleotide Int) -> Nucleotide -> (M.Map Nucleotide Int)
updateValue m n = M.insertWith (+) n 1 m

nucleotideCounts :: String -> Either String (M.Map Nucleotide Int)
nucleotideCounts xs = do
let empty = M.fromList [(A, 0), (C, 0), (G, 0), (T, 0)]
in
x Right A
'C' -> Right C
'G' -> Right G
'T' -> Right T
_ -> Left x

didn't you rewrite the C standard library? why did you do that, how does it help you or what did that even do for you?
sincere question

what IDE is that user?

you're mixing up different monads, i meant you should still use foldM but the inner function should be different. you can do
n'

QT Creator

Oh, is this your new JavaScript project? Yes, it looks nice.

Attached: 29c41ca4b21402622ec813ca9a312beb.jpg (564x846, 57K)

are you really making this in QT my guy

Attached: Screen Shot 2019-02-04 at 12.35.23 AM.png (848x1050, 558K)

I think he's just using the IDE, it's pretty decent and QT stuff is optional

Is it true that learning how to play music might make you a better programmer, since I heard a good amount of programmers are also musicians.

Name a better C++ IDE. I'll wait.

vim

Attached: 1556169182225.jpg (499x275, 40K)

emacs

You'd have to spend weeks configuring them to get everything that Qt creator has out of the box.

You can install any emacs distribution that by default comes with c++ IDE capabilities

It ain't over til it's over frens

well obviously if it's a different kernel with a different filesystem, memory manager, etc, at least SOME of the standard library functions will need to be rewritten. in particular memory and i/o functions

With visual debugging?

I really do need to add some snapping sooner or later :)

I wrote my own C library because otherwise there wouldn't be a C library. It's my own operating system built from scratch, so I have to provide everything myself.

I'm highly productive in Qt Creator thanks to its comprehensive understanding of C++. Also I was an engineer on Qt4 and Qt5 so it has a special place in my heart :)

You shouldn't need it.

Incel tier cope.

yes
(setq gdb-many-windows t)
M-x gdb

The real question isn't can you but instead how much time does it take to get to the point where I can use it? I'd rather just have it now so I don't have to waste time learning a tool instead of programming.

takes less than 1 command to install

>how much time does it take to get to the point where I can use it?
20 minutes to get started with spacemacs, then after using it for a week you'll never want to use a different editor again.
youtu.be/fdLCuJcS2Aw

>20 minutes to get started with spacemacs, then after using it for a week you'll never want to use a different editor again.
I used it for a few weeks but then stopped.
The only thing I really miss is avy-jump or whatever it was called.

>Also I was an engineer on Qt4 and Qt5 so it has a special place in my heart :)
Truly based

Attached: 1553016572136.png (532x582, 514K)

CLion

bloat

>got assigned to my ideal project at work

i hope everyone had a good week this week.

hmm, well avy-jump exists in all editors I've tried. It's called easymotion in vim, if you just google for that + editor you're sure to find something similar

stockholm syndrome, wagie

If I start using signals to wake up threads, calls to read could start failing with EINTR. I haven't used signals before, and I sense that they kinda are a smell, but is this something I should have had checks for beforehand anyway?

>make a competitive salary
>unlimited PTO/WFH

just because you hate your job doesn't mean you have to take it out on people who enjoy their work.

Xcode

you think I'm joking?

>decrying heretics who criticise the cult

I almost got it now, the only problem now has to do with char/String, which is another mix of monads (I think?).
Is this completely inappropriate and I should reconsider, or is there something simple I can do to make foldM act as appropriate?

updateValue :: (M.Map Nucleotide Int) -> Char -> Either Char (M.Map Nucleotide Int)
updateValue m n = do
n'

Oh shit there's a visual studio plugin HNNNGGGHHH thank you user.

it's ok, maybe one day you'll graduate from that bootcamp :^)

Are you the next terry davis?

i would have nucleotide as maybe a top level function since it might be re-used, but updateValue is very specific so i'd have it as something in a where block

Happy to help!

I did have it as an inner function a few iterations ago, I just moved it outside while coding to get a better overview of things. Will definitely move it back inside once I get it working.

clion isnt bloated you must be thinking of visual studio

Depends on what you mean by that :)
I really liked the guy, and it's a damn shame what happened to him. RIP King Terry.

Don't cry because it's over.
Smile because it happened.

He's in heaven now, united with god. They're fiddling around with TempleOS together, and probably running over glow-in-the-dark CIA niggers. I'm gonna pour one out for my homie.

what supplements does /dpt/ take?

Attached: 005550887.jpg (300x200, 33K)

Totally, he was talented, I mean

will you eventually run over a glow-in-the-dark?

None. I used to take steroids and cocaine but it killed my interest in programming. It was a bitch to quit, so I'm glad I finally managed to.

Rest assured, if I ever hit a glow-in-the-dark with my car, Jow Forums will be the first to know

Attached: chess.png (640x480, 15K)

Don't use signal. Use pipe and the thread will wake up whenever you write something to it.

Attached: 7c0d1278569ce01893fd461fc5fab878.jpg (1920x2880, 851K)

Use eventfd.
It was made for this exact purpose.
man7.org/linux/man-pages/man2/eventfd.2.html

>eventfd() and eventfd2() are Linux-specific.

Attached: 1523476041974.jpg (935x854, 158K)

My dream is to create the perfect language. It would be a low level systems functional language. How can I achieve this dream?

>Crippling your software just so it can run on a shitty retard OS with a 0.01% market share

If you have to, at least use a small #ifdef __linux__ to at least use an eventfd on Linux.

become a furry

>open file
>see this
absolutely disgusting, time to rewrite into modern c++

Attached: s.jpg (938x916, 129K)

Everytime I re-use d3.js I remember why I fucking hate it. Jesus fuck this is the least intuitive shit. Not to mention it just looks like unreadable trash.

crude interprocess communication
module Sock
def r
Marshal.load(self) # fixme: use json or something
end
def w(o)
Marshal.dump(o,self)
end
end

require 'socket'
class Server < TCPServer
def serve
client = accept()
client.extend(Sock)
loop { client.w("ur a faget") }
end
end

where can i learn about low level networking
i want to make a simple media server for myself but i don't want to be near or even be vaguely associated with webtards

isn't Bash just commands you use in a terminal? why is it considered a programming language? legit question

bash is not considered a programming language, it's considered a scripting language

Could try Beej's guide, though I think it's all in C
In general, you want to read up on TCP and UDP sockets

because it's a scripting language
batch and powershell are scripting languages as well

Attached: windows.png (466x178, 5K)

>A scripting or script language is a programming language for a special run-time environment that automates the execution of tasks...

Why would it not be a programming language?

aren't programming languages only those that can make programs and this is why HTML isn't a programming language?

You can't implement an arbitrary algorithm in HTML, but you can in C, Haskell, or Bash

yes
you can make programs in bash, batch, and powershell
what do you think shell scripts are

I've backtracked through programming history so far that I'm not reading articles about Unix systems in the 70's, but Greeks debating 0 as a concept.

>The ancient Greeks had no symbol for zero (μηδέν), and did not use a digit placeholder for it. They seemed unsure about the status of zero as a number. They asked themselves, "How can nothing be something?", leading to philosophical and, by the medieval period, religious arguments about the nature and existence of zero and the vacuum.

Imagine a language with no conceptual null and no literal/lexical 0 numeral.

Are there any good tools for designing software? Like drawing diagrams along with documentation and referencing implementation files?

Attached: 70446897_p0.jpg (1280x1900, 313K)

paint and notepad

Is programming by trial and error a good or bad strategy?

>A computer program is usually written by a computer programmer in a programming language. From the program in its human-readable form of source code, a compiler can derive machine code—a form consisting of instructions that the computer can directly execute. Alternatively, a computer program may be executed with the aid of an interpreter.
Bash scripts are programs which are interpreted by a shell. Their instructions are branching, looping, and running other programs. HTML documents are not programs because they do not consist of instructions that are executed.

Now you might say that functional programs are not programs because they don't consist of instructions, but they absolutely do. Their instructions are mostly of the form "evaluate this function according to these arguments". Logic programs have instructions to search for variable assignments that make a proposition true. Constraint programs have instructions to solve equations. And so on. But HTML documents are just documents. Comparing HTML documents to programs is like comparing technical reports to theatrical scripts.

HTML is a markup language, like markdown, XML or JSON. It specifies what data should be in the document and how it is to be organized, but it leaves all runtime details to the implementer.
This is very different from bash, which is a programming language.

There's other ways to program?

bad, a waste of time and errors

anything more professional?

photoshop and ms word

paint.net and wordpad

I can't wake up say N threads that use the same eventfd

on loonix?

Attached: 62602509_p1_.jpg (875x1650, 112K)

that's very good explanation. thank you anons!

Attached: 1553304709809.jpg (900x900, 51K)

You said professional

Any reason to use anything other than sockets for IPC?