[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: 327
Thread images: 55

What are you working on, /g/?

Old thread: >>59256297
>>
>>59258691
where is a place I can learn C,C# and C++?
codeacademy has none of them and I don't know where to start
>>
>Manually managing blocks of memory in C is like juggling bars of soap in a prison shower: It's all fun and games until you forget about one of them.
>>
>>59258712
VB.net is easier to start it
>>
File: 1487078974683.png (229KB, 855x4802px) Image search: [Google]
1487078974683.png
229KB, 855x4802px
>>59258726
>>
Websocket server in C using libwebsockets. thinking about P2P file transfer and things like doodling together
>>
>>59258732
but that's a shop anon
I'm talking about some tutorial or guide,like codeacademy does.
I learned Javascript and HTML through codeacademy but I don't know how to do C,C#,C++ or where even to start in them
>>
Anyone mind helping me fix this? C, reads stdin string and puts into BST

It just replaces all the nodes with the last inputted string, or something like that

/* Reads stdin one line at a time when input filename not provided*/
char *inName = NULL;
struct Node *root = NULL;
char sentence[100];
char *line = (char*) malloc (100);

if (inName == NULL) {
printf("\nEnter one line at a time:\n");

if (root == NULL) {
fflush(stdout);
fgets(sentence, 100, stdin);
strcpy(line, sentence);
root = insert(root, line, cflag);
sentence[0] = '\0';
free(line);
}

fflush(stdout);
sentence[0] = '\0';
while (strcmp(sentence, "\n") != 0) {
line = (char*) malloc (101);
sentence[0] = '\0';
fgets(sentence, 100, stdin);
if (strcmp(sentence, "\n") != 0) {
strcpy(line, sentence);
root = insert(root, line, cflag);
free(line);
}
}
}
>>
>>59258762
that's not even a function
>>
>>59258753
Try a beginner project and just start coding

captcha: road profession
>>
>>59258783
>just code bro

but where?
>>
>>59258753

For C, read the latest edition of C Primer Plus.
For C++, read this:
http://mazonka.com/shared/Straustrup4th.pdf
For C#, MSDN documentation should be sufficient.

>>59258732

VB.NET is dead desu. Didn't even get ported to .NET Core before F#.
>>
>>59258776
i know, its happening under my main. I'm just trying to get the logic right, but i think when im doing root=insert(...) its not giving me what i want, so when i go and try to print the inorder(root) its screwed
>>
>>59258803
>Straustrup
>>
>>59258802
download the free version of visual studio and google a simple project
>>
>>59258712
Sheesh, HOW often!
https://learnxinyminutes.com/docs/c/
https://learnxinyminutes.com/docs/csharp/
https://learnxinyminutes.com/docs/c++/
>>
>>59258806
well, the call for the recursive function should advance in the tree, that it, typically something like
recursive_func(node *root) {
while (root->next != NULL) {
recursive_func(root->next)
}
}


and i think you aren't moving in the tree, dunno
>>
>>59258824

I'm aware that his name is misspelled, probably to keep the file from being indexed by search engines.
>>
>>59258712
>codeacademy has none of them and I don't know where to start
..
>the internet has only codeacademy and 4chan
When I was young I went to the local library and grabbed a C book. Tried that? Apparently there is *nothing online* when you search for "c/c++/c# tutorial"..
>>
File: 234rf.jpg (31KB, 400x400px) Image search: [Google]
234rf.jpg
31KB, 400x400px
Any sufficiently well-documented lisp program contains an ML program in its comments.
>>
What compsci math book would be great ? I've found a MIT pdf about computer science math.
>>
#include <stdbool.h>
>>
>>59258895
Concrete mathematics
>>
>>59258908
#include <conio.h>
>>
File: img_054.png (263KB, 456x620px) Image search: [Google]
img_054.png
263KB, 456x620px
>tfw I thought C# was called "C-hash"
>tfw no one corrected me
>>
File: 148796936650.jpg (37KB, 321x474px) Image search: [Google]
148796936650.jpg
37KB, 321x474px
Do you make free software, /dpt/?
>>
>>59258969
>no one corrected me
cause you have no friends :(
>>
File: 1460880115115.jpg (60KB, 1024x576px) Image search: [Google]
1460880115115.jpg
60KB, 1024x576px
>>59258969
Should have watched more anime.
>>
File: 1487405871275.gif (706KB, 1280x1086px) Image search: [Google]
1487405871275.gif
706KB, 1280x1086px
>>59258969
>tfw I hear someone say ess-que-ell
>>
>>59258969
I wanted to tell you but you sound like such a faggot even thinking about you saying "octothorpe" makes me cringe.
>>
>these jobs that have vague task descriptions that make me not sure if I would be able to do them or not
I can code, but I don't know if I can do what they need
>>
>>59258969

>file extension .cs
>I wonder how this should be pronounced...
>>
>>59258969
does anyone correct u when u call dicks delicious?
>>
>>59258990
He has /g/ tho.
>>59258999
ess-que-ell > see-quel
>>
>>59258999
Every single person I work with calls it Ess Queue Ell, they probably don't even understand the wordplay in the name PostGreSQL!!!
>>
>>59259012
CuteSharp.
>>
>>59258969
found the redditor
you're fucked in both scenarios:
1) you watch anime d*bb*d
2) you don't watch it
>>
File: homu_sad.png (74KB, 184x289px) Image search: [Google]
homu_sad.png
74KB, 184x289px
>>59258990
>>59258992
>>59259000
All true.
>>59259030
Why would anyone correct a true statement?
>>
File: 1486475807545.jpg (13KB, 313x313px) Image search: [Google]
1486475807545.jpg
13KB, 313x313px
>>59259067
>anime d*bb*d
>>
Is there a minimum frequency to use for an SPI interface? I need a DAC, and I'll only need to set it less than once a second, so 100hz is literally the highest I would possibly go, bit-banging the data I need to set the output.

I know SPI itself has a "minimum" frequency of 1MHz or something, but I since I don't need ANYWHERE near that, I want to know if I could drive it slow. I'd expect my chip to only respond on the clock cycles (there'd be only the one clock, no data would be sent back, etc) but I'm trying to find any resource on running the interface slow and I can't find any.

I'll be asking this on DIY as well
>>
>>59259092
The Big O and FLCL had good dubs IMO
>>
>>59259042

No, that would be how you pronounce this:
https://github.com/ddobrev/QtSharp
>>
>>59258987
Yes
>>
>>59259092
i almost vomited myself when writing that.
>>59259119
Please leave this website and never ever say anything like that.
>>
File: 1483135677975.jpg (189KB, 495x700px) Image search: [Google]
1483135677975.jpg
189KB, 495x700px
>>59259119
>>
>>59259139
>>59259145
N-no bully
>>
I started learning D but seeing D is just as unsafe as C++ I am moving to Rust.
>>
>>59259192

Rust is just as unsafe as C++ if you use the unsafe keyword (necessary for some things)
>>
>>59259192
How
You can easily write safe D
>>
>>59259192
>tfw you fall for the Rust meme
>>
>>59259192
p-please show me your D
>>
>>59259229
Only inside the unsafe blocks.
>>
>>59259243
l-lewd
>>
Where's the fun in programming when everything is inherently safe?
also
An inherently safe chainsaw is entirely useless.
>>
Do I still have to write shit like 'type a = Integer' at the beginning of every file if I'm using the UnicodeSyntax extension?
>>
>>59259243
>my D
here
import std.conv;
import std.stdio;
import std.range;

void main(string[] args)
{
immutable max = (1 < args.length)
? args[1].to!size_t
: 0x4000;
size_t count = 1; // we have 2.
// flags[i] = isPrime(2 * i + 3)
auto flags = new bool[(max - 1) / 2];
flags[] = true;

foreach (i; 0..flags.length)
{
if (!flags[i])
continue;
auto prime = i + i + 3;
foreach (k; iota(i + prime, flags.length, prime))
flags[k] = false;

count++;
}
writefln("%d primes", count);
}
>>
>>59259078
>Why would anyone correct a true statement?
Spoken like a true depraved sissy faggot
I bet if I shoved my hard cock in your face you'd slobber on it too you degenerate perv
>>
>>59259269
>type a
that should've been a Z
>>
>>59259277
>I bet if I shoved my hard cock in your face you'd slobber on it too you degenerate perv
Yes! Please do that right now!
>>
File: 1486857139497.jpg (51KB, 520x463px) Image search: [Google]
1486857139497.jpg
51KB, 520x463px
Disgusting lewd LARPERS
>>
>>59259266
Do you want to use a gun without a safety lock?
>This divides the community into anti/pro-rust
>>
>>59259275
kute
>>
>>59259275
>
{
}
>>
>>59259300
I would love to shove my hard cock in your pretty gurl face and fine ass anon
>>
File: img_146.png (168KB, 352x368px) Image search: [Google]
img_146.png
168KB, 352x368px
>>59259277
Wew lad is that a promise?
>>
>>59259314
>gun without a safety lock
Sure. Just don't point it at anything you don't intend to shoot.
>>
>>59259266
>inherently safe
Provably safe, where you cannot compile without it being proven. This is just programming with a very strong type system due to the Curry Howard isomorphism.

>An inherently safe chainsaw is entirely useless.
Shit analogy.
>>
>>59259345
I wouldn't carry a gun without a safety lock in my pocket
>>
>>59259358

You are stupid.
>>
>>59259342
No promises but I might think of something for those luscious and hungry lips anon
>>
>>59259378
tell them shart in marter
>>
>>59259266
Not a chainsaw but they have table saws now that stop when it contacts human skin. Look into SawStop.

Would be harder to implement in a chainsaw but could be possible. More important for table saws anyway, fucking things take so many fingers.
>>
>>59259314
Safety locks can fail, better to just not leave guns to the professionals and keep the normie retards away.
>>
File: me_irl24.png (936KB, 1233x725px) Image search: [Google]
me_irl24.png
936KB, 1233x725px
>>59259393
>>
Never thought a tripfag can be so annoying
>>
>>59259416
>safety lock can fail
>so get rid of all safety locks
Flawless logic
>>
>>59259416
*better to just leave guns to the professionals
>>
>>59259420
I will pound that hot whore mouth like a pussy anon~
>>
>>59259425
how's your first week here going?
>>
File: 1487539231697.jpg (34KB, 710x720px) Image search: [Google]
1487539231697.jpg
34KB, 710x720px
>>
>>59259425
https://github.com/dlang/dmd/blob/master/samples/sieve.d

Lol
>>
>>59259455
yes
>>
>>59259425
>D
>plebbit
really makes you think
>>
>>59259416
A large proportion of private gun owners are police, veterans and so on...
>>
>>59259485
Probably a better programmer than you, gate keeper
>>
>>59259497
>Probably
>>
>>59259497
Why would one do that? Just go on the internet and tell lies?
>>
File: 234rf.jpg (21KB, 400x400px) Image search: [Google]
234rf.jpg
21KB, 400x400px
How can you compete?

http://3e.org/dmd/cv.pdf
>>
>>59259497
>gate keeper
is this supposed to be some sort of insult? i really don't get your kind.
oh, by the way, you're not welcome here.
>>
File: 1487503366271.jpg (158KB, 900x730px) Image search: [Google]
1487503366271.jpg
158KB, 900x730px
>>59259549
>>
really wanting to learn python but all the stuff I've found is for people who have at least a basic understanding of general code which I don't, do you guys have any website or software I can use to learn the basics and progress? thanks
>>
>>59259565
Well, you are not good at keeping reddit away. Have you been able to do one thing right in your life?
>>
>>59259577
>code
>python
>do you guys have any website or software I can use to learn the basics and progress?
Yes, I recommend your home website. Also know as reddit
>>
>>59259229
Python is just as unsafe as c++ if you use the C FFI
>>
>>59259565
You are too late, gatekeeper

>*screenshots this and posts it in reddit*
:D
>>
File: 148876211855.jpg (119KB, 900x730px) Image search: [Google]
148876211855.jpg
119KB, 900x730px
>>59259568
optimized
>>
File: 1488316573251.jpg (9KB, 300x222px) Image search: [Google]
1488316573251.jpg
9KB, 300x222px
>>59259603
stupid shit poster
>>
>>59259592
Seriously: piss off. Your kind is not welcome here.
>>
File: tyff.jpg (76KB, 800x600px) Image search: [Google]
tyff.jpg
76KB, 800x600px
>>59259425
>>
>>59259626
No.
t. reddit :DD
>>
>>59259192
Why bother? You're never going to actually do anything of note, no matter what language you choose for your imaginary projects.
>>
>>59259592
looks like he failed to save you from embarrassing yourself anon
>>
>>59259641
>he
Sorry gate keeper but you didn't fool anyone
>>
>>59259635
what killer appz did you make?
>>
>>59259635
>never doing things for fun and always for productivity
i feel sorry for you anon
>>
>>59259487
A large percentage of C programmers have enough experience to know what they're doing, too. Doesn't mean we should let retards contribute code to large C projects.
>>
>>59259645
Go be retarded somewhere else, like at reddit.
>>
File: 1486926580315.jpg (83KB, 1375x645px) Image search: [Google]
1486926580315.jpg
83KB, 1375x645px
Can we stop the bullying. Let's be like these pepes
>>
is doing web development considered as programming?
>>
File: 2017-03-06-040748_484x641_scrot.png (74KB, 484x641px) Image search: [Google]
2017-03-06-040748_484x641_scrot.png
74KB, 484x641px
>>59259645
Keep talking anon, you're doing the work for me
>>
>>59259658
Well, if I shitpost on reddit I get banned
If I shitpost on 4chen I get praised

so 4chen it is *shitposts eternally*
>>
>>59259664
you will suffer at your own hand
>>
>>59259673
>t. never been to reddit
>>
>>59259657
Find me one C programmer that knows what he is doing
>>
>>59259662
*pinches and pecks anon chans cheeks* <3
>>
File: 1455998238619.jpg (90KB, 675x900px) Image search: [Google]
1455998238619.jpg
90KB, 675x900px
>>59259664
If you use webasm
>>
>>59259668
Took you a while, did you forget where the element inspection tool is?
>>
File: 1459097156147.jpg (37KB, 686x576px) Image search: [Google]
1459097156147.jpg
37KB, 686x576px
What is the most racist language?
>>
>>59259700
Japanese
>>
File: 1488482942397.png (937KB, 900x600px) Image search: [Google]
1488482942397.png
937KB, 900x600px
>>59259700
HolyC. It's specifically engineered to be incomprehensible to the nigger brain
>>
File: linus-eff-you-640x363.png (213KB, 640x359px) Image search: [Google]
linus-eff-you-640x363.png
213KB, 640x359px
>>59259686
>>
>>59259626
Hi there, gate keeper. No slacking off, drive me to reddit
>>
>>59259695
>i-it's inspect element! people couldn't be realizing my IQ!
kek
>>
>>59259708
That Dirty CoW bug was pretty amazing, wasn't it
>>
>>59259713
>>59259712

Oh thanks you are still here. So how is that reddit purge mission going? Is 4chan still your safe place?
>>
>>59259707
As is regular C, that's why tards are trying to replace it by shitposting on the internet.
>>
>>59259708
Linus is a fucking noob he can't even handle C
>>
File: google_cloudbleed_fitbit[1].jpg (101KB, 1845x784px) Image search: [Google]
google_cloudbleed_fitbit[1].jpg
101KB, 1845x784px
>>59259657
>C is safe is used these hypothetical conditions and by these hypothetical programmers
>Meanwhile
>>
>>59259728
>let's put the focus back on him, that'll help me deal with how I made myself look
kek
>>
#define FMT(x) _Generic((x), int: "i", double: "f", default: "d")

#define FMTSTR(x) \
((union { \
struct { \
char a[sizeof(#x) - 1]; \
char b[3]; \
char c[sizeof(FMT(x)) - 1]; \
char d[2]; \
} a; \
char b[(sizeof(#x) - 1) + 3 + (sizeof(FMT(x)) - 1) + 2]; \
}){.a = {#x, ": %", FMT(x), "\n"}}.b)

#define PRINT(x) printf(FMTSTR(x), x)

#include <stdio.h>

int main()
{
int a = 24;
double b = 24.0;
PRINT(a);
PRINT(b);
}

$ ./a.out
a: 24
b: 24.000000

Damn right I'm going to use this for quick dirty debugging and that only.
>>
>>59259745
>him
Does the gate keeper have a dual personality disorder?

Reddit loves him tho
>>
>>59259749
>C
Enjoy your C(ancer)
>>
File: 1487620623197.png (61KB, 308x433px) Image search: [Google]
1487620623197.png
61KB, 308x433px
>>59259712
>I'm being retarded and no one can stop me!
Wow, you sure showed us.
>>
>>59259738
(you)
>>
>>59259752
This is proof that parents need to beat their children more often.
>>
File: 2k-tarisisaco-me.jpg (116KB, 593x594px) Image search: [Google]
2k-tarisisaco-me.jpg
116KB, 593x594px
What language can I use in order to escape memsnek?
>>
>>59259744
That's one hell of an HTTP request. At some point isn't another protocol required?
>>
>>59259758
you must be that fellow from yesterday
>>
>>59259783
sorry, i'm not your friend from plebbit
>>
>>59259772
True. There is a possibility for the gate keeper to develop severe autism due to overly strict parenting. Probably he thinks 4chan is his holy grail that he needs to protect from reddit users.
>>
>>59259744
>retards write retarded code in C
>this proves that retarded code written in C has nothing to do with the retards who write it
>>
>>59259800
Name one person that is not using "retarded" C
>>
>>59259800
Typical NSA tailored response.
>You make bugs so you are retard
>Keep using C
>The most exploit prone language in the histrory
>>
>>59259812
Linus Torvalds
>>
any good books on os building?
>>
File: maxresdefault[2].jpg (104KB, 1280x720px) Image search: [Google]
maxresdefault[2].jpg
104KB, 1280x720px
>tfw I was a lazy piece of shit all weekend and now I'll have to work my ass off to catch up
Never work more then 8 hours a day, you'll just burn out and have to play this game of catch up
>>
>>59259777
Nah, HTTP can do everything. It will be used for communicating with spacecraft in the future, only needs a few more headers.
>>
kys
>>
>>59259772
nah, if they get beaten they'll end up like you
>>59259752
>tfw you have to deny someone else attacking you because your ego is too fragile to handle it
kek
>>
>>59259749
>int: "i"
>default: "d"
You do realise that %i is equivalent to %d in printf, right?
>>
>>59259764
Hmm, I wonder why the gate keeper stopped responding by the time you cane here
>>
>>59259822
Except I'm not telling you to use C, I'm telling retards like yourself to stick to something easy like BASIC or Python and leave C to the real programmers.
>>
>>59259812
Me
>>
>>59259825
Thaks for the buggiest and exploit prone kernel in 2017
>>
File: reddit1.png (159KB, 1619x752px) Image search: [Google]
reddit1.png
159KB, 1619x752px
>>59259797
The issue isn't that you visit Reddit. The issue is that you act like you're from Reddit. You're a retard willing to throw a tantrum when you can't discuss what you want in the way you want despite how everyone else is acting. You can't pick up on social queues because you're so used to waltzing into any website or chat room and making a colossal faggot of your self. Lurk moar.
>>
H-how do I introduce myself
>>
>>59259846
C belongs to trash anyway
>>
#!/bin/bash

RESTARTED="/home/tom/servers/Server1/hasrestarted.txt"
echo "2" > $RESTARTED

screen -S server -X stuff '/chat The server will restart in 5 minutes, it is creating a full backup of the server. It will be offline for around 90 minutes.'`echo -ne '\015'`
sleep 5
screen -S server -X stuff '/shutdown 300'`echo -ne '\015'`

# Amend the XML configs
sed -i 's#<DistanceInSectors>8</DistanceInSectors>#<DistanceInSectors>32</DistanceInSectors>#' /home/tom/servers/Server1/Server/data/config/blockBehaviorConfig.xml
sed -i 's#<DistanceInSectors>128</DistanceInSectors>#<DistanceInSectors>512</DistanceInSectors>#' /home/tom/servers/Server1/Server/data/config/blockBehaviorConfig.xml

# Move the most recent backup out of the way temporarily
mv /home/tom/backups/Server1_mostRecentBackup /home/tom/backups/temp_Server1_mostRecentBackup

sleep 600

if [ `cat $RESTARTED` -ne "0" ]
then
pkill -9 -f 'Server.jar'
fi

sleep 5

# Make a backup of the server
cp -r /home/tom/servers/Server1 /home/tom/backups/Server1_mostRecentBackup

sleep 5
screen -S server -X stuff './start.sh'`echo -ne '\015'`
sleep 5

# Delete the 7th backup
rm -r /home/tom/backups/Server1_mostRecentBackup_7

# Move the remaining backups up a number, starting with the 6th backup
mv /home/tom/backups/Server1_mostRecentBackup_6 /home/tom/backups/Server1_mostRecentBackup_7
mv /home/tom/backups/Server1_mostRecentBackup_5 /home/tom/backups/Server1_mostRecentBackup_6
mv /home/tom/backups/Server1_mostRecentBackup_4 /home/tom/backups/Server1_mostRecentBackup_5
mv /home/tom/backups/Server1_mostRecentBackup_3 /home/tom/backups/Server1_mostRecentBackup_4
mv /home/tom/backups/Server1_mostRecentBackup_2 /home/tom/backups/Server1_mostRecentBackup_3

# Move the old most recent backup to the 2nd backup
mv /home/tom/backups/temp_Server1_mostRecentBackup /home/tom/backups/Server1_mostRecentBackup_2

>>
>>59259857
>The issue isn't that you visit Reddit.
Wrong. Fuck off back to your shithole of a "website".
>>
>>59259861
With images of your legs.
>>
File: 1471774902833.jpg (326KB, 636x900px) Image search: [Google]
1471774902833.jpg
326KB, 636x900px
>>59259861
Post your favorite cute anime pictures!
>>
>>59259857
>The issue is that you act like you're from Reddit.
And you got pretty used to "sniffing out" those reddit users amirite. Gotta keep my 4chen clean and free

Thanks for your service, 4chan border control
>>
File: img_121.png (576KB, 1156x980px) Image search: [Google]
img_121.png
576KB, 1156x980px
>>59259861
>>
>>59259861
>>59259876 but with thigh highs
>>
>>59259861
Ask a tripshit
>>
>>59259861
By getting on your knees anon
>>
@59259882
>amirite
So you really are a plebbitor.
>>
>>59259847
Yeah?

Quick, write a C program that averages two integers
>>
File: god1.jpg (11KB, 420x420px) Image search: [Google]
god1.jpg
11KB, 420x420px
>>59259882
See >>59259764
>>
>>59259892
>>59259890
>>59259889
>>59259888
>>59259876
Don't listen to them. Just cutepost and everything will be fine!!
>>
>>59259901
Oh I am, too bad you are not going to be doing anything to me.

you can get angry tho :D
>>
>>59259908
I already wrote that a while ago.
/**
* Averages an array of integers.
*
* Averages an array of integers, without overflow or conversion to a larger type.
* It is equivalent to the sum of the array, divided by the array's length (rounded towards zero).
*
* @param n Number of array elements. Must be greater than zero.
* @param arr A pointer to an array of n integers. Must be non-null.
* @return The mean of the array's elements.
*/
int iavg(int n, const int arr[static const n])
{
int avg = 0;

/* A buffer of values that are lost to integer truncation.
* It should always be in the closed interval (-n, n).
*/
int error = 0;

for (int i = 0; i < n; ++i) {
avg += arr[i] / n;

int loss = arr[i] % n;

// error + loss >= n
if (error > 0 && loss > 0 && error >= n - loss) {
// error = (error + loss) - n
error -= n - loss;
++avg;

// error + loss <= -n
} else if (error < 0 && loss < 0 && error <= -n - loss) {
// error = (error + loss) + n
error += n + loss;
--avg;

} else {
error += loss;
}
}

// Fix some overcompensation for error

if (avg < 0 && error > 0)
++avg;
else if (avg > 0 && error < 0)
--avg;

return avg;
}
>>
>>59259912
god is a meme
santa is not real
babies do not fall from the sky
gnomes are not alive
>>
>>59259921
I have already cursed you though. Pretty soon your family is going to have something bad happen to it.
>>
>>59259229
Even out of these. Rust's "safety" is the fetish of some guys on crack from Mozilla but it really does not cover much (and cannot). Building with clang using -fsanitizer provides better checks if you need safety (it's one of the only things that prevents heartbleed).
>>
File: 1479580200592.jpg (65KB, 680x680px) Image search: [Google]
1479580200592.jpg
65KB, 680x680px
>tfw people are too busy arguing about Reddit to cutepost
>>
File: img_112.png (199KB, 410x440px) Image search: [Google]
img_112.png
199KB, 410x440px
>>59259915
All cuteposters end up lewdposter
>>
File: 9-1.jpg (191KB, 1600x943px) Image search: [Google]
9-1.jpg
191KB, 1600x943px
>>59259776
Scala
>>
>>59259935
I thought the gate keeper is doing something more (((effective))) instead of being angry

wait till reddit sees this :"DD
>>
>>59259837
yeah i was just testing around.
>>
>>59259945
Back to your containment board faggot

>>>/c/
>>
>>59259953
I'm the chosen one
>>
File: no_escape.png (922KB, 1199x733px) Image search: [Google]
no_escape.png
922KB, 1199x733px
>>59259967
No exceptions.
>>
>>59259967
post the one that gives a (you)
>>
>>59259649
I have a full time job where I do C++ and occasional C#
>>
>>59259931
He said averages two integers, not "integer averages" n integers
>>
Hi, 1st year student here.
I write everything in C and never make mistakes.
>>
>>59259982
>I have a full time job
Oh, you just needed to clarify there
>>
>>59259653
That's the thing - you're not challenging yourself. You're constantly bringing yourself just up to the point where it's challenging, then changing course, constantly avoiding the necessary pain of learning. Challenge yourself!
>>
>>59259991
>typical C toddler of /g/
>>
>>59259958
>effective
It's pretty effective, you shall see when the time comes.
Why did you stop filling out the name field by the way?
>>
>>59259985
Run this program with n = 2 implied.
>>
File: 1484279646442-0.png (166KB, 543x727px) Image search: [Google]
1484279646442-0.png
166KB, 543x727px
>>59259966
>Not cute enough to contain me
>>
>>59259953
*shoves cock in mouth*
>>
>>59259662
You especially need to fucking kill yourself. Dumb frogposter.
>>
>>59260005
Gate keeper, I'm still here in your safe place. Do something about it
>>
>>59260029
No, your usual name. Not this reddit bullshit.
>>
>>59259980
I don't know what you're talking about, so here's my favorite one
>>
>>59260037
Better?
>>
>web browsers has tons of bugs in javascript (aka the usual "not-checking-input-size" stuff), so it make it a lot easier to find someplace to inject it.
Original post: >>>/v/369495250
Can someone explain this statement? If you have a function like
 foo(int x)

You can insert a string or double without the program automatically getting errors? Is this a js specific thing or something I need to look out for in other languages, (double checking the input)?
>>
>>59260049
No.
>>
>>59260039
There is one where she's giving a (you)
>>
File: n-no_homo21.png (544KB, 1196x384px) Image search: [Google]
n-no_homo21.png
544KB, 1196x384px
>>59260010
*pfffbbtttbpffbttbtb*
>>
>>59260052
COME ON, gate keeper. Please do SOMETHING about reddit invading 4chan
>>
>>59260062
First use your usual name.
>>
>>59260055
*pulls out and shoots all over that pretty feminine face then cum kisses*
thanks slut
>>
>>59260073
My name is Rajesh mukhpal, look me up on reddit
>>
File: 1481317259862.jpg (147KB, 700x800px) Image search: [Google]
1481317259862.jpg
147KB, 700x800px
>>59260055
Lewd posters are the natural enemy of the cute poster
>>
From this point on, I am going to be ignoring any post containing the word "r*dd*t*". You may resume participating in this thread when you are ready to act like an adult.
>>
>>59259999
You're a white millennial whiner
>>
>>59259941
>Rust's "safety" is the fetish of some guys on crack from Mozilla but it really does not cover much (and cannot).
It covers everything related to doing the wrong things to memory at the wrong time.
- all kinds of data race
- reading before initialization
- use after free/double free
And it uses the extra info known from the guarantees of the type/lifetime systems to optimize.

Meanwhile the best things you have for C++ are run time assertions and traces and you don't even have standard restrict. Also C++'s RAII is horrible (constructors and assignment operators are different, copying is default, can only move types with a null object).
>>
>>59260082
Wrong.
>>
>>59259985
Set 'n' to two, and you have a function which gets the mean of two integers.
If you're one of those stupid fucks who tries to argue that "Hurr, returning an integer doesn't count", the function can easily be modified to give you a mathematically correct answer, by returning "error" from the function as well.
avg + error/n is the true mean of the input array.
>>
File: 1471092754246.jpg (541KB, 852x848px) Image search: [Google]
1471092754246.jpg
541KB, 852x848px
>>59260086
WHATS YOUR STANCE ON CUTE
CUTE!!
>>
>>59260007
Still no good. Returns an integer, you see.
>>
>>59260094
>OOP is retarded
>Oh I know, let's blame the retardation of OOP on C!
>>
>>59260086
>gate keeper giving up
This is just plain sad!
>>
>>59260115
>He doesn't know about C with classes
>>
>>59260117
Why are you not filling out the name field?
>>
>>59260094
You don't understand.
The expert C programmer of /dpt/ is far too intelligent to make mistakes.
They write perfect code. Always. They get paid 300k starting to work on top secret military projects for this very reason.
>>
>>59260112
>what is type inference
>>
>>59260126
My name is Rajesh. I said this already
>>
File: C averaging two integers.png (36KB, 684x982px) Image search: [Google]
C averaging two integers.png
36KB, 684x982px
>>59260096
Wow, I guess you could also just return the array and the number of elements. Then you could calculate the REAL average using that too!
Genius!
>>
>>59260115
???
>>
>>59260117
>everyone criticizing me is the gate keeper
whatever helps you from cutting yourself anon
>>
>>59260051
It's a dynamic typing thing, especially with js because instead of throwing an exception it will try to convert it to another type or do something even dumber.
>>
>>59260136
Incorrect.
>>
>>59260117
I'm not that gatekeeper faggot, just some person who doesn't want /dpt/ to be flooded with this stupid r*dd*t spam.
>>
File: img_006.jpg (173KB, 1075x384px) Image search: [Google]
img_006.jpg
173KB, 1075x384px
>>59260085
We're not so different you and I.
>>
>>59260128
It's funny because according to alexa the userbase of 4chan is dominated by young females in their 20's and most of the 4chan users access it from their school computer
>>
>>59259776
PLEASE ANSWER
>>
>>59260167
use conio.h
>>
>>59260128
It's not even like safety is the only thing Rust has going for it. It's got leagues more abstraction than C and has good FP support, all zero overhead thanks to unboxed closures and traits.
>>
>>59259776
ruby
>>
>>59260180
but it's ded
>>
File: 16684208.jpg (44KB, 480x539px) Image search: [Google]
16684208.jpg
44KB, 480x539px
>>59260176
Not him but I don't hate Rust.
I just hate that it does not have nice books for intermediate users.
>>
>>59260176
>has good FP support
like what?
>>
File: 1488530483152.png (526KB, 792x858px) Image search: [Google]
1488530483152.png
526KB, 792x858px
>>59260155
CUTE
not
LEWD
forever!
>>
>>59260210
http://science.raphael.poss.name/rust-for-functional-programmers.html
>>
>>59260201
I don't hate Rust. I hate how retarded its shills are.
>>
>>59260210
As good as ML.
>>
>>59260138
What the fuck are you on about?
The "error" is just a side effect of the computation. It's the same as the remainder for integer division.
>>
>>59260138
True C experience
>>
>>59260221
Looks like some sort of hispter blog so I won't read it. Could you briefly explain it yourself?
>>59260234
Does it have the same sort of type inference?
>>
>>59260257
>won't listen to argument
>won't read arguments
>close years
>close eyes
You must be that gate keeper kid
>>
>>59260257
Yeah, more or less. A change that isn't always great IMO is that you have to write full signatures for all named functions, even if you're implementing a trait and all the types are already known. Most of the time it's not an issue though.
>>
>>59260257
Haskell is imperative

:^^)
>>
>>59260279
To be fair this blog barely mentions anything functional
>>
I want this thread die
>>
>>59260279
>monkey
about as primitive as rust
>>
>>59260279
Your post is pretty stupid. I regret reading it.
>>59260282
>Yeah, more or less.
That's pretty nice.
>you have to write full signatures for all named functions
That isn't a problem since I usually write them anyway.
>>
Type inference was a mistake.
>>
http://ericsink.com/entries/rust1.html
>>
>>59260332
Yes. This thread is absolute garbage.
You can tell just by how fucking fast it is at the moment.
>>
File: 1487301355639.jpg (82KB, 650x693px) Image search: [Google]
1487301355639.jpg
82KB, 650x693px
>>59260332
>>
>>59260336
At least monkeys know how to do register allocation
>>
>>59260422
what monkeys are you keeping?
>>
>>59260354
>I'm a strong independent code artisan who don't need no computer to do no work for me
>>
>>59260428
Codemonkeys
>>
Is CS50 a meme for a complete beginner?
>>
>>59260451
What does the 50 mean?
50 shades of C?
>>
>>59260445
>I'm a cuck
>>
>>59260474
cill yourself
>>
>>59260474
>50 shades of C?
5 stages of Cancer*
>>
>>59260478
cucks do more work while aryan type inferred language users don't
>>
Do I need to dress as a girl to program well?
>>
>>59260478
>you're a cuck for not wanting to waste time and characters solving equations like "f _ y = f x _" manually
>>
>>59260503
Yes. Make sure you wear programming socks.
>>
>>59260503
>Girls
>Program well
What?
>>
>>59260503
yes
>>
>>59260515
crossdresser != girl
>>
>>59260515
He said dressing as a girl you redditard.

>>59260508
*tips fedora*
>>
>>59260503
That's a precondition. You actually will become a smarter programmer if you wear high socks
>>
Can somebody please tell me the bb code to paste code?

I thought it was , or is there a 2000 limit cap no matter what?
>>
>>59260534
>>59260512
I can't wear socks, I'm a snake.
>>
>>59260540
[back]to[/reddit]
>>
>>59260527
>>59260525
Yes. But that lowers your ability to code since you are pretending to be someone who doesn't code well.

Personally, I slatter coconut oil all over me and eat curry for a week and cross-dress as an India. +10 on programming skill
>>
What do I do if I want to go from 1 to n in C#?

Like in real life I would type " 1-n " (= "one to n") but what's the C# equivelant of that?
>>
>>59260552

Or don't be a fucking dick. I've literally been on 4chan for 9+ years, sorry I don't fuck around /g/ all day.
>>
>>59260562
quantity isn't quantity

girls write good code, but not much of it

indians write lots of code, but it isn't very good
>>
>>59260568
lad why are you even bothering with C#, you don't even know what a loop is
>>
>>59260562
>cross-dress as an India
H-how do you dress as a country, much less cross-dress as one?
>>
>>59260503
Crossdressing is a high level technique tho. Don't let your boss catch you doing it if you haven't established that you can handle it.
>>
#include <stdio.h>
#include <math.h>

void line_display(int store, double sales); //Prototype for sub function, lets it work
void data_display(double highest, int store, double lowest);

int main() //main program
{
double sales; //sales value inputted
int store = 1; //Number of store that had x sales
double average = 0; //value used in calculating the average, want to start at the number zero because we are doing an average
double sales_total = 0; //total of all sales input. Also set equal to zero for calculation purposes
double highest = 0;
double lowest = 2000000000;

sales = 1; // needs to be equal to something not zero to guarantee the loop will always run

printf("To terminate this program enter zero"); //Lets the user know that an input of zero will end the program

while( sales != 0 ) //condition that has the loop run for numbers not zero as it would close the program
{
if (highest < sales)
{
highest = sales;
}
if(lowest > sales)
{
lowest = sales;
}
{
printf("\nEnter today's sales for Store: "); //asking for input
scanf("%lf", &sales);
>>
>>59260568
in Haskell this is [1..n]
>>
>>59260540
You use [ c o d e ] [ / c o d e ], but it still counts towards the normal character limit.
>>
>>59260572
Did someone pee in your drink anon-kun?
>>
>>59260568
In Scala it's 1 to n
>>
>>59260574
>girls write good code, but not much of it
Please. I come from a very good university. Any girl that writes good code is actually written by the massive beta orbiter.
>>
if (sales != 0) //statement that has our asterisk outputter run
{
if(sales > 0) //statement that checks for positive numbers before running, because if we have a negative we want to skip the run, output our error message, and then re-run.
{
line_display(store, sales); //calls for the values given in our function made for the output
store++; //updater
}
}
if (sales < 0) //else statement for outputting our error message
{
printf("Please enter again with a positive value");
}
}
}
data_display(highest, store, lowest);
//average = sales_total/store;
sales_total = sales_total+sales;
return(0);
}
void line_display(int store, double sales) //Function to determine output
{
if (sales < 1000) //checks if sales are lower than our value required for one asterisk, if not, prints nothing as it does not meet our requirement.
printf("Store %i ($%lf) : | ", store, sales);
else
{
printf("Store %i ($%lf) : |", store, sales); //User friendly output
for (double i = sales/1000; i > 0; i--) //Start at sales, run while sales is greater than zero.
{
printf("*");
}
}
}
void data_display(double highest, int store, double lowest)
{
printf("Store %i had the highest weekly sales: $%lf", store, highest);
printf("\nStore %i had the lowest weekly sales: $%lf", store, lowest);
}
>>
>>59260593
what is your program trying to do?
>>
>>59260568
In Python is it range(1,n)
>>
>>59260606
I have no beta orbiters, my code is my own
>>
>>59260593
>>59260614

Can somebody please help me get my lowest value working and then tell me where to place my average function? C is a dick ass language, I can only do so much in it.

Here's my current output
http://prntscr.com/egia13
>>
>>59260618
How more comments than actual code.
>>
>>59260595
>in Haskell this is
stop this meme isn't funny anymore.
>>
>>59260606
>what is confirmation bias
>>
>>59260632
yea but tell me what your goal is
>>
>>59260629
But you are not a grill
>>
>>59260631
>>59260618

This is what I'm aiming for, except not all of the bar lines at once. That would take arrays, and the last time I used them for these 'simple' projects they're making us use retarded functions for I got yelled at.

http://prntscr.com/egiaco
>>
>>59260632
How do you have*
Meant for the post above.
>>
>>59260633
in Haskell it is funny
>>
>>59260641
Girls can't code well because they are genetically inferior when it comes to logical thinking. This isn't confirmation bias, this is biology. Are there good female coders? Yes. But they are far fewer and rarer than their counterparts.
>>
>>59260648
Yes I am, otherwise why would I crossdress as a boy when I program?
>>
>>59260568

for (int i = 1; i < n; i++)
>>
>>59260683
You mean i<=n
>>
>>59260584

I do know what a loop is, so shut the fuck up you arrogant bitch. Don't EVER talk with such disrespect to me!

Got it, faggot?
>>
>>59260683
but that's wrong
Enumerable.Range(1, n)
>>
>>59260676
>Yes I am
Pretending to be a girl on the internet should be considered a mental illness.
>>
>>59260683
You want <=, not <, Rubes darling
>>
>>59259037
Postgresequel is a word-play?
>>
>>59260675
"logical thinking" is too vague to be a meaningful genetic trait. And most male programmers are utter retards, the only female programmers that make it are the ones who are actually good.
>>
>>59260683

I know that, but what if I need to go through multiple cases in a switch?
>>
File: 1483329696241.jpg (150KB, 890x876px) Image search: [Google]
1483329696241.jpg
150KB, 890x876px
>>59260675
>Girls can't code
>>59260675
>Are there good female
>>59260675
>Yes
Moron. You wanted to make a stupid point so much you didn't even stop to think if you had one
>>
>>59260593
>>59260614
>>59260631
>>59260650

I am OP for all of these, sorry for how spread out everything is. Any help is greatly appreciated, tired of this retarded ass assignment that they make us use dumbass irrelevant functions for.
>>
>>59260683

Woops. Meant to write <= n. Now it's just an inclusive range, or [1, 5) rather than [1, 5], which is garbage.

>>59260690
>>59260698

Yes, a typo. My bad.
>>
>>59260697
Posting on 4chan in the first place means you're probably mentally ill.
>>
>>59260697
Pretending there are no women who browse /dpt/ in order to satisfy your psychological complexes should be considered a mental illness.
>>
>>59260725
you mean i-1<n
>>
New thread

>>59260749
>>
>>59260710
>"logical thinking" is too vague to be a meaningful genetic trait
Logical thinking has a direct correlation with IQ. Shit like being good at chess. That is why despite chess having zero gender advantages physically, males still dominate the game.
>>
>>59260675
>But they are far fewer and rarer than their counterparts.
It has something to do with culture I think. My female colleague has always had a tough time around her girl friends. "You are working as WHO now?! Jeeesus girl"
>>
>>59260752
IQ is also incredibly vague and arbitrary. If anything, chess ability is MORE concrete than "IQ" or "logical thinking".
>>
>>59260775
>IQ is also incredibly vague and arbitrary
Spoken like a true female. I bet you think Einstein's intelligence is vague and arbitrary.
>>
>>59259425
>bookmarking Youtube
>>
>>59260789
I'm male actually. I'm saying IQ is arbitrary, not that intelligence is. Einstein's intelligence is demonstrated through his accomplishments, an IQ test would only give you part of the picture.
>>
>>59259577
>who have at least a basic understanding of general code
That comes by learning *a language, any language*. If even Python seems confusing to you, see if you find it easier with Basic or JavaScript, and take it all in more slowly
Thread posts: 327
Thread images: 55


[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.