/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

mattbriggs.net/blog/2015/06/01/the-role-of-a-senior-developer/
math.ucla.edu/~jteran/papers/SSCTS13.pdf
howl.io/
gist.github.com/anonymous/c29334ac54abdafea99702554072cd0a
github.com/wewman/4bash
twitter.com/NSFWRedditImage

Are you underage or why do you use an anime picture? Anime is for little girls

First for Fortan 77.

nth for lisplets are losers

But we're all little girls here!

Thank you himeposter

I've been meaning to learn it as a sort of curiosity due to ClojureScript. But I would always rather use Haskell over a lisp language personally. If you really want lisp mechanics Scala is more popular and I think it plays nicer with the JVM.

Okay, serious question, I listen to touhou music and all that but how do you even into touhou? There's eight million different games and fan made things all over the place and everyone else but me seems to know what everything is and where to go.

>read Forbidden Scrollery
>watch anime
>find your favorite character
>play the games that feature your favorite character most heavily
Got my dad into Touhou like this.

I remember the first time visiting /dpt/, there where a lot of guys talking about cool programming stuff and interesting projects. Now it's a piles and piles of crap not even near related to programming things. Can we return to the old days?

learning python like a moron.

How would I take a string like 'item1 | item2 | item3' and slice out item 2 only? data[7:data.index('|')] only returns ''. I feel that this is a simple thing that I am overlooking, but I just can't see it.

JavaScript that's run by v8 engines which returns strings for C# to build web pages that are sent with a dodgy server. This way, to make webpages you just write the boring html, add everything like this
var ScriptedPage p = new ScriptedPage("main.html",new {name = "Larry"});
For the simple hello world of most templating libraries.

There's also a function you can set so this happens at runtime, also I've implemented 6 different JavaScript templating engines.

be the change you want to see user.
Whining about meta is just as bad as shitposting.
And so is commenting on the meta-whining.

What does /dpt/ think of netrunner?
Do you think it has a chance?

Congrats on your CS degree Ruby!

>Forbidden Scrollery
Just looked this up, is this something I can just read and pick up how the touhou world/characters work as I go, or am I supposed to already know?

I already know a little bit about the characters due to all the music I listen to and random stuff from youtube, but that's it.

People were saying /dpt/ was going to shit back then, too. But admittedly, it has been kind of shitty lately. It just comes and goes with the seasons.

"foo | bar | baz".split(" | ")[1]

Yeah I agree. And no, netrunner has literally no chance.

Thanks. Never even seen split yet.

Netrunner has been around nearly an entire week and there still hasn't been a SINGLE code commit to their repo.

Web browser is not a child's play.
(Unless you are a C++ pajeet and link together a few Qt widgets)

confirmed for lisplet

>programming is a skilled trade
>programming is totally like a blue collar trade
>software apprenticeship
>software """""""craftsman""""""

Is there anything more pathetics than weak-ass pale-faced computer monkeys LARPing as skilled tradesmen?
It's been 40 years and they still don't even have an organized union.

>mfw the IEEE websites require advertisements to stay alive
>mfw I have no face because I can't afford one

If you will be reading /dpt/ Designated Pajeet Thread you'll understand that C and Haskell are true pajeet choice not C++.
mattbriggs.net/blog/2015/06/01/the-role-of-a-senior-developer/

That's because we require too much individual training and make too much money for collective bargaining to make any sense.

There's a huge divide in skill in CS. The most influential employers don't want unions because it would cost them a lot of money for dead weight programmers. The most influential programmers don't want unions because it would weigh down their salary and they'd make less money.

This kind of thing is why WHITE COLLAR jobs like software developers almost never properly form labor unions and when they do they're never big.

>code junkie
>software barista
>computer architect
C E A S E

>needing a union to ask mr shekelberg to treat you like a human and pay you better
wwwwwwwwwwwwwwwwww
When will brainlets just kill themselves

Currently trying to implement this paper math.ucla.edu/~jteran/papers/SSCTS13.pdf

fuck me continuum mechanics are hard

How much theory do you know? Tackling problems with little to no background is very dangerous.

I'm way too retarded for that shit

I feel like no matter how much math I take I'm completely unprepared for the real world

The paper is old like a shit of a mammoth, it contains PDEs and a solultion using finite-difference method just like in fluid dynamics. It isn't hard, it's a level of a CS undergraduate.

I mean the CS undergraduate level is sufficient to implement it in a code. To write a paper like this really requires good understanding of the physics of the process, classical mechanics to be precise.

Yep, specifically visco-elasticity. It's a really undertaught subject desu.

In the sense of physics it isn't straightforward, I agree. But you have already formulas to compute it, there's no need to bother if your part is to write a fast code for it, not to do research.

You're dad gay

In my opinion these things in computer graphics such as Monte Carlo integration, some dynamics with PDEs aren't actually rocket science. The success of Arnold Render or Nuke is not because they did some super discoveries, they just provide a good scalable and flexible code needed for the industry.

If you can write a code which you can put on several servers and GPUs to compute this simulation it will be more useful in practice than fucking around about physics.

Did you confuse me with the user that posted the PDF? There's no need to try so hard, I actually don't give a fuck what you think.

Wow! I hoped you do.

>PDF
Do you mean a probability distribution function? I didn't try hard, it's pleasure for me to discover about how things work.

I want to cuddle Ran-sama

Nope that privilege is mine and only mine.

>Viscoelasticity
I thought that you meant convection–diffusion. I remembered, viscoelasticity is quite simple.

Never said it wasn't, insecure user.

clojure or common lisp and why?
not responding will be parsed as racket

>and why?
This is the actual question for the majority of posts here.

careful, the very intelligent mods here sometimes actually ban you for saying that, personal experience

/dpt/ should make a programming language.

unlike the gargantuan projects Sup Forums usually engage in, making a compiter that does lexing, parsing, a bit of typechecking and then outputs some C is pretty simple.

then we name it something politically incorrect, put an ASCII cock in the CoC file and market it as an alternative to rust

So, I'm thinking of creating my very own text editor with all the kool features I want, but I don't really know where to start with the rendering of the text itself. How do text editors like Emacs generally render their text, do they delegate it to UI libraries like GTK or the windows API, or do they render them themselves using things like Cairo or something of the sort?

My intention is to make something as low level as possible, and I'll be using c++. The idea is to use a graphical user interface (AKA, I'll not be running the program on console). What are some good, open source, editors I should check out; preferably not monsters like Emacs.

Thanks for the help in advance.

anyone else here learning programming but not sure what they actually want to do with such a skill? I enjoy solving problems and i basically just do a bunch of exercises but i've created very little of my own ideas. I guess i'm mostly interested in just how the world runs on programs, stuff like computing systems inside of machinery, embedded systems and networks.

Ermm... how do I share my files only with special people?
I used pastebin, but I seem to not understand it very well.
I wanted to share my current progress of my assignment with a buddy so I can get some pointers whether I still need to do some stuff, or if it's enough to be submitted as an assignment to the faculty servers.

Do unions have to be about wages?
What about skills, responsibilities and ethical behavior?

I'm C# dev.
And I want some personal project to work on.
Suggest something.

>anyone else here learning programming but not sure what they actually want to do with such a skill
I never had this problem.

Implementing a language might be trivial
Designing it isn't.

Check notepad++ or geany. But It would probably be easier if you use javascript and electron. Otherwise you will have to write a lot of extra code to make it cross platform.

>What are some good, open source, editors I should check out
howl.io/

Between the two, I'd take Clojure. Because:

1. Compatibility with a large number of Java libraries (or JavaScript or .NET if ClojureScript or Clojure CLR are used).
2. Lisp 1 > Lisp 2, plain and simple.

designing a language is trivial, designing a good language isn't, and this is /dpt/ so who gives a shit about good

Lisp .NET Core.

Finally found a site that allows me private pastebins.

gist.github.com/anonymous/c29334ac54abdafea99702554072cd0a

Do you know why the Java compiler can't find the main body?

Has anyone worked with Sup Forums's API?

I'm trying to md5sum the images but the md5 Sup Forums says text (24 character, packed base64 MD5 hash)

What can I do here to check my local files with the currently online files right?

>moonscript is a scripting language that complies to lua
>a scripting language that compiles to an other scripting langage
Wew

What?

>what is transpiling
though I agree with you that it's stupid

learning linear algebra to work on my 3d loli sex mmorpg

currently have a rotating triangle kek

Can you make a comfy botnet for CIA niggers working on Ryzen with this language?

it's not stupid when the "scripting language" you're compiling to rivals the speed of C

Make a Lisp interpreter that runs on the DLR in .NET Core. Translate S-exprs into CIL.

do we still consider babbies writing in JavaScript programmers?

>skills
none
>responsibilities
none
>ethical behavior
LOL

And whats the point of that?
LISP is dead.

You'd just end up with a shittier version of Go with the best selling point being that it can apply partial functions.

People like you are why our profession will never be taken seriously.

Ah but I'm writing C# with JavaScript!

what is email?

Clojure.

CL is... dated. The language itself is fine, but the ecosystem reeks of an 80s approach to programming.

Do you think he's employed?

>posts ran-sama with everypost
A new form of namefagging

How does the ecosystem reek of an 80s approach to programming?

Projective geometry is the next step.

Mindless fun perhaps? You were looking for a project, and the world doesn't have nearly enough programming language variants that no one will ever use.

Some examples:
Pretty much every library assumes concurrency is something you'd never want to do.
"God-functions" that try to do everything for you, rather than concise, modular parts.
Cross-platform sucks, and you'll find a lot of documentation about "cross platform" talking about decades old kernel versions.
A lot of standard abstractions are borrowed from imperative programming practices, rather than the couple decades of development of Functional Programming's practices that even imperative languages are picking up now.

Really, you'd just have to use it and get a feel for it.

i bet these tech Sup Forums niggers cant solve SHIT

Given an integer N and M:
(1 ≤ N≤ 10^18, 2 ≤ M ≤10^5)
find the remainder after division of N-th Fibonacci number on M.

or you know, a classic form of avatar-fagging

nice math homework, nerd.

Filthy casual learning ruby here, I don't understand the syntax of the .sort_by method.

For example if I have a hash assigning numbers to colors and I want to sort it from highest to lowest it goes:
hash = hash.sort_by { |color, count|count }

What I don't understand is the |color, count|count part. Especially since I can remove the "count" at the end and it gives me the same result.
Could someone explain?

Plenty of libraries use bordeaux-threads or lparallelism. Look through quickdocs and tell me how many "god-functions" you see. I certainly don't see any. Cross-platform shouldn't be much an issue unless you heavily rely on FFI, but FFI is kind of a clusterfuck no matter what you use. You'll need to elaborate on your last point. CL can be written in an imperative way obviously, but there are plenty of FP related abstractions.

*lparallel

:sort_by is a method on Enumerable objects which sorts the elements of an enumeration, but instead of comparing the elements directly, passes those elements to a block and compares the output of that block. In the case of a Hash table, the elements are a two element array which can be split apart into its elements as separate arguments to the block. In the example you have provided, the hash is sorted by the values, and completely ignores the keys.

By the way, if you find you don't understand how some enumerable method works, be aware that you can put whatever you want in a block, including print statements!

irb(main):001:0> { hello: 3, world: 2 }.sort_by { |x| puts x.inspect; x }
[:hello, 3]
[:world, 2]
=> [[:hello, 3], [:world, 2]]
irb(main):002:0> { hello: 3, world: 2 }.sort_by { |x,y| puts x.inspect; y }
:hello
:world
=> [[:world, 2], [:hello, 3]]

Lua pretty amazing at speed. It's sad that the syntax in pig disgusting

Just finished making this.

What do you think? github.com/wewman/4bash

Thanks. I haven't gone over blocks yet, but
>the hash is sorted by the values, and completely ignores the keys
So in the |color, count|count part, I'm telling ruby that in the hash, color is the key and count is the associated value, and that it should sort by count?
Sorry if I'm being dense

>"lmao go concurrency is SO good"
>its literally impossible to do concurrency in go

Who said this?

I'm thinking of implementing 8ch to this, but I don't know if they have APIs/json support for their boards.

If not, I have to do it the hard way.

Looks fine. I'd add in an option to make it oneshot instead of it looping forever, but that's trivial.

I made it loop forever so when a new image is posted, it will automatically grab it after it refreshes. Also fixed an issue with the refresher running to 0 and staying 0.

Maybe add an option to do exit after a download? Or the other way around maybe.

Yeah I know, it's just something extra. Looks good though as is.

Oh yea, I read you wrong. It's night time here.

Thanks.

Though, do you think 8ch has json APIs like Sup Forums does? I did not find it.

Maybe that will be my hardmode challenge.

That's not terribly hard.

A quick google points to yes, but I don't use that site.

Oh shit I didn't see that, nice!

>I haven't gone over blocks yet
It's just Ruby's fancy way of doing callback functions.

>So in the |color, count|count part, I'm telling ruby that in the hash, color is the key and count is the associated value, and that it should sort by count?
Yes.

Alright, thanks again.

...