/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

youtube.com/watch?v=O1bsHR2DFvk
github.com/syl20bnr/spacemacs
github.com/commercialhaskell/intero
forum.dlang.org/thread/[email protected]
tiobe.com/tiobe-index/go/
a.pomf.cat/kqoxkv.ogg
twitter.com/SFWRedditImages

youtube.com/watch?v=O1bsHR2DFvk

>What are you working on, Sup Forums?

This made has written an operating system.

What are you doing with your life, user?

can you stop using different OP images each thread

no

Writing an operating system, I've got a basic interrupt based keyboard driver working.

I'm a spacemacs + intero missile now

github.com/syl20bnr/spacemacs
github.com/commercialhaskell/intero

OSGTP?

"I had a crisis of faith and thought the Sun was god

God gets angry when you do that"

This dude wrote a variation of C, his own compiler for it, then wrote an OS in it. And I still forget semi colons.

!JohnsonY5g

Don't feel too bad user, he's literally psychotic, a genius, but still psychotic.

>me using haskell

Come on, you know better.

Just put up this website
www.symmetr.io

let me know what you think

...

God seems like a very reasonable person from this example.

>flower elephant
what did he mean by this?

pooter and dong

The flower is the asshole, the elephant is the butt cheeks and benis

come on dude

why would a girl have a dong??

Why not?

Will you be affected by the changes to H1-B visas?

I've already been affected positively.

One of our clients was going to reduce our support and H1-B in a curry.

Curry can't get in due to recent changes.

can I make this any smaller?
#include

int main() {
for(char c, l ; (c = getchar()) != '\n' ;) {
putchar((c == l && l == ' ') ? 0 : c);
l = c;
}

return 0;
}

...

Huh, you would have thought that the client would be prepared to pay a bit more to get someone so skilled that they can only be found abroad.

That's the issue; H1-Bs are meant to find talent when that talent is unavailable in the US.

What they're actually used for is to import (relatively) cheap labor, with the bonus that they can overwork the fuck out of said employee without fear of that employee leaving.

That doesn't even work for me. It doesn't remove the spaces anymore, it just echos back what I type

Oh, definitely.

I dislike many of Trump's policies but doing something to curb H1-B abuse is absolutely a good thing, in my opinion.

works for me, what are you typing
#include

int main() {
for(char c, l ; (c = getchar()) != '\n' ; l = c)
putchar((c == l && l == ' ') ? 0 : c);

return 0;
}

...

Don't know what to say desu

>implying girl

Girls are better than boys. You can stop pretending to be a boy and take off that fake beard, Ruby.

all girls have dongs

also, java is the best language

Java 8 is unironically semi-decent.

>Implying pretending

If all girls have dongs, what do you call someone with a vagina? Also, C# is better than Java.

>If all girls have dongs, what do you call someone with a vagina
disabled

fuck C#

>what do you call someone with a vagina
A girlyboy.

I can't get your code to work. Dunno why. Windows 10, CodeBlocks IDE with GCC as my compiler. Compiling as C not C++.

This code did work though
int main() {
for(char c, l ; (c = getchar()) != '\n' ;l = c)
if(!(c==l && l == ' ') ) putchar(c) ;
return 0;
}

I'm using foldr to check for an element in a list, and I want to break when I find it, rather than continuing the fold until its end.

I think call/cc can be used for this? But I'm confused about how to do it? No matter how I try to implement it, it seems to continue the fold.

In Haskell it just werkz because of lazy evaluation.

it seems the problem is in my terminal putchar(0) doesn't print anything while in your terminal putchar(0) is printing a space.

After doing some testing, it seems that if I do putchar(0) I get a space, but you seem to not? Dunno how that should work, I don't usually implicitly cast numbers to char

how do you make a program that locks the terminal window so it can't scroll, where the entire window becomes the program instance? I only know how to make programs that print shit to stdout on individual lines

thanks for nothing

It was a minor syntax hiccup on my part btw
everything is fine now

ncurses

How did they program ncurses though

Everytime someone answers with a library it just leaves me wondering how they did it with the library. If ncurses can move a cursor around a terminal then clearly there is a way to do it in C

forum.dlang.org/thread/[email protected]
Something big going on over in the D forums apparently

D is dead

look at the termcap/terminfo databases

terminals accept special control characters that move the cursor, print characters, erase characters, change colors, etc.

terminfo.termcap is a database that says what the control codes are for each terminal.

Nope

so ncurses just makes it so you don't have to write a different version of everything for every type of terminal, doesn't it

this should also be faster than
since the putchar function isn't called when it doesn't need to be.

I believe it cannot be optimized any more than this.

yeah + other higher level features like reading a whole string instead of character by character, windows, etc

dead board

it's the middle of the night, pal

.... brb deleting picture from hard drive

it was supposed to be a cute grill damnit

...

Here, have a different cute grill.

It's not dead; it's just that nobody uses it.

tiobe.com/tiobe-index/go/
What the fuck happened here

Not having schizophrenia

the elephant ears are meant to represent the balls

a.pomf.cat/kqoxkv.ogg
How do I fuck up less, /dpt/?

what can you do in Java? Why not use Python then?

it is a cute grill (male)
don't let something like a penis get in the way

I finished making tetris in JavaFx it was pretty fun and challenging

who gives a shit about you shills and your programming languages. the language doesn't matter, what matters is that you're using the language to study reality.
get the fuck off this japanese anime board and start exploring reality.

Reality has very little to do with programming.
All you're doing when programming is using some bullshit rules to get some bullshit result at the end.

'l' is uninitialised on the first iteration of the loop.

>math isn't real
okay

Started collecting metadata from sourcecode files using pyparsing

I don't ever want to go back to LR parsers ever again

>some bullshit rules
you mean stuff based on reality?
>some bullshit result
you mean stuff based on reality?

>Popular search engines such as Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube and Baidu are used to calculate the ratings.

TIOBE ratings are very dubious.

>implying java is better

>not using the parser monad

i've took a bunch of programming classes at my community college but they only ever teach me to write terminal programs that average grades and sort arrays and shit. how do i learn how to put graphics on it and apply this to actually making useful stuff like android apps or windows applications with graphics and buttons and shit?

I am also writing an operating system.

They are worse than dubious. They are clearly a horrid meme that are obviously broken every time they get posted.

Yet for some fucking reason, people all over the Internet bring them up in every discussion as if they are an authoritative source.

>sepples
i can already see that it's trash

And I can already see that your programming skills are trash.

they are by definition better than your """"""""""skills"""""""""" so i'm okay with that.

C++ is bad but so are you

What the holy fuck is the point of a concreteDecorator in the Decorator Pattern?

I liked geany too but it doesn't remember the file name for some reason

I have a document littered with shit like "\n\n\n", "\n\t\n\n\n\n\n\n" etc that I want to get rid of.

But also some relevant text that happens to have a "\n" stuck on at the end.

Is there a regex expression that can find only linebreaks/tabs of an arbitrary length, but ignore linebreaks attached to something else?

stop using a language shit language.

>falling for the OOPs meme

>the current year
>oop design patterns meme
Why so slow, no one gives a shit about the patterns for a decade now.

I thought we scared him off years ago.

Because I want to get better at designing code?

"""Design patterns""" are a terrible way to design programs.

Care to point me in the correct way then?

Common sense and good taste.

HTML is indeed shit
but what can you do

Post the document and post the desired output.

The purpose of design patterns is to shoehorn inheritance and other OOP concepts where they don't belong.

I was finishing some code some guy asked for help with yesterday.

Both of us were too tired to figure out why it was still fucked when I left him.

This is said code:

What on earth is that supposed to be doing?

Beats the hell out of me.

He needed it to read an unspecified array of length 4096, using a ranged array of length 1024, and redundantly read it, while incrementing by 128 for some reason, and anything that is out of bounds, pad as a 0.

IDK, I just solved it. Not the slightest clue what it's for.