/dpt/ - Daily Programming thread

What are you not working on?

Previous:

Attached: code_quality.png (740x258, 65K)

Other urls found in this thread:

github.com/mfyuce/GitTorrent
iana.org/assignments/socks-methods/socks-methods.xhtml
esolangs.org/wiki/List_of_ideas
gitlab.com/kisaragi-hiu/language-startup-benchmark
youtube.com/watch?v=3MB2iiCkGxg
twitter.com/NSFWRedditGif

Learning std::topolotical_sort

how do I program my own death

exit(1);

Attached: 3EcvwuIxz_Jt8SMt-Sn-T7VwvFNALry3erLWSkb5mPE.png (393x768, 143K)

get an arduino, attach it to a motor connected to a gun, and make it pull the trigger on a timer

reminder this thread is still up

Why are functional languages like Haskell, F#, Scala, OCaml etc so damn slow.

Well for Scala and F# is slow because of their VM but why are Haskell and OCaml slow? Is it because of immutability? Can't the compiler optimize expensive copies?

for(;;)

GC, polymorphism, module boundaries
You can write areas of Haskell code that are compiled to loops with C speed, but it can't do that to the program in general & it makes the code a lot less clean and a lot more C like

Is anyone well versed in RapidXML?
Why the fuck I got null pointer when accessing the root node name?
for example:
foo.xml


and
foo.cpp
rapidxml::xml_document doc;
char * file = open_foo();
doc.parse(file);

when I access doc.name() it returns a null pointer, instead of char pointer to the string "foo"
Also when I access doc.first_attribute()->name() it also return a null pointer, instead of char pointer to the string "ver"
how to get the name of the root and the name of the attribute?

Rust has polymorphism and trait bounds too (is that similar to module boundaries?). But it has a decent performance.

Is the "Right Tool for the Right Job" motto accurate?

What's the right tool for say Java VS C/C++ VS Rust?

>Java
Mobile
>C/C++
Drivers and kernels
>Rust
Servers, Desktop apps.

Is there anything more comfy than picking up some canned coffee before spending all night programming while listening to takako okamura's entire discography?

Attached: daruku14.jpg (1280x720, 61K)

yea, having some oolong tea instead

What are your guys thoughts on Rust?
Worth learning even with all the faggot surrounding?

Rust needs a major fucking update, like C++ did with C++11. As of now, Rust is not ergonomic. The tools are nice, the dev environment is amazing but the language is a pain in the ass.

Decentralized Github NOW github.com/mfyuce/GitTorrent
Decentralized Github NOW github.com/mfyuce/GitTorrent
Decentralized Github NOW github.com/mfyuce/GitTorrent
Decentralized Github NOW github.com/mfyuce/GitTorrent

Attached: what the fuck.jpg (706x480, 96K)

Da fuck is wrong with you? Who the fuck cares who owns the fucking site?

If you want something done, use Python or Java. If you want something done right, use C/C++

>66307557
Smarter people. You don't even deserve a (You).

nice

>decentralize a centralization of a distributed system
wot

Eclipse and Android Studio are torturing tools. FUCKING TORTURE

iana.org/assignments/socks-methods/socks-methods.xhtml
So, how do I get description of how those guys extended the protocol? I have to write them "What do you mean by 'Challenge-Response Authentication Method'"?

>torture
You clearly haven't use Rust yet

Attached: ap,550x550,16x12,1,transparent,t.u1.png (549x413, 137K)

Need some project for class, I have 3 weeks time. I have a couple ideas but i'd like to hear something that isn't a calculator or something.

is a i3-3220 cpu + 8gb ddr3 1600mhz + ssd enough to program for android (android studio)? I keep thinking I need a supercomputer in order to program a "hello world"

Make an esolang.
esolangs.org/wiki/List_of_ideas
Most of these ideas are shit but you get the idea.

It should have some form of use tho, but thanks for the link

I feel you. I feel you.

Attached: 1476535232394.png (619x453, 46K)

>C++
>Drivers and kernels

Why do you think that C++ is more suited to those tasks than Rust?

dumb frogposter

Rust has 0 reason to exist

Cocs

yes, use phone and not an emulator for lower config, but you'll be fine with this one

Rust is the future of C++. Days of monolithic APIs are over and C++ is suffering from it.

everything productive

Attached: 1526386978527.jpg (613x587, 11K)

Because currently the language needs a major ergonomics overhaul see

>Rust is the future of C++.
Not until it gets a complete syntax overhaul.

>bash starts faster than go
lol
gitlab.com/kisaragi-hiu/language-startup-benchmark

based

Attached: language-startup-times.png (800x500, 50K)

thanks, brother

>startup time in seconds
>they're all sub 1 second
How can someone be so incompetent at something as simple as making a graph.

>vala
Ahh yes.. I loved that one

>a pain in the ass
Having a pain in the ass is a requirement to comply their CoC/k/

Attached: rofl-xd-lol-xd-57b2efbd21ba0.jpg (720x540, 185K)

Nim hit 5k stars!

Attached: 2018-06-11_12-05-40.png (1002x167, 50K)

It's officially hot trash

Nim's a decent sepples killer.
It just needs time to progress and clean up stuff.
Also i really love it's style agnostic options, even though i think a language should really have one or the other. But it's neat for one to try it.

Which component do I use in windows forms to display all the data of a table in a database?
DataGridView?

#include
#include

int main()
{

int min, max, t = 0;
scanf("%d %d", &min, &max);
bool a[max - min + 1];
for (int g = 0; g

>using go run instead of compiling
kek at whoever made that benchmark

one is not portable, could be interpreted as success by some people. use exit(EXIT_FAILURE);

Attached: 1446375648303.png (1070x601, 463K)

Not familiar with that library, but in XML the document is a node in itself and different from the root element. It is not an element and so has no name or attributes. It's first child element will be the root element. In libxml, there's the function xmlDocGetRootElement which would return the node for , there might be an equivalent for rapidxml.

I hadn't realized just how much of a clusterfuck C++ is.

youtube.com/watch?v=3MB2iiCkGxg

Things don't get stigmas for no reason, user.

I knew it was bad from my own experience. I just hadn't realized quite how bad it was because most of the projects I've done with it are reasonably simple.

This rundown of common facebook bugs did make me appreciate Rust more though, since many of them are stuff that the borrow checker + sync trait & type system would catch.

>making CLI interactive program
Should I use 'quit' keyword to terminate the program or 'exit'?

Attached: 1509012129602.jpg (400x400, 20K)

need one to terminate the program, and another one to get out current mode while the program still run

There's no way that's not gonna end in confusion. Have the method for exiting a mode be entering a different mode.

if a number is divisible by multiple square numbers it will be counted multiple times I think

Attached: C++ was a mistake.png (960x733, 253K)

>no main function
>no return
Is C++ really the lawless wasteland you guys make it look like?

just make it handle CTRL+C and CTRL+D gracefully, like grownups do.

>no main function

Attached: 1514234475503.png (645x614, 83K)

>no return
its a void function

It compiles, nobody said anything about linking.

>obj file needs to have a main function
>void function needs to contain a return
u wot mate?

Btw, it doesn't compile if you write that line twice in the function, because of an ambigous variable declaration error.

$ cat test.cpp
#include
void f() {
std::string(foo);
}
$ g++ -o test test.cpp
/usr/lib/gcc/x86_64-pc-linux-gnu/8.1.1/../../../../lib/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

I don't really like C++ either, but fuck off with your Jow Forumsprogramminghumor shit-tier memes

>but fuck off with your Jow Forumsprogramminghumor shit-tier memes
it's from a C++ talk this user linked

Compiling and running are two different things.

>compiles
>doesn't link
>thinks this means it didn't compile
This man is dedicated to trolling

C++ weeding out the shitters as usual

import os, strUtils, strformat

let
heuristics = paramStr 1
heuristicsChunk = 4
workspace = paramStr 2

var
newName: string
n: int
i = 1
for line in heuristics.lines():
if i mod heuristicsChunk == 1:
n = parseInt line
elif i mod heuristicsChunk == 3:
newName = fmt"{n}::{line}"
echo fmt"{line} will be renamed to {newName}"

inc i

I don't see any reason for it not to compile though?

Attached: 1518262781356.jpg (795x1097, 319K)

Just the fact that
std::string(foo);
std::string foo;

are the same shit.
and
std::string{foo};
is also valid.

That means something else. The first two are declarations, the third is a temporary construction (assuming foo is in scope).

Yes. Basically, the syntax is ambiguous on whether something is a variable declaration or a function call.

baka

Attached: 1527068662985.gif (287x344, 72K)

The underlying infrastructure isn't a stack based representation. It's a iterative based representation with some stack based elements. Whatever optimizations you nay prefer to use, it doesn't matter because the iterative language uses the same optimizations and they have the benefit to not optimize away as many function calls

desu JavaScript for everything requiring a GUI and Go for everything else

That's a really weird way to write C-x C-c

I'm making new modals for instructions on steps made on your phone in a major company's equivalent of iTunes

declaring all my variables as static to reduce the chance of stack overflows or memory leaks

just make everything immutable.

That's the best way to run out of memory.

>being this incompetent

Rewriting Linux with 4GB stack.

How do you launch your program from Vim?

Go back to your 1GB/s fizzbuzz hasktard, we have real work to do here.

What is the rule of thumb for the optimum size when creating memory pool?

>we have real work to do here.
Obviously not if you run into OOM errors with modern amounts of ram.

Hydrus replacement that is not a horrible over-abstracted slow piece of shit.

Sonic fangame

Attached: 20180610-161357_screenshot.png (640x480, 56K)

:!./myprogram

Cool, make it able to actually tag the majority of images instead of just a few of them.

Do you fags actually ever work on anything or do you spend your days shitposting?

Attached: nightman.png (1280x800, 532K)

I wish I had a cute programmer gf.

No you don't