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

/dpt/ - Daily Programming Thread

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

Thread replies: 318
Thread images: 53

What are you working on, /g/?

Old thread: >>60361465
>>
>>60373569

We are absolutely in agreement.
Personally I would side against overloading operators unless the meaning is intuitively obvious, e.g. +-*/ for arithmetic classes and [] for container classes. As soon as you have to ask "what does this mean for this class...?" then you're doing it wrong, because operators ideally have a globally consistent meaning.
>>
writing a VST synthesizer using rust
i-i have done it. i have become faggot.
>>
>Rustacean
I get having a CoC and forcing niceness. I get not being 100% serious in your docs. But stop with this shit in the official manual, for fuck's sake.
>>
Today I learned Rust has a pseudo-goto in the form of break label. You can add a label to a loop to allow break to exit out of an inner loop. Combined with using RAII for deterministic cleanup of resources upon an error, Rust has effectively eliminated every legitimate need for a goto using other language constructs.
>>
>>60373868
what about code generation using rust as an IL?
>>
>>60373801
>he isn't a crab
you literally don't even belong here
>>
File: 1489693063003.png (45KB, 601x338px) Image search: [Google]
1489693063003.png
45KB, 601x338px
>>60374076
fug u
>>
>>60373890

If you're looking to use another programming language as an intermediary language, I'd recommend not using Rust. Presumably, the compiler you are using to generate the IL will always produce correct code, so using a language with an advanced type checker will only slow down compilation time (the type checking should be done in the language you are transpiling to C). Moreover, Rust only supports as many platforms as LLVM does, while C supports at least as many targets as LLVM does, with compilers on other platforms as well.
>>
>>60374102
for a quick n dirty DSL, typechecking in the target language might be more time effective.
>>
File: payload.jpg (47KB, 450x450px) Image search: [Google]
payload.jpg
47KB, 450x450px
>>60373589
Go > *
https://tour.golang.org
https://www.golang-book.com

pic unrelated
>>
File: nagato-5.png (45KB, 256x176px) Image search: [Google]
nagato-5.png
45KB, 256x176px
>>60373589
thanks for posting my waifu
>>
File: 1489270393717.jpg (26KB, 720x720px) Image search: [Google]
1489270393717.jpg
26KB, 720x720px
How can one write a program in multiple languages at once?
I mean, how can components written in different languages talk with each other?
excuse my retarded question, I only know java
>>
>>60374221
lol no generics
>>
>>60374221
shit gc
>>
>>60374307

https://en.wikipedia.org/wiki/Application_binary_interface
>>
File: shogun.webm (3MB, 720x404px) Image search: [Google]
shogun.webm
3MB, 720x404px
/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA)

>>60374307
https://www.wikiwand.com/en/Application_binary_interface

>>60374221
https://blog.plan99.net/modern-garbage-collection-911ef4f8bd8e
http://qr.ae/drvVS
http://qr.ae/drvm8
http://yager.io/programming/go.html
http://nomad.so/2015/03/why-gos-design-is-a-disservice-to-intelligent-programmers/
http://java.dzone.com/news/i-don%E2%80%99t-much-get-go
http://dtrace.org/blogs/wesolows/2014/12/29/golang-is-trash/
http://www.lessonsoffailure.com/software/google-go-not-getting-us-anywhere/
http://www.lessonsoffailure.com/software/googles-go-not-getting-us-anywhere-part-2/
http://www.lessonsoffailure.com/software/google-go-good-for-nothing/
https://gist.github.com/kachayev/21e7fe149bc5ae0bd878

Go Go:                         33.553163084 seconds time elapsed
Go gccgo: 17.438276362 seconds time elapsed

C++ clang++: 5.518077517 seconds time elapsed
C++ G++: 4.659448453 seconds time elapsed

Rust rustc: 6.583698221 seconds time elapsed

Haskell GHC: 0.454930841 seconds time elapsed

Java OpenJDK: 1.189619693 seconds time elapsed


>>60374102
but llvm as backends that compile to c or javascript.

>>60373589
Thank you for using an anime image.
>>
Continuation from >>60373433 (posted 5 mins before thread died).
Does anyone here have any experience in going from OOP -> DOD?
In which case, do you have any tips or experiences you'd like to share?

Context:
I'm a C++ game dev, that has recently taken an interest in trying an entity system rather than the conventional component-based design.
>>
Just to annoy you guys, I intentionally added a goto into the SW project I’m currently working on. For the first time in my life. It was a very peculiar feeling, like shitting on the desk. (hmm… haven’t tried that yet) My fingers are still trembling, I feel guilty and depressed. I lost something, I’m not myself anymore, my guilt is chasing me. I believe they’re watching me during coding. Heard some strange remarks about me around the coffee machine, they probably know it. Trying to act normal, but it’s probably written on my face. I’m afraid that my boss will see that code and tells me down in front of the team. I would not survive that. Probably will be called “the goto guy” in the rest of my life. Not sure whether I can carry this weight, I regret doing that in the same minute. I wish I could change history, but it’s already committed. Everytime I open Mercurial, I get shocked by that change set with the ugly goto, like touching high voltage.

It seems that the only way out is setjmp.h. That would end the pain and I could be free again. I don’t want to be the average conformist coder, adding auxiliary variables to keep the state or restructuring all those five code lines, just to make my manager happy. I’m not broken yet, I still have self esteem. Probably if I add some Inline assembler, they won’t notice the goto…
>>
>>60374414
>Just to annoy you guys

not like we give a shit, you're the one that will have to maintain it
>>
>>60374139

I can't think of any reason why you'd get a speedup using another language's type checker, but I can think of a practical reason why not to. Namely, that a type checker is supposed to be a sign of code that is broken. How can you know what is wrong with your own program if the error message is in code generated by the compiler?
>>
>>60374413

>conventional component-based design.
???
>>
>>60374389
is that anime called shogun?
also is it worth a watch looks neat but that dude in red kinda looks homo. Im lookin for some action not gay shit.
>>
>>60374389
>https://gist.github.com/kachayev/21e7fe149bc5ae0bd878
lol, did you even read this?
>muh Promises
this retard doesn't even know how to use the tools the language gives him... and then, feels the need to criticize it

>Go Go: 33.553163084 seconds time elapsed
>Go gccgo: 17.438276362 seconds time elapsed
>https://yuki.la/g/50006496#p50011157
>2015
discarded

great job, faggot
>>
>>60374463
>I can't think of any reason why you'd get a speedup using another language's type checker
I mean in development/prototyping time of the DSL itself.

>How can you know what is wrong with your own program if the error message is in code generated by the compiler?
Again, this is in no way an optimal way to make a DSL, but

$ dslc file.dsl
... rust error ...
on line 882:
rust line; //file.dsl: line 223
>>
solid arity!
>>
File: wow anon.jpg (78KB, 884x574px) Image search: [Google]
wow anon.jpg
78KB, 884x574px
>>60374512
>yuki.la
>not warosu
>>
>>60374566
this is a cute smug akarin

>inb4 all akarins are cute
>>
>>60374607
kys degenerate weeboo
>>
File: 1429852208959.jpg (682KB, 600x3300px) Image search: [Google]
1429852208959.jpg
682KB, 600x3300px
>>60374630
>doesn't like anime
>visits 4chan
>>
File: 1468015463584.png (402KB, 800x1400px) Image search: [Google]
1468015463584.png
402KB, 800x1400px
>>60374630
i dont want to kiss you
>>
>>60373868
alright you get it back for this shit
>>
>>60374649
>>60374659
got ' em
>>
>>60374546

>I mean in development/prototyping time of the DSL itself.
Perhaps, but I'd figure if you want to make a DSL people would like to use, it might make more sense to put a little more effort into designing it, especially if performance is so relevant to its usage that it needs to be compiled, rather than interpreted or embedded within another language.

>Again, this is in no way an optimal way to make a DSL, but
Eh, I suppose you could do things like that, but it wouldn't be able to give you a detailed reason for the error.
>>
>>60373589
I just took a close look at D. Having done that I really, really wish it had taken off instead of Java. It looks absolutely wonderful, too bad that it's dead.
>>
const gf = false;

if (gf) {
console.log('tfw no gf');
}
>>
>>60374746

not braindead enough for the pajeets of the world.
>>
>>60374766
>my first day at uni
>already dreams in binary
-you
>>
>>60374766
So only say "tfw no gf" if you already have a gf?
>>
>>60374766
>apostrophes for delimiting strings
why do people do this
>>
>>60374496
I'm not sure what you're asking, but if you don't know what I mean by "conventional component-based design", I'm simply talking about a Component system.

In a component system, the functionality of game objects are split up into smaller components, that are then have to be attached to this empty shell. This is, for example, what the unity engine is based on.

An ECS, or an Entity System simply takes this a bit further by being more data centric and maximising the efficiency of the cache. (( though there are obvious downsides, such as a lack of abstraction and difficulty debugging etc.))
>>
>>60374832

It's nice in certain scripting languages e.g. PHP where funny things happen to double-quoted strings.
>>
>>60374766
this does the opposite of what you think it does.
>>
>>60374876

In Ruby, single quoted strings are faster to parse, because you can't do string interpolation with them, and most escape sequences are more or less interpreted literally.
>>
>>60374766
Obvious bait is obvious.
>>
>>60375069
>faster to parse
gotta save those microseconds
>>
(let ((f (lambda (g) (call-with-current-continuation g)))) (f f))
>>
>>60375251
Low-level language trying to be high level.
>>
((let/cc cc cc) (let/cc cc cc))
>>
>C++
https://www.youtube.com/watch?v=1CpjRMICXNM

>python
https://www.youtube.com/watch?v=IIAWs3_Hgtc
>>
File: 1493854464325.png (305KB, 640x974px) Image search: [Google]
1493854464325.png
305KB, 640x974px
So, what should I read after SICP?
>>
>>60375725
http://www.stroustrup.com/books.html
>>
>>60369996
>fgets() includes '\n'.
Here you go senpai http://sprunge.us/iOKj?c
>>
File: 1484983022937.jpg (83KB, 600x338px) Image search: [Google]
1484983022937.jpg
83KB, 600x338px
>>60375725
Does anyone know what's the font in this picture?
>>
>>60375725
>that picture
NO.
FUCK YOU.
I'M DOWNLOADING SICP, ACTUALLY READING IT UNLIKE YOU SEEM TO THINK, LEARNING THE WHOLE THING RIGHT HERE AT HOME WITHOUT A PENCIL OR PAPER WHILE PLAYING ON MY CELLPHONE, AND APPLYING MY LEARNING IN A USEFUL WAY WITHOUT GETTING A JOB.
>>
>>60375725
That youtube link doesn't work (unless I made a mistake when copying it): http://www.youtube.com/cource?list=ECE18841CABEA24090
It's Error 404.
>>
>>60375725
http://cs.brown.edu/courses/cs173/2012/book/
https://users.dcc.uchile.cl/~etanter/ooplai/
>>
File: 1494630474250.jpg (94KB, 542x491px) Image search: [Google]
1494630474250.jpg
94KB, 542x491px
>>60375725
TAOCP
>>
>>60375834
https://www.youtube.com/watch?v=2Op3QLzMgSY&list=PL8FE88AA54363BC46&index=1
>>
How do I catch an exception from an if statement?

if (a.toInt() == 0)

and my toInt throws an exception.
>>
>>60375877
You wrap the whole if block -- then and else clauses included -- in a try block.
>>
File: guidosicp.png (100KB, 601x623px) Image search: [Google]
guidosicp.png
100KB, 601x623px
>>60375834
http://paste.lisp.org/display/313070//raw
>>
>>60375907
I got it and I feel stupid for asking. Thanks.
>>
File: file.png (178KB, 483x663px) Image search: [Google]
file.png
178KB, 483x663px
>>60374221
What is Go good for? I mean I've learned the language but I haven't found anything I'd use it over anything else.
>>
How is Rust for cross-compiling non-trivial projects these days?

e.g. what if I need to

>compile one part of the project to a linux executable
>use that linux executable to transform some data
>compile another part of the project to a windows executable, linking it with the transformed data
>>
File: suggestion.png (320KB, 640x958px) Image search: [Google]
suggestion.png
320KB, 640x958px
>>60375725
>>
>>60375961
It's for when you would want to use java but you don't want to have all the great libraries of jvm.
There's really nothing special about it other than it lack lot of features.
There's better alternatives for it: D, Ocaml, (java, c#), Chapel. Even nim seems that it fills the Go's niche better than go.
>>
>>60376024
Really you should just use CL if you're not good enough to use a decent type system and you don't need C-like performance.
>>
>>60374221
>>60375961
https://github.com/golang/go/wiki/Projects
https://github.com/avelino/awesome-go

>>60375972
dunno about Rust (it's supposed to be easy to do, AFAIU), but at least in Go, you can do this easily
there is gox, but you don't really need it to cross compile:
https://github.com/mitchellh/gox

>>60376024
>Go's niche
and what is Go's niche, Pajeet?
>>
>>60375961
oh, and btw, one of the best features are:
- fast compile times
- CSP
- multiple arches support
it's mostly orientated to system/web backends stuff. the libs and docs are very nice
>>
>>60376064
Go's niche is Pajeet, Pajeet.
>>
>>60375646
>Scheme
>Low-level language trying to be high level
Low-level wizard trying to be high level
>>
>>60375922
Lol Guido. How did he find out what they meant by sending him the book?
>>
>>60376126
>>60376064
>all of this effort spent on such an abysmal language
Mankind is unworthy of salvation.
>>
>>60376059
Really you should just use C if you're not good enough not to need an excessively restrictive type system and you don't need CL-like performance.
>>
File: cal071315-gya-3b.jpg (43KB, 840x630px) Image search: [Google]
cal071315-gya-3b.jpg
43KB, 840x630px
>>60375961
Go is the language Rust tried to be and failed. It's the successor to C we were always waiting for.
It makes programming great again.
>>
>>60376253

>C
>type system
lol
>>
File: yukari_succ.png (50KB, 232x428px) Image search: [Google]
yukari_succ.png
50KB, 232x428px
>>60376258
>It's the successor to C
But it's GC and slower than C++??? Gofags on suicide watch???
>>
>>60376275
>not to need an excessively restrictive type system
>>
T without(T)(T[] args, T target)
in
{
assert(args.length > 1);
}
out
{
assert([12, 23, 23, 11, 0, 23].without(23) == [12, 11, 0]);
assert("ccxi".without('x') == "cci");
assert("abcderfiibcne".without("bc") == "aderfiine");
}
body
{
T[] result;
//To-Do
return result;
}
>>
>>60375877
Another question regarding this, how do I make it check the next statement if the first 'if'' throws an exception?

Currently I have
[CODE]
try {
if (a.toInt() == 0)
return 1;
if (b.toInt() == 0)
return 2;
if .....
} catch (Exception e) {
return 0;
}
but it throws in "if (a.toInt() == 0)"
[/CODE]
>>
>>60376251
what effort? it's so easy to learn and do stuff with it, it doesn't even feel like effort or time wasted, at all
>>
>>60376258
>Go is the language Rust tried to be and failed
That's very much wrong
>>
>>60376253
>he thinks a type system is about restriction
This is how I know you've never used a good one.
>>
>>60376275
Beside the point. The point is, like I said, that no good programmer needs a type system anyway, and certainly no good programmer needs C's sad excuse for one.
>>
>>60376305
Sorry for my retardation in formatting.
>>
>>60376297
>not good enough not to need an excessively restrictive type system
double negative, bitches!
>>
>>60376311
If you can't use any bound identifier freely in any context with no extra syntax, the type system is excessively restrictive.
>>
>>60376305

If you want to do different things depending on where the exception is thrown, you need separate try blocks.
>>
File: advanced.png (2MB, 1000x664px) Image search: [Google]
advanced.png
2MB, 1000x664px
>>60376293
Go uses a revolutionary new GC with the smallest pause times of any in the world, and its design minimizes garbage creation in the first place, so it barely needs to run. And unlike other languages, Go gets faster with every version.
>>
>>60376367
When will go get generics?

I mean it's not going to be able to get into the big boys' club like Rust did, but I think it'd be pretty nice if I were able to write Go for android instead of Java
>>
>>60376352
Again with the restriction meme. I suggest you watch this talk: https://www.youtube.com/watch?v=3U3lV5VPmOU
>>
>>60375069
Ruby can you be my personal programming senpai? I'm already into a different degree and I can't afford starting all over.
>>
>>60376422
Can't, I'm at the hospital. But it's not a meme, if not everything is an expression then the language is shit.
>>
>>60376352

I too like to subtract text from my numbers.
>>
>>60376298
Bump, how would you approach this?
>>
File: smug_ran.jpg (632KB, 709x1063px) Image search: [Google]
smug_ran.jpg
632KB, 709x1063px
>>60376367
If Go is such a good garbage collector then why doesn't it collect itself?
>>
File: boilerplate.png (984KB, 1024x568px) Image search: [Google]
boilerplate.png
984KB, 1024x568px
>>60376410
Generics are a mistake and the world is starting to understand this and turn away from them.

The usual argument for generics is to avoid writing "boilerplate." But understanding the details of how the code actually executes is vitally important to understanding what the program does. The aversion to working with it is simply a cargo cult. Writing it out by hand, you'll soon realize, is refreshing and rewarding.
>>
>>60376298
>T
instant shit language
>>
>>60376480
1/10
>>
>>60376470
why would you expect it to do so, that makes no sense
>>
JavaScript is Lisp's son with fetal alcohol syndrome
>>
>>60376480

>But understanding the details of how the code actually executes is vitally important to understanding what the program does.
yeah dude we should remove virtual methods too
>>
>>60376480
>>
File: 1494332105752.jpg (733KB, 3702x2198px) Image search: [Google]
1494332105752.jpg
733KB, 3702x2198px
>>60376480
>Generics are a mistake
No wonder Rob Pike thinks you are a retard for using Go
>>
>>60376544
To be fair to C, generics weren't anywhere near as well understood in 1972 as they were when Go was designed.
>>
>>60376556
This is correct.
>>
>>60376556

Fortunately C++ was able to fix this.
>>
>>60376556
Yes.
>>
Reminder that Rust doesn't have HKTs, regardless of how many packages contain "hkt" in their name you still can't implement traverse_ correctly in it.

Of course it doesn't have dependent types either, but let's not expect it to run before it can stand up.
>>
>>60376594
HKTs are for true brainlets.
>>
>>60376525
>"A little bit of copying is better than a little more dependency"
>>
>>60376594
At least it has Inline ASM
>>
File: gnu-gi-oh.png (183KB, 450x337px) Image search: [Google]
gnu-gi-oh.png
183KB, 450x337px
Wondering what embeddable scripting language I should use.
>>
File: sector.png (94KB, 1675x667px) Image search: [Google]
sector.png
94KB, 1675x667px
Does this mean the number of occupied sectors?
>>
>>60376623
Lua or guile.
>>
>>60376632
Don't use Lua.
>>
>>60376640
Why?
>>
>>60376649
Because Guile is GNU's official scripting language.
Lua is not even programming language.
>array indexing starts from 1
>>
>>60376632
>>60376640
Depends.
Lua isn't that bad.
>>
>>60376665
>Lua isn't that bad.
Yes it is.
>>
>>60376665
I honestly don't code a lot in lua, but it's pretty good for scripting. A lot of game companies use lua for gameplay and c++ for the backend.
>>
File: 16298607.jpg (17KB, 317x379px) Image search: [Google]
16298607.jpg
17KB, 317x379px
>>60376298
Last bump. What would you put inside the function body?
>>
>>60376662
>he doesn't use 1-based arrays in other languages such as c
get on my fucking level
char const* 1_based_string = "hello world" - 1;
>>
>>60376868
>having to use custom free function
>>
File: rape.png (194KB, 347x481px) Image search: [Google]
rape.png
194KB, 347x481px
>>60376818
I'd put a baby in your body, anon.
>>
>tfw you suffer from severe adhd
>>
>>60373589
Color space conversion.

I hate color space conversion.

A bunch of faggots decided they want to design standards around the inconsistent nature of human perception of color instead of designing devices that work directly with a wavelength as input.

So, now we have a growing format zoo and no such thing as round-tripping across all available formats.

Fuck color spaces and fuck "graphics".
>>
>>60376662
You're right, specifying an indexing is a mistake.
>>
>>60375756
>0
shouldn't it be \0?
>>
>>60377035
'\0' equals int 0
>>
>>60376298
>>60376818

size_t targetSize = target.size();

size_t i = 0;
while (i < args.size()) {
rem = args.substr(i); // args[i..$] or whatever.

if (rem starts with target)
// this is just string equality after capping rem to the size of target
{

i += targetSize; // skip
}
else {
result += args[i];
++i;
}


}
>>
>finally get degree
>no projects to apply myself
>uncreative so can't come up with anything
end me
>>
>>60377147
make something useful to yourself
>>
I need some naming advice. Please keep in mind that English is not my first language.

I'm writing simple support for different units and types of measurements - weight, length, arbitrary "custom" units and so on. I have no idea what to name it all.

Let's say we have concepts of measurement, like "length", "weight", "volume" and so on. Then within "weight" we have "grammes", "kilograms" and so on.

What do I call the classes of these? I'm thinking an enum/class for "Measurement" which describes measurement types like length and volume. Then one metre is a unit of measurement, so therefore the class which describes "metres" or "kilos" should be called "Unit" ?

Are there better names I'm missing here?
>>
>>60377226
Dimension maybe.
>>
>>60377190
but I'm just a NEET right now
idk what's useful to me
I could make some GUI application since I learned how to use Qt pretty well
>>
>>60377281
Intredasting. Weight, Lengths and so on are dimensions?
>>
>>60377303

Not really.
I think measurement fits better.
>>
I have a very stupid question, what happens if i don't specify the headers argument when calling requests.get in python? I just give it the url. I see it works anyway, am i right? I'm using it in a script that monitors a webpage for changes
>>
Hello, I have just done this:
#include <stdio.h>
#include <stdlib.h>

int main()
{
char arr[12] = {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '};
int i, e;
for(e = 0; e < 12; e++)
{
for(i = 0; i < 12; i++)
{
printf("%c", arr[i]);
}
arr[e] = 'H';
arr[e - 1] = ' ';
printf("\n");
system("CLS");
}

return 0;
}
The idea is make the H move from the first position to the last one. But it does too quickly.
How do I make the first for wait a second until runing again?
>>
>>60377303
https://en.wikipedia.org/wiki/Dimensional_analysis
>>
>>60377394
C does not have a standard way to sleep
>>
>>60377295
Yeah I'm talking about GUI apps.
Well, what do you use in your daily life??
there must be something you could build an app around or something. Or recreate something someone else did? What about your family? Can you make their lives easier?
>>
>>60377401
>>60377323
Aiight. Dimensions it is.
>>
>>60377440
Technically it has thrd_sleep.
>>
I made a shitty program that takes random strings from the user and chooses one to output. Any ideas how to make this program any more interesting. I want to expand it but idk what to add. Maybe GUI or something
>>
>>60377622

Make a new program that takes a sentence of English, and randomises the middle letters like in this picture.
>>
https://webmshare.com/nZq5E
>>
>>60377761
That's awful.

By the way check those 7777
>>
Is general software development an interesting/satisfying career? I've been leaning towards gamedev for a long time, however I'm not sure I want to deal with the high barrier to entry and ridiculous working conditions.

I just get worried that standard software dev would end up really dull.
>>
how2 learn django?
>>
>>60377840
no
>>
>>60377840
>is _ an interesting/satisfying career?

The answer is no, like every other career.
>>
>>60377858
>>60377869

Explain.
>>
>>60376544
C doesn't have this problem because literally everything is an unsigned char const*.
>>
>>60377756
It doesn't seem to hard, but I don't see the point of the program. Like in the one I mentioned, it's useful for when I'm not sure what anime/game to indulge in, so I enter it all in and choose one at random. I wanna expand on it but idk what to add.
>>
>>60377924
Correction: a struct { unsigned char const*; int; }.
>>
>>60377932

Make it cycle through the possibilities like a slot machine until it gradually stops on the final answer.
>>
>>60377840

Game dev is the same as regular dev except you get paid less and have shit hours. A software engineer working on a game isn't going to be doing cool video game stuff, they are going to be optimizing a task scheduler or hunting down cache misses.
>>
>>60377932
that's a really amazing program idea
>>
>>60377991
>you get paid less
Depends
>>
>>60377991
Even if the position is sold as 'gameplay programmer'?
>>
>>60377880
I'm not either of those people, but I would guess they try too point out that any 'career' in itself is boring (boss,colleagues, meetings etc). BUT you can have a really cool hobby which in principle is limitless..
>>
>>60378015
could you imagine what it would be to be a 'gameplay programmer' at ubisoft
>>
>>60377984
I like this idea, thanks. :)
>>
>>60377622
You could make it so that instead of choosing only one input at random, it chooses n at random, for n <= input size.
>>
>>60377226
Dimensions.

Look up the IUPAC Green Book, which goes through some dimensional analysis with the common physical and chemical dimensions.

By the way, 'gram' and 'kilogram' are not units of weight.
>>
>>60377991
Unless you're an indie game dev. Then it's shit hours, inconsistent pay but generally beans, and nothing at all like regular dev.
>>
File: chip328.jpg (60KB, 960x540px) Image search: [Google]
chip328.jpg
60KB, 960x540px
I didn't know the Rust compiler supports AVR
https://gergo.erdi.hu/blog/2017-05-12-rust_on_avr__beyond_blinking/

Nice.
>>
>>60374510
the anime is called "drifters"
>>
>>60378227
Python pleb here, Rust looks interesting. Is there any book I should read as an intermediate programmer?
>>
>>60377932
GNU shuf does a better job of this than your program. You probably store all these lines and select a random one at the end. Make this a true CLI app, that understands EOF and doesn't pollute the output you might use in a pipeline with diagnostic messages. Make it accept a parameter (-n) that tells how many random lines to output. Make it work when the input is bigger than your memory. Implement the rest of GNU shuf, without looking at its source.

The CLI is something you might think you are familiar with.
>>
>>60378301
Rust essentials, or the official Rust book online
>>
>>60377932
>>60378315

Also when you are done, try timing your app and GNU shuf. If yours is faster in multiple cases, send them a patch, though I doubt that would happen.
>>
Wrote a python script today that replaces non-ascii characters in a filename by either a suitable equivalent (like ae for ä or ... for …) or its escape sequence, because some other programs had problems with non-ascii characters previously, but they're ubiquitious.
>>
what does #[no_mangle] do actually?
>>
>>60378039
Maybe I'll just become a web dev :/

Why am I even doing this, I want to be a fucking film director
>>
>>60378039
Not if you do startups
>>
>>60378447
No sure, a startup wouldn't be boring. But that's not the career i was referring too, and you know it.
>>60378429
Whats wrong with that? Disregard the retards here.
>>
>>60378499
What's wrong with what? web dev?
>>
>>60378447
to be quite honest, a startup is most probably hell for any employee and just a self finding & learning experience for the founders.
>>
>>60378447
running a business isn't just fun and games unless you're just playing with your daddy's money
>>
How do I make floating points print only if they're different from a round number?
I want 1.0 to print as 1 without integering it.
Java.
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); and she's super duper cute and easy to prototype in! Say something nice about her, /dpt/!
>>
>>60378582
convert to int
>>
>>60378523
yes web development. Its fine if its paying your bills.
>>
>>60378639
Oh I wasn't shitting on web development. I'm just in a weird cycle of not knowing what I want to do with my life because I'm interested in so much shit and so many different fields.
>>
>>60378600
>programming language
>pronouns are "chan"
kys
>>
>>60378562
Well it's certainly not 'boring'
>>
File: 1385285724730.png (83KB, 744x626px) Image search: [Google]
1385285724730.png
83KB, 744x626px
What's the difference between
lea eax, [ebx + 8*ecx + 4]


and

mov eax, ebx + 8*ecx + 4


Does LEA serve any purpose that MOV can't handle?
>>
>>60378749
t. hasn't made a complete software application
t. hasn't filed taxes
t. hasn't had to deal with normies and kikes
>>
>>60378604
but i want 1.04 to still print as 1.04.
>>
>>60378803
https://stackoverflow.com/questions/1699748/what-is-the-difference-between-mov-and-lea
>>
>>60378831
Thanks but I already saw that link and it doesn't answer my question

Can someone knowledgeable with x86 assembly please chime in?
>>
>>60378808
>t. hasn't made a complete software application
not boring
>t. hasn't filed taxes
true, I have an accountant in the family, until she dies I probably won't have to
>t. hasn't had to deal with normies and kikes
I did, not really boring
>>
>>60378600
rip
>>
>>60378811
Convert back and check if they are the same
>>
>>60378848
anything beyond a shitty toy/learning project will have a shit ton of boring parts, it's as much of a grind as a software dev job
>>
File: bye motherfuckers.gif (891KB, 500x269px) Image search: [Google]
bye motherfuckers.gif
891KB, 500x269px
>>60378803
>picture
i'm fucking done
>>
>>60378880
'boring' from >>60378039 back in the chain
>any 'career' in itself is boring (boss,colleagues, meetings etc).
>>
File: 1466504389866 (1).jpg (20KB, 377x331px) Image search: [Google]
1466504389866 (1).jpg
20KB, 377x331px
>>60378933
How does the penguin slide backwards like that?
>>
>>60377932
i use programming all the time to make my life easier but dude just roll a dice like wtf hahaha
>>
>they don't work in infosec
learning whatever the fuck you want/need, pwning retards, treating your clients like shit and still getting paid, playing with awesome toys and stuff...
you fuckers don't know what you are missing
>>
>>60379074
I'm trying to break into the field
Is a masters in CS important for getting an infosec job?
>>
File: 1484589609241.jpg (50KB, 806x617px) Image search: [Google]
1484589609241.jpg
50KB, 806x617px
Please learn do C. Pentesters and the whole infosec field need to eat too.
>>
>>60379113
this
>>
>>60379091
I don't have a degree, I got in some company because I could demonstrate my knowledge and have some CVEs in web/desktop programs
in fact, I'd say infosec is one of the most pragmatic industries in the IT industry. if some people know you are good, they will hire you.
though it's broad af...
>>
>>60379074
>I'm 16 and wanna grow up to be a "black hat" daddy!
>>
I hate you.
>>
File: 1410539974135.gif (593KB, 333x362px) Image search: [Google]
1410539974135.gif
593KB, 333x362px
Is Haskell the fastest programming language?
>>
File: 1477878553198.jpg (48KB, 415x567px) Image search: [Google]
1477878553198.jpg
48KB, 415x567px
A String substract function.

More broadly a nice "without" function.
 assert([12, 23, 23, 11, 0, 23].without(23) == [12, 11, 0]);
assert("ccxi".without('x') == "cci");
assert("abcderfiibcne".without("bc") == "aderfiine");
>>
>>60379197
so...string.replace()?
>>
Just trying to write a little bit of test code to figure something out about truncating and scope.

I know where I'm fucking up, in that 3|2 != 2/5, I think, but I'm not sure how to put that into a topic to learn more about. So, what am I being ignorant about here /dpt/?


int main(void)
{

int n = 2/5;

if(n == 3)
{
printf("C truncates up!\n");
}
if (n == 2)
{
printf("C truncates down!\n");
}
else
{
printf("You fucked up!\n");
}

}
>>
>>60379206
>string
>assert([12, 23, 23, 11, 0, 23].without(23) == [12, 11, 0]);
>>
>>60379215
>code
Um..
That's not code...
>>
>>60379215
That 2/5 is 0.4, why would that "truncate" to either 2 or 3?
>>
>>60379260
>2/5 is 0.4
2/5 is 0
>>
File: oaiioGa.jpg (30KB, 360x360px) Image search: [Google]
oaiioGa.jpg
30KB, 360x360px
I'm taking Theory of computation next year. I feel pretty weak on basic algebra. I know the rules and everything, but I always feel lost when I need to do something like induction where I have to prove p(n) + (n+1) = p(n+1). Also I suck at induction.

What can I read or practice to be prepared for a class that I'm told will be mostly proofs?
>>
File: chen_what.png (44KB, 388x256px) Image search: [Google]
chen_what.png
44KB, 388x256px
>>60379197
Does it work with multi-rank tensors? Things like
std::vector <std::vector<double>>

etc.
>>
>>60379306
Doesn't have to
>>
File: yukari_wish.png (64KB, 350x235px) Image search: [Google]
yukari_wish.png
64KB, 350x235px
>>60379287
>can't even do induction
Kill yourself so and hope that you reincarnate into a non-brainlet
>>
>>60379287
Proof theory.
>>
>>60379260

Oh, fuck I always do that. Thanks. It works.

It """""truncates"""" down. Not sure why you put that in quotes bro but thanks.
>>60379248

I just didn't put the #includes in, but it compiles.
>>
File: proof.png (35KB, 749x258px) Image search: [Google]
proof.png
35KB, 749x258px
Can /dpt/ solve pic related?
>>
>>60379394
I can't read or grasp numbers. Can you write it in some other way?
>>
>>60379394
you should do your homework yourself
>>
>>60379166
>>60379356
Are you sure you replied to the correct person?
>>
>>60379192
no
>>
File: ran_delinquent.png (25KB, 120x234px) Image search: [Google]
ran_delinquent.png
25KB, 120x234px
>>60379394
>prove that R is complete a la Cauchy
>prove that F(n+1)/F(n) converges and approaches the golden ratio
>Cauchy-ness of {F(n+1)/F(n)} guarantees the statement
Don't even need to use induction. Read some Hume you fucking idiots.
>>
>>60379420
it's from sicp you pleb. the solution is all over the internet
>>
File: 1458230712081.png (876KB, 796x800px) Image search: [Google]
1458230712081.png
876KB, 796x800px
Is Haskell the second fastest programming language?
>>
>>60379463
yes and java is the fastest
>>
>>60379364
>down
towards 0, try it with a negative number.
>>
>>60379449
The point of the exercise is to do it using proof by induction. Are you unable to do that?
>>
>>60379521
problem of induction m9
>>
Is Haskell really fast for a functional programming language? Is it one of the fastest functional programming languages? On a scale of Python to C, where would Haskell be?
>>
>>60379546
I'll take that as a yes.
>>
File: 1460206898415.jpg (24KB, 289x340px) Image search: [Google]
1460206898415.jpg
24KB, 289x340px
Can /dpt/ prove that 2 ≠ 3?
>>
File: languages3.png (17KB, 522x384px) Image search: [Google]
languages3.png
17KB, 522x384px
This image is still correct notwithstanding your opinion of it.
>>
>>60379598
that wasn't me though
>>
>>60379601
Those symbols don't look the same, therefore they are not equal.

Q.E.D.
>>
>>60379618
>Neither
>Ruby
No it isn't. Notwithstanding YOUR opinion of it, that image is objectively incorrect.
>>
>>60379634
t. buttblasted ruby shitter
>>
>>60379618
>good performance
>C++
Wrong. Everything else is correct.
>>
>>60379638
Allow me to rephrase: Notwithstanding your opinion OR my opinion of that image, it's objectively incorrect. Therefore, your opinion of me is irrelevant, because it would only affect your opinion on the credence of my opinion, and this is not my opinion, it's a fact.
>>
>>60379601
There is no set of axioms that is both complete and consistent. So no
>>
>>60379650
t. buttblasted ruby shitter
>>
>>60379651
here's one
{}
>>
>I'm struggling with Python

It's over guys, I am too dumb to code
>>
>>60379650
>objectively incorrect
What is an "Objectively Incorrect"?
Formally prove using any consistent system that it's incorrect. That's the only thing I will accept.
>>
>>60379601
If 2 = 3 then 3 = Succ(2) = Succ(3) = 4 and so on, therefore x U {x} ∉ N which contradicts the axiom of infinity.
>>
>>60379662
See: >>60379650
>>
>>60379670
>axiom of infinity
This post is bad.
Set theory belongs solely on >>>/v/
>>
>>60379692
FUCK YOU, VIDEO GAMES ARE AN ART FORM AND WILL CHANGE THE WORLD war games suck though
>>
>>60379676
see >>60379669
>>
>>60379702
Killing is the ultimate expression of your humanity.
>>
>>60379664
Descend into madness. Learn Lisp.
>>
>>60378600
Dfag, answer the question from the last thread please.
>>
>>60379692
Are you actually pretending to be retarded?
>>
>>60379601
I can prove 1 != 1
>>
>>60379740
What makes you think so?
>>
>>60379669
>>60379707
nah
i'm still right though
>>
>>60379749
see >>60379669
>>
>>60379730
Killing is not the ultimate expression of humanity, nor is it necessarily even an expression of humanity. Killing is an expression. There are greater expressions of humanity than killing when it is an expression of humanity. Regardless, it is more often not.
>>
>>60379762
don't feel like it
>>
>>60379765
I didn't really read your mindless post. It sounds like something a leftist retard would say.
>>
>>60379747
I can too.
n != 1 * 2 * 3 * ... *  n-1 * n
1 != 1
>>
File: Capture.png (7KB, 394x77px) Image search: [Google]
Capture.png
7KB, 394x77px
>>60379601
>>
>>60379576
I wonder if there are really fast functional languages, like maximum 5 times slower than C.
>>
>>60379780
Right wingers are a plague on humanity.
>>
>>60379826
The negation of this is true.
>>
>>60379824
Example: C
>inb4 "C isn't a functional programming language"
it actually is, static functions with exported pointers are pretty much just lambdas
>>
>>60379826
As I expected. You can really tell right away with your kind of """people""".
>>
>>60379830
The sentence you just made is self referential in such a way as to render it meaningless.
>>
>>60374092
saved
>>
File: banner.png (37KB, 892x272px) Image search: [Google]
banner.png
37KB, 892x272px
>>60373589
Working on my imageboard, 4kev.org
>>
>>60379845
>endorses war and killing
>"""people""" with three pairs of quotation marks to imply a proudly held belief that some human beings are not people
provin my point here
>>
>>60379843
If C is a functional language so is Javascript and every other language
>>
>>60379874
>If C is a functional language so is Javascript
Javascript is indeed a functional language.
>and every other language
Not Java, not Ruby, and not most architectures of assembly.
>>
>>60379826
Blind progessivism for the sake of it is just as dangerous and harmful as blind traditionalism.
>>
>>60379434
Very.
>>
>>60379898
Give me one example of a view you've seen me express that was blindly progressive.
>>
(cont from >>60379931 ) Not counting here: >>60379702
Because that's just tongue in cheek.
>>
File: images.duckduckgo.jpg (108KB, 1000x1000px) Image search: [Google]
images.duckduckgo.jpg
108KB, 1000x1000px
>>60379931
>>
>>60379951
I said give me one example of a view you've seen ME express that was blindly progressive.
>>
>>60379951
Muh dick
>>
>>60379872
>endorses war and killing
Who are you referring to?
>some human beings are not people
Leftists aren't human beings. All human beings are people.
>>
>>60379967
Oh, I don't know. I just came into this thread.
>>
Please take this to >>>/pol/, this thread is for people to demonstrate their ignorance of programming.
>>
>>60379850
Is your E*ropean disability preventing you from reading properly? That sentence isn't in any way self-referential.
>>
>>60379977
>Who are you referring to?
This guy: >>60379730
Who also said these things: >>60379780 >>60379845
And if either of those weren't him, then they make no sense in context, because they both imply previous participation in the conversation.
>Leftists aren't human beings. All human beings are people.
>saying a category of homo sapiens aren't human beings
provin my point here
>>
>>60379951
Is it just me or is she sexually attractive?
>>
>>60379999
It is self-referential, actually.
>The negation of this is true.
>>
File: 1482444326492.png (61KB, 325x971px) Image search: [Google]
1482444326492.png
61KB, 325x971px
>>60380017
>>
>>60380027
wtf I love cute boys now
>>
>>60379999
>starred words
Into the trash it goes.
>>
>>60380015
>This guy
Where did he endorse war and killing?
>because they both imply previous participation in the conversation
Maybe on some other websites you and your kind visit. Definitely not here, though.
>homo sapiens
Only those who belong to this species are human beings. The implication is pretty obvious.

>>60380026
"this" doesn't refer to the sentence itself.
>>
>>60380040
>Killing is the ultimate expression of your humanity.
endorsing war: because it's obviously a response to "war games suck though"
endorsing killing: even more obvious
>Maybe on some other websites you and your kind visit. Definitely not here, though.
Disagree. Consider:
>I didn't really read your mindless post.
This implies previous participation in the conversation, because if he hadn't been participating, there'd be no reason for him to say he didn't read my post, because no one expected him to.
>As I expected.
This also implies previous participation in the conversation. The implication is much more obvious and warrants no explanation.
>Only those who belong to this species are human beings. The implication is pretty obvious.
The implication is scientifically inaccurate. I maintain this inaccuracy is deliberate as a kind of exaggeration. Implying anyone is less than human as a form of exaggeration is morally repulsive and ergo a demonstration of my point.
>"this" doesn't refer to the sentence itself.
I know it doesn't. But it does if you take it out of context. It was a joke, you see. Pretending to have absentmindedly abandoned the context of a conversation is funny. It's like a verbal slapstick.
>>
File: 1486428981152.jpg (111KB, 420x550px) Image search: [Google]
1486428981152.jpg
111KB, 420x550px
>>60379730
This
>>
>>60380162
It's horseshit though.
>>
What do you guys enjoy programming the most?
>>
>>60380209
>inb5 fizbuz
>>
>>60380135
>because it's obviously a response to "war games suck though"
In what way?
>even more obvious
How? It should be pretty easy to explain if it's so obvious, yet you for some reason can't.
>This implies previous participation in the conversation
Not in any English-speaking culture I know of. Maybe in your lost cause of a country it implies something.
>It was a joke, you see.
Ah, so you were only pretending to be retarded.
>The implication is scientifically inaccurate.
It is entirely accurate. I have actually studied your kind pretty thoroughly and I have concluded that there is simply no way you belong to the same species as the rest of us. We could meet somewhere and I could show you my research. But only under the condition that it will be in some neutral land which hasn't been infested by your kind yet.
>>
File: 1494260773491.jpg (48KB, 410x416px) Image search: [Google]
1494260773491.jpg
48KB, 410x416px
>>60380209
Currency converter
>>
>>60380247
kek
>>
>>60380233
>In what way?
It's a response to something in the post referred to by his. This much was made evident by his use of the >> syntax to refer to it. His post was also a sentence about killing. The only thing remotely related to killing in the post to which that sentence was intended as a response was "war games suck though." Therefore, it was a response to "war games suck though."
>How? It should be pretty easy to explain if it's so obvious, yet you for some reason can't.
He claimed that killing is the ultimate expression of humanity. Humanity is generally a trait held in high regard. An expression of it would therefore be desirable. His claim therefore entails that killing is desirable.
>Not in any English-speaking culture I know of. Maybe in your lost cause of a country it implies something.
It's not a matter of language. Such a response would carry the implication I claim it carries in any dialect of English, as well as Spanish, German, or Chinese.
>Ah, so you were only pretending to be retarded.
Clearly we don't share the same sense of humor.
>It is entirely accurate. I have actually studied your kind pretty thoroughly and I have concluded that there is simply no way you belong to the same species as the rest of us. We could meet somewhere and I could show you my research. But only under the condition that it will be in some neutral land which hasn't been infested by your kind yet.
You're talking out your ass. No, wait--this is worse than talking out your ass. You're writing absurdist science fiction. I'm not interested in your research, because it doesn't exist, and is part of a silly children's game you've invented in a desperate ploy to win this ridiculous excuse for a debate, and I'm in no mood for games.
>>
>>60376868
"1_based_string" is not even a valid identifier as it starts with a digit.
>>
>>60377035
Yes, and n should be '\n'. I fucked up formatting when I uploaded it. Sorry.
>>
>>60373589
>Anime
Hi.
Go to hell.
>>
>>60380328
>to which that sentence was intended as a response
But this is wrong. If it's not, then it should be easy to demonstrate. Yet you failed miserably at such a "simple" (according to you) task.
>Humanity is generally a trait held in high regard.
Can you link me to the post where he said he holds humanity in a high regard?
>An expression of it would therefore be desirable.
Only assuming he actually holds it in high regard. Which you can't possibly show.
>His claim therefore entails that killing is desirable.
Even if he somehow thinks it's desirable, his statement isn't an endorsement of it.

>It's not a matter of language.
Yes, I was wrong. It's a matter of species.
>Clearly we don't share the same sense of humor.
Indeed. I don't find saying blatantly wrong things to be funny. You seem to though.
>I'm not interested in your research
So you're not interested in the truth about yourself? That's nothing surprising.
>because it doesn't exist
It does. I could show it to you if you agree to meet me in a country which isn't entirely ran by the world police.
>I'm in no mood for games.
You seem to be, since you basically deny your own identity. How is that not a game?
>>
File: pp.png (72KB, 1366x768px) Image search: [Google]
pp.png
72KB, 1366x768px
Writing initialization firmware + bootloader for my OS on ARM64. It's an escape from all the wordpress and JS shit I had to do this week for money
>>
>>60373868
>Today I learned Rust has a pseudo-goto in the form of break label. You can add a label to a loop to allow break to exit out of an inner loop.
Jesus Christ you've JUST learned this? break has been a thing since c++
>>
>>60380399
Go fuck yourself with this made up fairyland shit and stop wasting my time.
>>
NEW THREAD!!

>>60380424
>>60380424
>>
>>60380420
I didn't expect a coherent answer from you anyway. It's not like you're even physically capable of delivering one.
>>
>>60380447
On the contrary, that statement is more applicable to yourself. The sort of reduction of semantics to first principles you constantly demand is beyond the scope of any discussion worth having, and of no interest to anyone who can read. It's like talking to a brick wall. I'll have no more of it.
>>
>>60380521
>that statement is more applicable to yourself.
Since I'm human there is nothing stopping me from being able to in principle construct a coherent response to any of your retardation. You on the other hand have a severe handicap, so I'm not expecting much here.
>The sort of reduction of semantics to first principles
Also known as actually referring to things that happened and not your retarded and misguided interpretation of them.
>It's like talking to a brick wall
I highly doubt a brick wall can offer you insights into your own nature. That would be pretty helpful, since currently you just outright deny reality.
Thread posts: 318
Thread images: 53


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