[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
/dpt/ - Daily Programming Thread
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

You are currently reading a thread in /g/ - Technology

Thread replies: 75
Thread images: 5
File: dennis_ritchie.jpg (30 KB, 309x400) Image search: [iqdb] [SauceNao] [Google]
dennis_ritchie.jpg
30 KB, 309x400
What are you working on, /dpt/?

Old: >>52366410
>>
Gee Billy two Threads!
>>
Friendly reminder that C is the most compact language in history, and any other language is awful for fizzbuzzing.
main(i){for(;printf("%s%s%.d\n",i%3?"":"Fizz",i%5?"":"Buzz",(i%3&&i%5)*i),99/i++;);}
>>
Nothing atm. Thinking about developing an OpenGL based 'Nodes & Noodles' library using GLFW for an upcoming project.
>>
can someone explain the function of the 'i' here?
I'm guessing it stands for integer?
 (do ((i 1 (+ i 1)))
((> i 100))
(display
(cond ((= 0 (modulo i 15)) "FizzBuzz")
((= 0 (modulo i 3)) "Fizz")
((= 0 (modulo i 5)) "Buzz")
(else i)))
(newline))
>>
>>52370509
It's the name of the guard variable for the loop. It could be any name.
>>
>>52370509
doesn't look like a strongly-typed language. i'd guess
a) yea, because
b) the interpreter deems it so
>>
>>52370074
All that knowledge and still you decide to post fizzbuzz babby programs on a meme board.
>>
>>52370509
Do is a macro, it doesn't contain information about types unless you declare it inside the body of do.
(i 1 (+ i 1))
contains a variable, its initial value and how it will be updated.
(> i 100)
will stop the loop when it holds true.
And everything from display on is the body of the do loop.
>>
>>52370571
I see
>>52371038
yh, I got the loop breaking logic, thanks for the break down though, it helps, I need to re-try sicp one of these days
>>
Why are these threads getting filled with fizzbuzz? It's the fucking easiest shit ever, stop talking about it and start talking about useful shit.
>>
>>52370037
I'm writing a script with the Weechat API to yank the youtube url and title from the current song playing in mpsyt.
>>
In my js book it says that all user defined objects and built in objects are descendants of an object called Object.

Can somebody please explain to me more information about this statement?
>>
>>52372305
So like all new instances of an object, are descended from THE OBJECT in js?>>52372305
>>
>>52372323
all defined TYPES are subtypes of Object. Instances of types are just the defined type. objects can't inherit from anything, only types/classes can.
>>
Wich one do you prefer /dpt/? curly brackets, parenthesis or tabs and spaces?
>>
>>52372305
Classes ("constructors" in js) are templates for objects. "THE OBJECT"
Is a constructor for elements defined as key:value pairs separated by commas inside curly braces, which is just a special way to say to the interpreter new Object(key value pairs)

This constructor creates a type of object that returns value when you call myObject["key"]

Its smtg like this
>>
File: carrots.jpg (95 KB, 959x822) Image search: [iqdb] [SauceNao] [Google]
carrots.jpg
95 KB, 959x822
yo bois, I want to make something similar for my landing page, maybe a bit simpler without the snaping

http://vincentgarreau.com/particles.js/

but with webgl, no libs. I spend the last week learning webgl and I'm now comfy enough that I have enough know how to draw a cube and texture it. but how do I go about link rld? I mean how do I even go about drawing a line or a circle? do I really have to make tiny triangles? Also I want to animate it meaning that my array should be a uniform and each render I would assign some new positions? or is there a way to offload that to glsl.

You don't have to answer me directly I have a whole night, so I could read some book chapters.

posting carrots for attention.
>>
Does Rust have any flaw?
Is Rust the perfect languages?
>>
>>52372375
Whitespace
Whitespace as syntax makes the code so clean and beautiful...
>>
>>52372537
its hot atm, no doubt but so was go.
>>
>>52372574
I found go meh back then...
>>
test
>>
Please don't use the picture of a man who ruined programming next time.
>>
Does the ampersand have a unique name in computer science?

As in
cout << &var

How would i read out
&var
?

Is it just called "Ampersand var"?
>>
>>52370509
What language is this?
>>
I got my first 6 figure job but they barely use source control, mix prod and dev environments on the same servers, and don't have a way to do local development

Why is everyone so bad at programming?
>>
>>52374681
What language do you use at work?
>>
>>52374716
css, why?
>>
>>52374874
You get paid 6 figures for writing CSS. Amazing.
>>
I'm building the API for my Snapchat clone. I'm planning on delivering the images as a BLOB through JSON.

Is this the correct way to go about what I'm doing??
>>
>>52372375
>curly brackets, parenthesis or tabs and spaces?
lolwut?
>>
>>52373732
fuck off hipster
>>
>>52374665
looks like a Lisp, probably Scheme
>>
File: 1451862300357.jpg (28 KB, 439x439) Image search: [iqdb] [SauceNao] [Google]
1451862300357.jpg
28 KB, 439x439
So is this the thread we're using?

Mod, you're probably here eagerly awaiting for someome to post lewd images so you can ban them, if you are, can you please delete one of the /dpt/ threads.
>>
>>52376034
I don't think JSON can encode Blobs, are you using a nonstandard extension of some kind?
>>
Why doesn't C++ have a garbage collector?

Because there'd be nothing left.
>>
>>52376108
Shut up and post in the real thread. >>52375963
Also stop encouraging the mods to delete anime.
We're literally 1 step away from becoming reddit at this point.
>>
>>52376148
>Shut up and post in the real thread
no you fuck off. stop trying to force you're faggotry on everyone here on /g/.
>>
>>52376131
It can if I encode it correctly, but I'm not sure if it would just be more efficient if I wrote the files to the file system and then delivered a link to that file via JSON which is then used to download it.
>>
>>52376141
>

Actually, it does allow for GC since C++11, but don't.
>>
>>52376247
There's no GC in C++11
>>
>>What language are you using?
>Primarily C, but compiled as C++ so we can make occasional use of C++ features when we want to.

Into the trash it goes.

Seriously, why the FUCK do people pull this shit? If you're gonna code in your shitty meme language, at least use a meme compiler instead of a meme++ compiler. Jesus christ.
>>
>>52376271
I don't think you understand how C++ works yet anon. Any vendor can create one if they choose, and the standard supports it for almost five years now.
http://en.cppreference.com/w/cpp/memory

there is at least one vendor who has implemented one iirc.
>>
>>52372498
Not a GL expert, but I can at least tell you some possible ways to do these things, even if they're not necessarily the best possible way.

>but how do I go about link rld? I mean how do I even go about drawing a line or a circle?
In old-school OpenGL there's a GL_LINES primitive that you can use instead of GL_TRIANGLES. I don't know how that interacts with the modern shader-centric design.

One option is to turn each line segment into a long, thin rectangle (two triangles) and draw that the same way you're doing with the cube.

Another option, since all your lines are on the edges of triangles, is to send the GPU the whole triangle, then use a shader to only show color along the borders and make the rest transparent.

For the dots, I'd render a quad that encloses the entire circle, and use a shader to check if each fragment is inside the circle or not.

>Also I want to animate it meaning that my array should be a uniform and each render I would assign some new positions?
You should use vertex attributes, not uniforms. If you used uniforms you'd need to make a separate draw call for each dot/line, which would be extremely slow.

>>52374625
Different languages use & to mean different things, so there isn't a consistent name (other than "ampersand" of course). In general people will know what you mean if you call it "ampersand", "and", or the name of the actual operation (in your C++ example, it's "address-of").
>>
>>52376293
There's no GC in C++11
There's support for a GC
Virtually noone does this
>>
>>52376287
>meme language
>old as you're grandpa
try harder faggot hipster
>>
>>52376325
>unironically using a 40 year old language isn't a meme

Literally how dense are you?
>>
>>52376314
>Virtually noone
So, in other words...it does. Is that what you're saying now anon?
>>
>>52376335
>can you believe people it's CURRENT_YEAR and people are still using C!?
>>
>>52376339
No, it doesn't.
There's no GC in C++11.
There's SUPPORT for a GC

e.g.:
Give me an example of you using GC in C++11.
It must be portable to any (hypothetical) standard-conforming C++11 compiler.

You can't because C++11 doesn't mandate GC.
>>
>>52376335
Someone smart enough to know the single most important programming language in history when I see it friend.

You're cute little iPhone wouldn't exist without it heh.
>or cars, factories, the internet. ad infinitum...
Modern civilization runs primarily on C.
>>
>>52376376
Modern civilization also runs off the patriarchy and the blood, sweat, and tears of countless exploited women and minorities. Doesn't make it right.
>>
Posting in real thread.
>>
>>52376372
Which part of
>"...but don't"
didn't you understand anon?

You're claim that C++ doesn't have GC shows
a) you don't know what you're talking about, and
> b) you don't know what you're talking about.

It does. But using RAII is the only sane way to program, so don't.
>>
>>52376381
wow what a shit thread

everyone move to the anime thread, where the little redditor won't follow us >>52375963
>>
>>52376376
>important
>cute
>heh
>>>reddit
>>
>>52376381
haha, bullshit. white men have forged you're comfy little reality my friend. but even if you're position was true
>sounds good and right anyway.
>>
>>52376404
fUCK OFF. The trap thread is literally reddit: the thread. There is nothing more progressive and retarded than delusional trannies pretending they're girls.
>>
>>52376403
The language != your favorite implementation
>>
>>52376403
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm
>>
>>52376420
actually, real trannies HATE crossdressers and anime that employs crossdressing characters as jokes

hating traps is literally reddit
>>
What do you call a programming language designed for women?

An object orientated programming language.
>>
>>52376404
>everyone move to the anime thread
equating animu and you're faggot shit =/=.

>besides,what are you doing here anyway? get back to you're designated gay street friend.
>>
>>52376421
I'm well aware, as I think I've demonstrated hehe

.>>52376430
Yea, I think I said that, but thx.
>>
>>52376238
Just have a link to a location instead. Encoding the files to work over JSON would be horrific and use way more bandwidth
>>
File: 1387402504905.png (14 KB, 471x411) Image search: [iqdb] [SauceNao] [Google]
1387402504905.png
14 KB, 471x411
>>52376439
B-but anon, that's rape.
>>
>>52376490
That's the most amazing logo I've ever seen
>>
>>52376503
https://github.com/ErisBlastar/cplusequality
>>
>tfw reading SICP and you only marginally understand what's going on
I'll never be a programmer will I
>>
>>52376589
The English in SICP is pretty high level
>>
>>52376594
hardy har, I understand the english just fine but I've never been good with math
>>
>>52376594
>not using a low level language
pleb you don't really know English you're just using words other people invented
>>
>>52376034
No, why not just return the image data with the correct MIME type set in the response?

If you really have to a use a text-encoding for your images, which I'm not sure why, you can encode binary data into text with base64.
>>
>be c++
>incredibly powerful language
>low level with high level syntax
>can do anything
>longest lasting language ever other than assembly
>people call me a meme language
>cri everytim
Thread replies: 75
Thread images: 5
Thread DB ID: 399867



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

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

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 shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.