/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?
Previous

Attached: 220px-I_like_APL_graphic.jpg (220x330, 15K)

Other urls found in this thread:

wiki.haskell.org/Haskell_in_industry
github.com/Gabriel439/post-rfc/blob/master/sotu.md
quantumcomputing.stackexchange.com/
area51.stackexchange.com/proposals/106955/quantum-computing
tiobe.com/tiobe-index/
pastebin.com/impnYAwh
leetcode.com/problems/number-of-islands/description/
softwareengineering.stackexchange.com/a/211326
twitter.com/SFWRedditVideos

Why haven't you learned Haskell yet, Jow Forums?

Please use an anime image next time.

Attached: daily programming club.jpg (1280x720, 166K)

Couldn't find any decent anime image so I went with the APL-PL

>Haskell
is strictly academic wankery that is of little use in production in the real world
no need to prove me wrong, you already know deep inside it's true

So you only learn a programming language because people in 'production' use it? Sad.

wiki.haskell.org/Haskell_in_industry

>Sad.
t. trumpler

Attached: SadApe.jpg (368x421, 30K)

rent free motherfucker

>no mention of haslel
>*was* a contractor, now they ded
>prototype
>using Ocaml and *a bit* of haskell
>We use Haskell and clojurescript, all stitched together with nixos. We're totally not practicing meme-based development

of course, trumpler is my spirit animal

github.com/Gabriel439/post-rfc/blob/master/sotu.md

Who are you quoting?

Ooh, I remember that one. Good resource, calls a spade a spade when needed.

the link I replied to

I'm doing a thing for Android and I've been having trouble with retrieving data from Firebase. Basically I'm reading data from the database and inserting it into a recycler view. It just isn't working the way I've done it. I'm just wondering what would be the best way to set this up before mucking things up. Basic gestalt:

class Thing
-reads data from database
-puts data into Thing objects
-puts Things into a list
-returns list

Adapter
-gets the list
-populates the recycler with Thing stuff

When I do this, the recycler just ends up totally empty. It works if I insert hardcoded stuff into the Things, and the db queries should be fine too, unless I'm retarded. From what I've gathered the issue is that the recycler gets built before the queries get done, so Thing just returns nothing and then nothing ever gets put into the recycler. I'm just not sure how I should organize this instead, so that the list actually contains something when it gets used

Attached: d3c11ff6.jpg (309x320, 10K)

debug and check the logs

what program should I make that would improve linux?

I call it the snail list. The "shells" are used to indicate to iterators when nodes are deleted. This technique improves on previous linked list implementations, which either use slow double atomic instructions, or destructively mark nodes as being deleted.

Each iterator is able to tell when it is out of date when iter->prev->next != iter->cur, and when it is, it must "crawl" forward until either it reaches the end of the list (is invalidated) or becomes consistent again before inserting or deleting an element.

In the diagram, the bottom iterator deletes two nodes, causing two "shells" to form around the top iterator. Each "shell" effectively bumps the iterator forward once, in lieu of iterators communicating directly with one another.

Attached: 20180416_210838.jpg (1280x720, 238K)

I don't know SHIT about machine learning and got assigned to a machine learning project at work, and need to get on top of the cutting edge research in machine learning in a week

Lay it on me straight, how fucked am I?

Attached: a28.jpg (480x454, 32K)

Also, the deletion operation can detect when it races with an insertion operation, and it will commit the insertion on behalf of the inserter. The inserter is always turned into a "snail", and the deleter always wins the race, because snails are slow.

Why would you get that assignment without the qualifications anons?

Actually, no, when the deleter detects a race it doesn't need to do anything with the inserter. When it commits the insertion, the inserter is automatically a valid iterator. Even better.

What's your mathematical background?

dumb frogposter

Eh...I just realized the snail part is cute but impractical. Better to just have the deleter change the deleted node's pointer to iter->prev.

That's a really nice and comprehensive review of what Haskell is good at.

It's pretty much what I use it for myself. Compilers, quick scripts, and occasionally for webshit backends.

lol this is a thing now
quantumcomputing.stackexchange.com/
>muh cloud
>muh haskell
>muh quantum computing
>muh AR
>muh VR
>muh google glass
>muh machine learning
>muh blockchain
what's the next faggot meme

>5 visits/day
area51.stackexchange.com/proposals/106955/quantum-computing

Haskell is straight and pure

Is Java still good?

hell yeah it's up there with C++

Yes

Java was never good.
Still isn't.

prove it

Attached: 1468472224634.jpg (990x557, 61K)

Attached: pajeet.png (89x107, 13K)

tiobe.com/tiobe-index/

Attached: microsoft certified.jpg (640x800, 190K)

Does java have preprocessor directives like #if yet? What about #define?

java doesnt have a preprocessor

pastebin.com/impnYAwh

"Uncaught TypeError: CharPack.packDb is not a function"

my button won't work

pls help

>up there
>with sepples
KEK

How do you solve this problem with an efficient amount of Haskell code?

leetcode.com/problems/number-of-islands/description/

t. transdragonkin unicorn haskellfairy

minimum spanning trees?

I mean...why would you expect packDb to exist. You don't define it anywhere.

is this array programming day?
>mfw that thread on hn had nobody mentioning boolean vectors
what a bunch of "full-stack" cucks

what about lisp flavored erlang?

>quantum computing
>meme
you have no idea what's coming

I am a dumbass, I forgot to bind Taffy to LocalStorage.

I am never coding on 2 hours of sleep again

APL is literally moon runes.

>you have no idea what's coming
epin
like machine learning it's very niche... much more narrow than memesters think. it requires a ton of $$$ to run, even more so than machine learning, hobbyists and small players won't be able to compete with the big guys.

how to do GUI programming in functional?

what language

Java

FRP

>functional java
what memery is this

yes

Hasklel

C++ is the greatest programming language ever to grace this planet.

Attached: 1501394589424.jpg (425x599, 172K)

I admit Jow Forums's obsession with C++ is cute.

C++ is the programming language of choice for cute and sexy anime girls, after all.

Attached: 1522508856654.jpg (1200x1700, 254K)

Lisp is the most powerful programming language.

Yeah but when it goes it's going to be sick. The thing about it, it's great for molecular simulation. We're likely to see "quantum bootstrapping", where we use quantum computers to design vastly more powerful quantum computers.

Beyond that, materials science and molecular simulation problems are currently exponential-time and quantum will bring them down to polynomial time. Considering material science and nanotech are an area where we could have huge progress, the potential is incredible. Not to mention the implications for biochemistry.

So yeah, quantum computation is of limited applicability, but limited to some really important things.

C++ is old and busted. Rust and/or Go are the new hotness

>Rust and/or Go are the new hotness
Don't forget to take your hormones.

Fuck you, I'm natty

Don't forget to take your hormone pills and soy supplements, Natty.

Do you not understand what "natty" means you dyel POS?

APL is what programming will one day converge too when people realize 1 line of APL is equivalent to 50-60 lines of C or C++.

No sorry, I don't know tranny terminology.

What's the best lightweight database software?

dyel confirmed, fuck off back to your bag of cheetos

read(2), write(2)

Fuck off back to wherever you came from. No one around here uses "dyel".

but stupid tranny jokes are totally Jow Forums related

fag

How do you store super global variables in Java?
I'm thinking about creating an object named Globals, store references of those variables in static attributes and call it a day.

Is this an ok pratice?

What the fuck has "dyel" got to do with trannies?
I literally had to look "dyel" up because I've literally never seen it before, and I browse this board basically 24/7.
He should fuck off and go back to whatever shit hole he came from.

public class aClass {
int number;
aClass(int i) {
number = i;
}

Should number = i be this.number = i? I've seen the latter mostly but I always do the former.

It's never an ok practice to use globals, but that is the most straightforward way to do it in Java.

You're not funny.

singleton? not sure what you're looking to accomplish

I wasn't trying to be.

You don't need to write "this" unless they share the same name, to differentiate between them.

Some annoying code standards require this., but most people don't use it unless it's necessary. When the second one happens, I've seen it most often in corporate projects.

I think most people realize it's a waste of space: softwareengineering.stackexchange.com/a/211326

Let's just say I have an ArrayList and want to make extensive use of it. Passing the reference of that list to nearly every method feels oboxious, so I was thinking about just having it as a super global.

it's bad practice but you can do this
public interface Globals {
List LIST = new ArrayList();
}

then you can just say Globals.LIST wherever you want

and you can make your class implement this and it's basically the same as doing import static com.me.app.Globals.*; and it will extend to the child classes

i am determined to make a program with no side effects

int main(void)
{
return 0;
}

>pop
>ret

>>pop
That has nothing to do with the semantics of C.
>>ret
Returning a value is not a side-effect.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

if err != nil {
return nil, err;
}

End my suffering, Jow Forums

Got my c# .net interview tomorrow. Wish me luck.

if err != nil {
fmt.Println(err)
}
?
Is there a reason you're not dealing with the error in your function?

>printf the error and keep going
if ((Nigga)you).AreForReal() {
panic("please")
}

>not seeing what happens to your program when something goes wrong
>ignoring free testing for the sake of soothing your autism
I bet you don't even like empty interfaces

Niggo do you even know what you are talking about?

Somewhat. Been pounding some go recently.

Usually if something's broken it'll panic anyway, the type checking gets the rest (most) during compile. Errors can be printed or even ignored and it doesn't make much difference, it'll panic at some point, but it can be good to print them for debugging purposes, just like it's good to print any intermediate value before moving on to the next step.

Just my opinion.

That's machete debugging. Eventually you will replace everything with iferr-caca and do error reporting at the top of your call stack no?

>Eventually you will replace everything with iferr-caca and do error reporting at the top of your call stack no?
eventually I'll have all my corner cases covered and will just throw errors (and panics) when input is shit.

Obviously this isn't some hardcore giant application, just tooling to automate my personal stuff.

Java can't make the console beeps
What is your excuse?

Why the fuck would anyone want to use a Lisp-2?

Why C standard defines datatype as "able to store value as big as X or more" rather than a fixed size?

To support weird and/or old hardware.