[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: 304
Thread images: 43

File: cppmap3.jpg (3MB, 3840x2555px) Image search: [Google]
cppmap3.jpg
3MB, 3840x2555px
Previous thread: >>60144368

What are you working on, /g/?
>>
>>60146297
Lisp is the most powerful programming language.
>>
>>60146327
keep posting this every day until it becomes true
>>
File: 0-YKPrhV.jpg (24KB, 512x512px) Image search: [Google]
0-YKPrhV.jpg
24KB, 512x512px
>>60146297
First for C++ goddess
>>
File: 1485658260765.png (335KB, 1396x592px) Image search: [Google]
1485658260765.png
335KB, 1396x592px
SHITKELL LMAO
>>
Behold! The true power of C with Classes.
http://hg.icculus.org/icculus/lugaru/file/tip/Source/GameTick.cpp
>>
>>60146352
She's pretty funny-lookinh.
>>
be wary of r/rust
>>
I am surprised that Swift is slow, thought it is on par with golang
>>
(Copypasta from old thread because autosage)

>>60146061
I appreciate that you try to help my, but this doesn't seem to be working either. Btw I have switched to clang (hoping it has better error messages) and compile with -std=c++1z.
<source>:11:91: error: expected expression
template <typename U = T, std::enable_if_t<is_trivially_destructible_v<U> == true> = ()>
^
<source>:14:92: error: expected expression
template <typename U = T, std::enable_if_t<is_trivially_destructible_v<U> == false> = ())>
^
<source>:18:34: error: no matching member function for call to 'print'
int main() { motherfucker<int>().print(); }
~~~~~~~~~~~~~~~~~~~~^~~~~
<source>:12:10: note: candidate template ignored: couldn't infer template argument ''
void print() { std::cout << "Yeah boi" << std::endl; }
^
<source>:15:10: note: candidate template ignored: couldn't infer template argument ''
void print() { std::cout << "Nah man" << std::endl; }
^
>>
>>60146393
I installed my cock cage but it's still not compiling.
>>
Rust can't implement traverse_
>>
>>60146425
For fuck's sake, anon. Stop calling your underwear "cock's cage".
And put that pathetic excuse for a boner away, it's embarrassing
>>
>>60146297
It takes exactly 15 secs to open 3.45 MB jpg.

Please refrain from posting it.
>>
>>60146360
What an awfully laid-out infograph. It's borderline impossible to read those damn names.

Language quality and language speed do not correlate at all, C baby. Otherwise, we'd all be using ASM.
>>
SHITKELL can't implement a kernel
>>
Hey guys I'm kinda bored and I'm thinking of reading either SICP or CLRS, which would you find more fun and/or practical? I'm confident regarding my math background and I have half a year experience is a junior developer so I think I can tackle them.
>>
>>60146453
https://wiki.haskell.org/Applications_and_libraries/Operating_system#Standalone_operating_systems
>>
>>60146449
>Language quality
Oh, in that criteria trashkell would come last
>>
>>60146444
>Degrading the guy who just said he's wearing a chastity cage
He's just going to boner up more.
>>
>>60146455
SICP for both fun and practicality.
>>
>>60146463
That's not an operating system
>>
>>60146455
SICP is still a good read.
>>
>>60146455
Read both eventually.
>>
>>60146486
It lists 3 operating systems, all of which have kernels, one would assume.
>>
>>60146297
>What are you working on, /g/?

Right now I am trying some iudeas for a form of autocorrect.

Right now I try to get a function running that goes from a string to a float.
Then compare two floats as a measure of similarity.

(Yes - I am aware that there already is code for that on the internet)
>>
>>60146486
>moving the goalposts
>>
>>60146498
None of them are operating systems
>>
Is there a point in reading CLRS if I passed the very extensive algorithms & data structures course at my uni
>>
File: homer.jpg (41KB, 960x540px) Image search: [Google]
homer.jpg
41KB, 960x540px
ive been writing python stuff for years but i want to get into real high performance programming

>also currently falling for "make your own video games" meme

i'm currently working through the official C++ tutorials, does anyone have any tips or resources for game development in C++?

i am already very familiar with all the basics of general programming so i'm looking for something more advanced than "hello world"
>>
>>60146519
What?
>>
>>60146527
I don't see any formal proofs in those links
>>
>>60146537
I don't see any formal proofs in this post
>>
>>60146465
Yeah, I agree, but probably for the exact opposite reason as you. C is useless for writing anything other than FizzBuzz, 99 bottles, and Hello World. Haskell is useless for anything other than re-implementing the mathematics field's favorite functions which already exist in other languages, then jerking your ego off about how you did it the "correct" "clean" Haskell way.

Good alternatives to Haskell : Ocaml, Clojure, most other functional languages.

Good alternatives to C : Anything that people ever consider "an alternative to C" is usually significantly better than C as well. Fortran, LLVM IR, etc.
>>
If my husband borrows my clothes, will he really become a better programmer? He keeps asking me to let him.
>>
Java is and always will be the best statically typed language in existence.
>>
File: 1479442638089.gif (897KB, 800x430px) Image search: [Google]
1479442638089.gif
897KB, 800x430px
>>60146510
>House
>Written in C

>Kinetic
>Dead link

>hos
>Written in C

AHAHAHAHAHAHA SHITKELL cucks why do they even try
>>
>>60146567
Ask your boyfriend if he's down for a threesome I'd say.
>>
>>60146558
>Good alternatives to Haskell : Ocaml, Clojure, most other functional languages.
Sad. You know little of the differences between these languages.
>>
>>60146444
If you first put that excuse for a language (I'm looking at you Rust) away
>>
>>60146416
oh wait try this:
#include <type_traits>
#include <iostream>

template <typename T>
struct motherfucker
{
template <typename U = T, std::enable_if_t<std::is_trivially_destructible_v<U> == true, bool> = { }>
void print() { std::cout << "Yeah boi" << std::endl; }

template <typename U = T, std::enable_if_t<std::is_trivially_destructible_v<U> == false, bool> = { }>
void print() { std::cout << "Nah man" << std::endl; }
};
int main() { motherfucker<int>{ }.print(); }


enable_if needs a specific type name to instantiate, since it defaults to void.
>>
>>60146558
>Ocaml
Why would I use it over Haskell?
>>
>>60146575
Yes, Haskell can be compiled to C, and there are macros and other things you can use to do inline C.
>>
File: CwhHfwhXgAAyyCE.jpg (6KB, 152x138px) Image search: [Google]
CwhHfwhXgAAyyCE.jpg
6KB, 152x138px
>>60146558
>Fortran, LLVM IR
>>
>>60146525
>c++
handmadehero.org (it's more like c with operator overloading but still a good resource)
>>
>>60146587
Why do you always lack arguments, drumpfkin C brainlet? Move out of my way. Patrician coming through.
>>
File: Untitled.png (4MB, 3360x1080px) Image search: [Google]
Untitled.png
4MB, 3360x1080px
Is this true? How can we fix this?
>>
>>60146594
Hey at least it's not trashkell
>>
>>60146606
If you're not good enough to understand Haskell, OCaml is at least better than many other possible alternatives.
>>
>>60146567
Buy a strapon and fuck him/. That's what he want.
>>
>>60146606
Way easier. Syntax makes more sense. No optional pythonic ass-pain. Syntactic sugar doesn't clutter up your thought process. Less time thinking about the "right" way of doing things, more time doing things. If you think about a problem procedurally, you can solve it procedurally.
>>
>>60146607
LITERALLY clickbait operating sytems
>OS written in haskell
>"oh it's just compiled to C"

HAHAHAHAHAHA
>>
>>60146603
>enable_if needs a specific type name to instantiate
That's why I'm using
enable_if_t
(notice the _t) that comes with C++14 and is defined as
template< bool B, class T = void >
using enable_if_t = typename enable_if<B,T>::type;
>>
>>60146643
No, you quite clearly said "those aren't operating systems"
>>
How can do I read data from a file in c#, where the data is seperated by a certain character?
>>
>>60146635
>If you think about a problem procedurally, you can solve it badly.
FTFY
>>
File: wtfthisshitagain.png (227KB, 708x675px) Image search: [Google]
wtfthisshitagain.png
227KB, 708x675px
>>60146416
>>60146603
btw I just tried to compile it myself and gcc here doesn't have the _v aliases yet. it works with ::value though.
>>
>>60146643
>OS written in C
>"oh it's just compiled to machine code"

HAHAHAHA
>>
File: newmainmenu.png (56KB, 1296x772px) Image search: [Google]
newmainmenu.png
56KB, 1296x772px
In not thinking about my winform order I created a main menu and character window after I already made the world. The mainForm design is always the first screen when the program runs and I'd like to change that. I figured it would work by hiding the mainform on its class and showing the menu on its but that's giving me an error at the mainform here
private MainMenu startmenu = new MainMenu();
startmenu.Show();

I'm sure there is a simpler way to make a different form run first
>>
>>60146643
Just as a side note, are you also losing your shit when someone says he wrote a program in C and you see some inline asm?
>>
C newbie here. How can I dinamically insert or remove new elements to a struct?

For example:
ID - NAME - QUANTITY
0 - Banana - 5
1 - Lemon - 6
2 - Apple - 3

And I want to add
 
3 - Lettuce - 2
4 - Tomato - 8
// and so on...
>>
>>60146558
Fortran is great but you're a fucking idiot lmao
>>
>>60146653
Okay then I stand corrected

Those are not OS written with SHITKELL, because SHITKELL can't be used to create anything
>>
>>60146643
the rts and gc are written in C
the kernel (the part you asked about) is written in Haskell
for the 3rd link

>>60146635
I could say the same for moving TO haskell
>>
>>60146654
Take homework questions elsewhere. We're busy discussing more important problems, like the best brand of programming socks.
>>
File: 1483677747944.png (20KB, 586x550px) Image search: [Google]
1483677747944.png
20KB, 586x550px
>>60146670
>SHITKELL requires you to compile to C and then compile to ASM
AHAHAHAHAHAHAHA
>>
File: wtfthisshitagain.png (233KB, 951x731px) Image search: [Google]
wtfthisshitagain.png
233KB, 951x731px
>>60146644
yeah but T is void by default, which you can't instantiate.
>>
>>60146658
Go ahead and show me how you write a pure function for a CLI prompt or a random number generator. Have fun writing your tokenizer by using a bloated tokenizer library instead of just using a while loop.
>>
>>60146702
that's a shame, fortunately HASKELL doesn't
>>
>>60146635
Funny, in Haskell everything just snaps together correctly for me. You must not be very good at using it.
>>
>>60146703
kek, I literally just got this same captcha
>>
>>60146689
I mean it isn't a homework question but okay.
>>
>>60146684
>GC in OS
Can't make this shitk̶e̶l̶l̶ ̶ up
>>
>>60146684
>I could say the same for moving TO haskell
No you couldn't. Did you even read what I said, brainlet? Those are all things that apply to Ocaml over Haskell.

>>60146677
Gaslighting C baby.
>>
>>60146635
>you can solve it procedurally
Do you mean as in Lisp? I didn't like that desu.
>>
File: wtfthisshitagain.png (239KB, 970x665px) Image search: [Google]
wtfthisshitagain.png
239KB, 970x665px
>>60146726
It keeps happening!
>>
>>60146753
>No you couldn't. Did you even read what I said, brainlet? Those are all things that apply to Ocaml over Haskell.
HAHAHAHAHAHHA BRAINELT BUT THEY:REFALSE HAHAHAHAHA
LMAO BRAINLET SHITCML
>>
>>60146718
There is no such thing as "Hask*ll" anymore. It's the name of a dead project
>>
>>60146704
do
putStrLn "What's your name?"
name <- getLine
putStrLn $ "Hello, " ++ name ++ "!"


There, a pure function for a CLI prompt.
>>
>>60146721
You've never written anything in Haskell worthy of putting in a portfolio, let alone worthy of getting you a job.
>>
Is it Haskill?
>>
>>60146776
not him but I wrote a http server in haskell and I used it to land a job
>>
>>60146745
Can't you just use String.split or whatever C# calls it?
>>
File: 1488219672394.jpg (22KB, 500x396px) Image search: [Google]
1488219672394.jpg
22KB, 500x396px
>>60146784
>Haskill
Yes
>>
>>60146784
i can tell you aren't one of the cancerous rodents that's been spamming threads all day, because this is an actually good post
>>
>>60146755
>Do you mean as in Lisp? I didn't like that desu.
No, you ape fucking retard, I mean procedurally. Some LISP dialects enable it too, but it'd be abnormal to have within LISP.
>>
>shitlang users desperately trying to deflect from their own inadequacies by posting negative remarks about haskell
>>
>>60146797
>frogposter

the world is full of non-surprises
>>
>>60146703
This shit just doesn't work despite everything.
>>
>>60146775
>putStrLn, getLine
>pure
Better luck next time, kid.
>>
>>60146784
Is Hask*ll haskill?
GUYS!?
There are two websites already. When is /g/ going to make the third one?
>>
>>60146776
If you struggle to make Haskell work then you've probably never written anything in any language worthy of putting in a portfolio.
>>
Good resources to learn how compilers work?

Been searching youtube but a I get a video with an Indian accent or it just teaches you how to compile.
>>
>>60146821
it's merely a description of an IO action
if you were to use your own custom IO datatype and provide a "run" function, you could, in the middle, edit that IO action and change it into something else
>>
>>60146834
That's impossible, Haskill is kill
>>
>>60146821
Thanks for proving you know nothing about Haskell. We can all ignore you now.
>>
>>60146834
That's a non-argument.
>>
>>60146845
>Read source file
>Translate to machine code
There
>>
>>60146854
It's a perfectly valid inference from the data available.
>>
can everyone please stop talking about haskell
>>
>>60146804
Misread.
>>
>>60146868
I wish.
Haskell is just TOO popular in this thread.
>>
>>60146799
You should stop thinking about posts authors.
Life is better if you just categorize posts into 'funny' or 'not funny' and go about your day.
>>
>>60146846
They revolve around side effects. A function isn't pure if the same argument doesn't result in the same output every time. IO of any kind is impure.
>>
File: compilers.jpg (55KB, 319x475px) Image search: [Google]
compilers.jpg
55KB, 319x475px
>>60146845
pick up this book, it's a classic
>>
>>60146868
Yes, let's instead start talking about other languages. We'll soon discover that the vast majority of them (i.e. anything that isn't Idris or similar) are far, far inferior to Haskell.
>>
>>60146820
Odd.
What about using a function parameter? That's should be easier to work with, albeit slightly more restrictive.
template <typename T>
struct motherfucker
{
void print() { print(typename std::is_trivially_destructible<T>::type { }); }
private:
void print(std::true_type) { std::cout << "Yeah boi" << std::endl; }
void print(std::false_type) { std::cout << "Nah man" << std::endl; }
};
>>
>>60146845
dragon book
>>
>>60146868
haskill*
>>
>>60146850
Okay, you're a butthurt brainlet ignoring the facts. Keep your mouth shut until you've turned 18.
>>
>>60146884
The function I wrote does result in the same output every time, though. The exact same value of type IO ().
>>
>>60146881
I'd rather classify posts into "user should have been banned for this post" and "user should not have been banned for this post"

>>60146884
the point is that monadic IO is like describing IO actions as values
the compiler then takes the main action and compiles it into a program
but the main value, itself, is just a regular pure immutable value
>>
>>60146868
Haskell is a great language. Prove me wrong.
>>
>>60146889
In terms of slower programs? Of course. H*skill is the slowest programming language
>>
>>60146902
What facts? That you don't understand putStrLn and getLine?
>>
>>60146911
actually, the box plot graph linked earlier (previous thread?) showed that the slowest binaries were Fortran
>>
File: 1477247328309.png (367KB, 636x358px) Image search: [Google]
1477247328309.png
367KB, 636x358px
If trashkell is garbage collected why doesn't it collect itself?
>>
>>60146911
It's amazing just how far shitlang users will go to deny reality.

>>60146935
It doesn't, therefore it is not garbage. QED
>>
File: wtfthisshitagain.png (236KB, 903x645px) Image search: [Google]
wtfthisshitagain.png
236KB, 903x645px
>>60146910
>no inline asm
>>
>>60146925
>showed that the slowest binaries were Fortran
Haskill*, not 4tran
>>
>>60146940
>reality
Of what? Trashkell being slow?

How is that 6 GBps treating you?
>>
>>60146756
>Select all squares with sandwiches
>shows pictures of hamburger
>>
>>60146676
You'd implement each entry as a struct, something like

struct entry {
char namebuf[128];
unsigned int quantity
};

And store a number of those structs in an array.

>>60146678
That's like saying C can't do I/O since you ultimately need to resort to asm to communicate with peripherals.

>>60146704
I seem to recall that linear congruential PRNGs use the previous result as the seed, for everything but the first call (which requires a seed to be generated externally). Which means you could implement as a pure function, if you require the caller to store and provide the result of the last call, rather than storing it internally as a local static variable in the callee.
>>
File: slowtran.png (43KB, 645x364px) Image search: [Google]
slowtran.png
43KB, 645x364px
>>60146948
No.
>>
>>60146935
Shitkell's GC can't even collect garbage LMAO
>>
>>60146969
>Trashkell user doesn't know what median is
Who knew
>>
>>60146990
The median isn't the slowest
>>
>>60146935
Really made me think
>>
>>60146945
FFI
>>
>>60146998
When did I say it is? Did you leave your brain in trash can?
>>
quite like this hasklet bullying gimmick
>>
>>60147004
That's not trashkell
>>
>>60146990
kek
>>
>>60147013
>>showed that the slowest binaries were Fortran
>Haskill*, not 4tran
The graph quite clearly shows that the slowest binaries produced are produced by Fortran.
>>
File: wtfthisshitagain.png (259KB, 1005x624px) Image search: [Google]
wtfthisshitagain.png
259KB, 1005x624px
>>60146964
you're missing the point.
>>
File: 1437837019806.png (26KB, 462x320px) Image search: [Google]
1437837019806.png
26KB, 462x320px
>>60146892
That's an option, of course. I just thought this would be a nice, small example to learn how SFINAE works.
>>
>>60146935
This is a good question
>>
>>60146990
Lmao you can't make this shit up
>>
>>60147021
http://brandon.si/code/almost-inline-asm-in-haskell-with-foreign-import-prim/
>>
>>60147031
>>60146990
>>
File: 1474436860884.png (568KB, 600x580px) Image search: [Google]
1474436860884.png
568KB, 600x580px
>>60147045
>Almost Inline ASM in Haskell
Almost there, trashkell. Try harder next time
>>
>>60146884
>A function isn't pure if the same argument doesn't result in the same output every time.
But many I/O functions DO satisfy that constraint. Puts() for example has a deterministic effect for a given input.

>>60146911
Isn't python slower?

>>60146963
"6 gigabytes per second" is a meme. At no point is there actually 6 whole gigabytes of garbage floating around. What it means is that it produces a small amount of garbage, and collects it again, millions of times per second.
>>
>>60146963
>not even trying any more, just plain making shit up about haskell
>>
File: 1468153628047.png (231KB, 342x342px) Image search: [Google]
1468153628047.png
231KB, 342x342px
>>60146935
That's because shitkell's GC is a garbage itself
>>
>>60147062
Java has "almost inline asm" too, you know.
>>
>>60147062
Just like Rust fags say: "we are working on it".
>>
>>60147070
>6 gigabytes per second" is a meme
It's not. It's a real case study. H*skill is just too efficient
>>
>>60147080
haskill*
>>
>>60147046
Wow, relinking your old post!
Just like earlier you had no fucking clue what HKTs were and had to keep moving goalposts to pretend they were slow, now you're moving goalposts to try and pretend you were right.

Nobody said anything about the median.
We were talking about the SLOWEST binaries.
Not the median, the SLOWEST.

Do you understand that? Is that simple enough for you? Me-di-an. Median.
>>
File: Untitled.png (618KB, 1030x624px) Image search: [Google]
Untitled.png
618KB, 1030x624px
>>60147033
>RIGHT LANE MUST TURN RIGHT
can you tell me what I'm missing
>>
File: 1492401162065.png (139KB, 228x260px) Image search: [Google]
1492401162065.png
139KB, 228x260px
>>60147087
>Being slower than Java
AHAHAHAHAHA How are shitkell cucks living with this hard fact?
>>
>>60147105
>What is the measure of central tendancy
Did shitkell drain your common sense or are you trying THIS hard to grasp that straw?
>>
>>60146907
>the point is that monadic IO is like describing IO actions as values
>the compiler then takes the main action and compiles it into a program
>but the main value, itself, is just a regular pure immutable value
All C void functions are pure guys!
>>
>>60147105
>We were talking about the SLOWEST binaries.
And you are talking about one slow binary

Is a trashkell fag too retarded?
>>
>>60147109
>Compiled language
>Slower than Java
Even Pajeets are laughing at haskill faggots
>>
>>60147125
the
slowest
binaries
are
produced
by
fortran
in
that
graph

i said it before, i am saying it again

>>60147134
No, and as I said earlier, you could take a function that interprets an IO2 action (where IO2 is your custom IO), and put a function in between that ALTERS that io action (by which i mean returns it, altered, not mutates it).

>>60147145
Slowest is slowest.
Do you really think it's just 1, given the ratios?
>>
>>60146935
kekd
>>
%.o: %.asm
$(AS) $(ASO) $(input) -o $(output)

$(NAME): %.o
$(LD) $(LDO) $(input) -o $(NAME)


What's wrong with this Makefile? It says
 make: *** No rule to make target '%.o', needed by 'kernel.bin'. Stop.
>>
>>60147162
The race that takes the thickest blackest dicks is the white race but that doesn't mean whites are sissy cuckboys does it?
Oh wait.
>>
>>60147162
>the
>slowest
>binaries
>are
>produced
>by
>fortran
>in
>that
>graph
1. SHITKELL autist is now so ass flustered he is confusing Return key with space LMAO
2. Slowest binaries are created by SHITKELL, There is one outlier for FORTRAN. Learn what an outlier is you fucking inbred SHITKELL autist
>>
File: r_102813_Wx1Vb.jpg (23KB, 291x309px) Image search: [Google]
r_102813_Wx1Vb.jpg
23KB, 291x309px
<html>
<head>
<title>/g/ - Technology</title>
</head>
<body>
<p><b>Anonymous</b> 04/30/17(Sun)22:24:02 No.60147087</p>
<p>>>60147062</p>
<p>Java has "almost inline asm" too, you know.</p>
</body>
</html>
>>
>>60147162
You're wasting your time trying to reason with these dunces, mate.
>>
>>60147162
>No, and as I said earlier, you could take a function that interprets an IO2 action (where IO2 is your custom IO), and put a function in between that ALTERS that io action (by which i mean returns it, altered, not mutates it).
A void function in C always evaluates to the same value, it's 100% pure.
>>
>>60146935
>>60146784
Ayy kek
>>
File: wtfthisshitagain.png (293KB, 1073x645px) Image search: [Google]
wtfthisshitagain.png
293KB, 1073x645px
>>60147107
I keep getting the same captchas.
>>
>>60147208
what?

>>60147231
an IO action in Haskell IS just a value
>>
>>60146360
SHITKELL LMAO
>>
>>60147210
>it's an outlier, therefore it doesn't count!
>>
>>60147250
yea but trashkell itself is not pure
>>
>>60147210
>evidence that contradicts my argument doesn't count!!!!
>>
>>60147249
make script to auto select the captcha
>>
>>60147268
SHITKELL autist is LITERALLY ILLITERATE
>>
>>60147282
>Counting outliers
How did you pass 5th grade?
>>
File: wtfthisshitagain.png (251KB, 924x665px) Image search: [Google]
wtfthisshitagain.png
251KB, 924x665px
>>60147035
Well the last example (instantiating enable_if_t with bool) should have worked. No idea why it didn't.
>>
>>60147210
m8
im so sorry i pointed it out
>>
>>60146525
>does anyone have any tips or resources for game development in C++?
The SFML library is pretty good
>>
>>60147294
SHITKELL autist never went to school in the first place
>>
>>60147231
No, a void function doesn't "evaluate to a value" at all. The "value of a function" in C is a compile-time abstraction, all it really means is helping the compiler figure out which mutable global variable (IMPURE! IMPURE!) to modify by the function.
>>
>>60147299
You pointed out that you are illiterate, we all know
>>
File: wtfthisshitagain.png (248KB, 1027x661px) Image search: [Google]
wtfthisshitagain.png
248KB, 1027x661px
>>60147283
at this point that might actually work.
>>
>>60147308
>says I can't read very well
>can't interpret graphs
kek
>>
>>60147299
>Counting outliers in statistics
>>
>>60147294
How does it feel to be scientifically dishonest?
>>
File: smug37.png (179KB, 462x450px) Image search: [Google]
smug37.png
179KB, 462x450px
>>60146935
>>
>>60147334
>scientifically dishonest?
OMG do you actually think outliers count?
Have you taken ANY SINGLE scientific experiment in your lifetime?
>>
File: 1433158199996.gif (1MB, 300x168px) Image search: [Google]
1433158199996.gif
1MB, 300x168px
I'm making a C# program with one thread for networking and another one for computing. First one waits for client command, sends that command to second thread, waits for result and sends it back to client.
However, first thread should still listen for new commands (in case client hits cancel) while waiting for the signal from the second thread. Whats the best way to do that in a single thread?

I thought about using receive with a timeout, then if client didn't send cancel check if the results ready, if not go back to receive.
First time in C# btw
>>
>>60147325
what's with your font, are you using XP or Arch?
>>
>>60147349
You do realize that going by "the slowest binaries" is stupid in the first place, right? If you want to be "scientifically honest" you should go by the average or median binary speed for each language.
>>
>>60147334
Did your parents send you to school?
>>
>>60147365
>You do realize that going by "the slowest binaries" is stupid in the first place, right? If you want to be "scientifically honest" you should go by the average or median binary speed for each language.
Maybe you should go back in time and tell that one faggot who's so desperate to attack Haskell users, presumably since he evidently has nothing else to do all day
>>
>>60147306
>The "value of a function" in C is a compile-time abstraction, all it really means is helping the compiler figure out which mutable global variable (IMPURE! IMPURE!) to modify by the function.
Yes, like in any other language because guess what, that's the entire point of any program running on a computer.
Any language or compiler not emitting code modifying global state would have zero useful effects and might as well not be executed at all (in fact, couldn't be executed at all on a real computer since at the very least a global instruction pointer must be incremented to go to the next instruction).
>>
>>60147365
>Take average of speeds
>hasklel comes out the third last
LMAO
>>
>>60147401
>third last
of the languages that are listed there
not of all the languages
>>
File: 1467902272499.jpg (2MB, 2000x4000px) Image search: [Google]
1467902272499.jpg
2MB, 2000x4000px
>>60147409
>that damage control
Typical trashkell user experience

6 GB/s
>>
File: IMG_20170121_123157.jpg (4MB, 4160x3120px) Image search: [Google]
IMG_20170121_123157.jpg
4MB, 4160x3120px
Is traversing a linked list in C as fast as traversing an array?
>>
File: wtfthisshitagain.png (260KB, 1079x646px) Image search: [Google]
wtfthisshitagain.png
260KB, 1079x646px
>>60147351
win7 with cleartype disabled.
I wish there was some way to force grayscale cleartype everywhere. subpixel rendering looks like shit on a crt.
>>
>>60147434
all 6 GB are dedicated to triggering procedural turbo autists
>>
>>60147436
no
>>
>>60147436
same big O
>>
>>60146935
It's busy producing garbage at 6 GBps
>>
spaces or no spaces after if/while/for

while(girth <= 6)
WriteLine("Subhuman.");


or

while (girth <= 6)
WriteLine("Subhuman.");
>>
Java is the best programing language.
>>
>>60147436
If you start at the beginning: yes
>>
>>60147501
No spaces, and braces on the next god damn line.
>>
>>60147501
neither of those are acceptable
>>
>>60147501
First one is preferable, however that syntax is horrible. Either put the controlled statement on the same line, or leave it on the second line, but indent it, and surround it with braces.
>>
>>60147436
arrays are generally faster due to cache locality.
linked lists may be spread all over memory.
>>
>>60147516
those are both irrelevant

he did forget tabs tho.
>>
>>60147501
while (girth <= 6) {
WriteLine("Subhuman.")
}
>>
File: wtfthisshitagain.png (326KB, 902x629px) Image search: [Google]
wtfthisshitagain.png
326KB, 902x629px
>>60147551
disgusting.
>>
>>60147540
>>60147551
whoops
i didn't know you could indent on 4chan, else i would have
>>
>>60147551
I don't really get the space between while keyword and the parenthesis of the condition, whereas there are no spaces between function name and the parenthesis of the parameter list.

I also do this but I don't know why, is there an actual reason for/against this?
>>
>>60147551
while(girth <= 6)
{
WriteLine("Subhuman.");
}

The only acceptable way.
>>
>>60147623
To distinguish between functions and built-in language constructs.
>>
>>60147623
The reasoning is that while/if/for aren't functions, so you shouldn't treat them as such, though personally I leave out the space.
>>
>>60147296
>>60146661
I gave gcc a go, and it seems to work perfectly fine there. Pretty odd that clang and MSVC won't compile.
Thanks a lot nonetheless, you might be the most helpful Anon I have ever met on 4chan.
>>
>>60147501
The correct way is

while (girth <= 5.5)
WriteLine("Subhuman.");
>>
while (girth <= 5.5);
WriteLine("Subhuman.");
>>
>>60147640
>>60147649
ありがと
>>
>>60147749
what is this chicken scratch you fucking geek
>>
>>60147768
he said "thanks"
>>
>>60147749
どういたしまして
>>
>bracketing single statements
absolutely gross
>>
>>60147541
Im doing some research into this. My program has two types of dynamically allocated memory: audio data in files and connection pointers. I figure i can use system calls to put audio data in its own section of memory (have some max filesize parameter) and then have the connections be the last thing allocated by brk and sbrk so that they can be in sequential order at the end of the data. Terminated connections will be freed and if a new connection comes in it will either fill the hole of the old connection or be appended to the end of the heap. This way ive got a linked list in order and i can just use pointer arithmetic and headers instead of malloc abstractions etc
>>
File: if.jpg (41KB, 550x512px) Image search: [Google]
if.jpg
41KB, 550x512px
>>60146616
>Implying trump supporters could get their head around programming, even if it's something as simple as C
>>
does using the ternary operator make you look smarter?
>>
>>60147936
Apparently so.

But anyone who thinks it constitutes "clever code" is fucking braindead.
>>
i did it!
>>> mergesort([5,4,3,2,1])
Dividing: [5, 4, 3, 2, 1]
Dividing: [5, 4]
Dividing: [5]
Dividing: [4]
Conquering: [5, 4]
Combining: [4, 5]
Dividing: [3, 2, 1]
Dividing: [3]
Dividing: [2, 1]
Dividing: [2]
Dividing: [1]
Conquering: [2, 1]
Combining: [1, 2]
Conquering: [3, 1, 2]
Combining: [1, 2, 3]
Conquering: [4, 5, 1, 2, 3]
Combining: [1, 2, 3, 4, 5]
[1, 2, 3, 4, 5]
>>>


def mergesort(A): 

def merge(lb, mid, hb):
li = lb # left index
ri = mid # right index
si = 0 # sorted index
tmpA = [0 for i in range(hb-lb)]

while(li < mid and ri < hb):
if A[li] < A[ri]:
tmpA[si] = A[li]
li += 1
else:
tmpA[si] = A[ri]
ri += 1
si += 1

while(li < mid):
tmpA[si] = A[li]
li += 1
si += 1

while(ri < hb):
tmpA[si] = A[ri]
ri += 1
si += 1

A[lb:hb] = tmpA[0:hb-lb]

def mergesortH(lb, hb):
print("Dividing: ", A[lb:hb])
if hb - lb <= 1: return
mid = (lb+hb)//2
mergesortH(lb, mid)
mergesortH(mid, hb)
print("Conquering: ", A[lb:hb])
merge(lb, mid, hb)
print("Combining: ", A[lb:hb])
return

mergesortH(0, len(A))
return A
>>
File: kek.gif (3MB, 286x258px) Image search: [Google]
kek.gif
3MB, 286x258px
>>60147159
I never fully considered that before.

I mean really, in the general case, how did they even manage it?
Slower than JVM, that's almost an achievement.
>>
>>60147976
Congrats, now bend over faggot
>>
>>60148025
owo what's this?
>>
File: yucurry.png (34KB, 878x667px) Image search: [Google]
yucurry.png
34KB, 878x667px
>mfw a colleague in quantum gravity says that Python is hard
>>
>>60147936
Only if you use the GNU extension:
a ? : b;


is equivalent to:
a ? a : b;
>>
File: 1436388980604.png (258KB, 549x560px) Image search: [Google]
1436388980604.png
258KB, 549x560px
Generally speaking, is it true that OOP users have very low IQs?
>>
So I've had this idea for a program but I'm not sure where to start. In terms of my background, I did some elementary java in university a few years ago, and learned some basics about C++ and python (I know, pretty normie tier).

So I want this program to take an audio file, and scan through the waveform to see where the music increases/decreases volume and then adjust the system volume accordingly (which would be set in the program) to maintain an optimal listening experience for times where keeping a certain volume is required (for example, it being night time and others being asleep, I would want to keep my music quiet but still audible to me). So for instance, if the music was very quiet, the system volume would turn up (gradually would be the best) and in loud parts it would turn down to some defined amount.

My biggest issue is I don't even know what language would be suitable to attempt this in.
>>
>>60148051
isn't the only language with easier syntax ruby?
>>
>>60148070
check out the open AL library with C++. googled it for you
>>
>>60148070
>C++ and python
>says "I know, pretty normie tier" but still posts it
>tier
Fuck off back to your subreddit.
>>
File: k-bigpic.jpg (160KB, 970x546px) Image search: [Google]
k-bigpic.jpg
160KB, 970x546px
>when you make your own self driving car implementation using javascript
Fuck the police
>>
>>60148070
it would be MUCH less work to just run your audio file through a compressor plugin/vst/whatever.
>>
>>60148134
>not writing it in assembler
normies must leave
>>
>>60147635
the only safe and sane way.
>>
>>60148169
>"""assembler"""
>>>/r/abbit
>>
>>60148169
It's pretty neat though. It uses binocular vision to locate more distance objects, and sonar for short range collision avoidance. Then it does pathfinding through the object field, before converting it to motor output powers using feedback control. The JS communicates with an arduino over serial to send commands to the motor controllers. Also it does pose estimation between image recognition frames using wheel encoder data.
>>
>>60148094

thanks, I'll look into it.

>>60148129

I thought you should know my background before posting the question, calm your autism m8.

>>60148166

I see. Would you agree with >>60148094 , as an alternative route?
>>
>>60148222
Everything in your post reeks of plebbit.
Why do you space your posts in this reddit way? Seriously, piss off. Your kind isn't welcome here.
>>
>>60148222
>Would you agree with >>60148094 , as an alternative route?
only if you want to make it unnecessarily hard for yourself. audio programming is not easy.
>>
>>60148237
>reddit way
you are the cringeworthy one here.
>>
can you call yourself a programmer if you dont know oop?
>>
>>60148271
Reddit-spacing is a well-documented phenomenon. Your kind is not welcome here.
>>
>>60148271
| reddit way

Yeah wtf is the reddit way? XD
>>
>>60148237

>muh secret club rules
>reeeeeeeee """""""reddit spacing"""""""

>>60148261

Alright, thanks. I'll look into both options.
>>
>>60148280
Yes. OOP is bad design in 80% of cases.
>>
>>60148280
Yes, that's actually one of the main conditions for being a programmer.
>>
>>60148285

No you.
I'll downvote your post.
>>
>>60148302
>muh
>reeeeeeeee
>plebbit spacing
The redditors seem to be out in force at the moment. I don't want reddit stink nearby. Fuck off.
>>
@60148356
Go back to rabbit because you don't belong here.
>>
@60148364

projection
>>
>>60148280
If you need classes to stop you from calling irrelevant functions on objects then maybe programming isn't for you.

The one thing mainstream OOP (i.e. Java) got right at least was doing away with headers, I still don't understand why anyone would want to use OOP in C++.
>>
>>60148237
>STOP USING MORE THAN THE MINIMUM NUMBER OF ROWS REQUIRED FOR YOUR POST
>MAKING ME SCROLL MORE THAN I NEED TO REEEEEEEEEEEEE

Get some vitamin D.
>>
@60148406
>reddit spacing
>caps
I didn't even bother to read your post, because I already know it's fucking stupid. Piss off.
>>
I wonder if gatekeeper anon is actually a programmer.
>>
>>60148435
Who is that? Your "friend"? Fuck off back to your retarded discord.
>>
>>60148366
>>60148380
>>60148422
Please just off yourself already.
>>
@60148436
Ah, I see. You're new here. That explains it.
Fuck off back to >>>/int/ or wherever you came from. You and your ilk simply aren't welcome.
>>
@60148436
>plebbit filename
>is an obvious newfag
>uppercase after '>'
So basically you're admitting that you're a redditor then.
>>
>>395CB00

lol, trying a bit to hard to fit in friend
>>
Daily reminder that these are shit:

weak-typing
Weak-typing only leads to constant headaches and exploits.

braceless enclosures
Braceless enclosures look fucking awful and are harder to see layout properly unless you use a decent IDE or 8-width tabbing/spacing.

OOP as a coding method. (note method)
OOP as a foundation for code is fucking atrocious. Doing everything in OOP is ridiculously high-overhead.
OOP has some useful features, but high-inheritance layers just reeks of retardedness. It's on a level as stupid as 20 IF chains when it 90% of the time it can be refactored in to a loop or recursion, or pure math.
OOP is way too easy to abuse. More so than GOTO used to be abused back in the day.
>>
god fucking dammit.
working my way through learn vimscript the hard way. one of the first exercises is to "Figure out how to map the _ key to move the line up instead of down."

ok...so I added
map _ ddP

no luck.
then I tried
map <underscore> ddP

no luck.

what the fuck!? is _ a special character or something? am I retarded? I've been reading through documentation and searching for like 20 minutes now.
>>
OH SHIT

Javafag?
>>
>>0345345431
pretty sure he just converted the post id to hex
>>
@60148569

>She doesn't type using her penis

>>>/r/abbit
>>
=> 60148569
You just confirmed my suspicion that you along with most of this thread are straight from reddit.
Practically every aspect of your post can be used to profile you. If your post indicates that you're a filthy redditor, I'm going to tell you to fuck off.
>>
>>60146297
FAT12 driver for my real mode operating system.
>>
File: takei.jpg (11KB, 441x408px) Image search: [Google]
takei.jpg
11KB, 441x408px
>>60148455
>>
•60148605

I, too, welcome our new reddit overlords.
>>
>>11100101011100101110011011
you are insane.
>>
4chan->getBoard("/g/")->thread("60146297")[60148605]
reddit > 4chan :&)
>>
>>60148655
why would you call yourself invoke?
>>
@60148653
>11100101011100101110011011
That's pretty "Epic" of you... Is this "Binary Code"?
>>
I think we may have reached an all-time low with this one
>>
>>60148655
>
<a href="javascript:quote('60148655')" title="Reply to this post">60148655</a>


I agree
>>
>>60148665
Just a few more posts. Let's kill off this cancerous thread.
>>
>>60148665
watashi wa agrees but it's also plenty fun desu
>>
If the mods delete 30+ posts of plebbit shitposting just after the thread hits the bump limit, will the thread be bumpable again?
>>
>>60148665
and all because of one gatekeeper.
>>
File: jejj.gif (2MB, 265x308px) Image search: [Google]
jejj.gif
2MB, 265x308px
>>60148605
>>
>>60148693
I think it does.
It's been a while since I've seen a chain of shitposts deleted near bump limit.
>>
>>60148659
it's my reddit account
>>
How do I get a gatekeeper badge?
>>
>>60144396
Forth
>>
>>60144396
H*skill
>>
this fucking thread is cancerous
>rust
ahahah SWJ
>java
PAJEET
>OOP
POO IN LOO
>Haskell
HASKLEL
>mention university
enjoy being a wageslave! also CS is a meme
>D
dead language
>spacing in your post
plebbit spacing!
>game development
not REAL programming
>IDE
real programmers use emacs
>linux
garbage, use plan 9
>normal use of greentext
whom are you quoting?
>>
File: 1462926501945.jpg (35KB, 554x439px) Image search: [Google]
1462926501945.jpg
35KB, 554x439px
>>60148808
Welcome to /g/
>>
>>60148808
>emacs
too bloated
real programmers use echo
>>
>>60148808
>HASKLEL
You mean SHITKELL
>>
>>60148808
It's amazing how hard it is to make a post here without some underage feeling the need to reply with the latest and greatest memes
>>
>>60148829
>echo
printf is superior
>>
>>60146297
>no here be dragons
>>
>>60148976
>>60148976
Let's try again
>>
>>60148855
Is it portable?
>>
>>60146360
>rust #2
i thought i was supposed to stay away from him mommy
>>
>>60148998
More portable than echo will ever be, faggot.
>>
>>60146966
>I seem to recall that linear congruential PRNGs use the previous result as the seed, for everything but the first call (which requires a seed to be generated externally). Which means you could implement as a pure function, if you require the caller to store and provide the result of the last call, rather than storing it internally as a local static variable in the callee.

You'd then have a hashing function and you'd be forcing yourself to write impure code to use it as a PRNG, with a global variable and a side-effect outside of it.
Thread posts: 304
Thread images: 43


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