/dpt/ - Daily Programmmmmmmmming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

github.com/tkarras/progressive_growing_of_gans
youtube.com/watch?v=2Op3QLzMgSY
en.wikipedia.org/wiki/Brussels_sprout
twitter.com/NSFWRedditImage

Trying to figure out rust macros.

>speckles_the_bird_on_the_keyboard_by_leftygreenmario-d6d0qid.jpg
>the bird
THE bird
on THE keyboard

Let the purposeless arguing begin (again)!

Also, Rustfags are cucks.

Is Carp the future? It's a fast, static, type-inferred lisp with automatic GC-free memory management and good C interop.

CLI calculator app.
AST parsing is difficult desu.

You blubbering idiot. I'm

c++ is the greatest language of all time

Carp is an interesting language. I'd be interested in learning more about it. Ideally interop with Rust would be relatively painless

You say "Lisp" as if it were automatically a good thing. Had it been "C-like" I'd have been more convinced, but to the same effect

...

Have you eaten your programming sprouts today, /dpt/?

A close second to C, but I get your point.

...

Whatever an sprout is, your image is a poor example of it.

C++ is probably the only language that sends both its compilers to infinite loop.

Care tô share any example? You're full of shit

I'm relearning c right now (I had to develop a quick and dirty understanding to translate between mips and c for my intro processors architecture class). It really is an elegant language.

struct Loop { Loop operator->(); };
Loop i, j = i->hooray;

AYY
BTFO BTFO BTFO BTFO BTFO BTFO

I understand at most 50% of it. That's some kind of iterator operator, right? But still C is the most

Wrong

2018 will be the year where we witness the marriage between hentai and machine learning.
I have finished collecting my custom hentai pussy and penis dataset (69,854 images) and will train github.com/tkarras/progressive_growing_of_gans on it. In a few days, results will be posted here.

This is holy work user. Godspeed.

It's only like 20% of a language. IIRC it doesn't even have macros

>tfw I am a .NET developer
At least I have a fucking job

Same.
Full-stack?

Looks like they fixed it. GCC reports
z.cpp:3:19: fatal error: template instantiation depth exceeds maximum of 900 (use -ftemplate-depth= to increase the maximum)


while clang reports

z.cpp:3:19: error: use of 'operator->' on type 'Loop' would invoke a sequence of more than 256 'operator->' calls
Loop i, j = i->hooray;

Yep.

Haskell is best language

That's hardly a fix if the language is still fundamentally wrong. Just use C.

Lisp lets you put the macro expander in an infinite loop very easily. Is that a "fundamental" problem?

That's a shitty way to "fix"

Does /dpt/ recommend a standing desk?

Is there any way to begin learning programming from square one pants-on-head retard zero clue level with LISP? A lot of the books at the library explain LISP as if the intended reader already knows programming basics, which I do not.

I thought the idea of objects becoming operations and operations becoming objects in an endless loop was beautiful. I had an idea that complex things like consciousness is really just a phenonemon resulting from layers of interactions between many very simple processes, and I feel like with enough time and parentheses, I could create something close to a sentient being.

I'm just a brainlet art major (and we can't enroll in computer science courses), so I have way too much time on my hands and even the slowest-paced course would be fine for me. Any recommended online course/books?

youtube.com/watch?v=2Op3QLzMgSY

These lectures are actually just awesome as a whole for programming in general.

im excited to see this

Sorry brainlet but qualia is still ineffable. Explanatory gap has been proven insurmountable by several philosophers

en.wikipedia.org/wiki/Brussels_sprout

>Brussels sprout
>Brussels
>ls
>s
my childhood is a lie

do you accept thicc thigh animu grils as thanks?

I have tons of time. Not quite infinite monkeys and infinite time, but a similar situation.

Grabbed this library from git however I'm not sure how I should include it in my makefile to get it to work nicely so I can just #include

Said makefile. Do I need to include an executable?
cmake_minimum_required(VERSION 3.9)
project(poker)

set(CMAKE_CXX_STANDARD 11)

include_directories($/Home/Documents/Programs/pokerstove/src/lib/pokerstove/peval/)

set(SOURCES HoldemHandEvaluator.cpp $/Home/Documents/Programs/pokerstove/src/lib/pokerstove/peval/HoldemHandEvaluator.h )
add_library(HoldemHandEvaluator.h)

add_executable(poker main.cpp)

Sure but not necessary. A better reward would be if you just stuck with it instead of giving up after a few days or weeks.

Who else /working tomorrow/?

>make functions that take functions and generate new functions that somehow solve the problem you actually want to solve
>rather than simply making the function yourself directly
what a roundabout way to solve a problem
academic wankery at its finest

I know, right? It's as if they don't want to continually make trivial functions, wasting valuable time. Instead they would rather just use significantly less time creating a function that can generate the trivial functions they need, instantly. The absolute mad men.

I'll stick with it for a very long time, I'm a slow learner. The videos you linked get into math-y things, should I learn that stuff first? I can get some high school math textbooks and a TI-84 for pretty cheap.

Nah, you can do that in your free time but if you have a grasp on algebra and some trig, you should be good. Study those things as needed.

>video from 1986
if it were possible to use lisp to solve our "trivial" problems for us, we'd have figured out how to do it by now

LISP is too powerful for mere mortals

Just trig? I'll hit the books and see if I haven't smoked myself retarded since high school.

I would advise studying it as it comes up. I had to take a lot of calculus and ordinary differential equation courses in college for my comp sci degree and I guarantee I hardly retained most of it. It'll just be easier for me to pick up if I ever needed to.

Question
Can i put my computer at risk by clicking or saving images on these threads ? is it possible to put a virus or keylogger embedded into them ?

>is it possible to put a virus or keylogger embedded into them ?
research why moot implemented captcha on posts

Somebody explain to me why the delete operation for a doubly-linked list runs in constant time

>The definition of the Delete operation states we are given a pointer x to the item to be deleted But what we really need is a pointer to the element pointing to x in the list, because that is the node that needs to be changed. We can do nothing without this list predecessor, and so must spend linear time searching for it on a singly-linked list. Doubly-linked lists avoid this
problem, since we can immediately retrieve the list predecessor of x

But isn't x contained in a node which means that we can't access the previous node without a pointer to the node that contains x?

x is a pointer to a node

the pointer is to the node
it's saying that in the singly linked case you also need the pointer to the previous node

Moot implemented captchas because some faggot started spamming pictures of a troll holding a sign with different numbers. If you're talking about the images with self propagating JavaScript in them, that only happened because retards on this site actually followed its instructions by renaming the file extension to .js and running it.

well i mean you always need the previous node but in the singly linked you need to go all the way around to get it, while in the doubly linked it's just there

Thank you for posting a bird :)

will doing a factory restart on a laptop or tablet get rid of viruses and keyloggers?

That seems to make insert somewhat cumbersome but I guess it's more efficient for deletion

Not the ones they installed in the factory :^).

most of them, but not all

>insert more cumbersome
It's barely anything but you save a ton on deleting
If you're writing some super fast code you wouldn't use a ll anyway

from the signature it looks like he's just inserting at the front or end

>IIRC it doesn't even have macros
Pretty sure that's wrong.

>dat feel when web programming jobs are making me use shitty web dev languages when I could be programming in glorious C elsewhere

Why did I take the easy route and apply for nodejs web jobs? I'm a C++ at heart. Ah well, easy money, I guess.

Depends on your tomorrow as 1st jan or 2nd jan.

You know what, Sup Forums, for all the shit-flinging y'all do, you guys are at least 70% of why I'm halfway decent at programming. I really do appreciate all the help offered here. It's like Stack Overflow without all the pretentious bullshit.
The memes here are pretty good too.

Thanks, everyone, here's a great 2018!

*here's to a great 2018. My bad

you could always web dev in C++

Let me guess, web dev libraries? Good luck ever convincing any web heavy company to use it.

( ._.)

Shut up, C++ webdev shill.

the fuck does the "&~" bit-wise operator do in c

I can't find macro definitions anywhere in the source or in the docs.
Also, I'm pretty unsure of their "ownership tracking" since they're just borrowing that term from Rust, yet they only implement half of it (only the linear types part; the reference types aren't very safe as far as I can tell)

It's sort of like the --> operator

& = bitwise and
~ = bitwise flip
These are used together to "mask" certain bits, so that all other bits are set to zero.
e.g.
X & ~ 5
turns off all bits in X except for the 0'th and 2'nd bit (since 5 = 1 + 4 = (1

It's constant time, assuming you already have a pointer to the node you want to delete.

I do tons of webdev in C++
I do the frontend in python (w/ django) and a bit of js now and then
but 95%+ of my time is spent working on the software that actually does all of the shit that matters
and that's all C++

My new job is going to have me using C# and NodeJs. I know the js syntax and am currently messing with nodejs. I hope they don't think I can't do the job. Nodejs seems easy enough and the event loop isn't any different from when I was doing windows event programming or java event programming. Any advice?

posting here too just because

can anyone answer this

>defining and then using as variable on the same line
It's your own fault

Pointers are just an address for where your data is located in the computer's RAM. You don't "get data out of pointers": pointers just tell you where to look for the data

I don't suppose any of you know how to gather raw graph data from forex/stock market graphs using java?

Also C lets you treat pointers like arrays. You can take any random pointer and call variable[1] to interpret the next chunk of memory over from the pointer's data as another instance of that same type. Arrays and pointers are sort of the same thing.

Make an HTTP request to the API for wherever your data is located, parse the data, ???, profit!

Thanks user

哩喜呆灣郎?

double *ptr = malloc(sizeof(double) * 3);
ptr[0] = 12.3;
ptr[1] = -753.61367274247;
ptr[2] = 100000000000000.1;
printf("1=%f 2=%f 3=%f\n", ptr[0], ptr[1], ptr[2]);


what he said

so how is a "chunk of memory" defined? I mean if I did malloc(16) or malloc(2*sizeof(double)) like others are saying how does this work? or like in where the pointer is incremented to specify the next chunk. how does the computer know what size a chunk is?

>You say "Lisp" as if it were automatically a good thing
It is automatically a good thing, assuming it actually has the qualities of a Lisp, which this thing doesn't.

Happy new year you shitty language using faggots.

FTFY.

...I actually have. What do I win?

>so how is a "chunk of memory" defined?
In :
double *ptr = malloc(sizeof(double) * 3);
Memory address at ptr reserves space equal to that of 3 doubles (64b * 3 ) after the starting memory location. ptr is also of double type so it will store each value you give it in 64 bits, regardless of how big it is. Therefore, you can only store 3 values in that space safely. You can however go over this value, but you will overwrite whatever maye have been stored outside of this memory range.
E.g. ptr[3] = 5; may store 5 in the memory address of another variable. Some compilers detect this and throw errors, others do not.
This is because the index from ptr moves in double bit amounts. So index 0 = 0, index 1 = 64, index 2 = 128, index 3 = 192, index 4 = 256, index 5... etc

>how does the computer know what size a chunk is?
Defined data type standards. A double is always 64 bits, long 32, int 16, short and char are 8 regardless of language.

>long 32, int 16, short and char are 8 regardless of language.
None of this is well defined portably, senpai.
char is at least 8 bits, int is at least 16, everything else is free game.

>A double is always 64 bits, long 32, int 16, short and char are 8 regardless of language.
That's wrong, though. Also, I think he was asking about malloc's book-keeping (how does it remember which regions are occupied?)

I have a a git repo with a fairly long history that's grown to be huge (100MB) after cloning, though nothing in the present directory structure could cause it to be anywhere that large. After cloning the repo, the largest file is in .git/objects/pack/, about 90M. Any hints on how I could investigate this?