[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: 330
Thread images: 29

File: SICPlogo.png (218KB, 686x580px) Image search: [Google]
SICPlogo.png
218KB, 686x580px
>i just wanted to learn haskell now i'm being cuckolded while i incinerate my own balls and shaft

What are you working on, /g/?

Previous thread: >>61609155
>>
>>61615299
I'm looking for help here man I really don't appreciate you trying to dismiss me as some shitposter. as far as i'm concerned you got me into this mess and i'm begging you to help me out of it. Right now i'm en route to the hospital. I've got a nominal understanding of haskell and a few other strongly typed/useless languages. My wife is being impregnated as we speak by a variety of blacks/indians/gypsies, and all of my children have some non-standard hair color and are undergoing hormonal therapy. What I want to know is what sort of map/reduce/collect algorithms you have offhand
>>
File: 1406803019377.jpg (103KB, 1280x720px) Image search: [Google]
1406803019377.jpg
103KB, 1280x720px
>>61615327
The OP is not your personal shitposting space.
>>
File: 0147-013.jpg (329KB, 861x1250px) Image search: [Google]
0147-013.jpg
329KB, 861x1250px
>>61615372
I want an anime gf so much that it hurts.
>>
>>61615327
>Intel Boot Guard is a technology introduced by Intel in the 4th Intel Core generation (Haswell) to verify the boot process. This is accomplished by flashing the public key of the BIOS signature into the field programmable fuses (FPFs), a one-time programmable memory inside Intel ME, during the manufacturing process; in this way the CPU contains the public key of the BIOS and it can verify its correct signature during the boot. Obviously, once enabled by the manufacturer, Intel Boot Guard can't be disabled anymore.
Why?
Were firmware attacks really all that common?
Couldn't you just re-flash the previous firmware before, anyway?
What is the purpose of this?
>>
Post a worksafe sticker for my laptop and I'll buy it. If I get more than 5 suggestions I'll pick 5 randomly.
>>
File: 1497308911652.png (2MB, 991x1426px) Image search: [Google]
1497308911652.png
2MB, 991x1426px
>>61615395
>>
>>61615398
botnet
>>
>>61615419
there are a lot of stickers with "there is no cloud, it's just somebody elses computer" and "it worked in dev, ops problem now" stickers that I lel at.
>>
File: 1472656952908.jpg (87KB, 1080x720px) Image search: [Google]
1472656952908.jpg
87KB, 1080x720px
>>61615420
I enjoy h3h3, though. :(
>>
File: die-cut-stickers.png (14KB, 325x262px) Image search: [Google]
die-cut-stickers.png
14KB, 325x262px
>>61615434
I was going to buy this one anyway, actually.
>>
>>61615419
>>61615434
>>61615453
Why the fuck are you posting this retarded nonsense here?
see >>61615420
>>
>>61615453
thats on my work pc right now, my CEO really fucking hates it and I love it.

>>61615468
I've posted a bunch of quality shit in /dpt/ today that you can't immediately associate with me because I left it anon, so go fuck yourself I could care less what you think nigger :)
>>
>>61615468
Ha, look at this asshole calling my shit retarded. Have you ever written an interrupt handler? Hm? How about a compiler? Try writing that shit in one of your fucking retarded meme languages. Shitposting is all well and good until it's someone else, right?
>>
>it's 2017 and OCaml still doesn't have a better multicore story than Python
https://www.reddit.com/r/ocaml/comments/61pep4/ocaml_multicore_support/
>>
>>61615501
>>61615510
>I posted on-topic shit at one point, so that allows me to post off-topic reddit-tier garbage
That logic makes no sense. Fuck off.
>>
>>61615398
The real purpose is to void warranties of people who would consider flashing custom firmware. It prevents a custom firmware industry from sprouting. This then allows them to do planned obsolescence by disabling things in firmware. For example, some 2 core low shelf CPU is often the same thing as the top shelf 4 core CPU, the difference is that 2 of the cores are disabled in firmware. Granted, sometimes the disabled cores are disabled because they have "birth defects," but not always.

When you're an asshole corporation, you always have to think 2 steps ahead of users who want to have fun.
>>
End my suffering /dpt/

∇ output ← {levels} dither input
:if 0 = ⎕NC 'levels'
levels ← 4
:endif

c ← 0 .. (⍴input)[3] - 1
x ← 0 .. (⍴input)[2] - 1
y ← 0 .. (⍴input)[1] - 1
mask ← (119 × (236 × y) ∘.+ x ∘.+ 67 × c) ÷ 255

output ← (⌊ mask + input × levels) ÷ levels

>>
>>61615542
What is this alien language? Is it Go?
>>
>>61615566
>Is it Go?
Definitely not, some sort of meme language(read functional)
>>
If MC guy is around: so essentially, Rust+Scheme is practical for gamedev? That's rather pleasing.
>>
File: 1498107207388.png (1MB, 991x1426px) Image search: [Google]
1498107207388.png
1MB, 991x1426px
>>61615420
>>
>>61615566
try assembly
>>
>>61615610
Rust+Scheme?

I'm doing C+Scheme.
>>
>>61615542
>>61615584
It's APL, and it's not functional at all (at best you could say it's tensorial)
>>
>>61615610
>Rust+Scheme
Meme Languages: Worst of The Bad: Ultimate Fight
Game development is more about architecture and design than language of implementation anyways.
>>
>>61615610
Rust's traits and generics is absolutely fucking retarded. If you are using a generic fucking type on function declaration, you gotta specify what trait is the function going to use
Plus T::output retrurn type? This is fucking ludicrous

>>61615624
I'm doing machine codes, bro. Step up your game
>>
>>61615636
>it's not functional at all (at best you could say it's tensorial)

*wets pants*
>>
Define "meme language".
>>
>>61615533
>comes to /dpt/ for high-quality content.
alright i'll actually talk to you. earlier i posted a question asking how i'd accomplish a rolling hmac in CL. do you think I got an answer? no dipshit--it's /dpt/ you think anybody in this thread even knows what hmac or let alone how to implement hmac in a recursive fashion is? I answered my own question later realizing that I can use `map` to recursively roll up an hmac signature across a list of inputs.
>>
>>61615542
I've got to admire your balls for sticking with this.

I tried J once. I still have the nightmares.
>>
>>61615667
Any language I don't like due to my sheer ignorance
>>
>>61615624
I thought you said Chicken integrated well with Rust
>>
>>61615673
There is a fucking difference between low-quality and completely off-topic.
Seriously, just fuck off.
>>
>>61615667
A language with no practical purpose whose (limited) adoption is only due to constant circlejerking in specific communities. See: Haskell in academy, Brainfuck in skiddies, Rust is lgbt
>>
>>61615680
Hmm maybe another anon did.
>>
>>61615690
C is autism, C++ is street shitting. I could go on
>>
>>61615666
Not sure why I laughed at this.
>>
>>61615704
I said no practical purpose.
>>
>>61615689
>rolling hmac, highly applicable in industry use cases is low-qual
>calculating hmac is off-topic in dpt
dude I get this is where you come to feel good about yourself but don't you think that is setting tha bar low
>>
>>61615690
Philistinism.

Latin, Greek, and Sanskrit have no practical purpose whose (limited) adoption is only due to constant circlejerking in specific communities.

It's called 'human knowledge', and it's glorious.
>>
>>61615719
Practical purpose is subjective. You can make the same programs in different languages
>>
>>61615730
As smart as you believe you are, you clearly didn't understand the post you replied to.
>>
>>61615726
There are libraries for that stuff anon

Besides, reimplementing an algorithm is boring. Creating new algorithms is more interesting and worth posting about
>>
>>61615730
The practical purpose of those languages is in preserving the integrity of works written in them, whose nuances (of aesthetics, sound, meaning, etc.) cannot be perfectly replicated by other languages.
>>
>>61615704
t. web artisan
>>
>>61615776
Is that supposed to be your argument?
>>
>>61615740
no shit there are libs you fucking gaylord. there are libs for just about every fucking computational function you can think of. what in the fuck is your point? are you saying that /dpt/ should just reflect pure academicia and new abstract concepts? be my fucking gest m'bruh show us some of the dope hifalutin bullshit you're pumping out? I'm guessing you wrote some awesome compression algo we all just overlooked right? or a revolutionary way or sorting record!?!?!?
>>
>>61615611
<8>chan is just as bad as 4chan kido
>>
>>61615776
t. expert fizzbuzz master
>>
>>61615737
The point is just because a language isn't adopted widely doesn't mean that it's worthless.

Haskell explores all kinds of weird and wonderful shit in categories, Rust in safety. That doesn't mean that those avenues of scientific/computer research should be shut down or ignored.

If you want to earn money, go away and use C++ or Java; if you want to learn something and possibly have some fun, use Lisp or Haskell.
>>
>>61615736
You can make anything in assembly, doesn't mean it's practical. It also shows the guy's butthurt when he proceeds to reply with the 2 languages most certainly used by the OS and browser he uses to shitpost on /dpt/.
>>
>>61615781
What the fuck anon.
>>
>>61615790
Define "practical"
>>
>>61615782
no way, it's way worse
>>
>>61615765
And that's exactly the point: he was disregarding all the interesting knowledge and learning which has been gained from 'lesser known' languages like Haskell, when, in fact, lots of functional/monadic shit has been taken from it for other languages.
>>
>>61615790
Most languages compile to machine code, why does it matter?
>>
>>61615783
lmao, no. I'm just an electrical engineer triggered by numale code artisans unironically shitting on C.
>>
>>61615797
+1, your programming experience extends to saving mspaint files. /copout
>>
>>61615832
C is autistic, there remains no mistakes in that
>>
>>61615815
what implementations are you basing this off of? outside of compiled languages thats basically not true at all.
>>
>>61615815
>>61615844
I will admit things like SBCL as rare exclusions to this rule.
>>
>>61615809
>he was disregarding all the interesting knowledge
I'm sorry I'm the one who has to tell you this but you're actually stupid.
>>
>>61615675
J is objectively better and more advanced, but I think that APL symbol are just “more readable” than J's ASCII glyph line noise
Besides, most APLs implement a big subset of J, though I'd just want the man's original ideas (range/domain/partition/power/derivative/integral operators, categorical stuff etc.) be implemented
>>
>>61615844
>outside of compiled languages thats basically not true at all.
Which is why I said Most.
Note that C, C++, Rust, Haskell can compile to machine code one way or another
>>
>>61615842
the whole field of programming is defined by an aspect of "autism" -- that is over-engineering, elegance, and perfectionism.
>>
>>61615874
C is not perfectionist either
>>
>>61615866
C, C++ and Rust compiling to machine code is one thing, Haskell (as somebody who works mostly with gdb and nasm) offends me greatly in it's assembly form.
>>
>>61615896
Use OCaml my man
>>
First reply decides which language I learn. By "learn", I mean read 2-6 textbooks on the language, depending on how many good quality textbooks are available and whether or not there exist a sufficient number of "advanced" textbooks (i.e. whether reading 6 textbooks would mean reading 6 beginner books on the language).
>>
>>61615906
NIm
>>
building an encrypted protocol similar to HTTP and a browser without JS and CSS, gonna revive web 1.0
>>
DON'T eat a handful of jalapenos /dpt/. Doing so will DEFINITELY NOT synergize with your programming socks.
>>
>>61615906
>6 textbooks
you will never make it, brainlet
>>
>>61615906
>>61615909
There's literally no actual textbook on nim
>>
>>61615923
Nim in Action
>>
>>61615906
4th for Classical Sanskrit.
>>
>>61615901
I actually really want to try and take some time to learn OCaml. One of my colleagues from other the pond showed me some incredible bullshit wherein they were using OCaml to boostrap microkernels that were basically stateless firewalls running in a cluster. a kernel crashes? so what, it's a connection reset. I work a lot in lxc (or in serious cases kvm/qemu) and OCaml seems so damn powerful for orchestration!
>>
>>61615932
Get out, parjeet
>>
>>61615920
Why do you say that?
>>
>>61615901
Imagine using a language that can't do multicore
>>
>>61615935
OCaml is deader than D
>>
>>61615932
And then some actual Rajesh keeps telling you that it's the mother of all languages and that PIE was colonizer envy
>>
>>61615973
>the mother of all languages
Fact: Hebrew is the most powerful language in the world.
>>
>>61615901
>>61615949
>OCaml is an industrial strength programming language supporting functional, imperative and object-oriented styles
alright I am interested. Also, I've heard enough from my friends using it for absolutely insane architecture.

>>61615958
I have so many personal references discounting what you've just said I am sorry. Unless you have some citation I have to assume you are uninformed.
>>
>>61615983
LISP*
>>
>>61615983
Aramaic would like a word
>>
>>61615995
>industrial strength programming language
Imagine retards falling for these marketing buzzwords
>>
File: 1495668969356.jpg (58KB, 692x659px) Image search: [Google]
1495668969356.jpg
58KB, 692x659px
>>61615983
>>61615996
>>
>>61615973
>>61615983
I wonder which language can express the content of the Bible in the fewest strokes or syllables. I would say characters but then Chinese would have what I consider an unfair advantage.
>>
>>61615995
No multicore
>>
>>61615995
>Industrial strength programming language
>No multicore
Why did he mean by this?
>>
>>61616019
>>61615949
>w-whaa no multicore!!
Damn, I must be some kind of black mage to do multiprocessing with OCaml then. Hint: threads aren't the only way to share resources.
>>
>>61616010
I was actually more curious as to how it accomplished functional, imperative, and object-oriented styles all at once. How convenient a world where you can choose you strawman you cognitive weakling hahahaha ^_^
>>
>>61616038
Python supports more paradigms but it's still a brainlet language.
>>
>>61616038
>how it accomplished functional, imperative, and object-oriented styles all at once
The only way any language can: badly.
>>
>>61616038
>as to how it accomplished functional, imperative, and object-oriented styles all at once
OCaml OOP is quite different from what you'll find elsewhere, I mostly see people use functional with imperative programming. As long as you don't use it mainly as an imperative language it's quite pleasant.
>>
>>61616036
Grapes are sour
>>
File: scalacollections.png (56KB, 1013x580px) Image search: [Google]
scalacollections.png
56KB, 1013x580px
Reminder that linked lists are faster than vectors in Scala
>>
>>61616102
https://www.youtube.com/watch?v=4jh94gowim0
>>
>>61616102
>He doesn't implement his own vectors in Scala
It makes me a little sad to think that there are brainlets like this who think they're qualified to comment on my language.
>>
>>61616120
>brainlets like this who think they're qualified to comment on my language
What makes me sad is that people only flame languages instead of showing actual code. It's like /agdg/ but only nodevs.
>>
>>61616120
>uses scala and calls other brainlets
>>
>>61616056
I only somewhat disagree with you. I have too many friends working in fields that I deem too be higher than *programming* in terms of prerequisites for mental faculties (EE, pure statistics, BPNN theoreticians, metaphysics, etc) that all use Python because the libraries allow them to easily convey their thoughts into code.

My problem with python is the underlying implementations that carry out their wishes are not the most efficient possible--sometimes due to the library they've chosen to carry out their wishes, and sometimes due to the way python itself handles their instructions.

Many people that use Python are not brainlets, they simply see it as the quickest means to an end for their more important and applicable problems. but yes, python itself in it's implementation, approach to CLOS, etc, is somewhat stifled and 'brainlet'
>>
>>61616120
pls stop trying to turn Scala into Python
>>
>>61616120
>his language doesn't come with optimized data types out of the box
lol pleb
>>
>>61616102
Have you tried testing it on operations that a vector would actually usually be faster than a linked list at, instead of just wanking over how good the linked list implementation is at all the things linked list implementations are supposed to be good at?

Example: set up a linked list of 100 elements and a vector of 100 elements and benchmark how long it takes to retrieve the 50th element
>>
>>61616061
thank you for an honest answer, I appreciate you.
>>
>>61616102
Go look at the implementation of Vector, then look at the powers of 2 in the tables.
>>
>not allocating everything on the heap
>>
Do you guys remember when people posted code in /agdg/? There was never more code than shitposts, I admit, but now it's like 200 shitposts for every codepost. Why is this?
>>
>>61616145
I just found those results here http://www.lihaoyi.com/post/BenchmarkingScalaCollections.html

Also surely vectors are supposed to be faster at traversal because elements are stored in contiguous memory
>>
>>61616165
>code in /agdg/?
Most of /agdg/ are GM and Unity brainlets who literally cannot code anything of their own.
And when you try to talk about programming they have an autistic, screeching fit.
>>
>>61616102
They're not uniformly faster, and their performance characteristics in Scala aren't any different from any other language.
>>
>>61616132
Have you looked at Scala code? It's one of the most impenetrable languages I've ever read. Scala programmers may be autistic but it's not possible that they're brainlets.
>>
>>61616147
No problem. https://realworldocaml.org/v1/en/html/prologue.html is where I send people who want to have a quick taste of OCaml. There is very interesting research done using the language at Inria, if you pick any team focusing on programming languages you're very likely to find cool examples of OCaml being used for bleeding edge stuff.
>>
>>61616165
Because every code post that which is not C or C++ is one of:
"numale"
"web artisan"
"autist"
"worthless"
"left wing"
etc etc
>>
>>61616181
Shit, I meant /dpt/. I haven't even been in /agdg/ for over a month.
>>
File: 1494167665321.png (146KB, 671x519px) Image search: [Google]
1494167665321.png
146KB, 671x519px
>>61616165
>/agdg/
>>
>>61616189
>complexity == quality
Scala code is so complex because they hate types. Go watch that PSP talk i posted earlier.
>>
>>61616181
>Most of /agdg/ are GM and Unity brainlets who literally cannot code anything of their own.
>And when you try to talk about programming they have an autistic, screeching fit.
As someone who browses both I'm quite the average /agdg/ poster (including nodevs) posts more programming-related stuff than we have in /dpt/, disregarding their programming level. This thread only has ONE [code ] for 115 messages.
>>
>>61616197
Where is the section that tells you how to do parallelism with threads?
>>
>>61616225
In the one that tells you sharing address spaces is retarded in a functional setting.
>>
>>61616210
From what I understand they don't hate types, they hate soundness
>>
>>61616181
>The Long Dark comes on steam for linux
>aesthetically simply, artistic
>barren world, basic but intuitive surivival system
>casually enjoyable, a few days/weeks of play
wait something is wrong
>not running well at all after ~5 min
>rendering takes a dump
>gnome deps?????
>what is unity?
>dev says no intention to resolve!?
paid $20
basically sold my asshole to a turkish gang in the UK for that ammount for as enjoyable as it's been.
>>
>>61616222
That's because this has stopped being a programmer help thread and is now a programmer hangout.
>>
>>61616222
>everyone needs to post code constantly
This is the same plagued mindset /agdg/ has.
As long as youre discussing gamedev or programming, there isnt an issue. And 9/10 times like now, the people meta-bitching arent providing the very thing theyre bitching about.
>>
>>61616222
shit meant quite sure
I mean when I was shilling my compiler on /dpt/ to get feedback people were too busy having language wars instead of posting code.
>>
>>61616236
Cool, but OCaml isn't just a functional language.
>>
>>61616225
kek
>>
>>61616248
>And 9/10 times like now, the people meta-bitching arent providing the very thing theyre bitching about.
You mean memes?
Friend I can provide memes.
>>
>>61616238
>From what I understand they don't hate types
From the way Paul puts it, the community wanted more and more abstractions and implicit types which is part of the reason why Scala is such an insane clusterfuck.
>>
It is objectively the most retarded thing in the world for a language to be both dynamically and explicitly typed.
>>
>>61616236
How do you do multicore processing on massive arrays?
>>
>>61616197
thank you!

>>61616254
could you provide an example of how it fails to fulfill it's claim? or if you are not able to do this, are you able to provide an argument as to how OCaml, through the use-cases provided in this link is a failure for not doing so in a purely functional fashion?
>>
>>61616286
As previously stated by other posters, OCaml is an imperative, object-oriented, and functional language.
>>
>>61616248
>This is the same plagued mindset /agdg/ has.
Beats "everyone must shitpost constantly" by a wide margin, senpai. Having constant gatekeeper, shills, who are you quoting, "X language sucks" (unless providing decent backing, anyone who pretends this is the case) is not programming-related.
>>
>>61616279
Python and PHP are both dynamically and explicitly typed. To answer your question, yes they are trash.
>>
>>61616279
>dynamically typed... but explicit
Does not compute. It's castrating dynamics. What language are you talking about?
>>
>>61616293
sorry i misread this as saying it is not 'functional' in any sense or lacks this capability. I am too used to functional programmers coming at me with knives.
>>
File: 1484774729665.jpg (292KB, 1920x1080px) Image search: [Google]
1484774729665.jpg
292KB, 1920x1080px
I don't know how to write code at all. Could I gain the skillset of a typical pajeet just by trying to learn online, or is this a skill thats much easier learned when taught by someone?
>>
>>61616333
its learned through countless months with a book, TE and lots of googling.
>>
rate my new markup language
>>
>>61616485
json isnt new
>>
>>61616497
yes silly anon, i was asking about my markup language instead *pats head* :)
>>
>>61615667
Any language that doesn't allow for pointer manipulation
These languages are useless on their own
>>
>>61616519

Well then you should post a screenshot of your new markup language, instead of a screenshot of just JSON. If your language is some sort of superset of JSON, show examples where code differs.
>>
>>61616636
pay attention to the tags senpai:
{"heading":"Hello world heading"}

creates a header, it's not a new format, its just something similar to html in json
>>
>>61616667

So you didn't really create a new language, just a specification for using JSON for a different purpose.
>>
>>61616667
its literally the same thing.
if you want something not shit, syntax wise, look at pug or SDL.
>>
>>61616718
>>61616667

People have already done that, there are javascript "JSON to diagram" libraries
>>
>>61615327
Bubble-inducing mutexes:
void diorama_partialcompile(diorama * d, int x, int y, int z, bool need_to_sort) {
control_demand(&(d->renderdata_inuse));
d->minsts_dirty = true;
block_inst * instance = diorama_getblock_inst(d,x,y,z);
block * b = instance->kind;
compile_block(x, y, z, d->raw_minsts + diorama_coords_to_offset(d, x, y, z), b, instance);
control_release(&(d->renderdata_inuse));
}

Beautiful mutex-free non-blocking channel (unless you fill up all 2048 slots):
void send_bu_cmd(diorama * d, int x, int y, int z, bool need_to_sort) {
block_update_cmd * target = bu_chan + (0x7FF & client_cursor);
block_update_cmd package = { {}, d, need_to_sort, false };
block_inst * instance = diorama_getblock_inst(d,x,y,z);
block * b = instance->kind;
compile_block(x, y, z, &(package.m), b, instance);

while(atomic_load(&(target->hasdata)));

memcpy(target, &package, sizeof(block_update_cmd));
atomic_store(&(target->hasdata), true);
client_cursor++;
}

void recieve_bu_cmds() {
block_update_cmd * package = bu_chan + (0x7FF & renderer_cursor);
while(atomic_load(&(package->hasdata))) {
diorama * d = package->d;
model_instance * m = &(package->m);
model_instance * target = d->raw_minsts + diorama_coords_to_offset(d, m->coords[0], m->coords[1], m->coords[2]);
memcpy(target, m, sizeof(model_instance));
d->minsts_dirty = true;
atomic_store(&(package->hasdata), false);

renderer_cursor++;
package = bu_chan + (0x7FF & renderer_cursor);
}
}


Now to remove the mutex guard around the view and projection matrices.
>>
why won't this compile?
i trying to program, but with no luck

#include <studio.h>

int maine()
{
printf("hello world\n");
return 0;
}
>>
>>61616930
spotted the mainer
>>
>>61616930
Maine is outside of your jurisdiction deputy
>>
>>61616930
hello Mr. Frog
>>
how do i use gdb to debug assembly programs? i can run and load the program and not much else
>>
>>61616998
>Using gdb for Assembly Language Debugging

https://www.csee.umbc.edu/~cpatel2/links/310/nasm/gdb_help.shtml
>>
>>61617012
>Stops the execution of the program 5 bytes after the address labeled by _start. Due to a bug in gdb,

> break *_start
>does not stop the program before the execution of the first instruction. A workaround is to add a no operation instruction (mnemonic "nop") to the beginning of your program and use:

> break *_start+1

first paragraph in and there's already shit like this? why is assembly treated like a 2nd class citizen all the time, fuck this shit
>>
I wanna kill myself
ZoneController(std::unique_ptr<ZoneView>(reinterpret_cast<ZoneView*>(gz_view.release())))
>>
>>61617045
Thats what you get for using POO
>>
>>61617042
fuck you too
>>
>>61617045
ZoneController(
std::unique_ptr<ZoneView>(
reinterpret_cast<ZoneView*>(
gz_view.release()
)
)
)
>>
>>61617045
Why are you using such a garbage language?
>>
>>61617093
>>61617045
Oh fuck me I was missing an #include so C++ didn't know that GridZoneView was a subtype of ZoneView
>>
File: teeth.jpg (36KB, 640x480px) Image search: [Google]
teeth.jpg
36KB, 640x480px
>>61615327
Do you write code into a text editor straight away?

I find that I write most functions on paper in my notebook before I commit them to the screen. I want to make sure I have the best algorithm I can, rather than throwing text at a screen and seeing what sticks.
>>
>>61617189
>Do you write code into a text editor straight away?
Yes.
>>
>>61617189
Why would you waste time iterating with an extra step?
I like notebooks for structure and feature planning so i dont muddy things up with comments though.
>>
>>61616930
State names should always be capitalized, anon. Try int Maine() and see what happens.
>>
Do this in your language and let me laugh at you
import std.stdio;

void main(string[] args)
{
auto x = 12;
auto y = 11.01;
writefln("%s", total(x,y));
}

auto total (T, U) (T a, U b)
{
return a + b;
}
>>
>>61616165
The people in that thread are retarded.
I used to lurk to provide advice and honest criticism which was always met with "WELL LETS SEE YOUR GAME THEN"
Other posters are right: just a bunch of unity jockeys making garbage clones nobody will ever play.
>>
>>61617236
total = (+)
main = print (12 `total` 11.01)
>>
>>61617042
>>61616998
figured out my problem, i needed to use -g when assembling. i'm still concerned how hard it is to do anything with regular executables though
>>
>>61617236
>

void main(string[] args)
{
import std.stdio: writefln;
auto x = 12;
auto y = 11.01;
writefln("%s", x + y);
}
>>
>>61617215
Well it's not a 1 to 1 thing.
What I mean is I usually reason about the function on paper first. Because the mental process of writing is very different from typing.

If I know exactly what I want to do, I'll obviously just type it in. But I find it helps to spend time away from the screen thinking about the problem in the abstract.
>>
>>61617289
oops
void main(string[] args)
{
import std.stdio: writeln;
auto x = 12;
auto y = 11.01;
writeln(x + y);
}
>>
File: Untitled.png (14KB, 800x600px) Image search: [Google]
Untitled.png
14KB, 800x600px
>>61615327
Working on my win32 opengl window / context library.

Trying to track down a memory leak that leaks 4kB per second. Fuck this winapi shit.
>>
>>61617328
>win32 opengl window / context library
What do you want it to do that sets it apart from the 900,000,000 others? Or just learning.
>track down a memory leak that leaks 4kB per second
fuck anon. Try valgrind
>>
>>61617363
>What do you want it to do that sets it apart from the 900,000,000 others? Or just learning.
Learning. I also hate using libraries that do not hold the same conventions as I do.
>Try valgrind
No valgrind for windows tho. I'm looking for alternatives.
>>
File: nope.gif (545KB, 500x211px) Image search: [Google]
nope.gif
545KB, 500x211px
>trying to get cmake to work with vulkan on windows
>>
>>61617189
It's easier to write in the editor. Sometimes you forget a temporal variable or you forget to run a different function or you forget to perform another check. If you're writing, you can't just move blocks of text up or down and fit more stuff. You end up with paragraphs of separated spaghetti. Fuck writing assembly on paper.
>>
>>61617236
>>61617289
>>61617299
I've yet to see a necrophiliac post anything beyond a ridiculously trivial program.
>>
>>61617748
As soon as i get done with my side project im returning to my vulkan library.
>>
Which is the least brainlet field of CS?
>>
>>61617840
Theory
>>
>>61617840
Cryptography.
>>
>>61615327
>decide to dip into python
>no brackets
>no semi colons

Wtf, it's like it's forcing me to forget all previous programming habits. Who the fuck thought this was a good idea to go against what is basically universal syntax?
>>
#include <stdio.h>

int main()
{
int year;

printf("Enter a year: ");
scanf("%d",&year);

if(year%4 == 0)
{
if( year%100 == 0)
{
// year is divisible by 400, hence the year is a leap year
if ( year%400 == 0)
printf("%d is a leap year.", year);
else
printf("%d is not a leap year.", year);
}
else
printf("%d is a leap year.", year );
}
else
printf("%d is not a leap year.", year);

return 0;
}
>>
>>61618073

>basically universal syntax
Outside of languages inspired by C, it's not really universal. It's a lot less common in scripting languages and in a lot of functional languages.
>>
>>61618200
>
   if(year%4 == 0)
{
if( year%100 == 0)

but why
>>
>>61618235
https://support.microsoft.com/en-us/help/214019/method-to-determine-whether-a-year-is-a-leap-year
>>
>>61618200
import std.stdio;

void main()
{
writeln("Welcome to Leap Year checker. ",
"Enter the year you want to check. ",
"Invalid number will quit the program.");

import std.conv, std.math, std.string;

while (true)
{

string x = readln.strip;
if ((x.isNumeric) && (NaN(x.to!uint)))
{
writeln(isLeapYear(x.to!uint));
}
else
{
writeln("Quitting");
break;
}
}
}

bool isLeapYear(uint n)
{
return (n % 4 == 0) && ((n % 100 == 0) && (n % 400 == 0));

}
>>
>>61618393
oh wait
>>
>>61618393
readln needs no be while !null
http://dlang.org/library/std/datetime/date/year_is_leap_year.html
and use ternaries if you want to be terse
>>
>>61618418
isNumeric catches that
>>
Finally i'm getting good results training a neural network to classify any product on a predefined set of categories by his name. It'll learn to associate stuff like brand names, words, references with categories i guess

i don't know how to avoid overfitting though

if you guys want to see enter here, although its boring af, i wish i could use my gpu to train nn faster but ati driver support sucks.

https://seashells.io/v/afcYZvzh
>>
CHALLENGE for /dpt/: Write a hello world program in C without using any semicolons.

Rules:
1) Can only include stdio.h
2) Can't use preprocessor directives other than "#include"
>>
>>61618522
i forgot to mention it, i scrapped a bunch of data with scrapy (like 44000 product names), it's pretty easy to use
>>
>>61618524
you could do it with inline assembly. i'm going to sleep though and don't know how i'd do it anyways. nite /dpt/
>>
Trying to finish K&R with ANSI-C but get stumbled as the Input-output examples doesn't work.
>>
>>61618522
>i don't know how to avoid overfitting though
you're not using the same data to score on as you're training on right? if you are that's completely useless. your network could just be creating a look up table
>>
>>61618559
Are you using the -ansi flag in GCC?
>>
>>61618524
First result on Google
#include <stdio.h>
int main(int argc, char *argv[printf("Hello, world!\n")]) {}

step up your game senpai
>>
>>61618583
I'm not sure why I called '-ansi' a flag. Is it a flag? Maybe it's called an option...
>>
>tfw elixir has a built in in-memory database like Redis and has built in logic to handle high amount of requests
I'm really starting to dig this language
>>
>>61618597
Generally they're called flags yes.
>>
>>61617328
>Fuck this winapi shit.
>WinAPI is responsible my application's memory leak.
>All Windows applications use WinAPI as backend, few have known leaks. WinAPI is responsible for my leak.
>>
>>61618524
Modify stdio.h then:
#include <stdio.h>
>>
>>61618524
First result on duckduckgo
#include <stdio.h>
void main() { if(printf("Hello, world!\n")) {} }

Step up thy game sempai.

>>61618657
Really? What part of WinAPI is leaky?
>>
where the fuck is OSGTP
>>
>>61618686
HeapAlloc
>>
>>61618627
shame the syntax looks like shit
>>
>>61618699
?

Isn't heapalloc just malloc for windows? Wouldn't the leak be in whatever the equivalent of free is?
>>
>>61615537
desu I just wanted to fix my shitty BIOS
>>
How do I make a nvm memelang and make money on the hype?
>>
>>61618966
*jvm
>>
>>61617748
Same goes for you, doesn't it?
>>
Is there a way to disable compile time evaluation of constants in g++? I'm trying to see what assembly it emits.
>>
File: 1488697930518.jpg (16KB, 460x241px) Image search: [Google]
1488697930518.jpg
16KB, 460x241px
>>61615327
How necessary is mocking when writing unit tests?
Cmocka is complicated as shit and I'd rather use CUnit but CUnit doesn't support mocking and I don't know enough about mocking to know if that should be an issue for me.
>>
File: 1485638062918.jpg (81KB, 720x720px) Image search: [Google]
1485638062918.jpg
81KB, 720x720px
I tried learning C++ through books. As it turns out, its boring and slow as fuck.

Why is there no fast way of learning this shit that you can actually trust as being correct?
>>
>>61619594
C++ is awful
>>
>>61619594
C++ is a big, complicated, bloated and inelegant language.

Just try making something if you find your books aren't moving fast enough.
>>
Not that anon, but I have to learn c++ for a class this semester. Any book recommendations?
>>
>>61619667
How much programming experience do you have?
What class is it?
>>
>>61619673
Not much, just matlab. I've been doing some coding exercises for c++ but haven't really gotten anywhere. It's a class on engineering software design.
>>
>>61619695
Sounds like it'll be OOP principles bollocks then..
>>
File: 1500986553061.jpg (124KB, 1440x810px) Image search: [Google]
1500986553061.jpg
124KB, 1440x810px
>>61619594
Write something (think big) using google as your guide. And then post it on code review SE.
Many C++ books are over 500 pages long and some do not even cover C++11, so not practical at all to use for learning. The one book that is short enough to be of use is A Tour of C++, and it does cover C++11 though obviously not super in-depth but good enough.
My advice: write stupid broken code, shove it in other people's faces, let them tear you apart (indeed, for a programmer it is a dream to have the opportunity to do so, nobody will decline the offer to show superiority over a novice), and make appropriate adjustments. Repeat until you feel totally satisfied and confident with the quality of your code.
I do most of my stuff in C so I can't critique C++ beyond intermediate level but that's my twopence.
>>
What do you think this program does?
#include <stdio.h>
#include "hello.h"

int main(void) {
printf("Hello world!\n");
return 0;
}
>>
>>61619745
>#include "hello.h"
who knows?
>>
>>61619726
Are you trying to say that is the name of the book? Many are named along the lines of OOP principles. Thanks for the help though.
>>
How do I store data I received into a txt file with Javascript
Example: streaming Twitter's API then writing them into a text file, line after line

https://github.com/jonschlinkert/write
this one straight up overwrites the .txt file with the latest data instead of recording it in the next line
>>
>>61619745
> int main(void)
reeeeee
>>
is there a bitwise operation to check equal bits?

a b  result
0 0 1
1 0 0
0 1 0
1 1 1

1101001
0110011
-------
0100101
>>
>>61620247
xnor
>>
>>61620255
thanks
>>
Can I wake up a specific thread waiting for a condition variable given its ID or something?
>>
>>61620087
void main (void) {}
>>
File: Scala_logo.png (3KB, 192x72px) Image search: [Google]
Scala_logo.png
3KB, 192x72px
What's a good resource for learning Scala?
>>
>>61620888
It's best not to.
Learn Haskell instead, it's the same sort of area.
>>
>>61620921
I'm applying for a Scala job, not a Haskell job.
>>
>>61620951
I'm sorry for your loss
>>
>>61620958
I kinda like the Java ecosystem. It has plenty of library support and isn't run by pink haired trannies like Rust.
>>
How do I make webdev and don't want to kill myself
>>
long time;

heheeheheheh
>>
>>61621045
kinda hard to do there. I recommend just not.
>>
File: korpietu_2001_tl.jpg (40KB, 820x500px) Image search: [Google]
korpietu_2001_tl.jpg
40KB, 820x500px
I want to learn Java. Where do I start?
>>
>>61616333
Posting more lewd anime girls greatly improves your programming ability.
Trust me.
>>
>>61620971
Then find a java job, its marginally better than scala
>>
>>61617236
#include <iostream>

template <typename T, typename U>
auto total(T a, U b) {
return a + b;
}

int main() {
auto x = 12;
auto y = 11.01;
std::cout << total(x, y) << '\n';
}
>>
File: .jpg (44KB, 529x502px) Image search: [Google]
.jpg
44KB, 529x502px
>write things in python
>never use classes
Is there anything actually wrong with this?
>>
>>61621179
Degenerate.
>>
>>61621138
The position I'm applying for uses Scala, but other departments use Java and Go. I already know Java and Go, so I figured: why not learn Scala?
>>
>>61621174
It's sad how one of C++'s most powerful features (templates) is still bogged down with heavy syntax and confusing limitations.
>>
>>61621098
by jumping off a cliff
>>
>>61621179
you dont really have a choice. the (((OOP))) in python sucks ass
>>
>>61621208
Not really, the syntax isn't that bad.
If you don't need access to the template parameters, this is valid C++ and does the same thing:
#include <iostream>

auto total(auto a, auto b) {
return a + b;
}

int main() {
auto x = 12;
auto y = 11.01;
std::cout << total(x, y) << '\n';
}
>>
File: kiiraurheilukuva2ek1804_tl.jpg (260KB, 1024x624px) Image search: [Google]
kiiraurheilukuva2ek1804_tl.jpg
260KB, 1024x624px
>>61621217
I did it, but didn't learn anything.

What next?
>>
>>61621078
size_t
>>
>>61621230
I didn't realize you can deduce argument types outside of templates.
>>
>>61621098
Learn some C, then learn some C++ and you're good. May also read some intro stuff about try-with-resource and other sugar.
>>
>>61621252
The course I'm heading on is Java. Don't ask me why. C and C++ is definitely on my do-list. However, seems like I have to tackle Java first.
>>
>>61621274
Knowing both Java and C is good before you learn C++.
>>
>>61621230
Is there any real case where you need auto keyword?
It's been 6 years since c++0x release and I have yet to use it even once.
>>
>>61621291
Whenever you're in template hell.
>>
>>61621274
People who study Java before they learn some C always come to /g/ with stupid questions like >why do I get NullPointerException if there's no pointers in Java
Please don't do that.
>>61621283
Not sure why do you even want to learn Java if your goal is C++.
>>
>>61621297
Why not use proper generalization instead?
>>
>>61621291
You don't need to use it, it just makes your code easier to read when you have long type names, like instead of writing shit like
std::vector<std::unique_ptr<MyClass>> stuff = get_stuff();

You can write
auto stuff = get_stuff();


The only time when you actually need to use auto is when binding a lambda to a variable.
auto lambda = [](){ /* ... */ };
>>
>>61621347
>makes your code easier to read
>undefined type is easier to read
Are you being serious?
btw
>what is typedef?
>>
File: 1487667689141.jpg (32KB, 350x602px) Image search: [Google]
1487667689141.jpg
32KB, 350x602px
>>61621331
I promise, I won't ask that. Just show me in the right direction, where to get the material.

>ps. cliff didn't work
>>
>>61620921
>Learn Haskell instead,
If you want to work at McDonalds.
>>
>>61621389
It does if a 300-character-long typename eventually becomes just int (and you know it). Besides, correct naming of variables SHOULD assure that anyone should be able to guess at least the kind of type.
Typedefing every auto, even in mildly complicated code, would result in a mess of typedefs used only once or twice.
>>
>>61616181
I don't know if they're programmers or not, but it seems some of them have achieved more than most of you ever will. For example.

>>>/v/385469016

So you can keep arguing about which meme language nobody uses is better, thinking that's "talking about programming" and doing hello world toy projects in them, but don't call "brainlets" to people that are actually *doing* something.
>>
>>61621389
It's mostly for cases when the type is obvious, like:

#include <vector>
#include <memory>
#include <cstdio>

struct S1 {
S1(const char* name) { printf("S1 %s\n", name); }
double a, b;
};

template<class T>
using unique_vec = std::vector<std::unique_ptr<T>>;

int main()
{
auto m = std::make_unique<unique_vec<S1>>();
// is a std::unique_ptr<unique_vec<S1>>
m->emplace_back(std::make_unique<S1>("foo"));
m->emplace_back(std::make_unique<S1>("bar"));
return 0;
}
>>
do I have to install a server on my machine to make a good JS game
>>
>>61621078
xd
>>
>>61621518
You didn't really convince me. Autos are much less readable then proper types and it's a fact.
Well I'm not really against the keyword, but people throw it all over their code as soon as they discover it's existence and it's super irritating. If you love auto you need to switch to python or something and stop spreading the cancer in statically typed languages. It's like everyone decided goto is fancier than loops and procedures.
>>
>>61621645
VeryLongTypeName<WithTemplateParamaters *obj = new VeryLongTypeName<WithTemplateParameters>;[/code
so readable
>>
>>61621645
>>61621659
Talking about relative degree of readability in C++ is moot. It's C++.
>>
>>61621645
Some of the constexpr stuff is easier with auto. In particular, doing constexpr lambdas seems much easier than using std::function or whatever:
#include <functional>

constexpr auto get_lambda_auto(int val)
{
return [=](int a, int b){ return val*(a+b); };
}

std::function<int(int,int)> get_lambda_func(int val) // how to constexpr ?
{
return [=](int a, int b){ return val*(a+b); };
}

int main()
{
constexpr auto auto_lambda = get_lambda_auto(3);
static_assert(auto_lambda(1,2) == 9);
return 0;
}
>>
>>61621291
ayy fuck you, m8. I use auto very frequently. I don't use generic types as often.
>>
>>61621659
might be more readable if you could format your post correctly
>>
File: output2.webm (3MB, 1280x720px) Image search: [Google]
output2.webm
3MB, 1280x720px
>>61615327
I've just made script for handy capturing screen.
>>
File: 1501271129884.png (107KB, 500x373px) Image search: [Google]
1501271129884.png
107KB, 500x373px
Python noob here. I'm trying to use selenium, but every time I start the script, it launches firefox. Here is the code:

    driver = webdriver.Firefox()
driver.get(url)
return BeautifulSoup(driver.page_source, parser)


I thought selenium was a headless browser. How do I supress firefox launching?

(I'm using firefox 54.0, with selenium 3.4.3, with geckodriver 0.18.0 on Ubuntu 16.04)
>>
Is there any good statically typed and memory managed language that has good interpreter and native compiler?
The language needs to have really easy C interface.
>>
>>61621968
for hwat purpose
>>
>>61621985
the general one
>>
>>61621968
What do you interpreter for?

Rust is good statically typed, memory managed language with native compiler and has relatively easy C interface.
>>
>>61621993
doesn't work like that
state your purpose
concrete and detailed
>>
>>61622016
Rust is not good language and interpreter is needed for live coding.
>>61622031
dumb faggot.
>>
>>61622035
>I need a tool but I don't know why
nice one my dude
>>
>>61622042
>programming languages exists only for really specific purposes
I guess I will just program everything in C because it's pretty fucking general purpose.
>>
>>61622063
Good luck with complex GUIs.
>>
>>61622084
Real programmers don't bother with gooeys.
>>
>>61622104
This, 99% of programs can be made far more simple to use with just a CLI (easy automation by scripts, don't have to learn your way around the UI, etc). Of course, other people are free to create a GUI for my programs if that's what they prefer, but I won't provide one.
>>
>>61621645
std::string::size_type s = str.size();


Omg, I hate auto.
>>
>>61621968
You're looking for OCaml anon.
>>
>>61622135
Shame clients won't pay me for CLI applications.
>>
>>61621968
C#. Rly, the language itself is good. It's MS toy though so it's pretty much dead outside windows and MS tends to kill of it's frameworks like forms or silverlight or whatever for no real reason.
>>
>>61622104
>>61622135
Are you guys living in some imaginary world or something
>what is photoshop
>what is autocad
>what are design, architecture, art, finances, healthcare, science, agriculture, power plants, games, web, <insert industry name> etc, etc.

99% of real software absolutely need guis
>inb4 people are dum, if only they were smart
People are not dumb, people are busy with tons of other industry specific shit.

It's our duty to make their jobs easier.
>>
>>61621645
So OCaml is wrong? Because auto is the default in OCaml.
>>
>>61622244
gp (good post)
>>
>>61622234
Imagine a language that can't do multicore
>>
>>61621968
D
>>
>>61622244
the software you listed probably makes up about 1% of all software
also
>games
>real software
>>
>>61622234
>no native thread support
>no unsigned type
>the C interface requires you to write shitton of stuff
Otherwise I would be using ocaml, the build tools and the ecosystem is nice.
>>
>>61622259
1) I'm sure you don't really need multicore
2) If you really need multicore you can use multi processed (look at what Jane Street does)
3) OCaml will be multicore
>>
>>61622292
>I'm sure you don't really need multicore
Imagine grapes being so sour
>>
>>61622292
If he doesn't need multicore why will OCaml be multicore?
>>
>>61622244
I would agree. I would also say modern gui's are shit. I don't know what the alternative is.
>>
>>61621869
Is that Gnome-Pie? I'm going to have to try that out.
>>
>>61622244
All you did was list specialist software. That doesn't seem to go against what I said at all, I doubt all the different types of software you listed amount to more than 1-2% of software, maybe more like 5% if you really have to include games. Either way the overwhelming majority of programs absolutely do not require a GUI. You don't include a GUI by default, you include one if your program needs one.
>>
>>61622244
>99% of real software absolutely need guis
No they don't.
Most software that is actually useful are command line tools.
>>
>>61622292
>3) OCaml will be multicore
Just you wait. One day <language> will be <feature>!
>>
>>61622444
Haskell will never be OOP
>>
>>61622450
>implying Haskell CURRY is POO
>>
>>61622450
You will never be employed.
>>
>>61622470
What?
>>
>>61622450
>Haskell
>autistic mental gymnastics over IO
>>
>>61622506
It's not mental gymnastics.
>>
>>61622533
If you're autistic, that is.
>>
>>61622547
If you don't have autism, why are you using an anime imageboard?
>>
>>61622604
Haskell is top tier autism. Anime is common joe autism.
>>
File: 1500443008665.gif (285KB, 361x393px) Image search: [Google]
1500443008665.gif
285KB, 361x393px
>>61622636
it's all autism to me, buddy
>>
>>61622648
would desu/10
>>
>>61622679
desu ne!
>>
>>61615327
What would be the best way in Python to sort a list of (number, word) tuples
so that they're ordered by number and if a number repeats they're also ordered alphabetically?
>>
>>61615327
What would be the best way in Python to sort a list of tuples so that they're ordered by the first element
and in case an element is repeated they're also ordered by the second one?
>>
File: consider.jpg (29KB, 600x600px) Image search: [Google]
consider.jpg
29KB, 600x600px
new thread
>>61623104
>>
>>61623044
https://docs.python.org/2/howto/sorting.html#key-functions
Depending on how you will insert you either want to sort the array twice once using the alphabetical key and then using the number.
Or you create a comparison function which suits your sort (see key functions).
I'd default to doing the latter.
>>
>>61623156
Nice, thanks man
Thread posts: 330
Thread images: 29


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