/dpt/ - Daily Programming Thread

What are you working on?
Previous thread:

Attached: 1523920114325.jpg (1280x720, 166K)

Other urls found in this thread:

youtu.be/87l9IhZkUuw
youtu.be/RPq_Eo_lLhs
youtu.be/t90kAoxYg7U
youtu.be/DlKXJ906pd8
youtu.be/rOU4YiuaxAM
youtu.be/j7CDb610Bg0
youtu.be/3nlSDxvt6JU
youtu.be/CTAud5O7Qqk
james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html
twitter.com/AnonBabble

thank you for using an anime image

Trying to get Boot to work for Clojurescript.

working? im working to learn a fucking language thats what im working on. im self learn guy, any idea how to make money after learning python/C/ruby ? im interested in penetration testing any stuff i should know

Just lost a shitload of my bigass program due to corruption. Reminder to always keep backups and always eject external harddrives before unplugging them. Don't be an idiot. It can and will happen to you. Looking for music recommendations or something to listen to while I rebuild everything.

>always eject external harddrives before unplugging them
WTF? Are you actually using FAT for anything at all other than interchanging files between different operating systems?

Just bought an external drive to carry my shit around on between computers user. I just used the default. Dumb of me, I know. But not keeping a backup was dumber.

Is there any benefit in looking into hipster languages like Haskell, Rust, Ruby and Lisp instead of just sticking with C, C++, Java or C#?

Can anyone explain me this sentence
> If you were a good enough programer you wouldn't worry about the OS you run you could ssh into your server

help, what does ssh into your server means

>But not keeping a backup was dumber.
Perhaps, but on any real filesystem, you shouldn't have to worry about corruption, at the very least.

Learning Haskell or Lisp will make you a better programmer, even if you never use them outside of hobby projects.

Fun

you probably wont go far with your logic
not learning new things to improve your skills because youre on Jow Forums and ppl with anime backgrounds call Ruby a hipster language is just braindead shit buddy.

Ruby shill spotted.

You forgot your anime girl user.

Just wrote a Python library for easier testing of various audio waveforms.
>>> from sox import dplay, sine
>>> dplay(sine(f=sine(f=1, amp=200, bias=500), amp=0.5), T=2.0)


Thanks for using a great image, OP.

Attached: yuyu-15.gif (300x169, 2.02M)

>Can anyone explain me this sentence
Yeah: the guy's a moron.
Being able to ssh into a server running your OS of choice has nothing to do with being a good programmer.
Also, if the requirements say your program needs to run on ShitOS, and there are portability issues, that shit won't help you one bit.

>on any real filesystem, you shouldn't have to worry about corruption, at the very least.
*snort*
ah, to be young and naive

No probelm. There is a high chance you are the one who posted it.
Different PL don't offer magic.
Just learn the abstract of what every PL has to offer you'll notice every PL is just different syntax with possibly different limitations.
E.g: creating a variable, functions, lambdas, basic system calls like console output and file IO...etc
>interested in pen testing
Learn C and then python
youtu.be/87l9IhZkUuw
youtu.be/RPq_Eo_lLhs
youtu.be/t90kAoxYg7U
youtu.be/DlKXJ906pd8
youtu.be/rOU4YiuaxAM
youtu.be/j7CDb610Bg0
youtu.be/3nlSDxvt6JU
youtu.be/CTAud5O7Qqk
How mastering the general purpose ones (at least one high and one low PL) and then getting into FPL for fun? Learning something new won't give you cancer.
Besides, if you want a job, you better learn the PL popular in your area.

oh tell me how i should limit my programing skills for the shake of society user, we should just all learn python and c and call ourselves the gods of programing right. get lost

No. Just C.

Attached: 1506932291819.jpg (1280x960, 259K)

I'd let Maki give my ding-dong a tug

Fun, learning; they might not have the community or libraries of bigger languages, but they're fine otherwise.

Can someone explain to me how something like Haskell can be useful in the real world, outside of really niche stuff?

I understand and enjoy the functional programming paradigm; however, "pure" functional programming is free of side-effects. However, in real applications it seems to me like side-effects are the most important part. You will wait for input from a user, then draw to the screen, change state (because software that's being interacted with does have state), send a network request, write to disc, access a database... Sure, between those endpoint, there'll be some processing of the data. But in the end, it seems that "look at this data and decide what to do based on it, then interact with the real world (read: throw out a whole bunch of side-effects) accordingly" is much, much more common than "take in this data as input, process through it functionally and spit out the processed data".

So, is there a way to use Haskel for programming typical desktop applications, or is it really more of a niche thing for times when the business logic is relatively free of side-effects and more about processing data correctly?

Haskell models side effects using monads. The gist of it is that all your side effects can be contained to stuff like I/O while the majority of your code is pure functional.

In fifteen years, I haven't had any corruption whatsoever on ext3/4, XFS or ReiserFS that wasn't caused by the underlying hardware. Admittedly I don't know about NTFS, but surely it can't suck that badly.

>haven't had any corruption whatsoever on ext3/4, XFS or ReiserFS that wasn't***
that has nothing to do with the original point: keep backups (see also: don't skip leg day)
the fact that your FS dindu nuffin ain't gonna get your data back

translating to english:
haskell uses one huge global variable, and only modifies that
smug haskell weenies love to pretend that this makes their programs side effect free, which is their preferred way of training their self-delusion muscles

/dpt/ anons, do you use docker for team work?

>love to pretend that this makes their programs pure
much like "I'm still pure because he only did me up the arse"
Haskell is a religion after all, so you'll notice more of these similarities.

I never denied that. Nevertheless, in this particular case, backups shouldn't have been necessary.

>use DOCKER for TEAM WORK
What is this, madlibs?
use TAR for VERSION CONTROL
use HAMMER for SCREW
use EGGPLANT for PROSTATE MASSAGE

Attached: 377248cc3632c98867e1e6c050ee85_jumbo.jpg (1024x845, 85K)

1. you kinda implied that it ain't that important
2. but it sure would've helped

Attached: Vo7SwyIdfd.jpg (1333x1000, 344K)

>haskell uses one huge global variable, and only modifies that
I thought a monad was a way of chaining functions, not a variable to mutate.

a monad is a burrito
exactly that, and completely interchangeable
nothing less, nothing more

Yeah but like, say looking at my company's code I'm working on right now, the IO and other side-effects are so closely linked to the functional bits that separating them basically means chucking at the very least 50%, and possibly more like 80% of the code into an "IO layer" and then being smug that the remaining 20% are "pure".

Sure, I can see some modules which heavily process data - we have a lexer-parser for an in-house simple language, which could easily be implemented purely functionally - but outside of bits like that, it really seems superfluous.

A monad is just a monoid of the category of endofunctors

Attached: tumblr_o0a3wrvSLX1tzlep2o1_500.gif (500x281, 1.21M)

Didn't a guy with a monad get into Smash 4?

>this one tool is the only tool, the best tool, for every problem I might encounter
I too make sushis using only a hammer.

Attached: 1498579043005.jpg (706x690, 90K)

>what's the problem?

This. Simple really.

>A monad is just a monoid of the category of endofunctors
's a classic really
james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html

It's just that people love saying how Haskel is actually great for real world applications and all that. I never contested that it would work in envornments tailored to functional processing (like a lexer-parser, for instance), I'm asking for clarification on that particular claim.

I take in the answer is just "it's really not"?

I was implying that it shouldn't have been necessary in this particular case. The hardware didn't actually fail.

yep
see

not necessary, but sufficient
and let's drop the autism for a bit - the most realistic and pragmatic approach

I still don't know what Docker actually is/does. And I don't care to find out.

>1972 - Dennis Ritchie invents a powerful gun that shoots both forward and backward simultaneously. Not satisfied with the number of deaths and permanent maimings from that invention he invents C and Unix.
I love this

he cute

Attached: docker.jpg (770x600, 55K)

I'm making a twitter image downloader because twitter is fucking garbage by default for downloading cute grills.

I'm going to use the text boxes for tags so I can make searching for images easier. The rest of the filename is so that I can build the original post's URL since the default filename makes it impossible to find the original source.

Attached: download.webm (518x487, 256K)

Your inability to comprehend that 'real world problems' might be much more than what you've encountered in your particular shitty career has nothing to do with Haskell.
Even among the IO heavy applications some can benefit a lot from Haskell.

You're just the nth obvious bait wanting to start another stupid language flamewar on a dead thread. If you really were curious you'd just google 5mins and read on why some businesses decided to use haskell.

Kys you're self already.

I used docker for a university group project, we spent three days right before the deadline sorting out problems related to it.
Apparently addressing the host machine from inside the container in a platform-independent way is such an outlandish problem that they only just added support for it, and we literally didn't have it available before the deadline. The workaround? Running docker in a virtual machine.
I wish I was joking.

>Kys you're self already.
*your :')

>being this new

out with you

post the cute grills already! nobody cares about the wem.

also,
that's actually a nice idea. I like it, you're going to share the code ?

>wasting dubs that hard

Attached: ebin.jpg (336x476, 41K)

rxjava

Does anyone here use VS Code on Linux? I just read an article about it, and it sounds really nice. Only the name Microsoft discourages me a bit.
I'd mostly use it for C/C++ and Python development. At the moment I'm using JetBrain's stuff (CLion etc.).

Focus on the product (and disable telemetry).
It has an amazing performance for a program running on electron.
Wouldn't use it for things other than .net core, haskelly and python.

anyone here do any game dev? (either in industry or just hobby projects)

any good resources for a noob like myself?

Unreal, Unity or monogame are the easiest.
Unity has dozens of resources given it is taught at uni and has a huge base of non enterprise or even solo devs.

Anyone here have experience with reading in packets using libpcap?

reading in live packets with pcap_next, seg faults if it runs out of packets and I'm looping through to find the one I need (comparing the recieved ip with the one I'm expecting) so if I don't get a response fast enough it just crashes, currently using sleeps to get around this but it causes some major delay.
Anyone know a better way?

>learn nothing but c
[brainlet (1).png.jpg.exe]

Damn. I want a cute comfy programming club.

use pcap_next_ex and see some examples online for live capture.
pcap_next doesn't distinguish between error and packet getting fitered and whatnot but it doesn't cause seg fault.
Make sure you have the latest lib version.

C/C++ and Python are both really suited to custom dev environments built on top of vim or emacs. Or if you're lazy, download one of the pre-made packages with a bunch of plugins included - spacemacs being one example, but there are tons including pure vim ones.

What you need an IDE for is Java. I've also not found a good way to use a javascript debugger in an editor, so you need a browser for that. For most other things, get rid of bloat.

You realize that tw*tter is one of the worst places on the internet to download anime art from right? Everything uploaded there gets fucked into a

ah yeah that would work so much better, thanks.

If only retarded god tier nip artists would stop posting there.

What keeps you going, /dpt/?

Attached: wc7u8noqs1t01.png (660x680, 111K)

At this point I just write them off no matter how good they seem. If they don't care about their art, why should I?

Any way I can limit precision of floats in Python? During computation I'd like certain changing parameters to be always rounded to n decimal points not only during logging but also during computation.
Or is my only option to round them whenever assigning new values?

Why would you ever want to do this?

pickup violent python

Create new functions for arithmetic and use those instead.

>Yeah but like, say looking at my company's code I'm working on right now, the IO and other side-effects are so closely linked to the functional bits that separating them basically means chucking at the very least 50%, and possibly more like 80% of the code into an "IO layer" and then being smug that the remaining 20% are "pure".
What is your company's product? Don't need names, but what does it do? That just sounds like shit code to me.

They teach you new ways of thinking about programming.
Lisp and Ruby are highly likely to even become your preferred hobby language over C/C++/Java/C#, because they're just so joyous to program in.
And lots of people find benefits in using Haskell or Rust in their hobby projects too -- such as less frustration in the long run because the compilers and typing are so strict.

those things are, as you say, at the endpoints. and it depends on the application, but in my experience, there can be quite a bit in between, and much of it can and should either be pure or at least limit side effects strictly to objects directly taken by mutable reference (and of course global mutable state should be avoided at all costs in favor of context objects), because it's consistently good for code and helps you avoid a lot of pain. without global mutable state, taking objects by mutable reference can still form very useful guarantees to users and compilers, since it makes the scope of potential side effects known to a user, and keeps them as few and as local as possible. at that point, functions on such objects are still deterministic; just think of it like part of the input to the function is the values of the parts of the object's state it reads, and part of the output is the new values of the parts it mutates. given an object with the same state (or same relevant portion of state), the function will yield the same output. this determinism guarantee propagates outwards into calling scopes, and is even strong enough (and keeps the amount of relevant information small enough) that nonlocal/overall determinism becomes rather trivial to detect/enforce over a broader context. that's how constexpr in C++ works; by enforcing rules not much stricter than usual (primarily "no global mutable state, no undefined behavior"), it becomes manageable for the compiler to guarantee determinism for arbitrary/nontrivial code, using potentially any of a vast majority of language features (in a feature-heavy, imperative language), in contexts where the overall necessary/relevant inputs are known (it basically lets you embed pure functional programs written in C++ as compilation stages)

Wasn't there a nip alternative to twitter? Does it also compress images?

You'd probably be surprised at how much can be refactored to not rely on state and side effects. That's why Haskell is considered so enlightening to learn: you get really good at thinking about programming without relying on side effects and state.

I don't know if you count this as programming but I wanted to try out feedbin for RSS but found out there's no easy way to deploy it with all bells and whistles so I'm working on an ansible playbook that will configure it and all of its sub-services using docker.

Attached: ansible_work.png (3840x2160, 230K)

Did you mean Pixiv? Its not really twitter, more their DA.
And it has some, but an option to get the original (albeit compressed) image.

But for some reason tons of nip and western artists love using twitter to post their work and never upload them elsewhere. ITs weird.

For a while some artists linked to their patreon and no, I am not talking about pixiv.
I recall reading posts about twitter banning lolis and some said nips would just switch to their nip version of twitter but I forgot the name.
I honestly gave up on twitter and fucking puke everytime I see a twitter image on google. Seeing sachiko full of lossy shit drives me angry.

I don't recall that happening, twitter is still the main place for most nip artists still and I know a few still post their loli (then instantly delete) there.

hot women and hot assembly

holy wall of text, batman

Superior genes. I'm just a naturally positive and motivated person. I have no idea what a depression is and I just enjoy my life as it goes.

I think they use twitter because of the (You)s you could get there and interactivity with comments.
I just browse pixiv now and then and booru when I feel bored. If they have a patreon, you can find them on pixiv and booru otherwise just fuck their lossy shit.

The dream of formal verification with types.

>browsing Jow Forums
>superior genes
Pick one and only one.

>butthurt lowly peasant

Attached: alijeres.jpg (600x600, 211K)

I refuse. Also, this idea that only lowlife scum of society come to Jow Forums is silly. Just look at some of the battlestation showoff threads. Some people here are pulling pretty amazing money at a reasonably young age.

That might have been true in the formative years of Jow Forums on most boards, but nowadays I think it's mostly contained to places like Jow Forums and so on.

BPM/CRM with a heavy js-based webapp frontend and basically a LAMP stack with heavier data (basically all the actual business process definitions, cases, submissions, etc.) stored in AWS. Most of the frontend code is event handlers either modifying local state and DOM, or calling backend APIs. Most of the backend code is housekeeping the data in the database, or interfacing with AWS APIs (or APIs between internal components), plus boilerplate for authentication, access control, session management, and all that - with various transforms and business logic stuck in between. Really, most of the code at all layers is concerned with putting the right data in the right places at the right time, and while functional is good for getting "the right data", imperative seems better for satisfying the "right places" and "right time", so maybe our product isn't a good example. I'm in no way an experienced dev - this is my first and only job so far.

bst makes me think I am the only one falling for the linux meme and the rest of Jow Forums are getting comfy uasing win10

Nah man, linux is the only way. Unless you think your PC waking up at 3 am in the morning without your consent or knowledge to do "updates" is normal.

Okay, so it's UI and glue code. Haskell is definitely not a good choice for that kind of work. It would be much more suited to actually implementing the back end.

>implying you aren't a peasant to the elite

i highly recommend C# as a starting language (it's easy to learn like Java, but is better for a number of reasons, especially in the context of game dev), along with MonoGame, or maybe SFML.Net. both are simple and intuitive, but also don't hold excessively hold your hand or get in your way, which is good for actually learning and understanding how game dev works. i recommend avoiding Unity, because it's bloated and heavily integrated (not to mention it runs like absolute garbage - both the editor and the assemblies it generates); it tries to do way too much for you (which also means it makes a lot of assumptions, and limits what you can do), and hides everything away, meaning you'll learn the Unity way of doing things (which often isn't very transferable), not so much how things actually work. note that code from XNA 4.0 books/tutorials/etc will work for MonoGame with only minor changes (if any), because their interfaces are almost identical (the MonoGame documentation lists the few differences)

that looks dangerously close to a jizzface, user