[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: 312
Thread images: 41

File: female_on_the_computer.png (479KB, 930x619px) Image search: [Google]
female_on_the_computer.png
479KB, 930x619px
What are you working on, /g/?

Previously >>60853430
>>
Second for (t)Rust.
>>
>>60859884
Threadly reminder not to use Rust.
https://doc.rust-lang.org/1.2.0/book/dining-philosophers.html
fn main() {
let p1 = Philosopher::new("Judith Butler");
let p2 = Philosopher::new("Gilles Deleuze");
let p3 = Philosopher::new("Karl Marx");
let p4 = Philosopher::new("Emma Goldman");
let p5 = Philosopher::new("Michel Foucault");
}
>>
Fourth for if your can't trivially implement a kernel in your programming language of choice, your language is complete and utter TRASH.
>>
File: 1494922328131.png (194KB, 562x389px) Image search: [Google]
1494922328131.png
194KB, 562x389px
>>60859900
>"""Philosopher"""
What did they mean by this?
>>
I am sad and lonely /dpt/

What should I write to feel better
>>
>>60859942
2dAIgf
>>
>>60859942
A kernel.
>>
>>60859928
It's Antifa propaganda disguised as the dining philosophers problem.
>>
File: Sophie_Wilson.jpg (291KB, 640x426px) Image search: [Google]
Sophie_Wilson.jpg
291KB, 640x426px
>>60859900
>sample strings in the outdated manual
>the best argument rust-haters could come up with
Feels good.
>>
>>60859942
Lisp interpreter.
>>
>>60859900
all these are commies and anarchists
fucking Mozilla
>>
File: qt_logo_green_rgb_whitespace.png (44KB, 2362x2362px) Image search: [Google]
qt_logo_green_rgb_whitespace.png
44KB, 2362x2362px
I'm at that stage in my relationship with Qt Creator where I love it very much, but already know I'll soon start seeing the ugly part of it.

It's designer is so good for quick understanding of UI elements, I literally cum buckets while changing all the options on them.
>>
I created
thisisfun.xyz
An ad free e-hentai archive with usability, free downloads, and almost 18,000 mangas and doujinshi already queued.

Im working on a way to earn more gp on e-hentai so that the archiver can function. Does anyone know an automated way of doing so?
>>
>>60859971
Diversity tickets.
>>
>>60859971
Is this "thing" human?
>>
File: yeah_i_know_its_from_twitter.jpg (633KB, 1432x1209px) Image search: [Google]
yeah_i_know_its_from_twitter.jpg
633KB, 1432x1209px
>>60859968
>>60859975
>>
>>60860001
Yes, and she designed the CPU in your smartphone.
>>
>>60860002
>twitter
I don't want reddit stink nearby. Fuck off.
>>
>>60860016
>"""she"""
http://esr.ibiblio.org/?p=7524
Just because your dress like a girl doesn't mean you're a girl. It only means that you're mentally diseased.
>>
>>60860016
I don't use "smartphones". And it doesn't look like a "she" to me.
>>
File: literallywho.png (19KB, 784x349px) Image search: [Google]
literallywho.png
19KB, 784x349px
>>60860002
>>
Why must ATS be so ugly?

fun{}
qlist_make_nil{a:vt0p}():<!wrt> qlist(a, 0)
//
fun{}
qlist_free_nil{a:vt0p}(qlist(a, 0)):<!wrt> void
//
(* ****** ****** *)
//
fun
{a:vt0p}
qlist_length
{n:int}(q0: !qlist(INV(a), n)):<> int(n)
//
>>
@60860002
>leftist trash
>twitter
Opinion discarded.
>>
>>60859983
Could you host "http://ajax.cloudflare.com/cdn-cgi/nexp/dok3v=85b614c0f6/cloudflare.min.js" yourself? CDN-based tracking sucks
>>
>>60860110
You may visit the ip directly if youd like 198.98.50.185

I use cloudflare to cache the images and reduce bandwidth usage. The site has unlimited but if my site grows popularity there will be alot of usage. Do you recommend I get off cloudflare?
>>
>>60859983
I don't like the current UI.
A killer feature for me would be to search by multiple tags. I really miss that on tsumino.
>>
>>60859857
a big ole stim shit :^)
>>
File: 14593473170160.jpg (55KB, 296x475px) Image search: [Google]
14593473170160.jpg
55KB, 296x475px
>>60859900
Deleted the compiler, I'll wait for an alternative one. Fuck this language.
>>
>>60859908
ohh that reminds me I have my OS book in the car I'll go get it when I'm off the toilet
>>
>>60860062
you forgot t@ype
>>60860161
xDdD write ur Own combiler
>>
Nice to see most of /dpt/ is still insecure about people who are vastly superior programmers to them
>>
File: 1496545778042.jpg (75KB, 815x722px) Image search: [Google]
1496545778042.jpg
75KB, 815x722px
my best friend took up programming and he started crossdressing and it suits him really well I'm literally attracted to him when he's dressed up

h-help
>>
Right now I'm working on a project with some NLP. I have a set of pdf documents and visualize some computed metrics.

How can I convert pdf docs to text? I know it's non trivial, I've used different python libraries but there's always some charcters that are not converted well (trying to convert to utf-8).
>>
File: 20170611_171514-1.jpg (891KB, 1410x3545px) Image search: [Google]
20170611_171514-1.jpg
891KB, 1410x3545px
ARE YOU KIDDING ME
I got the fucking curry edition
>>60860164
>>
>>60860274
fuck him in the boipucci
>>
>>60860247
>people
What "people"?
>>
>>60860305
ok pajeet
>>
>>60859908
What is an ``kernel" though?
>>
>>60860353
Simone Peyton-Jones
Edwina Brady
Joan Carmack
Lauren Page
Geraldine Sussman
>>
File: dlang_chan.jpg (70KB, 349x368px) Image search: [Google]
dlang_chan.jpg
70KB, 349x368px
Threadly reminder that dlang-chan has RAII; she's quite fast in execution and compilation; she's becoming fully memory-safe; and she's super duper cute! Say something nice about her, /dpt/!

>Tour
http://tour.dlang.org/
>Books
https://wiki.dlang.org/Books
>GC
https://dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
https://wiki.dlang.org/Libraries_and_Frameworks#Alternative_standard_libraries_.2F_runtimes

>>60859857
>3DPD
>>
File: OpenGL Chart.png (125KB, 1678x1764px) Image search: [Google]
OpenGL Chart.png
125KB, 1678x1764px
Playing around with this a little more today.
Also got media-libs/mesa upgraded to 17.0.6 which supports 4.5
>>
>>60860441
Your shit taste in anime girls really isn't helping with making D more popular around here.
D is shit, and a train wreck. It has no redeeming features whatsoever.
It isn't even fast, and can't even write a kernel in it. LMAO.
>>
>>60860462
Okay.
https://github.com/Vild/PowerNex
>>
>people are still shilling D
let the dead sleep
>>
>>60860521
>people are still shilling Rust
let the dead sleep
>>
File: 1460565612998.png (253KB, 367x422px) Image search: [Google]
1460565612998.png
253KB, 367x422px
>>60860435
>>
>>60860542
>Rust
>dead

If Rust is dead, then D is fully decomposed.
>>
>>60860542
abortion is wrong
>>
anyone have a good tutorial site/book for learning OpenGL with GLFW
>>
>>60860545
I don't understand what you meant by that post
>>
File: 1488764247327.jpg (507KB, 852x848px) Image search: [Google]
1488764247327.jpg
507KB, 852x848px
>>60860635
What do you think I meant by that post? And what did you mean by your post?
>>
>>60860584
Have you tried googling one and getting it off library genesis?
>>
>>60860521
>>60860542
Amazing. Why do you to have to fight? Both D and Rust are okay.

In fact if I wasn't as comfy with D, I'd probably be using Rust these days.
>>
Haskell!
>>
File: 1495122955491.png (24KB, 722x452px) Image search: [Google]
1495122955491.png
24KB, 722x452px
>>60860481
So THIS is the power of D..
>>
File: 1490484353990.gif (456KB, 480x360px) Image search: [Google]
1490484353990.gif
456KB, 480x360px
>>60860791
good post
>>
Rustfags, how much restrictive do you feel when you do functional programming in Rust. Do you have to manage memory by yourselves? And what features do you miss most from a functional programming language such as scala
>>
>>60860825
Link to original video?
>>
File: 1478163441256.gif (344KB, 480x360px) Image search: [Google]
1478163441256.gif
344KB, 480x360px
>>60860791
Please do not mention "Haskell" ITT. Spamming is not encouraged
>>
>>60860744
>Why do you to have to fight?
Because fags love to group themselves in imaginary camps and bicker over stupid shit. It's one thing to shit on a language and its developers for actual reasons, but that rarely happens, and instead we get shitposting. And what's worse is that it's always the same stale "jokes" over and over again--nothing original. Though this is a reoccurring theme across 4chan in general.
>>
>>60860841
Have you tried reverse-image searching? Because I found it.
>>
File: 1480682268954.png (11KB, 648x61px) Image search: [Google]
1480682268954.png
11KB, 648x61px
>>60860861
But it's wrong though.
>>
File: 1494534430051.png (664KB, 1300x1500px) Image search: [Google]
1494534430051.png
664KB, 1300x1500px
>addr2line
Well this is going to make kernel debugging somewhat easier.
>>
>>60860897
No shit, anon. Look a bit deeper in the results google vomits out. Here's a hint: filenames
>>
File: OpenGL Chart.png (171KB, 1853x1850px) Image search: [Google]
OpenGL Chart.png
171KB, 1853x1850px
>>60860584
You're learning OpenGL too, what a coincidence. What king of stuff are you interested in using it for?
>>
>>60860845
I want to fuck that monkey.

>>60860943
Not him, but what are you planning to do with OpenGL after you sufficiently learn enough it?
>>
>>60860147
It does have that feature, just enter two words, ex. Femdom English
>>
>going through elm tutorial
>making a dice roll
>leaves adding an additional die as an exercise
>"Shouldn't be so bad"
>Have been working for hours to no avail

Sucks being a brainlet ;_;
>>
>>60860969
That doesn't mean you're a brainlet, though you still probably are.
>>
File: OpenGL Chart.png (8KB, 460x950px) Image search: [Google]
OpenGL Chart.png
8KB, 460x950px
>>60860964
I'm not motivated by game programming like most people who learn OpenGL. But I am interested in playing around with different kinds of real time interactive visualization of data, can't you tell from my screencap?
>>
how do i transfer multiple, random values of one list to another in python? i know how to use pop with this kind of thing, but it only works for one element like this:

list = ["1", "2", "3", "4", "5"]
x = list.pop(random.randint(0,len(list)))
>>
>>60861046
Hey, that's pretty cool, anon!

>can't you tell from my screencap?
I thought it was a work problem from the textbook you're using.
>>
File: graph.png (21KB, 756x1034px) Image search: [Google]
graph.png
21KB, 756x1034px
>>60861046
>>
>>60860481
wow I forgot all about livecoding
>>
>>60861081
Oh you where in the earlier thread too?

>>60861103
Haha did I just contribute to the making of a meme?
>>
Give me a data processing problem
>>
>>60861156
Number of dicks your mum takes an hour.
>>
>>60861060
Use numpy and everything will be fine

L = np.array(["1", "2", "3", "4", "5"])
x = L[np.random.choice(5, 3, replace=False)]
>>
>>60861156
shitposts/hour
>>
Im making a simple launcher for WoW private servers using c# forms and Im having trouble figuring out how I can dynamically display if a server is online or not.

I have no problem figuring out how to ping if i know the direct IP address, but its behind a DNS - the DNS of its login server.

what do /g/?
>>
File: silicon-valley.gif (811KB, 500x281px) Image search: [Google]
silicon-valley.gif
811KB, 500x281px
>>60861166
>>
what drives people like Terry?

i just realized he unironically wrote a bloody os, jesus
>>
>>60861194
It's not that hard. Not with that much time.
But you're certainly very good when you can do it despite his problems.
>>
File: 1490556930178.jpg (66KB, 546x618px) Image search: [Google]
1490556930178.jpg
66KB, 546x618px
>>60861194
>unironically
>>
>>60861194

> leave a carpenter alone with a bunch of wood
> come back in 20 years
> he built a house
> you are suprised
>>
>>60861194
Terry is a cancerous newfag meme of 2015. During election /pol/ got a lot traction and some of them moved to /g/

They only like terry because he calls people nigger
>>
>>60861235
>meme
>>>/v/
>pol
>>>/pol/
>>
>>60861235
Ok faggot.
I initially got interested in him when he used to post videos talking about his operating system and how it worked. But it all went to shit when he started livestreaming, he didn't talk about his OS anymore. It was just him and his daily life, quite boring.
>>
>>60861250
>
>>>/trash/
>>
File: 1472341273282.jpg (196KB, 939x1115px) Image search: [Google]
1472341273282.jpg
196KB, 939x1115px
How would you go about helping someone with structured text when your only experience with it was extrusion??
>>
kek I had a weird dream last night.
>>
>>60861540
cool blog

i'm joking
>>
>>60861230
>leave a carpenter alone with a bunch of wood
>come back in 20 years
>he made thousands of sanded wood dildos
>you're aroused
>>
>>60860046
>accusing others of being mentally diseased
>citing esr
top kek
>>
>>60860435
ebin :^)
>>
>Class exists
lmao why the fuck would I ever use (((structs))) if classes are more sophisticated
>>
Hey guys, I really enjoy coding C, and I was wondering if there's other systems langs you like?

Does anyone here enjoy coding ASM? I might try something like z80 or 6502 just for funs.

I've also given Go and rust several cracks, neither of them stuck for me like C did, though. They're just not as fun for me, idk.
>>
>>60861850
Because structs are just classes with members public instead of private by default.
>>
File: 1496768456966.jpg (86KB, 942x869px) Image search: [Google]
1496768456966.jpg
86KB, 942x869px
>>60861858
C is better for simple-minded people.
>>
>>60861858
I feel ya, anon. C is really fun; so much so that I couldn't enjoy Java and C# afterwards. I'm having a good time with D though.

>>60861876
The differences between a struct and class vary form language to language. Plus, he's shitposting. Why bother replying, anon?
>>
>>60861858
C is a nice beginner friendly language. Although D is more comfy but it's a big language
>>
>>60861882
Admiring complexity is something only retards do.
Simplicity is the way.
>>
>>60861850
sure, let me just treat the class as memory, like it is and ooohf, where the heck did that segfault come from?

>>60861882
what did he mean by this

>>60861889
Have you tried rust or Go? I never touched D because people bash it...
>>
>>60861909
>where the heck did that segfault come from
It's telling you to read more books
>>
>>60861909
>Have you tried rust or Go?
I plan to after I finish up with D.

>I never touched D because people bash it...
Is this your first day on /dpt/? Every language gets shat on. D's pretty nice because it's essentially an improved C++. Plus, Andrei is one of the creators of the language. You can't go wrong with it.
>>
>>60861909
>and ooohf, where the heck did that segfault come from?
How fucking retarded do you have to be to get a segfault from a class?
Unless you're using some other language, classes work pretty much the same as structs in C++, with a few extras that are only there if you use them.
>>
>>60861944
See, here's the thing, right. I don't think you can fix C++, so "improved C++" to me is like, not much of anything.

>>60861958
http://en.cppreference.com/w/cpp/concept/PODType
>>
>>60861974
>I don't think you can fix C++,
As in it's as good as a language can be, or that it's so broken that anything based on it can't fix?
>>
>>60861944
>D's pretty nice because it's essentially an improved C++.
Dfags keep saying this, but it's more like an improved Java or C#.
>>
>>60862004
>Improved Java and C#
Sign me up senpai
>>
>>60861974
You'd change your mind if went and checked it out, anon. Plus, it was designed from the ground up as C++ but not shit.

>>60862004
Maybe one day you'll actually try it out instead of being a shitposter~
>>
>>60862004
C# is an awesome language.
>>
>>60859942
Using maryTTS and EmotionalML write a GF/companion for yourself. Idk what to use for speech recognition (probably ms shit if you're on win or some google api?)
>>
>>60862015
Maybe one day you'll be able to write something more than a toy program without the GC.
>>
>>60862044
In addition to the kernel linked earlier: http://vibed.org/
But please, continue showing off your impressive ignorance, anon-kun~~~
>>
>>60861993
I think C++ should have been its own language, based on C but not exactly on C, in the same way as C#.

It just does too much shit, has too many exceptions and edge cases, and carries a lot of flaws and history with it. Something like Rust but without safety, plus C-like syntax, etc.

>>60862015
I'll give D a whirl sometime.

>>60862044
Because most code is performance-critical, right?
>>
>>60862068
>kernel linked earlier
You mean this one >>60860824? the one that page faulted?
>>
>>60862076

If you're not writing performance-critical code, you're not writing C or C++. You're writing Java or C#, or some other managed language.
Like D.
>>
c is the best innit

it always feels like home coming back to it after tiresome ventures
>>
>>60862092
computers are pretty good these days. Not saying use python to write an audio mixer but, step back for a second my dude.
>>
>>60862088
>implying that's D's fault
Delicious, delicious ignorance~~~

>>60862092
>If you're not writing performance-critical code, you're not writing C or C++
That's almost the dumbest fucking thing I've read today. Plenty of code that's not performance-critical is written, and has been written, in C and C++ everyday.
>>
>tfw almost finished the D book
Only 4 chapters remain
>>
File: 1439648511159.jpg (116KB, 469x469px) Image search: [Google]
1439648511159.jpg
116KB, 469x469px
>>60862181
>>
>>60859857
What is a language like Lua or Squirrel with nice simple syntax but isn't dead as shit.
>>
>>60862181
Does the book talk about design, besides syntax? If it doesn't, it's shit.
>>
>>60862218
Lua?
>>
>>60862218
how is lua dead?
>>
>>60862118
How can You stand a languagage with no higher order functions?
>>
>>60862218
python
>>
>>60862232
>>60862234
Ok, maybe not dead. I just feel like Lua has it's limits as a standalone language.
>>
>>60862221
If uou want that get Andrei's book
>>
>>60862092
D isn't even managed though is it? Not to the extent of Java or C# at least.
>>
>>60862248
Lua is great as an embedded language.
>>
>>60862237
can't you pass pointers to a function in C?
>>
>>60862248
so what do you want? a scripting language that isn't a scripting language?
>>
>>60862181
Have you found any convenience features for doing Manual memory management?
It's surprising to me that a language that that aims to replace C++ doesn't provide you with good memory management functionality. I was very put off by the language when I realized that I can't use 90% of features if I don't want the GC. It takes the language out of my field. Can't use it.

It's so easy to fix too.
>>
>>60862248
which are?
>>
>>60862267
You can.
>>
>>60862275
Not that anon, but read this: https://dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
>>
>>60862257
It's pretty much the same as C#. Garbage collected classes, RAII structs.
>>
>>60862237
You decide what kinds of functions you want to be able to pass around, then you design something using function pointers. Sure, it can be really verbose, but man, that's the thing.

Higher-order functions are an inherently verbose thing, you're doing a lot and there's no two ways about it.

That being said, the C function pointer syntax is sometimes horrible.
>>
>>60862257
The GC comes by default, but unlike C# it doesn't require a massive AST, runtime can be stripped off and you can go with no GC
>>
>>60862302
>RAII structs
I never got this RAII stuff. What does it mean exactly?
>>
>>60862275
>Have you found any convenience features for doing Manual memory management
Of course, working with arrays are so much easier, and it caters to my FP practices, it's like a godsend. You can still define fixed sized arrays though.
>>
>>60862272
I don't really have a set project in mind. I'm used to coding everything in Java. Most intense thing I've done is use the LWJGL to dick around with models.

Tried Lua and looked at Squirrel yesterday. I like how simplistic the syntax is in both. It feels familiar and makes sense. Not ever god damn thing is an object. However, it doesn't appear like you can do intense stuff in Lua and Squirrel looks like a dead language.
>>
>>60862342
constructors and destructors I think
>>
outputting debug data > debuggers
>>
>>60862342

The name is shit. It basically means scope-based object lifetime. When your object goes out of scope, it gets destroyed, and any cleanup it needs to perform is performed then.
>>
>>60862313
>>60862237
>>60862267
>verbose
what

Can you please demonstrate zip in C?
import std.algorithm.sorting : sort;

int[] a = [ 1, 2, 3 ];
string[] b = [ "a", "c", "b" ];
zip(a, b).sort!((t1, t2) => t1[0] > t2[0]);

writeln(a); // [3, 2, 1]
// b is sorted according to a's sorting
writeln(b); // ["b", "c", "a"]
>>
>>60862348
Lua has metaprogramming so you're not really limited on expressive power, only performance
>>
after some conversations with a [spoiler]java[/spoiler] friend of mine, and the way the language features heavily influence the way he solves problems, i'm starting to really take an interest in how programming languages are created and designed

i'm a self-taught amateur who's only ever done hobby projects, so i have no idea where to go from here. what can I read/watch/do to get more into this stuff
>>
>>60862395

>There is a particular problem
>The best solution to this problem is found
>The language is built around that
Alternatively
>There is a committee
>The committee invents some problems
>The language is built around that
>>
>>60862395
>spoonfeed me youtube videos on this esoteric subject
programming languages are generally created by people who already understand programming languages so there's no tutorials for retards, sorry
>>
>>60862395
Go through SICP. It's the real deal.
>>
>>60862296
Not sure that gives me that much. I don't see the article going anywhere but downhill after he mentioned how delighted he was to use the smart pointers in C++. If this is targeting a crowd that has performance as their primary concern (pretty much, it's always a tradeoff in development time and performance of course nobody rewrites everything to well inspected asm after their C implementation) its rather misguided in its approach. You can use smart pointers and still be performing well but not for all cases and the common case is that you have a bunch of custom allocator for different jobs.
JAIs temporary memory (recently demoed) hits the nail on the head where the performance VS development speed is concerned. It's not designed as your solution to the problem (as GC would generally be marketed) it's designed as a temporary solution to save you time. It's still giving you all the features needed to make libraries conform to your needs by having allocator be scoped/global overrides so you can write libraries that take users the end users custom allocator well without added overhead.

That's the kind of feature I want in D. I'm fine with the GC being a default (though from a design pov the system should be designed around mmm to make a wider range of memory management systems viable) if they just give me all that's needed to make the standard library not use their allocator and instead use my own. The extra step that JAI takes is to generalize it out to custom libraries.

I'm not sure of how well D or JAI will do but JAI is certainly in the lead now and it's not even far along.
>>
>>60862457
>In the lead
For my subgroup of people that wants to leave C++
>>
>>60859908

You can't trivially implement a kernel in any language, because kernels are not a trivial task.
>>
What math should I be comfortable with in order to do stuff with machine learning? Specifically Computer Vision/Image Recognition?

I assume Calculus and Linear algebra are definitely prerequisites
>>
>>60862457
>JAIs temporary memory
its funny how far these game programmers will go to avoid using a garbage collector, considering it's basically just a slightly faster GC that's more of a hassle to use
>>
>>60862502
>kernels are not a trivial task
Perhaps for you.
>>
>>60862516
>machine learning
isn't there a meme thread somewhere for you retards?
>>
>>60862516
Discrete math wouldn't hurt either.
Numerical analysis probably.
>>
How can a website implement a proper age verification?
>>
>>60862537
Ask for birth certificates or social security numbers
>>
>>60862537
>>>/g/wdg
>>
>>60862537
>You have 30 seconds to answer this question:
>Which of these songs came out when you were 15 or older?
>list of songs from the last 10 years
>>
>>60862566
>>60862528
>>60862522

>>>/trash/
>>
>>60862342
It basically means you allocate stuff when creating an object, that object is the sole owner of the stuff allocated, and that stuff is deallocated when the object is destroyed.
>>
File: 1279800241866.png (189KB, 624x444px) Image search: [Google]
1279800241866.png
189KB, 624x444px
how to detect duplicate images that vary in quality?

did not that microsoft cp filter do something clever like impose a grid and average the colour intensities of each grid cell, and that turned out to be fairly unique among differing images?
>>
>>60862628
http://www.imagemagick.org/Usage/compare/
https://www.imagemagick.org/discourse-server/viewtopic.php?t=25264
>>
>>60862645
seems promising, thanks.
probably unnecessary to reinvent then.
>>
>>60862658
>>60862645
although maybe I might have to after all.
if I wish to compare all my images to eachother, processing each more than once is pretty wasteful, so a hash with collissions for similarity might work better
>>
>>60862371
You actually did it, anon. Now I'm implementing a zip function in C just for fun.
>>
How would you sum an array in O(1)?
>>
>>60862815
A probabilistic algorithm would be to generate a random number that might be the sum of an array.
>>
>>60862815
>How would I sum n elements in constant time
Have a bounded array length
>>
>>60862815
let n = 1
>>
>>60859900
make a better one. hardmode: no ancient greeks
>>
>>60862815
constantly keep track of the sum while the array's being built. not a real solution, but it's not a real question so i don't feel bad
>>
File: OpenGL Chart.png (63KB, 2600x2015px) Image search: [Google]
OpenGL Chart.png
63KB, 2600x2015px
>>60861046
It's coming along. Top is my OpenGL chart.
>>
>>60862877
GWF Hegel
Friedrich Nietzsche
Bertrand Russel
Thomas Hobbes
Simone de Beauvoir
>>
>>60862886
No anon that is a real solution. One that a lot of people overlook.
>>
>>60862522
Actually, kernels are not a trivial task for anyone ever, including you. If this is news to you, that's because you're a troll.
>>
>>60862581
what if you don't listen to music though
or watch tv
>>
>>60862969
>kernels are not a trivial task for anyone ever
Prove it.
>>
>>60862962
the question's asked in a way that implies you have an array plopped in front of you and have to sum it in constant time, not to design an array with constant time for a sum method
>>
>>60862992
ask terry
>>
>>60862518
>slightly faster
Anon trust me it's not just slightly faster. GC is a nightmare in games. GC is very good when you're doing marathon computing. But for games and other high performance applications it just doesn't fit. People tend to forget that games isn't just PC. they're on consoles also and while they're not as memory constrained as they used to be game companies will always be pushing the limits of their lower end targets. GC is a variable you can't have there.
>hassle
The hassle does start when you need more granular control usually. Which is what JAI seems to aim to deliver. I'm very happy with that too. Your basic memory management won't be difficult ever. Nobody had trouble using their own memory pool or whatever.
But if you're in the situation that D is in where (right now) a lot of features rely on having GC its a problematic situation simply because you strip away so much of the language when you can't use it.
>>
File: 2017-06-12_03-18-38.webm (1MB, 800x600px) Image search: [Google]
2017-06-12_03-18-38.webm
1MB, 800x600px
>>60859857

I'm working on my raymarcher, using GLSL, but it's still really basic. I've a long way to go yet.
>>
>>60862815
2*arr[rand()%(sizeof(arr)/sizeof(*arr))];


On average, that'll give you the sum.

As averages go, though, it'll be pretty spread out.
>>
>>60863015
>GC is a nightmare in games

Go's GC halts for at most 1ms and a frame takes 16ms to draw. Unless you're mixing your own audio or something, GC is often just fine.
>>
>>60863065
Oops. Fixed version:
(sizeof(arr)/sizeof(*arr))*arr[rand()%(sizeof(arr)/sizeof(*arr))]
>>
File: samegame.png (788KB, 930x2152px) Image search: [Google]
samegame.png
788KB, 930x2152px
dpt how well can you solve this?

given w, h, #moves, <grid> maximize the number of blocks erased

when you erase a block every block that is 4 connected(up/down/left/right) and the same color is erased and all of their neighbors similarly

blocks fall through down through any empty spaces after every move

output
<number of moves>
<x> <y> (1,1) is top left

https://paiza.jp/logic_summoner/challenges/logics_skill_4005 (you'll have to log in)
>>
>>60863082
This looks like a job for a union-find data structure.

That's all I'll say about it. I cannot brain enough today to actually put effort into solving it.
>>
>>60863015
>GC is a nightmare in games
People just repeat this mantra without having any idea what they're talking about
GC is only a 'nightmare' if they use a model of garbage collection which has indeterminate stalling, GCs that clear their memory in small steps that don't stall are fine for games
And yeah they complain that oh you need to squeeze out every bit of performance you can yet people are using scripting languages and XML and tons of other inefficient shit
>>
File: 1497231146.png (29KB, 348x363px) Image search: [Google]
1497231146.png
29KB, 348x363px
C99 is cool, I had no clue this works
>>
>>60863143
but then you have to remember the type of x and if it changes you're dividing by the wrong thing
>>
>>60863134
But why would you even use GC in games, efficiency aside? You don't even need it. If there's an intuitive connection between the code you're writing and some made up world where the objects in your code are props -- as is the case in game dev -- then isn't it always quite obvious when the objects should be freed? Namely: when they're destroyed or incapacitated in-world.
>>
>>60862996
Don't they allow you to know the length of the array in constant time?
>>
File: 1497231583.png (9KB, 291x142px) Image search: [Google]
1497231583.png
9KB, 291x142px
>>60863185
here, get fucked :^)
>>
>>60863205
but then if the length of x changes youre fucked
>>
>>60863187
you use GC in games for the same reason you'd use it anywhere else. You're greatly oversimplifying how they work. We're not living in the days of Doom or Quake where all a game is is a slick, well-engineered engine, there's a ton of gameplay and UI work that needs to be done on top and for that things like garbage collection are invaluable
>>
File: 1497231809.png (15KB, 372x156px) Image search: [Google]
1497231809.png
15KB, 372x156px
>>60863211
shit, you're right. Let me fix that real quick
>>
>>60863076
>gamedev in go
>>
>>60863225
>>60863237
>game""""dev""""
>>>/b/
>>
>>60863237
I was just giving an example.
>>
>>60863247
gamdev is ten times more programming than webdev or toy projects in dead languages
>>
>>60859942
A love letter.
>>
>>60859857
Just picked up Scheme. I've been going through tutorials and project euler.
>>
>>60861882
bless us with your wisdom, your holiness
>>
>>60863309
How does one physically pick up a programming language?
>>
>>60863061
What language and libraries are you using?
>>
>>60863227
youve got the original problem again

i have barely done any C, but i think this will work

( sizeof(x)/sizeof(x[0]) )

doesnt matter if the type changes that way
>>
>>60859857
What programming language does he use?
>>
>>60863367

I'm using C++ and GLFW to create a window.
I then use the OpenGL API to render 4 vertices forming a quad, the same scale as the quad.
The entire scene is then rendered in a fragment shader, No mesh data or any more vertices after that, pure raymarching.
>>
>>60863407

same scale as the window*
>>
>>60863368
joke detector: nonexistant
>>
>>60859975
>commies
>implying that's a bad thing
Read a book anytime, son.
>>
>>60863367

oh, and for the GUI stuff:
https://github.com/ocornut/imgui
>>
>>60863431
its a shit joke m8
>>
How do you install GtkD using DUB?
>>
>>60861060
Use random.sample
x = [list[i] for i in random.sample(range(len(list)), #elems)]
>>
>>60859857

what design patterns have you implemented and been the most proud of?
>>
>>60863597
I'm fond of the Strategy pattern
>>
>>60863597
I'm never proud of any of my implementations because they're so subpar.

>>60863633
Remember to thank the janny, anon~
>>
main = sequence (repeat (putStrLn "MODS = GODS" ))
>>
>>60863597
Why would you be proud of implementing a design pattern? Statemachine is quite useful I guess, with entry and exit actions for each state.
>>
>>60863597
why would you be proud of doing something somebody else came up with?
>>
>>60862395
Read that Racket book made by that one indian.
>>
Hey thread question:
Why do game devs add a cube in levels of games?
I'm watching a dude do boundary breaks and I watched one for Batman AA and around the level were these patterned cubes.

Why do they do this?
>>
>>60862395
>the way the language features heavily influence the way he solves problems
what do you mean anon? can you give an example?
>>
>>60863686
main = forever (putStrLn "MODS == GODS")
>>
>>60863767
starting with Half Life people commonly use a patterned cube as a default texture if thats what you mean
>>
>>60863792
but then I'd have to import Control.Monad (forever)
>>
>>60863800
that was a thought. But the pattern cube looked like
The texture was that of a png file on google with that background. Any reason for that then?
>>
>>60863792
main = putStrLn "MODS == GODS" >> main
>>
>>60863842
that's the default background in photoshop
>>
>>60863859
so then if they did it say in Batman AA, what does that mean?
>>
>>60863686
(loop (write-line "MODS == GODS"))
>>
>>60863842

It helps visualise the transparency channel, which might otherwise be confused with RGB if shown as just white. It also helps identify the scale of your main image relative to transparent background. In the context of textures, a checkerboard is nice as a way to visualise how your uv mapping distributes over the surface of some geometry, without need an actual texture.
>>
QUICK, WRITE A PROGRAM THAT OUTPUTS ITS OWN SOURCE CODE.
>>
>>60863883
for (mods) puts(gods);
>>
>>60863887
That def makes a lot more sense now. So then would it just be a texture cube for Inkopolis in Splatoon? That would is the same texture as the assphalt
>>
>>60863900
  

>>
>>60863900
char*f="char*f=%c%s%c;main({printf(f,34,f,34,10);}%c";main(){printf(f,34,f,34,10);}
>>
yo wtf??????????

the indexer/editor sees the identifier from a system header just fine, but when i try to compile, the compiler doesn't see it

i have relevant include folder at the top in "Paths and Symbols" and at the top in "Preprocessor Include Paths, Macros etc."

WHAT THE FUCC
>>
>>60863900
Hello, world!

Written in H9+
>>
>>60863900
10 PRINT "ITS OWN SOURCE CODE"
20 END
>>
>>60863932
>10
>20
>>
I'm pulling a total brain-fart right now.

I just re-installed Solus after floating a few distros on laptop and for some reason it will only install Ruby 2.2.4, updated and upgraded all packages and it still only pulls 2.2.4.

Anyone have any suggestions?
>>
>>60863927
Do you get a file not found error or undefined symbol errors?
>>
>>60863924
(string= "char*f=%c%s%c;main({printf(f,34,f,34,10);}%c" "char*f=\"char*f=%c%s%c;main({printf(f,34,f,34,10);}%c\";main(){printf(f,34,f,34,10);}")

NIL
>>
>>60863877
I dont really have a clue unless you show me a link, there's a million reasons why you could have geometry or textures sitting outside the level, they could be assets that are projected onto something else in the real level, or they could bit left over bits from when the level was being made that they didnt bother to remove
>>
>>60863134
>small stalls are fine
A small stall in a game that needs to run at solid 60fps means you have that much less to work with. Because you need to hit the frame. Where GC can be used in game is in tools for the game. Nobody in their right mind would use it in the shipping engine.
>>60863076
Assuming it were to take an entire millisecond (that's way too much, as you know you only have 16.66ms to waste that on GC is crazy. Especially if it's stalling all threads with many GC systems do). It's a massive overhead for a very minor convenience, you won't see Go used in difficult projects. See we're not talking about anons first pacman clone here that's trivial. You could write it any way you want and it works well on virtually any machine. If you're in a more constrained environment like when you try to deliver the best experience to people on their modern console you need to be better than that. might have to store 8byte pointers everywhere.
Compare it to JAIs temporary memory which has essentially the same careless allocation but virtually none of the overhead of heap allocations.

Games aren't a case where you can just allocate things willy nilly. I think that's generally the case in software but when you're competing in performance and development speed the way you do in games you simply can't.

Also I think the reason the bad rep of GC in games is so massive is because GC encourages you not to care about your memory. While that's what you have to do if you want a well performing program. You allocate large chunks. Not individual objects. The fragmentation isn't just problematic in memory use its also problematic in performance because of the cache misses you inevitably take.

So theres a contradiction in using GC for high performance computing. Youre told they deal with it but you have to keep it in mind yourself anyway. And when you do keep it in mind yourself you could trivially work with a MMM system instead because youve already taken the overhead.
>>
>>60863932
Is programming in binary machine code the easiest way to make a quine?
You just print the program in whatever way you want right?
>>
File: hqdefault.jpg (16KB, 480x360px) Image search: [Google]
hqdefault.jpg
16KB, 480x360px
>>60863914

It could be anything. A graphics developer may have their own preference for what they use to visualise texture mapping (without the core art assets) - in some cases they might prefer a checkerboard effect that varies depending on the object, and in others, they may use something like a depth visualiser or a normal visualiser to help debug graphics.
>>
>>60863940
Traditional BASIC requires that. Technically you COULD use 1 and 2, but because editors weren't very good in those days you'd end up hating yourself if you had to go back and change anything.
>>
>>60863960
>>60863973

It's decently long
https://www.youtube.com/watch?v=qpLr7J-wukw

But as you watch he will mention it, I don't remember at what time he mentions and shows the cubes

I never understood debugging. I'mma look into this

This is why I stick to music
>>
>>60863954
undefined symbol

it's pthread.h and it works fine until i try to use pthread_cond_timedwait_monotonic_np, which the indexer sees (it's looking in the correct include directory) but the compiler seems to be using a different pthread.h file
>>
File: yfw.jpg (28KB, 400x264px) Image search: [Google]
yfw.jpg
28KB, 400x264px
>>60863955
>I am though. I promise.
>pic related: yfw
>>
>>60863963
I said 'steps' not stalls, GCs appropriate for games don't stall at all
High performance and batching and manual memory managment is all well and good for the core of your game engine that handles rendering and animation but that's not 90% of game code
>>
>>60863985
If the error you're getting is undefined symbol, that's not a problem with the header file, that means the corresponding compiled implementation file isn't getting passed to the linker.
>>
>>60864029
If it's pthread.h, that's a standard system library, isn't it? So you probably wouldn't be passing an implementation file in that case, but rather a library object file.
>>
>>60864029
>>60864042
POSIX threads (pthreads)
The android libc, bionic, provides built-in support for pthreads, so no
additional linking (-lpthreads) is necessary. It does not implement full
POSIX threads functionality and leaves out support for read/write locks,
pthread_cancel(), process-shared mutexes and condition variables as well as
other more advanced features. Read the bionic OVERVIEW.txt for more
information.


so how do i tell the linker to use the right version
>>
>>60864042
ye
>>
>>60864027
Anon you clearly don't have experience in this. Games aren't that trivial anymore. Of course there's systems that see more benefit from being optimized but you're not going to see a game that doesn't benefit from being given more room to move.
>>
>>60864063
Check the overview.txt. Bionic might not support pthread_cond_timedwait_monotonic_np.

In any case, "undefined symbol" usually means the compiler can find the header file just fine, but the linker can't find the library object file.
>>
>>60863984
that cubed texture is simply the default texture. it's what they apply to something when they haven't made the real texture yet, or don't need to. the small cubes with that texture are once again the default model. It's what will likely appear when you need to create a guide for something, or the real model intended to be displayed is missing.
>>
>His language can't even be used to implement a kernel
>>
>>60864071
the compiler/linker works with pthread.h already, but it's the wrong version, i want the special snowflake android version, the same one that the indexer already sees
>>
>>60864063
One thing that massively tripped me up awhile ago: when you pass your linker flags, are you passing them before or after your own code?
Before = "durrrrr undefined symbol *fart noises*"
After = works fine
I still do not understand this magic but ok
>>
>>60864098
Which language?
>>
>>60864096
i never understood why they rendered the game with that in it. You'd think they would remove it even if it's just a few MB of space.
>>
>>60864098

>His language can't even be used to implement a physical computer
fucking laughable

Besides, if a language "can't" be used to implement a kernel, that's not a limitation of the language, that's a limitation of what implementations of it currently exist.

Javascript freestanding compiler when.
>>
>>60864078
I've been a game programmer for 15 years
The overhead from a reference counting GC is barely above the overhead for virtual function calls in C++ and you aren't complaining about that
And go look at garbage libraries people use for their big console projects like Scaleform which shave 15 FPS off your game, or any scripting language
GC has an undeservedly bad reputation because some types of GC, like the old Java ones accumulate garbage and then stall to delete it all
All programming is a trade-off between ease of development and efficiency. If you want the most efficient program possible, program it all in machine code. I'm not arguing that you should make your renderer in garbage collected OOP, but if you write the majority of your gameplay code in raw manually managed C++ you're wasting alot of time
>>
>>60864093
i'm pretty sure bionic does support pthread_cond_timedwait_monotonic_np. it's in /platforms/android-9/arch-arm/usr/include/pthread.h

>>60864106
this is not the problem. the android ndk build system takes care of linker flags for you, and the user doesn't need to explicitly link pthread. it compiles fine except if i use pthread_cond_timedwait_monotonic_np
>>
>>60864119
It's a few kB of space. It's nothing, we're not living in the 1980s
>>
/* BIONIC: same as pthread_cond_timedwait, except the 'abstime' given refers
* to the CLOCK_MONOTONIC clock instead, to avoid any problems when
* the wall-clock time is changed brutally
*/
int pthread_cond_timedwait_monotonic_np(pthread_cond_t *cond,
pthread_mutex_t *mutex,
const struct timespec *abstime);

/* BIONIC: DEPRECATED. same as pthread_cond_timedwait_monotonic_np()
* unfortunately pthread_cond_timedwait_monotonic has shipped already
*/
int pthread_cond_timedwait_monotonic(pthread_cond_t *cond,
pthread_mutex_t *mutex,
const struct timespec *abstime);

#define HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC 1
>>
>>60864148
i mean data still adds up tho.
>>
>>60864098
>kernel
What is an ``kernel"?
>>
>>60864156
yeah well you could go around manually touching up every texture in your game so they compress better but with gigabytes of memory who gives a shit?
>>
>>60864138
>virtual function calls
You avoid that for good reason anon.
This isn't constructive conversation.
>>
>>60864164
Refrain from using faggot quotes outside of /prog/. Thank you for your cooperation!
>>
>>60864174
I wonder how much that would be at the end of it all.
>>
>>60864177
PS. I'm not advising you use C++s facilities for managing memory at all. They're awful on every level.
>>
>>60864185
Refrain from using gatekeeper-like rhetoric outside of /frog/. Thank you for your cooperation!
>>
>>60864177
99% of game programmers use them, stop drinking the Jonathan Blow kool-aid
>>
>>60864185
``/prog/" is dead.
>>
>>60859900
Dropped
Fuck Rust
>>
File: tumblr_inline_n97r6wdX2H1qbenep.jpg (94KB, 500x360px) Image search: [Google]
tumblr_inline_n97r6wdX2H1qbenep.jpg
94KB, 500x360px
>>60863842
The reason you use the checker pattern is to visualize the UV map. For actual debugging a color coded and number stamped that identifies each square in the texture uniquely is more common in my experience.
I do Middleware though. Maybe they do a simplified default on release just because it's cheaper. It'd make sense. They can be really small.
>>
>>60859900
>writing let for each new variable
> :: instead of just white space
>unnecessary = sign after variable
Rust's syntax is so dumb.
>>
>>60864200
Jonathan blow is in no way the person whos to be credited for how people perceive virtual function calls today. People like Mike Acton and the Cpp crowd are certainly leagues beyond Jblow in importance for influencing people on this.
>>
>>60864098
> >His
>>60864164
> >What is an ``
>>60864185
> >/prog/
>>60864198
>gatekeeper
>>60864207
>/trash/
>>60864220
>eggy.jpg
>>60864240
>/trash/
>>60864252
>ygge.jpg

Holy fuck.

An argument made entirely of memes.

Well my life is fucking over now actually.
Nothing else can happen that can top this.

Fuck you.
>>
File: 2017-06-12-053007_713x289_scrot.png (34KB, 713x289px) Image search: [Google]
2017-06-12-053007_713x289_scrot.png
34KB, 713x289px
I don't understand, why is it that a dash in a variable fucks up the "is" command in here?

I could just go with "==" but then Raymond Hettinger would scoff at my code
>>
>>60864281
Don't try to find logic where there is none.
Python is a clusterfuck.
>>
>>60864273
It's the same shit, ultimately they're just projecting their experience as low-level engine programmers across the entirety of game programming. When you actually try to make an entire game based on low-level engine design principles you end up shooting yourself in the foot just like you would if you tried to use high-level coding principles to write your engine. Processing animation, physics and rendering will use 90% of your CPU power but account for 10% of your game code. Make that data-driven, cache aligned and manually manage all the memory. Just don't try to do that when you're writing the gameplay
>>
>>60864281
That looks crazy.
>>
>>60864329
>coding
>>>/g/wdg/
>>
>>60864329
>game play entirely separate from engine.
Anon programming the systems of the game is the most important and difficult task. Renderers you largely copy. Same with animation. But if you start wasting CPU time when writing the interesting bits of your game you could never have written a game like GTA V with tons of unique interesting interactions.
>>
>>60864329
But what if your animation is 2D, your physics is nonexistent, and your rendering is just blitting?

Case in point: games that want to feel like snes jrpgs
>>
>>60864360
Not him but:
>programming the systems of the game is the most important and difficult task
Most difficult: yes perhaps.
Most important: no.
The most important task isn't even strictly a programming task.
You see, ordinary software is written for a well defined purpose. You write it, and then you can do something with it, that will help you do other things in some way.
A game isn't a tool. A game is a work of art. You need a vision. That there is your most important task.
>>
>>60864360
engine programmers rewrite renderers over and over again to make them better and better and include new graphical features. that's what they do. I can guarantee you most of GTA5s processing power is being used on the rendering, a bit on physics and a quick google can tell you that they use several scripting languages which have even worse performance than GC. Gameplay code doesn't impact performance much unless you're a bad programmer

>>60864364
then you dont need to worry about performance at all, your game will run at 1000 FPS unless you've fucked something up
>>
>>60863900
Too easy
import std.stdio, std.file, std.algorithm;

void main()
{
thisExePath.File("r").byLine.each!writeln;
}
>>
>>60864412
>std.stdio
>void main()
>!
That's fucking disgusting. Don't show your garbage around here ever again.
>>
>>60864424
That's less disgusting than your lardass mum
>>
File: 1480712855290.jpg (86KB, 1200x907px) Image search: [Google]
1480712855290.jpg
86KB, 1200x907px
>>60864412
>>
>>60864442
Thanks for the rare akari
>>
New thread:
>>60864449
>>60864449
>>60864449
>>
>>60864281

== compares values
is compares references

Python presumably is doing some optimizations on certain strings, where it will use the same reference on string literals. It might not perform this optimization on all strings.
>>
>>60861194
>schizophrenia
>>
Does /dpt/ have a sticky or something?

I'm really interested in learning programming but after some quick browsing I don't seem to have found a quick 101 that would let me understand how I should go about beginning my journey.

Would appreciate any advice.

Pic unrelated
Thread posts: 312
Thread images: 41


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