/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1542063086768.jpg (1280x720, 183K)

Other urls found in this thread:

learnxinyminutes.com/docs/python3/
github.com/lazywinadmin/PowerShell/
twitter.com/AnonBabble

Rewriting my C++ programs in C.

C++

Attached: 1543994528909.png (579x819, 742K)

Second for fuck anime.

You know I was thinking about it and I realized: JavaScript really does rock

Attached: 1483899720236.gif (540x304, 1.29M)

sexually

A perfect hash table has no collissions, but do these exist with no wasted space also?

too much of a brainlet to understand the zero overhead abstractions?

>35 years old
Gross

>tfw to smart to fall for the zero overhead abstractions meme

Why? C++ is backwards compatible, so all C++ code is also a valid C program

Because C++ is shit.

yeah no

Imagine being so retarded you can't even understand C++.

>all C++ code is also a valid C program

Attached: 1534590772786.jpg (221x250, 9K)

C is to C++ as ebonics is to english

How can I learn python in the least amount of time possible? I applied for a job with absolutely 0 python knowledge and I got called back for an interview

Attached: 1544668610520.jpg (600x600, 53K)

It's bait

now this is an excellent post

Help me understand this post
Do girls who use C++ look like this?
Do men who use C++ like girls like this?
Is this girl the C++ language itself, seductively showing off her zero cost abstraction vtables just for me?

vtables are zero cost??!?!?!

I am building some new tools for comfortable GUI development in C++.

ZERO COST VIRTUAL ABSTRACTIONS POSTMODERN MEMORY ALLOCATIONS CIRCULAR BUFFERS

good repeating numbers.
>What are you working on, Jow Forums?
being comfy. Its comfy.
Lots and lots to improve, but I got hard time looking simple stuff like how the creep gait exactly works on robots. I maybe should write a documentation about all this shit i do. We need more robot documentation on the internet

Attached: drugs.webm (1280x720, 2.45M)

>creep gait
wrong. Creep gait is out there. I mean trot gait.

All 3.

Attached: 1543545369031.png (579x819, 519K)

finally some good posters in here

Attached: 1456582658044.png (406x385, 278K)

A brilliant article

Attached: paper.png (794x618, 184K)

Attached: boy_or_girl.png (617x674, 61K)

i just had a stroke reading that. thanks

I have always been here user

Attached: 1540356039219.png (627x900, 655K)

learnxinyminutes.com/docs/python3/

>C++ coders are pedophiles
Explains a lot actually

i really enjoyed their early work on decoupling compilers

Attached: paper.png (729x432, 92K)

You are on the techloli/g/y board on a pedo website, what do you expect?

Attached: 1450221665795.png (1254x890, 453K)

>those authors
lole
link to paper?

Men who use C++ look like this.

Have you looked into Jobs et. al.’s recent work on fuzzy blockchain applications? They are promising but there are still unsolved problems relating to the fuzz building up static electricity which can damage the VRAM.

does it web scale?

Should I learn Lisp if I hate Jews?

and you better never leave
pedo website

If you're not a pedophile or a C++ programmer, you're mentally ill.

Fuck off trapfaggot, traps are gay filthy disgusting homos and will never ever be cute. Take your garbage fetish someone else.

Attached: 1529300918932.png (579x819, 617K)

learn rust

Hey I'm learning C, could someone set me straight on this here? Thanks.
typedef struct {

char *city;
char *country;


} Location;


void loc_init(Location *loc, char *city, char *country){
loc = malloc(sizeof(Location));
loc->city = malloc(sizeof(strlen(city)));
loc->country = malloc(sizeof(strlen(country)));
strcpy(loc->city, city);
strcpy(loc->country, country);
}

int main(){

Location shitville;
loc_init(&shitville, "Fuckplace", "Fuckland");

printf("%s %s", shitville.city, shitville.country);

}

Attached: 20111126-clisp.png (506x362, 17K)

>does it web scale?
Enterprise-grade scaling is theoretically possible using load-balancing SLI GPUs and open-source satanic runes

malloc strlen + 1, the '\0' byte. or use strdup()

also I looked quick and didn't see it but sizeof(strlen()) is wrong, just use strlen() only.

>oy vey
SBCL is miles ahead anyway.
It also has some of the best code I've ever seen.

one more thing, remove this line:
loc = malloc(sizeof(Location));
loc is already allocated. If you fix all those things it should work.

Thanks but this still is giving me garbage

void loc_init(Location *loc, char *city, char *country){
loc = malloc(sizeof(Location));
loc->city = malloc(strlen(city)+1);
loc->country = malloc(strlen(country)+1);
loc->city = strdup(city);
loc->country = strdup(country);
}

nvm works thanks

barely tested
#include

#include
#include
#include

typedef unsigned char uint8_t;

typedef unsigned int uint;

static int isgirl(const char *name)
{
size_t i;
uint count;
uint seen;
seen = 0U;
count = 0U;
for (i = 0U; name[i] != '\0'; i++) {
uint r;
r = 1U = 4);
scanf("%100s", line);
if (isgirl(line)) {
fputs("CHAT WITH HER!", stdout);
} else {
fputs("IGNORE HIM!", stdout);
}
return EXIT_SUCCESS;
}

Imagine if this was a cross

strdup mallocs for you, if you use strdup you can remove the 2 malloc lines.

Attached: 1555011745592.webm (1280x720, 2.57M)

That should be it for today. Good night lads.
Tomorrow is kode cleanup tiems and all that boring stuff.

Attached: walkin.webm (1280x720, 2.44M)

Creating different modules for my friends IRCbot in python.

>still don't know how to manually build a program

Attached: 1494800626199.jpg (482x549, 57K)

It's alive.

why do people program in lisp?
do they have some parenthesis-philia?
i mean it would be based if lisp machines were still a thing but they are not

What in the name of fuck

is this a real VN? link please

Okay this is epic!!!!

BAIT

>Jow Forums can't make a game they said

I don't get the hate for Lisp parens

It'd make sense if it were coming from MLers or Haskellers but it never is, it's always Cweenies

I'm writing a script which queries my firefox history to get my most recently watched youtube vid, google translate it, find a torrent and add it to qbittorrent. It's a good idea, you should do the same. do it now

Code review my first powershell script Jow Forums

$timeout = if ($args.Count -eq 0) { 5 } else { $1 }

write-host Beginning poll to log user off after $timeout minutes of idle time

while ($true)
{

$idletime = quser $env:UserName |
select -skip 1 |
% {($_ -replace '\s{2,}', ',').Trim()} |
% {$_ -replace ',rdp-tcp#\p{Nd}+,',','} |
ConvertFrom-Csv -Header 'UserName','ID','State','IdleTime','LogonTime' |
select -expand IdleTime

if ($idletime -eq '.') { continue }
elseif ($idletime -ge $timeout) { logoff }

}


>inb4 >powershell
Its for an enterprise windows server I don't have much choice when it comes to shell.

blessed

why not put that inside a function?

It wasn't bait, Im honestly asking why. Low level lisp and lisp machines seemed like a great idea. So what happened

Why yes?
Its intended to run standalone

LISP is a very powerful language with a simple syntax.

it's good practice

github.com/lazywinadmin/PowerShell/

pick a library
use its functions

in opengl when using the compute shader you can exactly specify how many time it is getting called and every run has a unique id.
is there something like this in the regular drawing pipeline, like
>draw this model 20 times in a row
that way I could set the uniforms in a ssbo once and then draw everything in 1 go.

Attached: 1481539961641.jpg (353x332, 17K)

>very powerful
how many kilojoules are each LoC for lisp?

C++ is worth learning even if you don't use it
it has so many features that by the time you actually finish fully learning it you can basically do anything

Dumb anime poster. What do you even mean. What language? What is manual?

Everyone, in his heart of hearts knows that C++ reigns supreme. Don't fight it, kiss the ring.

>run compiler
>run linker/lib
i build libraries manually whenever i can, just to avoid the bloat that is cmake

how do i easily write a function that takes a templated type that has a lot of template parameters without duck typing?

lisp is very powerful
requires over twice the amount of energy of C programs

Attached: lisp.png (694x536, 331K)

Yes, instancing.

>Rust nearly overtaken C in two categories
damn those trannies are transitioning fast to the top

Lisp machines didn't actually run Lisp.

In Python, as function names:

>set_interface_mtu
>set_bridge_priority
>create_lag

vs

>interface_set_mtu
>bridge_set_priority
>lag_create

Which one?

Look mom. A table full of numbers.

template
void function(T t);
annotate the type with type traits if necessary and query them
use SFINAE or some other method to restrict it to whatever you want

that's exactly what I was looking for

Of course rust is fast. But until they provide modular compilation it will stay a joke.

That's fine, the more you lift, the stronger you get.

SEETHING

Attached: pepelaugh.png (378x357, 81K)

Wait 1 year and use concepts.

What do you mean?

concepts can be emulated in current sepples pretty easily, they honestly aren't necessary

B-but you can serialise parsed ASTs now! I-it doesn't matter that they break between compiler versions!

I know. Your point?
The emulation is disgusting. Use the proper thing when it comes out.

>what do you even mean
build a program from the source file/s
>what language
cpp
>what is manual
doing it manually by running the compiler instead of pressing Build in the IDE

Attached: 1514151905804.jpg (577x575, 59K)