/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

harmful.cat-v.org/standards/
twitter.com/wikileaks/status/850758438451765253
twitter.com/wikileaks/status/850765624477274112
twitter.com/wikileaks/status/850782274362593280
twitter.com/wikileaks/status/850783902616625152
twitter.com/wikileaks/status/850692885062139904
g-2.space/sr/dms.html
twitter.com/wikileaks/status/850285712696061953
twitter.com/wikileaks/status/850323865972596738
twitter.com/wikileaks/status/850339013412114432
youtu.be/uxmMt4EW3PQ
youtube.com/watch?v=UJdioGzBiY0
wikileaks.org/ciav7p1/
wikileaks.org/vault7/
stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags
youtube.com/watch?v=XT25JQ6X9OU
twitter.com/SFWRedditImages

Please do not use an anime image next time. Thanks.

Reminder:
harmful.cat-v.org/standards/

UTF-8 is the only good string encoding standard.

>programming on wangblows

>HINSTANCE hPrevInstance

I doubt that animegirls are into winapi desu

What is man supposed to use when here's just no good statically typed and compiled language.
>sml
no good implementaion
>ocaml
sml with shitty syntax, also does not support native threads
>lisp
too verbose, also static typing not standardized
>c
decent but manual memory management is annoying in prototyping phase
>sepples
cluster fuck that no sane person would touch
>d
can't decide if it wants to have gc or no
>rust
better stay away from it because it attract lot of crazy hipsters
> any jvm/clr lang
requires huge vm
>go
Rob Pike is faggot, also no macros

fuck uriel and his gang
the only good thing they ever made is dmenu

>cat-v
opinion discarded

Pascal?

time to write your own language

Anyone arguing against UTF-8 should kill themselves.

>Not using Ada with RAII or scoped dynamic memory pools

Honestly why shill Ada when even the military stopped using it?

The thing I don't like about Unicode is the fact that code points are distinguished from code units even though you still sometimes need multiple code points to represent a grapheme, and some graphemes can be represented in more than one way.

Otherwise it's definitely the best thing we've got. It's extremely unfortunate that Windows uses UTF-16. UTF-32 is kind of worthless because graphemes essentially have a variable-length encoding on top of code points.

>why shill Ada
Cause it's genuinely really good? I don't follow.

The syntax is horrible

It's constant and obvious. I bet you could read a complicated program in it right now and you would follow it easily.

Not an argument.

>end

That's not a good thing user. That's like saying COBOL is great simply because i can read it even as a layman.

...

End isn't valid on its own. What are you taking about?

>Clear meaning isn't good
>Muh sekret klub

Do you also think COBOL is great user?

Is it true that IIT produces the best programmers?

I've never used it. But if the only negative you can come up with is 'clear intent', it sounds pretty good.

The biggest problem with COBOL is that it doesn't support local variables or dynamic memory allocation.

Stuck on this gay pancake problem in google code jam.
Doing it in C.
Help me.

MASSIVE WIKILEAKS HAPPENINGS HAPPENING AT THE SAME TIME RIGHT NOW

HUGE NSA HACKING TOOLS LEAK IN PROTEST OF TRUMP STRIKING SYRIA

twitter.com/wikileaks/status/850758438451765253
>Shadow Brokers releases password to NSA hacking tool binaries from 2013 as "protest" over "abandoning base"

twitter.com/wikileaks/status/850765624477274112
>Browsable decrypted Shadow Brokers "NSA" hacking tools+docs files corresponding to password released today

twitter.com/wikileaks/status/850782274362593280
>Today's #ShadowBrokers NSA dump shows hundreds of NSA attacks on China + pretending to be China when hacking

twitter.com/wikileaks/status/850783902616625152
>Today's #ShadowBrokers NSA dump shows hacking attacks on EU states, LatAm, Russia, China, Japan & South East Asia

LEAKED GUCCIFER2.0 CONVERSATION SAYS SETH RICH WAS THE LEAKER
>SETH RICH WAS THE LEAKER

twitter.com/wikileaks/status/850692885062139904
>Direct Messages from U.S. alleged Russian spy @GUCCIFER_2 to actress-model @robbin_young (according to the latter) g-2.space/sr/dms.html

VAULT 7 PART 4

twitter.com/wikileaks/status/850285712696061953
>RELEASE: CIA malware for Windows "Grasshopper" -- which includes its own language

twitter.com/wikileaks/status/850323865972596738
>CIA malware "Grasshopper" re-installs itself every 22 hours by corrupting Windows Update--even if is disabled.

twitter.com/wikileaks/status/850339013412114432
>CIA docs show that its "Stolen Goods" malware is based on code from "suspected Russian mafia" #Vault7

Julian Assange Press Conference and Q&A on Vault 7, Year Zero and the CIA (03-09-2017)
youtu.be/uxmMt4EW3PQ

WikiLeaks Julian Assange Press Conference On CIA Hacking "Dark matter"(3/23/2017)
youtube.com/watch?v=UJdioGzBiY0

wikileaks.org/ciav7p1/
wikileaks.org/vault7/

I was doing tidy numbers until I came across the test case 111111111111111110 which is going to take literally ages to run through in either direction.

How the fuck am I supposed to turn in the answer in less than 8 minutes?
There's 100 inputs and they're all 10^18 numbers like this.

Go to IHOP, get inspiration.

How do I edit certain parts of an HTML file in C++.

Anyone solved D guys? Is it fucked up? Got meself 65 points and now I am tired

>implying dwm isn't good
it's probably my 2nd favorite WM after CWM

Can someone help me out here? I got a linux box with apache php mysql and wordpress installed. Now clearly i intend to make a website.

Now I want to write the website in java... so do i wipe the box and put tomcat on it? Wordpress makes it look nice and pretty and shit but that uses php.

I am super super confused right now

Yes, I want to write it in java

You are most likely overthinking it a lot
Take a breath and start fresh, it's really easy

You could use a PHP Java interpreter

>lisp
>too verbose
it honestly depends on the dialect

Learn Haskell, then Idris

If it's not too complicated regex should work.

>haskell
>garbage 1gb/s

stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags

>believing memes

>he doesn't know

>implying

WHO ARE YOU QUOTING

>python developer
>want to learn C++ to get dat hedge fund money
>start Accelerated C++
>supposedly a book for people who can already program
>introduces basic concepts like loops at length with dense, jargon-filled text

I was promised a quick and dirty intro to C++

What the fuck is this

>implying implications

Yo fellas.
I have written a space invaders clone. Now I need to make it so when I press a key it goes in reverse. I am using a stack and I got it to push values on, but I can't figure out how to pop them and have it actually "play" in reverse.
Right now I'm making all the game features into functions, then maybe I will have it simply go backwards if passed certain values. IDK

>python developer
It's too late. Your brain is far too damaged.

kek. Thanks, did not know this.

Typical python "dev"
You're on the same level as people who don't know anything about programming, lmao

You.

Sad but true.

Python babbies always get flustered when I interview them.

You're going to need all the help you can get to de-retardize your brain, pycuck.

Rewrite it in Idris. Then it will pretty much add the feature for you.

Show me your ways, wise C++ jews

How do I convert

Learn a real language like JavaScript

C++ is pretty much never used for new projects now

...

>C++ is pretty much never used for new projects now
Don't say that.

Why? It's true. Most new projects are done in more modern languages.

>learning javascript
youtube.com/watch?v=XT25JQ6X9OU

Modern C++ is a thing, too.

...

I don't know what would Dijkstra love.

Too little, too late. Maybe if C++17 had been C++07 then the language would survive.

Does anyone know why I get this error? I'm trying to auto open an HTML file that was created.

Functional Programming.

So JS?

ShellExecute most likely wants a const wchar_t.

>this is what haskeks actually believe

Use ShellExecuteA or prefix your strings with L for wide strings, i.e L"open"

TY, I placed an A after "ShellExecute" and it worked. wtf why though, lol.

>not le argument

the quirks of winapi

It's strong in game development, and wherever you need performance, that's all I care about.

If you want performance you should use FORTRAN.

Windows has two version of most functions taking strings in some form, an ascii and wide char version - ShellExecuteA and ShellExecuteW in this case - and then ShellExecute is a macro which gets defined as one or the other depending on whether _UNICODE is defined (which it is by default in Visual Studio since 2010 if I remember correctly).

Windows fucked up by picking UTF-16 and a wide char type for their unicode solution which broke binary compatibility, requiring two versions of every function dealing with text.

You are out of touch if you think that C++ is dying. It is the third most used language. There is not an obvious replacement for it or the vast ecosystem.

Rust, of course.

>It's extremely unfortunate that Windows uses UTF-16
Oh, the good ol' days when people thought we would solve the codepage problem forever by simply moving to 16bit chars.

Yeah
And Esperanto is an obvious replacement for English

You don't believe that yourself, user.

Rust is great but the ecosystem is pretty bare.

>le
You have to go back.

Fortran's performance advantage is specialized in certain types of matrix calculations. And with C's restrict keyword, performance is almost the same.

please explain restrict like I am a retard

I was about to do a project in Elixir
then I saw a youtube video
then another
then another
then another
then another

pointers don't point to the same memory location

Esperanton oni kreis ne por anstataĆ­igo de l'Angla lingvo.

When you mark a pointer restrict, you are promising the compiler that any accesses through it are non-aliased. This enables some minor optimizations, but can be used all over the place so in total you can get a big gain.

What does the original say?

It's pretty much the opposite of volatile, if that helps.

restrict has absolutely nothing to do with volatile.

Volatile says that the memory might be modified more than assumed by default, restrict says it will be modified less than assumed by default.

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

Is it allowed to label something both volatile and restrict?

Python scripting project because webdev and (((hybrid))) app devs are mentally damaged.

You could have just said BASIC but thanks anyway.

It's allowed but I'm pretty sure it would be nonsensical.

>Volatile says that the memory might be modified more than assumed by default
Volatile says that reads and writes to it should not be cached.

Probably, but it would be pretty useless. restrict aids optimisation, but volatile hinders it.

False. Volatile is an optimization barrier that says a value might be changed in-between accesses.