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

/dpt/ - Daily Programming Thread

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

Thread replies: 327
Thread images: 25

File: prog.jpg (105KB, 473x496px) Image search: [Google]
prog.jpg
105KB, 473x496px
Old thread: >>61300449

What are you working on, /g/?
>>
File: comments.png (14KB, 555x126px) Image search: [Google]
comments.png
14KB, 555x126px
>very few comments in the winapi headers
>it's shit like this
>>
I just finished writing a fizzbuzz program in pure machine code using only a hex editor.
>>
>>61306066
I just finished in your mom LOL
>>
>>61306014
I want to quickly evaluate if it has a shit api or not quickly so I just write some pretend user-code that does what I want and then try to fit it to the library. If it doesn't fit with reasonably little effort it's a shit library. At least the API side of it. Most of the time that's enough to deter me.
Of course there's libraries I'm forced to work with and then it turns into a question of if I wrap it or if i just deal with the horrible API for others convenience.
>>61306058
Go to MSDN.
>>
>>61306058
when you are told to comment your code so you point out the obivious
>>
>>61306028
anime is trash for pedos
>>
>>61306066
What machine?
>>
>>61306086
>Go to MSDN.
Wasn't complaining for the lack of documentation, I'm just rewriting the headers. Just pointing out the silliness
>>
>>61306100
>2017
>not being a pedo
get some tastes bro
>>61306028
I am working on a multiplayer blackjack game using bitcoins
>>
>>61306105
Ok.
>>
>>61305999
You get over it.
Depression is literally just narcissism. They're both pathological self obsession and cause exactly the same kind of psychological agony, the only difference is your fixation is negative.
You want to feel better? The first step is to man up and stop making everything about how bad you feel.
>>
>>61306127
>Depression is literally just narcissism. They're both pathological self obsession and cause exactly the same kind of psychological agony, the only difference is your fixation is negative.
>You want to feel better? The first step is to man up and stop making everything about how bad you feel.
its so easy to spot those with aspergers / alexythmia
>>
>>61306127
>have you tried not being unhappy?
what a flaming homo
>>
>>61306147
>>61306161
It's true though, it's impossible to be depressed if you have the discipline to simply will your thoughts not to constantly revolve around how depressed you are.
>>
>>61306127
So all those doctors and medicine are just a massive conspiracy to siphon money from narcissists?
>>
post code faggots
>>
>>61306201
In my country, when "massive conspiracies to siphon money" are actually helpful, but can still be considered conspiracies because they're not actually necessary, we call them "luxuries."
>>
>>61306127
>Depression is literally just narcissism. They're both pathological self obsession and cause exactly the same kind of psychological agony, the only difference is your fixation is negative.
I used to think this way until I realized depressed people sometimes kill themselves. A narcissist would never do that.
>>
>>61306197
>it's impossible to be depressed if you [...] will your thoughts not to revolve around how depressed you are
>it's impossible to be depressed if you aren't showing the symptoms of depression
What a shocking conclusion!
>>
anizb anon, is your site dead for good? i miss it already
>>
>>61306197
most depressed people try to escape from the thought of their depression with distractions and yet still hurt, im starting to think you just dont understand how people work
>>
>>61306259
This.
Basically anon here thinks she has been depressed and she just had the discipline to get out of a moody situation.
>>
>>61306275
>most depressed people try to escape from the thought of their depression with distractions and yet still hurt
That's because they lack the willpower to keep their thoughts away from how self-obsessed they are.
>inb4 that's what depression is
It's not. Lack of willpower is not an illness, it's a personal weakness and a good reason to do the rest of humanity the courtesy of removing yourself from the gene pool.
>>
>>61306058

Why exactly are you looking through winapi?
>>
const int or enum?
>>
>>61306297
>That's because they lack the willpower to keep their thoughts away from how self-obsessed they are.
yeah, you obviously have lacking mind theory, a common symptom of autism. hope you get better soon buddy
>>
>>61306279
Actually I still am depressed.
The other messages were my mental depression demon taking the wheel.
You know how sometimes when you have a mental illness you get the little voice that's like "yoooooou suuuuuuuuuck blegh blegh blegh bleh heh heh blorch"
>>
>>61306337
>Actually I still am depressed.
So you haven't even cured yourself?
Just shut up.
>little voice
Most depressed people don't describe having MPD/schitzo issues. Stop pretending you're depressed.
>>
>>61306310
see >>61306105
>>
>>61306378

Oh, I see.
>>
>>61306315
if a enum could serve you why use const int?
>>
>>61306376
attacking depressed people doesnt work well in hiding how miserable you are yourself my man
>>
>>61306390
because when making wrappers to C libraries most languages have fucking retarded way of declaring enums but you can pretty easily use variables and especially ints.
>>
>>61306376
>So you haven't even cured yourself?
Of course I haven't. How could I with an attitude like this? >>61306297 >>61306231 >>61306197 >>61306127
I'm also this guy: >>61305999
>Most depressed people don't describe having MPD/schitzo issues. Stop pretending you're depressed.
But muh psychiatrist
>>
Why do people say you should never goto inside a block? Used judiciously, it can make you repeat code less.

int main(unsigned argc, const char* const argv) {
unsigned i = 1;

if( argc == 1 )
goto once;

for( ; i < argc ; i++ ) {
if( freopen(argv[i], "r", stdin) == NULL )
error("Could not open %s", argv[i]);
once: /* loop will stop at next iteration, since argc = 1 and so is i */
parse();
}

return 0;
}
>>
>>61306429
what a pile of garbage
>>
>>61306429
theres break and continue for that
>>
>>61306443
dumb java poster.
>>
Should enums be named as plurals or singulars?
i.e. enum FooFlag{}; FooFlag flag; or enum FooFlags{}; FooFlags flag;
>>
>>61306429
Well, for one thing, because then you have to do this shit:
>/* loop will stop at next iteration, since argc = 1 and so is i */
>>
>>61306447
>java
not him but I use breaks and continues in C and don't even use Java so I have no idea what you're talking about
>>
>>61306447
dumb high level language poster
learn assembly then see why goto is bad my noob
>>
File: 563BE1B9.jpg (225KB, 2378x1783px) Image search: [Google]
563BE1B9.jpg
225KB, 2378x1783px
post your programming environment
>>
>>61306485
you need goto's in assembly because there's no loops...
>>
>he needs more than (, ), and # for syntax
>>
>>61306415
>Of course I haven't.
Then why are you giving advice counter to the professional advice you've been given?
>>61306394
I'm not hiding that. I have been diagnosed MDD.
>>
>>61306497
think about it in the context of C code my little brainlet.
>>
>>61306504
>his language doesn't define compilation for 3D text arrays
Animefags need to stop.
>>
File: my battlestation.jpg (191KB, 1920x1080px) Image search: [Google]
my battlestation.jpg
191KB, 1920x1080px
>>61306492
>>
>>61306504
>his language's syntax is more than spaces
>>
>>61306521
nobody would program whole project in C, it's only used to make common codebase that you can use any language on.
>>
>>61306497
You actually don't need goto in assembly.
You can just always use call.
If you need a loop, you can do it recursively.
For TCO, you can pop the stack before the call.
>>
File: me.jpg (29KB, 500x333px) Image search: [Google]
me.jpg
29KB, 500x333px
>>61306492
pic related
>>
>>61306550
kek
>>
>>61306513
>Then why are you giving advice counter to the professional advice you've been given?
I am the guy I was giving advice to. I was samefagging.
>>
>>61306550
>dude just like use recursion in assembly bro!
you have never done recursion in assembly and I doubt that you have ever written any assembly language.
>>
>>61306568
>I was samefagging.
This doesn't change anything.
>>
File: also me.jpg (61KB, 800x800px) Image search: [Google]
also me.jpg
61KB, 800x800px
>>61306492
see picture
>>
I like the p convetion for predicates in CL, but sometimes, you need to add a dash, otherwise it will look akward, this is why I like ? for predicates also.
>>
File: me too btw.jpg (98KB, 640x640px) Image search: [Google]
me too btw.jpg
98KB, 640x640px
>>61306492
old pic
>>
>>61306529
???
What are 3d-text arrays?
>>61306540
go away, esoteric fag
>>
File: 563BE1B9.jpg (274KB, 1920x1280px) Image search: [Google]
563BE1B9.jpg
274KB, 1920x1280px
>>61306492
>>
>>61306577
When the bad voice says stupid things, they have to come out, because if they stay in, I become a lump.
The fact that they're stupid is irrelevant to this.
>>
>>61306492
>tranny
>>
>>61306576
>and I doubt that you have ever written any assembly language.
You're right I've never invented a unique processor architecture so very sorry
>>
>>61306610
>Lisp fags think their language is minimal
>>
>>61306644
you're saying like that's a bad thing
>>
I want to get back to Javascript. I did the codecademy course eons ago and did some personal dicking around but never dived as deep as I wanted to.
Book recommendations, anything?
>>
File: zoz.png (1MB, 1920x1080px) Image search: [Google]
zoz.png
1MB, 1920x1080px
>>61306492
>>
>>61306663
its bad and you must be punished for being such a degenerate faggot anon
>>
>>61306671
there is nothing gay about a feminine penis
>>
>>61306666
mozilla javascript guide + es6 features page
>>
>>61306660
It is minimal if you hand-roll a mechanical compiler that plugs in as a USB device and compiles to a breadboard instead of to a program on the disk.
>>
>>61306682
it'll be gay when i pull your panties apart and rape your pucci
>>
>>61306671
oh pls """"punish"""" me for being trans sempai
>>
>>61306658
>Just another way JS pretends there are primitives.
They look like primitives, act like primitives and are identified in the spec as primitives as opposed to objects.

How are they not primitives?
>>
>>61306660
It's not, its kitchen sing for me.
>>
>lisp fags don't even have empty lists
>
(atom nil) => t

lmao
>>
>>61306711
who cares
it's shit
>>
>>61306709
i'll make you choke till you pass out.
>>
File: debunked.png (253KB, 1920x1080px) Image search: [Google]
debunked.png
253KB, 1920x1080px
>>61306729
Debunked.
>>
>>61306729
atom is everything but list with values.
There is empty list
'()
which is equal to nil
>>
>>61306610
>What are 3d-text arrays?
Imagine a page of normal text. It's 2D, every character has an X and a Y position and every character can be determined to be left/right and above/below another arbitrary character.

Languages like C are 1D, they don't consider whitespace important in most cases and newlines can be omitted completely excluding the preprocessor.
Python is 2D, it has whitespace play a significant role through indentation.
A 3D language would have you define statements in 3D space. Allowing you to fit more of your code on your screen (which is a 3D->2D projection).
But if you have a 2D or 1D language and try to do this it's rather pointless.

And naturally you can store n dimensional text as a flat array, this is now about the storage.
>>
>>61306711
By having methods and constructors. And I really don't care if JS is that retarded to leak out implementation details in the typeof operator, which is just one way it is broken and one of JS broken operators.
>>
>>61306753
>
(consp nil) => nil
>>
>>61306771
>leak out implementation details
There's literally nothing wrong with this
I don't even like javascript
>>
>>61306778
The original claim was:
>lisp fags don't even have empty lists
Not:
>lisp fags don't even have empty pairs
>>
>>61306753
list aren't real in lisp, they're an illusion
just cause you have a function like so
(defun listp (x)
(or (consp x)
(eq x nil)))

doesn't mean the empty list exists
there is no such thing as an empty list
>>
>>61306801
Wrong. Types in Lisp and similar languages are just predicates. The function listp is a type. A datum x is a list if and only if (listp x) => T. And that's not an invariant to which listp must adhere, that's the actual definition of a list (that is, the "is-a" relationship goes the other way).
>>
>>61306754
That's just syntactic sugar.
>>
>>61306787
>There's literally nothing wrong with this
There is, and it's the reason nim is crap, PHP is crippled, git is semi-functional garbage and the old UNIX folks should have done the way of Uriel and debugged themselves before creating their OS.

If I wanted to program in a scripting language in which I must know the implementation I'd program the interpreter myself.
>>
>>61306837
If you don't want to have to know the implementation just don't use the leaked implementation details
>>
>>61306771
>By having constructors.
We established that the constructor Boolean returns a different value than a boolean literal. Not only does it work differently with the typeof operator but it works differently as a conditional (new Boolean(false) weakly equals true)

Can you find any source that states that Javascript doesn't have primitives? Because I've shown you the spec itself, and the spec says that it has primitives which aren't objects.
>>
>>61306851
>Not only does it work differently with the typeof operator but it works differently as a conditional (new Boolean(false) weakly equals true)
Wow that's horrible.
Prove it to me?
Can hardly believe it.
>>
>>61306825
That doesn't mean an empty list is real.
That's just a construct which is useful for things such as method overloading.
>>
I'm working on an automated testing framework. It's java based.

> Hello I'm pajeet
>>
>>61306871
var prim = false;
var obj = new Boolean(false);
if (prim) {
alert('primitive false is true');
} else {
alert('primitive false is false');
}
if (obj) {
alert('boxed false is true');
} else {
alert('boxed false is false');
}
alert('typeof prim: ' + typeof prim);
alert('typeof obj: ' + typeof obj);
>>
File: 1458320371534.png (546KB, 612x688px) Image search: [Google]
1458320371534.png
546KB, 612x688px
How do I do slope collision in a 2D platform game with tiles?

How I understand it, is that I need to define the type of tile, so that if tile whatever is equal to 1, its a solid square, 2 is an ascending slope at 45 degrees, 3 is a descending slope at 45 degrees, etc.

My problem is is that I have been unable to come up with a good formula for moving alongside the slope.

I calculate which tiles to check, only those around the entity.

for ( cy=top_t; cy<=bot_t; cy++ ) 
{
for ( cx=lft_t; cx<rgt_t; cx++ )
...etc


Collision with fully solid tiles is fine, but when I get to sloped tiles I begin to have a problem. I've only worked on the ascending tile so far:

int x = cx*til_w; 
int y = (cy+1)*til_h;

int x1 = (int)ent->hb.box.x + (int)ent->hb.box.w;
int y1 = (cy+1)*til_h - (til_w-(x1%til_w)) - ent->hb.box.h - 1;

ent->pos[1] = y1;


til_w and til_h are both the same value, 16 (in this case). Is there any formulas that are optimized and efficient, "be all, end all" to slopes in a 2D platformer?
>>
>>61306897
>That doesn't mean an empty list is real.
Yes it does. An empty list is real as in really a list. Because a list is just any datum for which listp returns true, and listp returns true for the empty list. There is no "really a list" beyond whether or not listp returns true. There's "really a pair," which is decided by whether or not consp returns true. But there's no rule stating that all lists are pairs.
>>
>>61306846
>just don't use the leaked implementation details
In PHP that's impossible, though.
In git that is impossible once you have to revert to something.

>>61306851
Actually, I'm not >>61306871 but show me the second part and consider me convinced.
>>
Working on a browser made from scratch in Go.
>>
I just found out why calloc has it's arguments the way it does
Took some time though
>>
>>61306969

>>61306914
Fair enough. JS should have a flat array comparison built in, tho.
>>
>>61306921

The math way of doing it would be to approximate a vector describing the 1D surface of the floor underneath the entity and mutatively project the entity's velocity vector onto the surface vector. I've done it this way before and it tends to work pretty well.

If you're unfamiliar with vector projection, here's how it works. You know how if you have a vector v, you can split it into its x and y components? But those are really just its components along the x and y axes.

Suppose you have another vector u. The vector projection of v onto u is then v's component along the u axis.

https://en.wikipedia.org/wiki/Vector_projection
>>
>>61306921
a LOT of rotation and checking if coordinates are bigger than another
>>
>>61306924
I guess I'm thinking about the structure.
To me, a list is nothing but a chain of cons, and it must end so nil is the convention in Lisp, null in C.
>>
>>61307000
>tfw the app goes in a GC cycle while im fapping to 2d tranny porn
reeeeeeeeeeeeeeee
>>
>>61307032
>GC cycle
sub-millisecond
>>
>>61307031
It's true that nil is not a real link node in a recursive chain of pairs. That is to say, it's not a real pair.
But it's still a real list.
>>
>>61307050
>sub-millisecond
Guaranteed?
>>
>>61307000
how far have you gotten, Rob?
>>
I want to learn about threading but the only language I semi-know is Lisp.
Is there a "threads for the beginner" but with lisp, book
>>
>>61307055
yes
>>
>>61307081
I can't seem to find any garauntees.
>>
In Unix, is it good style to delete any tmp files that a program uses?
>>
>>61306921
>>61307016
>a vector describing the 1D surface
I should clarify, by "describing," I mean tangential to. For example, if you had a big ol' tile or solid entity that was perfectly round, or whose surface was otherwise differentiable, and your character entity was standing on it, you'd want to project the character's velocity vector onto the surface's tangent line at the point of contact.
>>
>>61307079
Everyone seems to use Bordeaux Threads. What problem are you working on, that you feel concurrency is the best solution?
>>
>>61307081
At an immense cost of throughput.
>>
>>61307101
not my problem
>>61307144
don't be retarded
>>
>>61307151
It's true though.
>>
>don't be retarded
>>61307164
>It's true though.
wew
>>
>>61307125
My application will have a feature to fetch images in the background, I don't want the user to wait for it to be downloaded, specially if they have a slow connection.
>>
>>61307107
No don't give a fuck. The tmp partition will be cleared on next reboot or when space is needed.
>>
>>61307151
>not my problem
The spec doesn't define the GC at all it seems:
https://golang.org/ref/spec
Who can take this language seriously?
>>
Is Clojure(script) dying?
No commits to the main repository since may, many libraries are unmaintained, Hickey didn't do any cool presentations this year.
>>
>>61307193
>wew
>>
>>61307210
>doesn't define the GC at all
because it's so fast, it's not even worth mentioning
>>
>>61306028
On a terminal, what's the difference between:
$ a.out


and
$ ./a.out


And why does the first one not work?
>>
>>61306492
/college/
>>
>If I free some random "unused" pointer my whole shit falls apart
Seriously what de fugg
>>
>>61307238
the first means to search for an executable names a.out in PATH
the second, is an explicit path (something begining with / or ./ or ../) so the file is explicitly used
>>
>>61307238
If you don't specify the path to the executable, it will try to find it under the directories in the $PATH environment variable. The current directory of . is not typically not listed in $PATH, so you must specify the path manually.
>>
>>61307230
If it's not guaranteed to have a latency of max <1ms (which frankly leaves much to be desired at the worst cases) then why can you rely on it being so? You simply can't do that without making a big mistake.
>>
>>61306197
just stop being sad lmao
>>
>>61307197
https://github.com/orthecreedence/cl-async
this looks pretty good. you don't need a full multi-threading library, just a library with simple async operations.

>>61307209
Thank you

>>61307249
>random "unused" pointer
Why would you have these? If you didn't allocate it, don't free it.
>>
>>61307238
because if you do not specify a directory (./ means current dir) bash will look in you path, which usually points to /usr/bin in which a.out is not present. So you add ./ to tell bash that it should look for the given file in the current dir
>>
>>61307230
Go's GC is not fast, it is low latency.
>>
>>61307265
I don't do mistakes
>>
it is really cool and progressive that linux has a built-in tempura directory (/tmp) where i can queue beautiful #aesthetic pictures of tempura i order from restaurants before i binge -upload them to instagram

i only wish the recycle bin (/bin) worked right though

#justhackerthings #hackerlyfe
>>
>>61307284
Liar.
>>
>>61307275
free(rand()); // unused
>>
File: Liskaface.png (138KB, 398x340px) Image search: [Google]
Liskaface.png
138KB, 398x340px
>>61307261
>>61307262
Oh, gotcha.
Thanks!
>>
>>61307016
>>61307121

thanks

Is vector projection like this?

tile = ( cy * map->Width ) + cx; 


I am a little lost by this though, do you know of any resources I can look at that have bits of code or formulas I can play with?
>>
>>61307275
>>61307249
Okay I figured it out fucking strtok
The pointer was used but after strtok I thought I didnt need it
Should read the manual more accurately I guess
>>
>>61307249
Write your own allocator. It's wiser.
You can define it to simple not do anything if you give it a pointer it hasn't allocated. Or log it with the line and file of the calling site.
>>
So, looking at Go
var d = math.Sin(0.5)  // d is float64
var i = 42 // i is int
var t, ok = x.(T) // t is T, ok is bool
var n = nil // illegal

Why this onerous syntax for declarations? Why not just do
d =) math.Sin(0.5)  // d is float64
i =) 42 // i is int
t, ok =) x.(T) // t is T, ok is bool
n =) nil // illegal

or something similar?
>>
>>61307384
Doesn't Go use := for declarations with inference?
>>
>>61307384
why is setting variable to nil illegal?
null is considered benefial.
>>
>>61307384
>Those smileys
M E M E L A N G
>>
>>61307402
What type do you infer from nil?
null is a mistake btw
>>
>>61307384
Otherwise, assignments and declarations would be indiscernible.
>>
>>61307398
I hadn't seen that:
>Inside a function, the := short assignment statement can be used in place of a var declaration with implicit type.
But yes.
>>61307422
https://tour.golang.org/basics/10
>>
>>61307429
Don't ever fucking quote me with a link to that language again, idiot.
>>
>>61306028
I didn't know much more detail about database programming than basic selects. Recently started learning about pgsql. I didn't really know what all you could do, it looks really cool.
>>
>>61307440
I didn't quote you at all.
Moron.
>>
>>61307417
>null is a mistake
null is the best thing ever, dumb go poster.
>>
>>61307461
Go has nil, which is the same thing. Reference types being implicitly nullable is a mistake.
>>
THANK YOU OP for not using a filthy shitskin thread pic
>>
>>61307480
Holy Shit go is bad.
>>
File: Screenshot_20170710-114443.jpg (13KB, 422x239px) Image search: [Google]
Screenshot_20170710-114443.jpg
13KB, 422x239px
>>61307329
See attached formula.

In this case, a is the entity's old velocity, a1 is the entity's new (desired) velocity, and b is the tangent line of the floor at the point of contact.

Putting it in terms of the entity's x and y speed, and assuming an ascending right-triangular slope with known width and height, here's how it would look in pseudocode:
slope_length_squared = slope_width*slope_width + slope_height*slope_height;
dot_product = entity.xspeed*slope_width + entity.yspeed*slope_height
entity.xspeed = slope_width*dot_product/slope_length_squared
entity.yspeed = slope_height*dot_product/slope_length_squared
>>
>>61307482
This is a false flag.
>>
>>61307151
>don't be retarded
I'm not. Any form of garbage collection can either have good throughput or good latency or be mediocre at both.
>>
>>61307532
you are rust programmer
>>
>>61307289
>
>>
>>61307550
>Any form of garbage collection can either
false
>>
>>61306028
pic reminds me of alfred's playhouse
>>
>>61307550
literally just don't use dynamic allocation
then your gc has good everything
>>
>>61307591
>don't use the GC
>then it's good
True.
>>
>>61307591
if you don't use dynamic allocation you don't need gc, dumb GC poster.
>>
>>61307608
but you do nigga
>>
compile time garbage collection is
>>
>>61307618
They call that escape analysis, friendo.
>>
>remove what causes seg fault
>still get seg fault
DEAD ON THE INSIDE
>>
Native libraries with C interface or just JVM for cross language library?
>>
>>61307643
>JVM
>cross language
bwahahahahahahaha
>>
File: 1499566161974.jpg (2MB, 2000x1429px) Image search: [Google]
1499566161974.jpg
2MB, 2000x1429px
>>61307634
>not using a debugger
>writing fault code in the first place

plebs out
>>
>>61307634
use valgrind
>>
File: 3.6M helloworld.png (39KB, 313x254px) Image search: [Google]
3.6M helloworld.png
39KB, 313x254px
What the fuck?
>>
>>61307670
the power of sjws
>>
>>61307652
There's quite many languages that can compile to jvm and use .class files easily.
>>
>>61307679
yeah, java 6, java 7, java 8, plenty
>>
>>61307643
Native library with C interface is always best. If you use a tool like Swig, you can procedurally generate your bindings for other languages.
>>
>>61307694
clojure, scheme, common lisp, scala, ceylon, kotlin, python, ruby, ada to name few...
>>
>>61307670
>static linking, not even once
>>
making a world4ch archive since there is none
>>
>>61307721
>needing to dynamically link for hello world
>>
>>61307670
rustc 1.16 on Windows gives a 115kb Hello World binary, which does compare favorably to G++.
>>
What is the source for OP's pic, please?
>>
>>61307720
>let me just prove my mental illness
>>
>>61307742
>windows
NOT POSIX COMPLIANT
>>
>>61307742
>Windows
>>
It is possible to write safe portable code without the overhead of safety checks but only if you are very smart like me
>>
>>61307763
https://en.wikipedia.org/wiki/List_of_JVM_languages
You clearly have mistaken java for jvm. I have make program using 3 different languages quite easily by compiling to java bytecode.
>>
>>61307785
>I have make program
ask me how I know where your designation
>>
Is there any reason to use malloc() instead of new in C++?
>>
File: MoonHuntingBearS.jpg (141KB, 700x700px) Image search: [Google]
MoonHuntingBearS.jpg
141KB, 700x700px
>Got half a point deducted because I used 0 instead of '/0'
>>
>>61307765
>POSIX
not portable
>>
>>61307800
there's no reason to use C++
>>
>>61307800
If you want to allocate without initialization.
>>
>>61307799
>ask me how I know where your designation
With grammar like that, same to you buddy
>>
>>61307800
malloc is gimped because C++ lacks implicit casts from void*
>>
>>61307801
lies, you used 0 instead of '\0'
>>
>>61307800
There's rarely a reason to use new, you should do stack allocation for almost everything.
>>
>>61307809
not posix compliant operating system can not even be considered operating systems.
Windows is pile of shit.
>>
>>61307801
>/0
>>
>>61307827
>triggered
every tiem! ;)
>>
>>61306115
that sounds fucking cool
>>
>>61307801
lol but '\0' is equal to 0.
>>
>>61307833
this
stack allocation covers 80% of cases and unique_ptr solves another 15%
>>
>>61307838
>>61307831
This is exactly why I didnt use it
Way too error prone

>>61307847
Muh bad style
>>
>>61307841
>tiem
with spelling like that, same to you buddy
>>
>>61307835
if your code doesn't build with -ffreestanding, it's shit
>>
>>61307861
>error prone
Not really, '/0' wouldn't even compile
>>
>the size of his binaries isn't < 1 KB
nice bloated shitware
>>
>>61307861
>programming is error prone
stick to css m80
>>
>>61307874
microcuck pls..
>>
>>61307906
but I cucked you tho ;)
>>
>>61307861
>remembering the difference between \ and /
>error prone
>>
>>61307874
What does that options change? All my programs still compile with it.
>>
>>61306028
kys animefag
>>
>>61307896
>I never make mistakes
How's that FizzBuzz coming along?

>>61307888
So you're wasting time and have to recompile
>>
File: fibonacci.png (28KB, 1096x724px) Image search: [Google]
fibonacci.png
28KB, 1096x724px
C is dead.
>>
>>61307942
>So you're wasting time and have to recompile
Only if you're dumb enough to forget how escape sequences work
>>
>>61307939
kys muslimfag
>>
>>61307962
lol
>>
>>61307968
Just admit youre wrong you annoying brat
>>
>>61307982
t. brainlet
>>
>>61307982
You're a fucking retard if you don't understand escape sequences, and I hope you get violently sexually assaulted.
>>
>>61307982
calm your flexbox lad
>>
>>61307986
>>61307987
Well sorry I don't remeber useless shit and instead actually program
>>
>>61307765
Good. POSIX a shit.
>>61307733
This. Dynamically linking should be a tool for plugins and plugins only.

>>61307569
false

>>61307629
this
>>
>>61308008
>instead actually program
you sure program when you don't even know syntax
>>
>>61307987
not him but as someone who has been raped fuck you that shit ruins your whole life
>>
>>61308008
>I don't remember how to program and instead actually program
Just stop, you don't do anything. You're a student, and you haven't even learned escape sequences. Accept that you're a student, and you've got
>>
File: 1496153414694.gif (586KB, 1119x884px) Image search: [Google]
1496153414694.gif
586KB, 1119x884px
say i want to have assert within a widely used templated function.

how do i make the assert print the location of its instantiation? and why the fuck is it pointing me to declaration even? it's a shitty fucking template, it doesn't exist before instantiation.

how the fuck are templates actually worse than macros?
>>
>>61308010
libc is a plugin
>>
>>61307962
Makes sense.
JIT compilers can beat AOT compilers in such trivial numeric benchmarks.
>>
>>61308019
>>61308032
If you think that's important then that says everything about you
>>
>>61308046
>I program
>knowing how to program is not important tho
wew
>>
>>61308008
>I don't remember how to program and instead actually program
Just stop, you don't do anything. You're a student, and you haven't even learned escape sequences. Accept that you're a student, and you've got a lot to learn, and continue learning. You're not particularly clever, and you're not particularly creative, and nobody else is fooled into thinking so.
>>
>>61308032
>Accept that you're a student, and you've got
Despite the constant negative press covfefe
>>
>>61308008
>escape sequences
>useless shit
wew lad
>>
>>61307801
>Got half a point deducted because I used 0 instead of '\0'
I'd file an official complaint. This shit shouldn't fly.
>>
>>61308036
>muh OS is a plugin
No.
>>
>>61308065
I said no such thing
>>
>>61308027
turn off the computer buddy
>>
>>61308065
>libc is an OS
No.
>>
Why is it so easy to bait on /dpt/
Freshmen sure think they know a lot
>>
>>61308072
>muh OS wrapper is a plugin
>No.
fixed
>>
>>61308065
of course, that's how I can program on my OS and you can run the program on yours
>>
>>61308058
>>61308032
Whoops lol actual post is >>61308057

>>61308082
>people who don't know much think they know a lot
This is not news

>>61308085
>libc
>OS wrapper
???
>>
File: img_021.png (132KB, 257x233px) Image search: [Google]
img_021.png
132KB, 257x233px
>>61307987
>I hope you get violently sexually assaulted.
I won't press charges.
>>
>>61307670
I wouldn't know how to make a helloworld weigh 3.6M in assembly even with static linking, but the rust compiler did it.
This must be the world's most advanced hello world program. It doesn't simply emit "hello world". It actually considers itself and the world, becomes sentient and reaches out in enlightment: "Hello world!", all before the last 0.000001M, the final ret, and dying.
>>
>>61308102
y...you too
>>
>>61308076
Why?
Because I can't be a Kool Kid and laugh at all the hi-LA-rious rape jokes?
It wasn't even my fault. I never asked for it. It's a lie! He was lying! It's BULLSHIT!
>>
>>61306197
>if you have the discipline to simply will your thoughts
Thoughts don't create emotions retard. Emotions create thoughts.

If you want to influence your thoughts you have to influence your emotions. Hit your macros and micros with a good diet, 8 hrs min of sleep each night, exercises, sunlight everyday, no fap, etc etc
>>
>>61308102
you can, by the time they come i'll be done with you anyways
>>
>>61308141
If you're upset by words on the internet, you should spend less time on the internet
>>
>>61308090
>>61308095

The standard library shouldn't actually exist in binary form. the compiler should replace it with the adresses of OS specific calls directly.

Apart from that, every other library that only depends on the standard library and other retarded crap like opengl headers should be linked statically for maximal dead code elimination and global optimization.
>>
>>61308170
>strlen should be a system call
why?
>>
What is the language to learn for desktop and mobile platform programming?
java is not because the project that compiles to IOS is discontinued.
Ocaml might be but it doesn't support natives threads so I don't you can even count it as programming language.
Sepples is just too ugly.
I'm skeptical about Apple languages supporting windows.
C is just too arcane.
>>
>>61308141
You seem like you'd appreciate this web series.
https://youtu.be/_CxHATXa_j0
>>
>>61308184
I think he talks about all the stuff you couldnt do yourself
Strlen qould have to be implemented by yourself
>>
>>61308188
Java for Android/Deskt
>>
>>61308184
*the parts of the standard library that aren't directly implemented with OS functions.
>>
>>61308188
Objective-C/Swift for iOS
>>
>>61308188
Unironically C#
>>
>>61308188
>Ocaml might be but it doesn't support natives threads so I don't you can even count it as programming language.
>impliying you're skilled enough to do multithread
>>
>>61308188
codenameone is discontinued?
>>
>>61308201
this
>>
>>61308188
GO
O
>>
>>61308188
html, css, javascript, php, mysql, and bash
together, not as separate suggestions
>>
File: 1452096874920.png (112KB, 359x393px) Image search: [Google]
1452096874920.png
112KB, 359x393px
A-Anon.., w-what Editor are you using?..!?
>>
>>61308263
Emacs+Spaccemacs
>>
>>61308170
>opengl
>should be linked statically
>sorry, this application requires an amd card, wasn't linked with the nvidia opengl
>>
>>61308263
vstudio for c++ and c hash
vim for everything else
>>
>>61308149
Both affect each other retard. Surrounding yourself in poisonous thoughts will affect your psyche. You have an excessively rigid view of the human mind. It's an analogue machine that's constantly reprogramming itself. If you think that drowning yourself in negative thoughts, no matter how valid may be, isn't making you predisposed to negativity, think agian.
>>
>>61308195
not her but
what

the FUCK
>>
>>61306584
behead those who insult carly
>>
>>61308277
>spacemacs
ewww
>>
>>61308233
robowm

>>61308223
microshit

>>61308215
>>61308205
not cross platform enough.
>>
>>61308263
i'll edit your girly face with my jizz.
>>
>>61308319
not an argument
>>
>>61308263
Too many.
>>
When you apply for job do you always include cover letter?
Im want to send my cv to some companies but on their site all they ask is for is to send your cv on specified mail.

Should i just send message with cv.pdf attachment?
>>
>>61308223
Seconding this because you can hit 3 platforms (4 if you exert a little bit of effort) with ease.
>>
>>61308340
>>>/adv/
It's not like we know any better. We're all unemployed here.
>>
>>61308263
cringe as fuck
>>
>>61308170
God fuck now I have to compile everything: binaries are no longer offered because they have dead code for compatibility with multiple machines.

And if my computer bricks, I'm fucked because my compiler to compile a new operating system was on it.
>>
>>61308188
C#
sell out and get paid
>>
>>61308342
5+ soon, considering the 3.0 announcement.

https://blog.xamarin.com/glimpse-future-xamarin-forms-3-0/
>>
>>61308340
I always include that image of me on my back with my legs in the air, but instead of a dick entering me it's the company logo with a speech bubble beside me with the text "Whoa I'm becoming one with the team!!"
>>
>>61308366
fuck of Heljsberg nobody likes you.
>>
>>61308340
Last time I got a job I unironically shittalked their product and bullied their techlead (it was a startup kinda) simultaneously showing what I can do in just an hour on skype call desktop sharing. Was a bit drunk and apologized a month later but the job was mine
>>
>>61308379
fug das juicy
It's utterly underrated quite frankly. I'm still waiting for Fluent wave 2 that shit is going to be sweet on all platforms.
>>
>>61308379
Where is the catch with Xamarin? It seems too good to be true tbqh. Why is Swift still a thing if Xamarin exists?
>>
>>61308355
>multiple machines.
Something like that doesn't exist in my glorious vision.
>And if my computer bricks, I'm fucked because my compiler to compile a new operating system was on it.
Good, keeps you from shitposting.
>>
>>61308437
Xamarin is nice, but you have to still consider that you're developing for wildly different platforms.

Native is still the best way to go; Xamarin just lets you cut out some dev time, but your results are probably not going to be quite as perfect as native GUI.
>>
>>61308437
>he has never experienced the horror of coding for xamarin
>>
>>61308406
im talking about applying, dont know what to type in mail
>>
>>61308170
>global optimization
?
>>
>>61308468
I've never used Xamarin, please explain
>>
>>61308379
Was mostly talking about UWP not Xammy, but yeah even more platforms if you go that route.
>>
So my semi tech illiterate dad needs a .dll made from these code examples in a moldy fortran book he bought in 1997 for this project he has been writing in visual basic for 20 years.

He thinks I am smart and wants me to figure out how to do this.
I found the code snippets here http://www.boundary-element-method.com/acoustics/manual/abem.htm

I think I have all the files I need downloaded (AMBEM3_T, GEOM3D, INTEIG, H3LC, AMBEM3)
and installed gfortran, but I have no idea where to start writing a makefile in fortran to see what this stuff does.

I have no understanding of the math behind these programs either.
>>
>>61308458
>Native is still the best way to go
Performance-wise or..?

>>61308468
never used it, yeah. but I sorta like c# and thought about giving it a go
>>
>>61308295
>>61308295
Depression is a consequence of a chemical imbalance in the brain.

The thing is, humans are just animals, and while we like to think that we have deliberate, conscious control over our lives, the reality is that there are deep biological mechanisms at play in determining every aspect of our behavior and psychology. Rather than try to use pure force of will and positive thinking and other bullshit, I prefer to manipulate the deep biological mechanisms directly, via things like diet, sleep, exercise etc. No fap in particular is a deep, powerful biological level a man can use to shape his own life in a real way, rather than just talking or thinking about it.
>>
>>61308475
think of the usual "<greeting> I'm applying for <position>, I've attached my CV <closing comment> <regards>"
>>
>>61308514
lever*
>>
>>61308514
>No fap
Stopped reading right there

Regular furious masturbation, sometimes at work, raises my productivity and helps me cope with reality. What really, really helped me though is quitting smoking. Man, never felt better in every way
>>
>>61308504
>I have no understanding of the math
Should start here there are plenty of great online courses/videos to help you understand it. Doesn't even have to be a deep understanding but if like algebra confuses you, programming is ruff 4 u
>>
new thread
>>61308604
>>
>>61308195
WHY DID YOU LINK ME THIS
WHY WOULD YOU DO THIS
THIS IS AGONY
>>
File: fapping addiction.jpg (76KB, 1325x209px) Image search: [Google]
fapping addiction.jpg
76KB, 1325x209px
>>61308580
so you read everything but the last sentence, okay my dude

enjoy your mineral deficiency you tosser
>>
>>61308455
>Something like that doesn't exist in my glorious vision.
Amiga is NEVER EVER coming back.

NEVER EVER.

>>61308514
Ahh "science." "chemicals."

You realize that chemicals fluctuate based on your mood too? Your body makes different chemicals to dump in your body based on your current mood. That's why they're called neurotransmitters: they're an instrument of communication just as much as they bestow moods. It's not a one way street idiot.

You'll never be the machine you want to be. You attempt to reduce yourself down that level precisely because you want control. You'll never be able to control yourself solely by not masturbating and eating kale. You will always be influenced by mental factors you cannot control.

Captcha: Boulevard BLVD
>>
>>61308610
No I shouldnt start there I just want this shit to compile and figure out how to use it's output.

I don't need to know what the modal solutions of the three dimensional Helmholtz equation is.
>>
>>61308720
Oh that's just a fancy word for a partial solution of the wave equation.
>>
>>61308764
Ok maybe the math isnt so complicated but it's irrelevant. I have the solution, I just want it to compile into something useful.
>>
>>61308818
>const char* const argv
lol
>>
>>61306429

because this is much simpler to understand, you don't need a bunch of comments to explain what it does and it's more efficient while we're at it because you won't define a useless local variable. You're also not making mental gymnastics that your compiler was made to do for you.

int main(unsigned argc, const char* const argv) {
if( argc == 1 )
parse();
else {
unsigned int i;
for( i = 1; i < argc ; i++ ) {
if( freopen(argv[i], "r", stdin) == NULL )
error("Could not open %s", argv[i]);
parse();
}
}

return 0;
}
>>
>>61308801
I'm being a dick anon. The wave equation is pretty fucking complicated, especially in 3 dimensions.

You can hear how complicated it is when you hear a drum. Strings, 2 dimensional wave equation shit, have a "clean" sound, whereas drums have complicated overtones: so complicated computers use noise channels to simulate them and it successfully fools our brains.
>>
>>61308832
That is very interesting, this is going into some sort of web app my dad is writing for modeling acoustics in home theaters.

do you know how to fortran though?
>>
>>61306429
In most cases where a goto could be used effectively wrapping the code in a function and inserting a return is clearer. Most uses of goto are effectively replaced by structured programming constructs.
>>
>>61308706
Your body makes different chemicals to dump in your body based on your current mood.
Yea that's my entire premise. I'm glad we agree. You cannot simply choose your mood by "willing your thoughts". You can INFLUENCE your mood by living a healthy lifestyle, getting sunlight, getting socialization with other people, etc.

You ever stayed up for over 24 hours straight studying/working on something and noticed you were in a bad mood at the end of it? Yeah.

>You attempt to reduce
On the contrary. I take a holistic approach where you try to reduce the mind and body into separate isolated components.

>You will always be influenced by mental factors you cannot control.
I'm always in a good mood. It's been working very well for me. We're just crabs in a bucket though aren't we.
>>
>>61308830
this was copy-pasted
>>
File: goodmorningrunatya2.png (53KB, 419x263px) Image search: [Google]
goodmorningrunatya2.png
53KB, 419x263px
>tfw finally did -Wconversions and cleaned out all the old style casts from your lib and replaced them with asserted cast
i found at least 4 wrong sign conversions
>>
>>61307969
muslimfag?

i'm probably whiter than your entire family mr 56%
Thread posts: 327
Thread images: 25


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