[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 318
Thread images: 24

File: dpt before after.jpg (206KB, 700x671px) Image search: [Google]
dpt before after.jpg
206KB, 700x671px
old thread: >>61547024

What are you working on, /g/?
>>
Don't bring the STD shit from last thread in here please.
>>
How do I tell cmake compile a subdirectory of files with certain compiler flags without applying those flags to the rest of the build?
>>
File: 1493413670485.png (972KB, 1280x720px) Image search: [Google]
1493413670485.png
972KB, 1280x720px
If your language isn't functional, it's dysfunctional!
>>
>>61550100
Stop posting literal fag shit and delete this thread.
>>
File: trashkell_on_suicide_watch.png (448KB, 580x1500px) Image search: [Google]
trashkell_on_suicide_watch.png
448KB, 580x1500px
>>61550146
>muh "moan ads"
>>
>>61550146
#define pure __attribute__(pure)

static pure int func1(int a);
>>
>>61550155
There aren't monads in Scheme baka.
>>
File: what is this.png (111KB, 715x848px) Image search: [Google]
what is this.png
111KB, 715x848px
>>61550155
?
>>
>>61550152
>homophobe gets triggered by harmless anime
ahaha, stay mad stormfag :^)
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
First for "I haven't actually coded anything over the past 2 months".
>>
>>61550222
Why not start now?
>>
File: 1499486904283.gif (577KB, 540x540px) Image search: [Google]
1499486904283.gif
577KB, 540x540px
>>61550263
Not this shit again
>>
>>61550263
He can't program
>>
>>61550275
fine, i'll stop posting it
>>
>>61550292
Why do people hate it so much?
>>
>>61550302
It leads to a bunch of useless rolling posts.
>>
>>61550302
Not so much 'hated' as much as it's just posted way too often I think
>>
>>61550275
Nice tumblr gif.
I like the way the colours are all fucked up and overall lack of useful motion.
>>
>>61550115

https://cmake.org/cmake/help/latest/command/set_property.html

See if you can find something in that that will help you.
>>
Can someone suggest cool project to develop in elixir? Already learned the basics, want something to do, but no idea on what would be good
>>
>>61550308
>>61550317
Ah got it
Is it any good though?
I can never get think of something to code to test out my skills and this seems like a good compilation of projects for all skill levels
>>
>>61550591
If you can't make up your own projects you should work on that. Being able to take initiative and have ideas is important unless you're just hired to glue libraries. Probably important even then but less so.
>>
File: sweating pepe.jpg (54KB, 540x511px) Image search: [Google]
sweating pepe.jpg
54KB, 540x511px
name 3 programming languages
you have 10 seconds
go ahead, I'll wait
>>
>>61550722
can you wait more than 10 seconds
>>
>>61550722
in reverse order of quality
c
c++
rust
>>
>>61550734
hello can you please be more clear about your ordering
>>
>>61550747
best to worst
>>
>>61550722

C
C++
Ruby
>>
>>61550115
If you're trying to set compile options for a specific target you'll want to use `target_compile_options` over setting properties on source files or directories since sometimes those source files may be reused or you may have multiple targets in a directory that could need different compile flags. A guideline I use for the CMake builds I've created is to try to focus on using CMake's targets wherever possible since that gives me an independent axis to develop my CMake on. I then don't have to worry about directory trees and options getting inherited that way, instead I just describe the dependency relationships between my various targets.
>>
>>61550749
best to worst in reverse order???
>>
>>61550730
no
>>
File: tH3YTVf.jpg (61KB, 640x478px) Image search: [Google]
tH3YTVf.jpg
61KB, 640x478px
>>61550722
scheme
C++
java
>>
>>61550764
guess i cant then
>>
>>61550722
C++11
C++14
C++17

the only programming languages worth using
>>
>>61550817
C++ is garbage
>>
calculate the product of all the cubes of the integers in the range from 1 to 6.
The result should be 1,728,000, but look out for the base value!
>>
>>61550821
your mom
>>
>>61550722

C+
C++
C+++
>>
>>61550830
I never saw no 1728000 when converting the answer to different bases. Pretty sure you're wrong.

> (apply * (map (lambda (x) (* x x x)) (iota 6 1)))
373248000

And solution check:
https://www.wolframalpha.com/input/?i=product+of+first+6+cubes

That number in base 25: 1d5clk0
That number in base 26: 15ak608
>>
>>61550722
Basic
Logo
Pascal
>>
>>61550902
```
user=> (reduce * (map (fn [x] (* x x x)) (range 1 7)))
373248000
```
yeah, I was just about to double-check myself
>>
>>61550911
>reduce with no knil value
>fn [x]
what the hell?
>>
I wrote a C# console app that takes a txt as input and produces music using system beeps. This was 10 years ago, now I flip burgers
>>
>>61550933
user=> (doc reduce)
-------------------------
clojure.core/reduce
([f coll] [f val coll])
f should be a function of 2 arguments. If val is not supplied,
returns the result of applying f to the first 2 items in coll, then
applying f to that result and the 3rd item, etc. If coll contains no
items, f must accept no arguments as well, and reduce returns the
result of calling f with no arguments. If coll has only 1 item, it
is returned and f is not called. If val is supplied, returns the
result of applying f to val and the first item in coll, then
applying f to that result and the 2nd item, etc. If coll contains no
items, returns val and f is not called.
>>
>>61550957
Oh, it's clojure.
Oh, clojure has pattern matched lambdas.
>>
File: very popular post.png (72KB, 475x507px) Image search: [Google]
very popular post.png
72KB, 475x507px
>>61550957
>clojure
why would anyone do this to themselves
>>
File: que.png (234KB, 620x640px) Image search: [Google]
que.png
234KB, 620x640px
>>61550972
Actually what is wrong with it?
As a language, it is very comfy.
>>
>>61550986
It's the third least comfy modern lisp dialect.
>scheme > clojure > common > emacs
>>
File: hihg_speed_spinner.jpg (45KB, 636x471px) Image search: [Google]
hihg_speed_spinner.jpg
45KB, 636x471px
>>61551006
> muh LOOP
> muh DO
desu I switched to clojure from CL because of what you get out of the box
>>
How do I add a PPA without sudo privileges through a syscall?
>>
File: 1469488054577.jpg (25KB, 390x478px) Image search: [Google]
1469488054577.jpg
25KB, 390x478px
>>61550100
Writing a Malbolge interpreter in Rust!
>>
>>61551143
akari is cute!
>>
>>61551107
/fglt/
>>
>>61550100
Stop posting faggot shit.
>>
>90k out of 120k of debt paid
My life is being wasted on this
>>
>>61551532
>borrowing money
>>
I rewrote my backup encryption program

import os, binascii, time, subprocess, keys, base64, shutil, hashlib

pw = base64.b64decode(keys.password).decode("utf8")
gen = hashlib.sha512(os.urandom(4096)).hexdigest()
gen2 = hashlib.sha512(os.urandom(4096)).hexdigest()
gen3 = hashlib.sha512(os.urandom(4096)).hexdigest()
gen4 = hashlib.sha512(os.urandom(4096)).hexdigest()

static = time.strftime('%d-%m-%Y')

zippity = '"C:\\Program Files\\7-Zip\\7z.exe" a -t7z -p"' + gen + gen2 + gen3 + gen4 + '" -m0=lzma2:d1024m -mx=9 -aoa -mfb=64 -md=32m -ms=on -sdel -mhe -- ' + \
static + '.7z "c:\\test"'

opensesame = '"C:\Program Files (x86)\KeePass Password Safe 2\kpscript.exe" -c:AddEntry "' + keys.database + \
'" -keyfile:"' + keys.keyfile + '" -pw:"' + pw + \
'" -Title:"Backup for ' + static + '" -UserName:"' + \
static + '" -Password:"' + gen + gen2 + gen3 + gen4 + '"'

dank = subprocess.Popen(zippity, stdout=subprocess.PIPE, shell=True)
result = dank.communicate()[0]
print result
memes = subprocess.Popen(opensesame, stdout=subprocess.PIPE, shell=True).communicate()

shutil.rmtree('__pycache__', ignore_errors=True)
>>
>>61550722
HTML
JavaScript
CSS
>>
>>61550838
Less efficient and more bloated than C
>>
>>61551750
>less efficient
std::sort > qsort
>>
Is writing C-backed CGI websites in 2017 a crime?
>>
File: 1482998598056.png (157KB, 3184x2379px) Image search: [Google]
1482998598056.png
157KB, 3184x2379px
>>61551757
>>
>>61551800
It's a punishment.
>>
>>61551811
Why are you using streams if efficiency is a concern?
>>
>>61551825
streams is what C++ brings to the table
>>
>>61551835
C++ brings a lot of things to the table. If you want flexibility and safety you can use the new features. If you want speed you can use the C constructs which are still valid. Don't blame the language when you shoot yourself in the foot.
>>
>>61551811
>this meme image again
He was talking about sorting, not IO. Besides, you can always use C-style or even unbuffered IO in C++, but you can't have templates in C.
>>
>>61551848
>>61551850
>Maximum damage control mode
>>
I am trying to log into my email account on mail.com (using Python). I can't use IMAP/SMTP because it's a paid feature. Can someone help me how to send a proper POST request for the login?

I tried sending a "normal" POST request using the form information I got from their website, but my response says that I need to have cookies enabled. I assume it's because data is missing in the request's header, including cookies?

I checked what it sends using my web browser's developer tools and this is the content of the request's header.
I guess I can add some of those to the POST request. But what do I do with the Cookie line? Do I just add it into the header with the others or do I have to use the special cookie feature of the Requests module?
I see also that shownPromos has separators like "|" and ";". Do I just add the whole line as a string or should I create a dict?
The login data shows up under the Params tab in Firefox's Network information feature. I assume I send those as "data" in the request, as in session.post(website, headers=my_headers, data=login_form_data) (using Python's Requests module)?

Host: login.mail.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: https://www.mail.com/int/
Content-Type: application/x-www-form-urlencoded
Content-Length: 365
Cookie: cookieKID=kid%40autoref%40mail.com; cookiePartner=kid%40autoref%40mail.com; shownPromos=NUMBERHERE#LONGNUMBERHERE|1|false; ushallpass=true
Connection: keep-alive
Upgrade-Insecure-Requests: 1


Or if some Python/Requests pro could take a look at the website and give me hints how to do this ;_;
>>
>>61551858
>I can ignore legit responses by labeling them "damage control"
C-tards are really desperate.
>>
>>61551811
C pee pee objectively BTFO
>>
>>61551811
>assembly
>using syscall directly

>C
>including a whole library to the executable

>C++
>streams
>>
>>61551927
>>including a whole library to the executable
>Still lighter than C++
>>
>>61551927
>>61551934
I chuckled
>>
>>61551934
The C++ executable is less than 8% bigger than the C executable.
The C executable is at least 700% bigger than the assembly.
>>
>>61551956
So, still lighter than C. How sad
>>
>>61551978
*C++
>>
>>61551811
The benchmark is shit, he doesn't use -O2, he uses completely different APIs in all three cases and the code is so trivial he basically measures start-up time. It's in no way comparison between C and C++ languages, at best it's a shitty comparison between different IO libraries.
>>
>>61552009
>C++ has shitty IO library
Got it
>>
>>61552009
C++'s I/O is notorious for being fucking awful.
>>
>>61552032
>>61552009
>>61552029
Don't confuse IO streams for all IO. Streams make out only a small subset of IO in C++.
>>
>>61552051
C's stdio doesn't count. That is actually good.
>>
File: 0193.png (10KB, 532x192px) Image search: [Google]
0193.png
10KB, 532x192px
>>61551903
Spoof the user agent and use a cookiejar for cookies: http://docs.python-requests.org/en/master/user/quickstart/#cookies

And don't forget to send all the form data
>>
>61552029
iostreams isn't the fastest IO library out there, but it's safer and easier to use than (s)printf(n)/(s)scanf. Then again, C-style IO is a part of C++ standard as well, and raw syscalls are available too, so it's actually an argument against C.
>>
>>61552150
>C++ has "more", so it's "better"
Bloat != better
>>
>>61552156
>I'm too stupid to select the correct tool for the job
Shoo, Cnile
>>
>>61552156
>if I like it, it's "features"
>if I don't like it, it's "bloat"
I guess you don't use 3rd party libraries either, to prevent bloat.
>>
>>61552167
C++ certainly is never the correct tool for the job, so I guess you're in the wrong here.
>>
>>61552062
You're forgetting POSIX stuff like sockets, memory mapped files etc. There are many ways to do IO, that's my point. I write C++ for a living and I almost never use iostreams, because they're a poorly implemented attempt at doing file IO in "the UNIX way".
>>
How do I make a thread-specific flag to be set in signal handler?
>>
>>61551811
>Bitches about the width of the c++ code
>Uses 8 space tabs and std::endl instead of '\n'
Wew what an idiot.
>>
>>61552201
_Thread_local, I guess?
You have to go through more work if you want a signal to be handled by a certain thread.
>>
>>61550100
>tfw no programming gf(male)
It's hard alone guys :c
Anyway I'm working writing a compiler for this custom microprocessor we made in house in my uni with LLVM
>>
File: scren.png (51KB, 753x410px) Image search: [Google]
scren.png
51KB, 753x410px
I finally got it to recognize and handle negative signs correctly. Will anybody try to run and find bugs with certain expressions in my code?
>>
>>61550817
can't use C++17 in any professional setting, IMHO
>>
>>61552197
It's the correct tool for the unfortunate idiots that invested years into getting really good at C++ and can write inefficient crap fast. It's still inefficient crap though. They are responsible for global warming.
>>
>>61552148

Thanks, I'll give it a try and report back.
>>
>>61552278
So something like this?

#include <stdio.h>
#include <signal.h>
#include <pthread.h>

volatile __thread sig_atomic_t flag = 0;

void sighandler(int signum) {
if (signum == SIGUSR1) flag++;
}

int main(void) {
signal(SIGUSR1, handler)

while (1) {
/* blah blah */

if (flag) {
printf("%d received SIGUSR1", pthread_self());
flag--;
}
}
}
>>
>>61552446
*The while loop is in thread function, not in main, sry
>>
>>61550722
python
java
c++
>>
>>61552446
>__thread
_Thread_local is the standard way of doing that (added in C11).
But yes, that is basically what I was thinking.
>>
>>61551835
because they are comfy, not because they're efficient
>>
>>61552588
>comfy
They are a fucking ugly travesty.
>>
>>61552513
I googled _Thread_local and got only cpp references and some stackoverflow threads. Found __thread instead. So it's basically the same thing?
Also, currently I'm using c99 in my program but I don't think that would be a problem.
>>
>>61552632
they are literally the least ugly advanced tool in programming
>>
>>61552638
>cpp references
The website you're thinking of (cppreference.com) also contains a C reference.
http://en.cppreference.com/w/c/keyword/_Thread_local is specifically talking about C.
>>
New to python. I have some pretty large (~250 mb) data files I need to parse. It has a header that needs to be stripped and parsed, the header has a constant number of lines then I need to grab the remaining data into an array. The problem is that the data is space separated.

Heres what a truncated version looks like:

name                          file
mm:dd:yyyy date
1000 step
ASCII format
0.006590014826 0.01056775935 0.05037204215 -0.005005003458 0.0000000000000
0.007466250727 0.01017152043 0.05107891269 -0.005066066623 0.0000000000000
-0.002156435107 0.01796314096 0.02352260734 -0.004138336647 0.0000000000000
-0.002332655905 0.01775984036 0.02373702091 -0.004145065990 0.0000000000000
-0.002611070775 0.01725777888 0.02449372289 -0.004133134965 0.0000000000000
-0.002421410948 0.01637628893 0.02612801885 -0.004113625462 0.0000000000000
-0.001368118469 0.01514990826 0.02814966763 -0.004113994320 0.0000000000000
-0.0005231490794 0.01381049804 0.03054153926 -0.004171488907 0.0000000000000
>>
File: IC225104.png (10KB, 482x364px) Image search: [Google]
IC225104.png
10KB, 482x364px
i have started drawing a state diagram in mathematica to plan out a fairly complex stateful algorithm/machinery or what you want to call it. i've spent many days fixing up the code of a previous version of this algorithm so i wanted to plan this one out properly before i even write the actual code.

do you guys do anything like this, i know you're not big on UML diagrams, but state diagrams and other ways of illustrating algorithms even if it's just an mspaint drawing seem quite powerful compared to juggling everything in your head
>>
File: figure_13-1.png (145KB, 902x658px) Image search: [Google]
figure_13-1.png
145KB, 902x658px
>>61552753
I work on network code so I often draw stuff like picrel to visualize protocols and stuff, it helps a lot. I mostly use pen and paper tho.
>>
>>61552753
Yeah, when I approach a new or hard problem I mostly start by drawing it first, writing up some basic logic and only then I start writing code
>>
>>61552704
nvm fixed
>>
File: 1500793647233.jpg (17KB, 385x398px) Image search: [Google]
1500793647233.jpg
17KB, 385x398px
I have a list (.mp4's) that I want to host on a web page, its very basic.
What would be the best way to get a .html template and script it so that the title/filename/video location can be changed to what ever is on the list.
>>
I'm a bit confused. I am trying to parse a string as Complex struct I made. So I have to: 1. split with + and -, 2. trim any leading or trailing whitespace, 3. convert each slices into i32, 4. and finally collect::<Vec<i32>> them. How can I achieve this?
>>
>>61552945
parser monad
>>
>>61552062
>C stdio
>good
LMAO
>>
>>61552945
What you want to write is a lexer, not string manipulation.
>>
>>61552753
I personally think that state machines are really cool, for some reason.
>>
>>61550100
how did you guys become programmers? how hard did you have to work for it?
>>
>>61553079
>dont have a social life
>mostly put all your other hobbies aside
>immerse yourself in everything programming
>dont stop reading and trying new languages.
>>
I'm reading the 2nd edition of the Rust Book. It's a pretty bad resource, but the best one out there. At least it covers most of the language.
>>
>>61553346
>It's a pretty bad resource, but the best one out there.
>the cult language obsessed with new people dont have a good into book
Sad, whys it bad though?
>>
>>61553346
Rust Essentials
>>
>>61553380
Almost all language, especially C89 has their cults
>>
Time for some SAP ABAP
 DO 40 TIMES VARYING lv_lga FROM p0008-lga01 NEXT p0008-lga02
VARYING lv_betrg FROM p0008-bet01 NEXT p0008-bet02.
IF lv_lga IN lr_lgart.
IF lv_betrg NE 0.
lv_z = lv_betrg.
EXIT.
ENDIF.
ENDIF.
ENDDO.
>>
>>61553380
I don't understand the target audience of the book. It's tedious to read for experienced programmers, but the explanations are too shallow for novice programmers. Some parts are overly explained, while other parts lack certain depth.
>>
>>61553467
No one has shilled like Rust though, almost all their talks start the exact same way like theyre on a script. No one is more obsessed with cultivating a "safe" environment, and no one else has been as keen on new people as rust.

Its just a really odd community desu, ilke a modern twilight zone episode.
>>61553618
Yikes, sounds like someone who doesnt know how to teach.
>>
>>61553346
Yeah both editions of the Rust Book are really bad.
>>
>>61553641
> No one has shilled like Rust though
Go shills are way more active on the internet, and D shills are at least as active on /dpt/.
>>
>>61553684
>D shills are at least as active on /dpt/.
desu im mostly the only one who posts D somewhat regularly. And im not just talking about /dpt/, as rust shill have mostly dropped around here.
>>
>>61553684
>D shills
More like
>I'm tired o' de shills, mon! (Jamaican accent)
It's also just one half-step away from D, but I usually call it D-flat. D isn't really a language, but I just doesn't support enough current.
>>
>>61553641
>Yikes, sounds like someone who doesnt know how to teach.
You're exactly right. It's a shame though. The Rust language is solid, but the community is dysfunctional. Not all are bad obviously, but SJW are a vocal majority.
>>
>>61553841
I think well probably see a splinter in the next few years or someone not in the community do a spiritual successor with a less extreme/fixed BC. Or maybe once the PC fad dies again, they can get back to programming.
>>
>>61553841
What does sjwism have to do with programming?
>>
>>61553861
I don't think Rust'll be able to recover from splintering. It's community driven, so once the community blows up it's all over. That wouldn't be an issue if companies showed interest in the language, but I don't think they want to enter the Rust ecosystem because it's very inclusive.
>>
>>61553929
They slow down progression by making a fuss over trivial things.
>>
>>61550152
>>61551410
Let's spot the closet fags who lash out at at their insecurities
>>
>>61553932
I think the core team and people who actually enjoy rust instead of talking about it would do just fine. Although im not sure how things would go down seeing as theyre stuck at mozilla. So im guessing a new Rust by a different name will probably be more likely if the community drags on like this.
>>
>>61553939
How `making a fuss` slows down progression?
Does making a fuss about SJWs slow down progression as well?
>>
>>61553943
That is the most ass-backwards logic I have seen on here is quite a while.
Fuck off, degenerate.
>>
>>61553966
>is quite
in quite*
>>
>>61553959
>How `making a fuss` slows down progression?
Because it diverts attention from actual problems like I said before.
>Does making a fuss about SJWs slow down progression as well?
It does so as well. Both sides are equally bad.
>>
>>61554001
SJWs started it.
>>
>>61554015
That's not an excuse. SJWs wouldn't have gotten traction if people simply ignored them.
>>
>>61554047
No, the problem is people enable SJW which then gets people annoyed, it is not simply a matter of ignoring them.
>>
>>61553966
Straight guys secure with their sexuality doesn't lash out homosexuality
You know who it is? It's people like priests who preach against gays and they're the ones who rapes 10 year old boys!
>>
>>61554064
Do you mean that people force SJWs into the community which results in people getting annoyed?
>>
>>61554001
> Because it diverts attention from actual problems like I said before.
Do you have any data on for how long it diverts attention, and of how many?

From my experience, SJW/pol shitstorms are rare outside /g/, most people just don't care, and I can't think of an instance when it actually affected the progression. The funny thing is, some of the most productive Rust developers are left-leaning, while none of the /pol/tards contribute anything, they just whine about MUH SJW.
>>
>>61554098
No, when SJWs get riled up about something, developers let them walk all over them.
>>
File: 1444526640398.png (389KB, 934x1000px) Image search: [Google]
1444526640398.png
389KB, 934x1000px
>>61550100
Not trying to troll the thread or anything, why don't people use this image anymore, it was the default for like two years and then I come on /g/ and it's gone, it's been back once or twice since then but it's not normally used, it's not that the other images are bad but I like this one
>>
>>61550222
I was programming in C just yesterday, though it's 8am and I still haven't slept so do with that what you will
>>
>>61554125
People like seeing more than one thing. And we have like two-shitpostiers pushing their respective gimmicks in the OP
>>
>>61550722
lisp
>>
>>61554125
I still occasionally use it, but I post a modified "flat" version.
>>
>>61554109
>Do you have any data on for how long it diverts attention, and of how many?
Do you have any data to claim otherwise?
>From my experience, SJW/pol shitstorms are rare outside /g/, most people just don't care, and I can't think of an instance when it actually affected the progression. The funny thing is, some of the most productive Rust developers are left-leaning, while none of the /pol/tards contribute anything, they just whine about MUH SJW.
>most productive Rust developers are left-leaning
Why did you bring up politics all of a sudden?
>>
>>61551006
I actually prefer common over clojure, it's got a lot of limitations that carry over from the JVM mostly the poor support for tail recursion that make it so more intricately looping constructs don't behave quite the way you intend, sure it's easy to work around if you know about it, but when you're learning the language it makes it really really difficult to do something you think should be very simple given the nature of most lisps

I think it's issues like that where clojure earned it's negative reputation for most people
>>
>>61551811
>AT&T syntax
tl;dr
>>
>tfw can't into make files
>>
>>61554169
> Do you have any data to claim otherwise?
No, but it's a counterintuitive claim so the burden of proof is on you.
> Why did you bring up politics all of a sudden?
To show that not "both sides are just as bad" but that /pol/-tards are actually worse because they don't contribute anything besides whining.
>>
>>61550100
I'm using Apache Poi to create a groovy script that reads out a "visual" excel file containing server racks and creats a csv table out of it.
>>
>>61554206
please read this my nigguh
https://www.gnu.org/software/make/manual/make.html
>>
>>61554207
>No, but it's a counterintuitive claim so the burden of proof is on you.
Do you really think I keep tracks of shit I read on the internet? Your question is completely illogical.
>To show that not "both sides are just as bad" but that /pol/-tards are actually worse because they don't contribute anything besides whining.
I'm sure you have some statistics to back that up.
>>
>>61554206
learn a language that doesnt need them
>>
>>61554224
thanks monica
>>
>>61554244
C runs on anything, and C++ runs on nearly anything
I need to use them because I have no alternative
>>
>>61554267
What wild hardware do you need to run on?
>>
I lost interest in programming in my spare time since I started doing it as a job. Will it come back?
>>
>>61554278
No

t. been programming for 5 years
>>
>>61554278
Imagine you're a porn actor and you spend all working hours fucking.

then you come home and your girlfriend wants to fuck
>>
>>61554125
I think the image looks shit and uninspiring. It kind of triggers me that the person is upside down and not the right way up.
>>
>>61554226
>Do you really think I keep tracks of shit I read on the internet?
So why do you think `making a fuss` and `diverting attention` affects anything then? It has no effect on the technical side of things, and most people in the community only care about it.
>I'm sure you have some statistics to back that up.
No, it's completely anecdotal, but I thought even /pol/-tards agree on Rust being run by SJWs.
>>
>>61554303
It represents the state of FP - everything is retarded.
>>
>>61554278
What language do you use?
Learn a completely different one.
>>
>>61554277
he will not answer this
>>
File: 1.png (121KB, 934x1000px) Image search: [Google]
1.png
121KB, 934x1000px
>>61554125
opt
>>
>>61554308
So you consider everyone disagreeing on SJWism in Rust a /pol/-tard? That's very narrow minded.
>>
>>61554392
>That's very narrow minded.
welcome to the fantasy land of neo-libs.
>>
>you can't pass by reference an integer to a function in Ruby (without some ugly hack like wrapping it in a list and then passing it)
Dropped. Fucking weird scripting languages.
>>
>>61554392
> So you consider everyone disagreeing on SJWism in Rust a /pol/-tard? That's very narrow minded.
Not at all, I myself not a big fan of it. But I consider everyone who chooses to focus exclusively and extensively on this particular aspect and deliberately provoke political confrontations in technical communities a /pol/-tards.
>>
reading the PCI spec to write the PCI subsystem for my arm64 OS
>>
>>61554435
>everything is a reference except when it's not
why is C the only language with clear value/reference semantics?
>>
>>61554435
>different languages aren't the same

who knew
>>
>>61554452
Nobody provoked any political confrontations but you.
I simply stated my opinion that the Rust community is sidetracked by trivial things raised by SJWs. I don't see what's political about that.
>>
>>61554311
Java Enterprise stuff. Also, on a different note: How autistic is it to love cleaning up bad code?
>>
>>61554496
Pretty autistic but I see the appeal.
Learn something that isn't C-like, you may find it fun.
>>
>>61554496
>Java Enterprise stuff.
well no wonder you have no interest in programming.
And its not, getting a 1k source file cut in half or more with the same or more functionality is a GOAT feeling.
>>
>>61554435
>passing a value type by reference

Why would you do this?
>>
>>61554523
>well no wonder you have no interest in programming.
Nah, I like my work. I feel satisfied when coming home, it's just that I don't have the drive to do anything programming related any more. More art and natural language learning.
>>
>>61554494
And I haven't called you a /pol/-tard, haven't I?
I'm talking about people who bring SJW up every time anyone mentions Rust here, or go to reddit and rust forums to post obvious baits and provoke shitstorms. My points are 1) there're no evidence of the Rust community being "sidetracked", whatever it means in practice 2) many of the shitstorms I assume you have in mind are directly caused by /pol/-tards and not SJWs.
>>
>>61554465
Perl allows passing by reference easily. Makes me sad that two vastly inferior languages like Python and Ruby replaced it.
>>
>>61551732
normie the post
>>
>>61554549
Back to the coding bootcamp with you.
>>
>>61554612
Not an argument.
>>
>>61554598
How does it look in Perl? Something like it does in PHP?
>>
>>61554588
>My points are 1) there're no evidence of the Rust community being "sidetracked"
There was literally a github issue opened to rename "bad-style" to "unique-style" or whatever.
>>
>>61554641
my perl is a bit rusty (I don't even have it installed anymore), but according to google:

my $str = "foo";

print $str, "\n";
change(\$str);
print $str, "\n";

sub change {
my $ref = shift;
$$ref = "bar";
}


The second print outputs "bar".
>>
>>61554651
https://github.com/rust-lang/rust/issues/38869
>>
>>61554651
How is this a "sidetracking" of the community? Projects do change wordings all the time. Besides, most of these issues are baits by /pol/-tards.
>>61554701
>a troll issue by a /pol/-tard
>immediatly detected as such and closed
Exactly.
>>
>>61554751
>a troll issue by a /pol/-tard
>a /pol/-tard

how do you know he is a /pol/ user? do you know him personally?
>>
File: heh.png (33KB, 665x221px) Image search: [Google]
heh.png
33KB, 665x221px
You have 10 (ten) seconds to suggest something interesting that is moderately challening to build with C.

Also best C book : http://icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf
>>
>>61554751
>Besides, most of these issues are baits by /pol/-tards.
It was a genuine issue, i even watched a talk where the girl rep brought it up.

>pol
>pol
Jesus, you sound like a Yurop flag on /int/ constantly bringing americans up.
>>
>>61554701
>thumbing down this disabled man
Why?
Don't thumb down just leave it alone. Think about his feelings.
>>
>>61554766
>moderately challening to build with C
Do you mean time-wise, or what?

Anything non-trivial takes fucking forever in C, the challenge being your ability to wade through a bullshit swamp of uselessness called C.
>>
>>61554766
A neural network backend.
>>61554788
>anything takes a lot of time in C
Not at all. But of course a rookie C programmer is going to find that anything takes a lot of time. As it would in any language where you're inept.
>>
>>61554588
>And I haven't called you a /pol/-tard, haven't I?
No, but you were verbally aggressive.
>I'm talking about people who bring SJW up every time anyone mentions Rust here, or go to reddit and rust forums to post obvious baits and provoke shitstorms. My points are 1) there're no evidence of the Rust community being "sidetracked", whatever it means in practice 2) many of the shitstorms I assume you have in mind are directly caused by /pol/-tards and not SJWs.
I disagree, most of shitstorms are caused by SJWism. /pol/-tards don't use Rust because they know they get vaporized by the community.
>>
>>61554806
Objectively speaking, you can do nontrivial things in other languages much faster than in C.
>>
>>61550100
Out of boredom, creating a local file based start page that can store notes and sketches and survive a history wipe.

Turns out that IndexedDB can store almost arbitrary amounts of data that is hard to delete, without request at all.
Letting W3C create JS APIs was a mistake.
>>
>>61554771
>you sound like a Yurop flag on /int/ constantly bringing americans up
the sad part is the irony of this post will probably be entirely lost on you
>>
>>61554758
>>61554771
>/pol/-tard
Well, I don't know any better term for this group of people, I don't think "alt-righter" or "anti-SJW" are good terms.
>It was a genuine issue, i even watched a talk where the girl rep brought it up.
This is why I said "most" and not "all". Still a far cry from being "sidetracked", isn't it?
>>
>>61554788
>Do you mean time-wise, or what?
time-wise, ability-wise.
>>
>>61554829
enlighten me
>>
>>61551532
Student loans?
>>
>>61554840
>Still a far cry from being "sidetracked", isn't it?
Communities who entertain PC bike-shedding are side-tracked.
>>
/pol/ faggots need to leave
>>
>>61554815
> /pol/-tards don't use Rust because they know they get vaporized by the community.
That's my point, they don't use it, they don't contribute to the community, but they spend a lot of time whining about it here and outright trolling the community, like >>61554701.
>>
int * ptr;

please explain why you would ever use this style
>>
>>61554819
>you can do nontrivial things in other languages much faster than in C.
Depends on what you're doing and your standards for what the results should be like but yes there's many languages more expressive than C.
But calling it "taking forever" is ridiculous.
Most of the development-speed gains you gain in other languages (generally, certain high productivity langauges like Haskell are difficult to touch) can be gained from using libraries, of which there are many.
Where C fails it's usually when libraries in C assume you wanted a good scaling solution rather than something quick and dirty. But where it fails in that way is in things like JSON parsing. And it's usually not gonna double your development time or anything.
>>
>>61554889
Youre the passive aggressive centrist on the team.
>>
>>61554889
because things need their safe spaces
>>
>>61554889
>int*
Has issues with multiple declarations on the same line.
>int *symbol
implies the star is part of the symbol rather than the type.
>int * symbol
Doesn't have issues at all other than just being plain weird.

But I prefer the first though.
>>
>>61554920
>implies the star is part of the symbol rather than the type.
it is, that's how it's parsed, that's how the syntax works, that's how arrays work.
>>
>>61554929
Not semantically.
You're modifying the type of the symbol not the symbol.
>>
>>61554884
The link >>61554701 is indeed trolling, but these ones are not:
https://github.com/rust-lang/rust/issues/41646
https://github.com/rust-lang/rust/pull/25640
>>
>>61554868
> Communities who entertain PC bike-shedding are side-tracked.
Even if it's, like, a hundred lines change once a month? You're being too sensitive. It's nowhere near as bad as license bike-shedding in many projects, and you don't say the kernel is "sidetracked" because of GPL2.
>>
>>61554936
declaration follows usage. *ptr yields an int, just as it says
>>
>>61554947
GPL and license shit is side-tracking too.
>well its only ARBITRARY_NUMBER, who cares
Kill yourself.
>>
>>61554952
>declaration follows usage.
Oh nice it's the moron again.
The semantics of this is not that the symbol is modified. Same with [].
Hidden.
>>
>>61554897
>Where C fails it's usually when libraries in C assume you wanted something quick and dirty - like almost anything related to IO, strings and number type parsing in the standard library - rather than a good scaling solution.
FTFY
It's not like anybody could build something like Boost for C, since the language lacks too much for that. Many tried like glib or apr, all failed to come up with something adequate.
>>
>>61554967
Like it or not, that's how the grammar is defined.
>>
>>61553467
This
>>
>>61554945
>>61554966
So two somewhat SJW-ish issues in two years? You're right, SJWs are literally killing Rust and turning it into Marxist propaganda.
>>
>>61554766
>>61554766
>>61554766
pls reply
>>
>>61555008
you could dig through the issues and find much more. but anyway, lets stop shitposting.
>>
>>61555011
Fix GTK file picker. You love C, right?
>>
>>61555023
already fixed.

are you new?
>>
>>61555008
Why do you keep involving politics?
>>
>>61555038
No it's not fixed. Stop lying. Fix the gtk3 file chooser dialogue upstream
>>
>be me
>meet my loaded distant relative
>casually mention my dum startup idea, esports related webservice. nothing serious
>"say no mo faam, how much do you need? 100k? 200k?"
>wtf.jpg
shit

Now I don't want to offend him in any way but holding a day job and managing a startup sounds like hell on earth.
>>
>>61555011
Build a configurable ETL system with a GUI that works with at least one major DBMS, and any arbitrary REST API (anonymous auth).
>>
>>61555046
Exactly
>>
>>61555047
there were countless threads about this topic in the past 6 months or even a year

a guy with a anime profile pic on github fixed the issue

stop lying you fucking retard
>>
>>61550722
Tcl
Rebol
Scheme
>>
>>61555051
Tell him $150k, negotiate a margin skim with him, get a prototype out in 6 months.

How hard can it be?

Fuck that, put me in contact.
>>
>>61554978
>It's not like anybody could build something like Boost for C
What? Of course you could. They don't because Boost is a terrible idea.
>People failed to come up with something adequate
Because they're attempting to something that's just misguided.

99% of programs you use don't actually need Boost, you need small bits, most of the bits you need shouldn't carry the complexity that comes with Boost.

>like almost anything related to IO, strings and number type parsing in the standard library
Why would you use the standard library if you find it inadequate? When I said that you should use libraries if you want to speed up development did you really think I meant that you should just use the standard library? I'm very surprised you'd assume that.
>>
>>61555073
You don't know what you are talking about. The gtk2 file uploader was "patched" by a weeb but it never made it to the upstream because of the shittyness of the code.

There so many so-called oh-so-knowledgable C developers ITT and ironically no one wants to touch irl C projects
>>
>>61555051
>near-free neetbox from family to pursue a passion project
Dont pass it up you dummy.
Give you two-weeks and get on it
>>
>>61555108
so it was fixed.

retard
>>
>>61554766
An AI waifu.
>>
>>61555149
>so it was fixed.

No, it wasn't.
>>
>>61555108
These days C is only used for maintaining legacy codes, really. C++ is heavily used for games and for all the GPU APIs written in it. However C++ is such a cancer you cannot call it from better languages.

>>61555149
It is not fixed
>>
>>61555164
>However C++ is such a cancer you cannot call it from better languages.
dude extern c lmao
>>
>>61555178
xd
>>
>>61555164
>C++ is such a cancer you cannot call it from better languages
?
>>
>>61555189
just rust propaganda
>>
>>61555189
Do you have trouble in understanding plain English?
>>
>>61555198
Microsoft propaganda
>>
>>61555201
Well, if I take your statement literally, it's simply wrong, so I'm giving you the chance to clarify.
>>
>>61555189
The C++ ABI is something the committee has been fighting with for ages.
You'd be hard pressed to find someone recommend you try if you have other options.
>>
>>61555189
IIRC the only language you can call C++ from without "extern C" is D. Then again, I'm now sure how Qt bindings work.
>>
>>61555201
>extern doesnt exist
>>
>>61555215
>your statement literally, it's simply wrong
It's not. In C, there's no standard binary language implementation rules, either, but it's an order of magnitude simpler and in practice compilers use the same rules. Another reason making C++ code hard to debug is the above-mentioned complicated grammar, since debuggers frequently can't deal with many language features (place breakpoints in templates, parse pointer casting commands in data display windows, etc.).

The lack of a standard ABI (application binary interface) has another consequence - it makes shipping C++ interfaces to other teams / customers impractical since the user code won't work unless it's compiled with the same tools and build options. We've already seen another source of this problem - the instability of binary interfaces due to the lack of compile time encapsulation.
>>
>>61555227
C has a much, much simpler interface, and its rules for converting a source code interface into a binary interface are straightforward enough that generating external interfaces to bind to is done in a well-established manner. C++, on the other hand, has an incredibly complicated interface, and the rules for ABI binding are not standardized at all, neither formally nor in practice. This means that pretty much any compiler for any language for any platform can bind against an external C interface and know exactly what to expect, but for a C++ interface, it's essentially impossible because the rules change depending on which compiler, which version, and which platform the C++ code was built with.
>>
>>61555227
>you have to have the language pretend it's C to be able to call into it.
Great. No >>61555223 is correct.
>>
>>61555247
>C ABI is good because everything supports it
>having native C ABI doesn't count
>>
>>61555226
You still need extern the last time i checked unlike C where you can just import the libs.
Interop with C++ is still not even 100%, but thats mostly just niche edge-cases where an equivalent is conflicting natures.
>>
>>61555227
Idiots like you do exist
>>
>>61555330
>you cant call C++ from other languages
>yes you can
>Well THAT doesnt count
???

Dont come on a programming thread and spout vague statements.
>>
>>61555339
>no functions taking or returning objects.
>no templates,
>no classes,
>no exceptions

> """"""""C++"""""""""

You never worked in any actual project, have you? Stupid faggot
>>
>>61555339
Huh, I just hid you because I assumed you were trolling.
But perhaps you're just ignorant. You can't extern C code that's not C compatible. What extern C lets you do is write C inside a C++ compiler and use the C ABI for that specific code.

It's difficult to argue that's C++.
>>
>>61555375
He's just another underage shitposter that has ZERO knowledge what he's talking about
>>
>>61555392
There's a lot of those here.
>>
>>61555375
>What extern C lets you do is write C inside a C++ compiler and use the C ABI for that specific code.
Wrong. extern "C" only affects linkage, the code you're writing is still C++. The body of your functions will be C++ and you can use C++ features within those functions. All that changes is that the interface to those functions.
>>
>>61555366
>>no functions taking or returning objects.
extern (C++) int add(int x, int y)
{
return x + y;
}
void main() //void or int
{
import std.stdio;
add(1,2).writeln;
}


???
>>
>>61555418
https://dlang.org/spec/cpp_interface.html#special-member-functions
>>
>>61555418
Also
https://dlang.org/spec/cpp_interface.html#exception-handling
https://dlang.org/spec/cpp_interface.html#lifetime-management
>>
>>61555418
I have no idea what you're trying to illustrate here.
>>
>>61555418
That's C, nothing unique to C++. Better call it a placebo: fucktards that write C into .cpp files
>>
>>61555236
What does any of this have to do with the assertion that C++ cannot be called from other languages?
>>
>>61555476
I really dont get the argument i guess.
Interop is just for external code youre slowly trying to port.
Why would you want to use the extern language's tools when you have your own.
>>
>>61555479
That's D defining a C++ function and calling it using UFCS.
>>
>>61555519
These assertions explore why C++ cannot be called from other languages. Are you dumb?
>>
>>61555519
C++ doesn't have a standardized ABI. You cannot call without having a stable ABI, and the only stable part of the C++ ABI is its extern "C" subset.
>>
>>61555525
This is because C++ is compatible with C in the source level. The things that are unique to C++ is not supported, even D has its limitation
>>
>>61555528
>>61555538
Since when did "call C++" turn into "write verbatim C++"?
>>
>>61555563
Right when you call C++ """"verbatim C++""""
>>
>>61555563
I think thats what theyve been mistakenly trying to argue this whole time.
>>
>>61555563
I don't know what you're getting at.
>>
>>61550722
Lua
C
ASM

the holy trinity
>>
>>61555687
>muh LOO-uh
>>
>>61555709
Name a better easily embeddable interpreter with an already established ecosystem
>>
>>61555722
>All these buzzwords
>>
>>61555722
Typical poo in lua
>>
>>61555722
Python
>>
>>61555722
Why do you need an easily "embeddable interpreter" with those buzzwords etc
>>
>>61555722
Don't argue with these fucks, they've no idea what they're talking about. The only alternative would be Scheme but >FP.
>>
>ask out a qt from accounting on a date
>"Let me text you back, ok?"
>next evening
>accidentally saw her with a dudebro from finance dept
life is hard, my programmer bros
>>
>>61555759
I'm writing a game and its really comfy to add mod support with it.
I experimented with Duktape but its criminally slow.

>>61555779
<3

>>61555750
Reasonable. I was thinking about using it but i dont have any experience with it as opposed to lua
>>
>>61555820
>things that never happened

Or at the very least, didn't happen in quite this manner.
>>
>>61555820
Doesn't get easy. Us programmers were naturally seen as too nerdy and not cool so we locked ourselves in our rooms with only a computer to provide companionship.
>>
>>61555820
Two years ago I went on a date with a girl, after which she told me not to text her and 'cause she'll text me herself. I'm still waiting. Oh, and she's a PHP coder, so I'm not sure if I dodged a bullet here. She was quite fun to talk to tho.
>>
How do mail clients know how to thread replies?

Is there something in the SMTP protocol that specifies this, or do they just guess which messages belong in a thread?
>>
File: cp.png (168KB, 655x618px) Image search: [Google]
cp.png
168KB, 655x618px
is this the best C book or is there any better?
>>
>>61556066
Mail headers.
https://www.ietf.org/rfc/rfc2919.txt
https://www.ietf.org/rfc/rfc2369.txt
>>
>>61556122
Second Edition. But yeah, it is.
>>
>>61556122
Enjoy your buffer overflows.
>>
>>61556122
C Programming, A Modern Approach
>>
>>61556177
>he can't write working C code
>>
>>61556219
Where are these buffer overflow free C programs?
>>
>>61556226
int main(void)
{
return 0;
}

Here's one, dumb fuck.
>>
>>61556240
>int main(void)
exactly
>>
what do I need to do next in this crazy github command line thing to make it so that I can do githubs to my repo?

i wanted to clone
> git clone [email protected]:xxxxx/project31.git projectDirectory

I could not clone. I got a permission error.
I went online and they said.
To make sure you are connecting to the right domain, you can enter the following command...
so I got pic related.

The instructions I was following didn't tell me what to do if I found an issue.
I'm still searching. just posting this here to maximize speed.
gotta code fast
>>
new thread

>>61556266
>>61556266
>>61556266
>>
>>61556264
Did you add your public key to the account?
And is the key pair present on your machine?
Because currently you're using key based authentication, you could try using HTTPS one which will simply ask you for GitHub credentials instead.
>>
>>61550722
html
htm
jackie chan
>>
>>61556337
fuck. well I guess I might as well try to understand this now. i will go the https route though meanwhile.

yeah. the keypairs are present in my .ssh folder.

I willl probably need to know what the fuck is going on with .ssh if I ever want to become a wizard
>>
>>61550722
A, B, C.
>>
>>61556580

>>61556580

>>61556580

>>61556580
>>
>>61556122
Modern C by Gustedt
Thread posts: 318
Thread images: 24


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.