/dpt/ - Daily Programming Thread

What are you working on?

Attached: 1529381023816.png (615x597, 301K)

Other urls found in this thread:

javascript.info/
gitlab.com/cppit/jucipp
gnu.org/software/emacs/download.html
hackerrank.com/
twitter.com/SFWRedditImages

First for C#

Playing atc right now.

C# is bad and causes even more brain damage than Java

How hard would it be to write a frontend for gcc/clang and make my very own language?

driving myself into insanity
how should i name my projects?
pagan mode:
>pick the name of random a god(ess)
>pick the name of random a vakyrie
weeb mode:
>pick the name of random a japanese color

s/clang/llvm

t. oracle

First for CHIP-8

Attached: chip8-sokoban.webm (696x496, 205K)

Checking out Elm. Already know a bit of fp and want to combine it with the power of 10x electron apps.

Attached: dumb frogposter 6.jpg (1000x800, 65K)

OOPsies bad, toxic functional programmers good

Sacchan

>electron
how dare you

Attached: behead object oriented programmers.png (590x448, 202K)

make a blog like the rest of your kin

Fuck you, your RAM is mine now. Bitch.

>doesn't install your app
nothing personal, kid

Trying my luck again.
I need some help with the proper syntax for saving something into a pandas dataframe while doing a for loop.
The code works but I get nothing.
The problematic part is :
>data['new_value']
for x in range(0, 9):
data['new_value'] = data.loc[data['test_value'].isin([x+1]), ['old_value']].sum()

I usually go look up a greek/roman word for the thing I'm making.

If perl is just regular expressions, what are cool stuff made in perl?

ITT we drop truth bombs, I'll start

Modern C++ is a decent language

>calling something a 'truth bomb' will make it one

I adopted a cool business / hacker name, and then I just named them like coolname1, coolname2. I lost count around 16 or so.

Now I basically follow:
0 If its something I intend on showing off, I name it something identifiably associated with myself or my business.
1 If its a personal project I give it a cool name of something I like, like a personal hero, or a neat thing I experienced recently
2 If its a semi-secret project that I might feel embarassed to show off, I just name it a random string of letters and numbers, maybe with something encoded into it.

XML makes Java acceptable lisp

Nice.

Maybe I talked to you in the previous thread. I am working on an Elm/Haskell/Electron project right now.

"""Modern""" Java is a decent language

why not make something good instead?

I don't think so. I was actually just joking, I have no intention of doing an Electron app. Just learning Elm because I think it might be useful to know.

What are you making?

I want to solve some C++ issues
Post code + compiler or linker errors and I'll answer.

Literally my second day using any programming language, the task was to make a program that can find the amount of money owed over a year period on a 5% interest rate. Does this look ok?

Attached: interest.jpg (1816x556, 105K)

Real programmers abstain from vacuous worldly pleasures and distractions.

I just showed this off the other day. Its music software. A tracker.

The front end is in Elm for composing spread sheets of music. Then it sends messages to a Haskell process which generates audio buffers in an efficient way. Currently I am connecting the Elm and Haskell parts. The interop communication is kind of tedious. The Elm part has "EngineMsg" that are a custom type of all the things the UI might want to tell the Haskell part to do. But it has to get encoded into json, and then pass through the JS part in the electron window, to the JS part in the electron instance, into the Haskell instance as a string. The Haskell part has to do similar things.

I use these trackers to make music like: www.youtube.com/watch?v=zRoQdSoUfHQ

Attached: DANK MEME 2018-09-07 at 22.06.31.png (1364x888, 67K)

seems fine desu

Attached: banana ai machine learning.jpg (554x1200, 71K)

looks fine to me
it's so simple there's nothing really to complain about

t. micropenis

Thanks friends, just going over it again. How important is the decimal point for the interest rate? And slightly offtopic but I'm using Repl.it but have been told to use JSFiddle, Are there any benefits to either or is it personal preference?

If OOPsies actually understood FP then they wouldn't be OOPsies.

Name ONE advantage of FP over OOP.

In JS it doesn't matter. In other languages it may.
It doesn't matter. If you like it then it's fine.

Far more reasonable code.

So I need to host my data online. It's just a massive serialized data in binary format. Is there any free host for this.

I need this to keep track of my credits/debits and reminders etc across devices. So purely for personal use.

Attached: 1536461729788.jpg (560x560, 34K)

I can't understand why you took such a long-winded way to get to the solution.
I might have to write my own version of this to work out what the fuck you're doing all this shifting around for.

>reasonable

Attached: doge.png (476x347, 15K)

Lisp isn't as popular as python because all books begin with installing emacs

In computer programming, the term hooking covers a range of techniques used to alter or augment the behavior of an operating system, of applications, or of other software components by intercepting function calls or messages or events passed between software components. Code that handles such intercepted function calls, events or messages is called a hook.

Hooking is used for many purposes, including debugging and extending functionality. Examples might include intercepting keyboard or mouse event messages before they reach an application, or intercepting operating system calls in order to monitor behavior or modify the function of an application or other component. It is also widely used in benchmarking programs, for example frame rate measuring in 3D games, where the output and input is done through hooking.

Hooking can also be used by malicious code. For example, rootkits, pieces of software that try to make themselves invisible by faking the output of API calls that would otherwise reveal their existence, often use hooking techniques.

Attached: 1536063434958.jpg (500x500, 53K)

Scala is primarily an OO language. No wonder it's such a disaster.

do it on AWS, fuck free hosts

you could use Heroku I guess. But AWS will give you more functionality and it won't cost you more than a couple of bucks a month

Lisp isn't as popular as python because python coddles newbies. There's nothing wrong with emacs, just read the tutorial

You are part of the problem. What an absolutely frustrating piece of shit emacs is. Emacs (and stallman) killed lisp

>Stallman killed lisp
THANK YOU BASED STALLMAN

Yes you faggot if you want a language to be adopted by as many people as possible that means coddling newbies. Who would of thunk
You don’t star every single book with a chapter on installing emacs if you want to lure in new users

>emacs is frustrating because it's not just a glorified notepad

Coddling newbies makes a language worse.

holy shit user

emacs lisp is one of the worst lisp dialects for real though

I don't disagree.

Emacs is frustrating because
>it has unconventional shortcuts
Why would anyone have to learn new key combinations for everything? There’s a reason standards are adopted. Emacs keybinds aren’t even ergonomic. They are arbitrary.
>it doesn’t rely on the mouse
Guess what, people use mice now.
>there’s no straightforward way to install it unless you’re on Linux
Most people have windows or macos
>installing packages or themes is confusing
Yes bro just go to your dot emacs file and configure your software from scratch? Oh you spent 2 hours and it still doesn’t work? lol that’s how it is
>things don’t even work straight from the box
I followed online instructions and the damn thing couldn’t even find a package

Yeah emacs sucks unless you spend a month getting used to it. Nobody wants to do that. I understand in the past because there weren’t better alternatives but now? Forget it

Guys I'm losing my mind over this.
Doesn't anyone here work with pandas ?
I even tried this but I only get NaN.
data.loc[x, ['new_value']]= data.loc[data['test_value'].isin([x+1]), ['old_value']].sum()

* Don't use var
* Mind your naming
* Every number is an IEEE-754 64bit double precision floating point number in JS, with the exception of the very recent addition of BigInts
* prompt returns a string, just so you know
* Use javascript.info/ to learn anything in an up to date manner

How the fuck does avoiding emacs make the language worse? Jesus fuck

Both these are true.

Speaking of text editors tho, emacs and vim do feel dated and just ugh, vimscript and emacslisp being utter shit doesn't help either. If you are not a veteran with ~20 y.o. config files where everything is in place, they are just not worth it

Nuage electron based editors suck, except perhaps vscode. Seems like Microsoft does some shit with it

What else? Sublime? Neovim maybe?

I mean, I do like my vstudio but it's a uge program

gitlab.com/cppit/jucipp

Attached: 1535758853717.jpg (346x510, 31K)

>Nuage electron based editors suck, except perhaps vscode. Seems like Microsoft does some shit with it
I don't think microsoft does anything special with it, it's just that they're good programmers and know what they're doing

[prompt("Please enter how much you would like to borrow")].forEach(x => alert(`The total interest for $${x} over a year is $${(+x)*0.05}`))

>>it has unconventional shortcuts
>Why would anyone have to learn new key combinations for everything? There’s a reason standards are adopted. Emacs keybinds aren’t even ergonomic. They are arbitrary.
Emacs predates those conventions and standards. Whoever came up with them unwisely ignored existing software. Blame them for not following Emacs, not Emacs for existing first.
>>it doesn’t rely on the mouse
>Guess what, people use mice now.
I don't have a mouse. Additionally, note that just because Emacs can be used without a pointing device doesn't mean you can't use one with it. You can!
>>there’s no straightforward way to install it unless you’re on Linux
>Most people have windows or macos
What are you talking about? gnu.org/software/emacs/download.html gives straightforward instructions for installing on Windows and Mac. Additionally, Aquamacs exists for Mac.
>>installing packages or themes is confusing
>Yes bro just go to your dot emacs file and configure your software from scratch? Oh you spent 2 hours and it still doesn’t work? lol that’s how it is
I don't think it has ever taken me more than two hours to install a package or theme. I don't know how to relate to your situation.
>>things don’t even work straight from the box
>I followed online instructions and the damn thing couldn’t even find a package
Not enough information provided. Did you add a package repository to your config? Was your package list out of date?

vscode suck, in my experience.
Huge performance issues. Maybe it'll get fixed some time in the future.

I use gedit at work.

>I don't have a mouse
hows life rofl

ITT: "waaaaaahhhhh configuring an editor is hard"

I am not paid to configure editors

You're not paid to post about how you are incapable of configuring your editor either but here you are

Is there a list of beginner projects anywhere? Trying to learn, I know the basics, and I've heard that the best way to learn is just by doing, so I want to try and just go ahead and dive head first in.

You do realize you’re proving my point right? Having to make sure my packages aren’t out of date? Blaming others for not adopting emacs shortcuts?
I’m not saying it’s not a good piece of software because it is. It’s just a dated software and it requires so many things that we now take for granted that nobody who didn’t learn it ages ago is going to bother with it

And going back to my point, if lisp books all start with telling the reader to install emacs (when perfectly valid alternatives like sublime exist) the language will never catch on

projecteuler
reddit.com/r/dailyprogrammer
rosettacode
exercism.io
hackerrank.com/

>Having to make sure my packages aren’t out of date?
You can configure Emacs to automatically update packages once and then never have to worry about it again.
>Blaming others for not adopting emacs shortcuts?
You mean the exact same way you blame Emacs for not adopting other software's shortcuts as defaults? And by the way you can change Emacs shortcuts if you want.
>perfectly valid alternatives
>sublime
Sublime falls short of Emacs in terms of providing a good Lisp development environment.

Scheme good, no?

ye

subl is alrihgt

What mong do you have to be to go on Jow Forums and mock people for not using a mouse?
Has all of Jow Forums already been overwhelmed by zoomer javascript devs?
What are you paid to do actually?
Are you paid to effectively do your work?
At one time that involved being competent enough to also improve your workflow. Last I checked the configurability of emacs and even vim trumps that of garbage like VS and other bloated shit. The speed of editing also beats it hands down by leveraging more of the keyboard.
What are you fucking on about? There exist packages for managing emacs packages which means you don't have to make sure of ANYTHING.
He was also not blaming anyone for not adopting emacs shortcuts, you're the moron complaining that emacs uses unconventional shortcuts and he was merely pointing out that emacs predates the new convention. In fact, I am pretty sure that emacs (or readline) were the first programs to use ctrl and alt key combinations which means that the garbage dumbed down shortcuts of modern editors were actually an imitation of emacs.

The reason people use emacs (and vim) is because of the flexibility, the configuration and the key bindings which allow people to work quicker and more effectively. These people are willing to take the investment of having to configure and learn their text editor in order to actually get the job done more quickly.

And that’s the problem. Your answer to everything is customizing it. If I read a book on lisp I don’t want to be customizing anything. Much less a software that I’m not even remotely interested in using. I want to learn the language.
And how is sublime not good enough? It has a repl that you can send your code to, it has paredit and it has syntax highlighting.

Face it, the way lisp is taught is unwelcoming for beginners. Nobody wants to install emacs. And somebody telling you to “lol go customize it” just adds to the frustration.

That's why I love this official stage, because it's small, but its structure makes for a complex solution

In order to get the boxes around to the goals, you have to move around each quadrant, and that's only possibly if the way around is clear both ways, in most of the box setups. So you find the few box setups where you can leave a box and still push the other around freely both ways

Yeah that’s great. But a python book doesn’t tell you to go and install vim. If a beginner has a choice between installing, learning and configuring motherfucking emacs to learn lisp, or just start writing code, what do you think he will choose?
Lisp is unpopular not because of the language but because the language is taught through emacs

You don't *have* to install emacs, just as you don't *have* to type in the examples from the book verbatim. You can write lisp in notepad if you want to.

That's what I'm doing using Sublime. But a beginner won't see that. The first chapter being about emacs is just offputting.

You are clearly a beginner too, user.

lol patronizing people because they don't like emacs
just because i'm a beginner in lisp doesn't make me a beginner

>implying workflow bottlenecks lie in not-so-efficient autism over your text editor
Is it wrong that I am keking out loud faam?

This isn't about whether you like Emacs. This is about you getting riled up about a book's editor recommendation and claiming that beginners will be put off Lisp because of it - all while you weren't put off by it and you continued while ignoring it, and at the same time admitting that you're a beginner! It's also about you being misinformed about Emacs, blaming it for things that it should not be blamed for, making erroneous assumptions, and spreading all of that here.

Somehow I doubt your derision extends to your own use of editor functionality. How productive would you be without copy and paste?

It's not "a book" it's pretty much all books on Lisp and Lisp dialects.
And you're delusional if you think most programmers don't share my views on emacs

C is every bit as powerful as C++, people are just too retarded to see the preprocessor as anything other than a tool for importing and guarding headers

It applies whether it's one book or a hundred recommending a particular editor. You were able to look past it once, you could do it again. So could other beginners.

And it's hardly surprising that some other programmers are similarly misinformed about Emacs. You're fortunate that I and at least one other user here are correcting your misapprehensions, otherwise they would go unchallenged and yet more programmers might become misinformed.

Preprocessor abuse is not a good thing.
Preprocessor macros are also not as powerful as templates.

How do I stop feeling retarded at work, I feel like it messes with my T level
>tfw morphing in a low t basedboy

>C is every bit as powerful as C++

Attached: 1408310349282.jpg (798x450, 48K)

>C is every bit as powerful as C++, people are just too retarded to see the preprocessor as anything other than a tool for importing and guarding headers
C++ has preprocessors AND templates, constexprs, generics, concepts and move semantics. All C has is non portable macro hacks which is why C is a dead language.
Not even C compilers are written in C now so it's not even self hosted lmao

>his compiler/langs needs a header file and an include guard in the year of 2018
>yet his language can't download, build and install dependencies in the holy year of 2018

Attached: 1536063434957.jpg (1000x1000, 80K)

read a book?

I used sublime for stuff that didn't require an ide, you can use the autosave trick, or just crack it yourself to get rid of the nag window (it's pretty easy)
Now I use emacs for most things tho

>header file

Someone explain to me why high level languages like C# and Java still not have auto generated interface files but their users still mock C for needing explicit header files? What's the point of removing mandatory header files when you still need interface files for basically everything? Fuck your hypocrisy.