[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: 329
Thread images: 52

File: K&R c.png (1MB, 1000x1400px) Image search: [Google]
K&R c.png
1MB, 1000x1400px
old thread: >>56011432

What are you working on, /g/?
>>
>>56019764
First for D
>>
>>56019857
if C's perfect, how come people have made new languages to avoid it?
>>
>>56019866
Because pointers and manual memory allocation scare numales and women.
>>
>>56019883
what about object oriented?
>>
>>56019921
OOP has ruined programming.
Also, any OOP features worth using can easily be implemented in C through struct pointer abuse.

OOP was practiced long before it was called OOP.
>>
>>56019764
tell me op, do you have a script which tells you when a /dpt/ thread reaches 299?
I'd have a higher opinion of you
>>
>>56019947
IIRC bump limits in /g/ are 310.
>>
>>56019883
How someone can consider himself useful at programming without knowing a thing about dynamic memory allocation, and data manipulation through pointers?...
>>
>>56019962
>all future OS' will work the same as the ones of today
>>
you know what would be funny, if OP was a sophisticated troll
OP bought a 4chan pass
OP made a script to detect when a thread reaches bumplimit, if it had, it calls the "makenew dpt program"
always with himegoto or whatever her name was
>>
Seems legit
>>
>>56019988
You know what would be funny?
If you had bought a 4chan post
And then you made a script to run extremely irregularly, say every month or so, it calls "make new post saying this"
always with makenewdpt or whatever its name is
>>
>>56019866
People made new lenguages because the need of specific features to specific needs... C++ can solve a lot of things... but no everybody can learn it...
>>
rate my function /g/

def serverLookup() -> [Server] :
servers = sql("SELECT name,lat,lon,status,ip4 FROM servers")
Servers = [ Server(*server) for server in servers ]
return Servers
>>
Is the dynamic typing meme, dare I say it, finished?

https://github.com/python/typing/issues/258
>>
>>56019866
When faced with greatness, weak souls often turn away.
>>
>>56020095
No
>>
File: DOZO.jpg (54KB, 500x375px) Image search: [Google]
DOZO.jpg
54KB, 500x375px
DOZO!
>>
File: image.jpg (24KB, 184x184px) Image search: [Google]
image.jpg
24KB, 184x184px
>>56020120
Only a matter of time before TypeScript is subsumed into the ECMAScript spec
>>
>>56020148
Does she have Down's?
>>
>>56020183
yes, actually
>>
>>56019962
>dynamic memory allocation, and data manipulation through pointers
is K&R a good resource to learn that ? Or is there better resource for those specific subjects?
>>
>>56019824

His name is Hime Arikawa.

>>56020303

http://cslibrary.stanford.edu/102/PointersAndMemory.pdf
>>
>>56020303
Read Understanding and using C pointers.
>>
>>56020012
3/0, would raise div by zero interrupt again.
>>
File: 1467070554775.png (55KB, 217x190px) Image search: [Google]
1467070554775.png
55KB, 217x190px
I'm using a boolean to map a gender in my employee class, obviously using true as a female, and false as a male, cuz all mens are liar :^)
I bet this could land me a job in google.
>>
>>56020451
What language?
>>
>>56020451

>all mens are liar
But you are a man and you just said that all men are liars. Doesn't this create a logical paradox?
>>
>>56020477
being a liar doesn't mean you always lie
>>
File: 1432755334823.png (122KB, 452x391px) Image search: [Google]
1432755334823.png
122KB, 452x391px
Help me choose a programming language, /g/

I'm a senior in Aeronautical engineering and would like to become a structural designer. I only know some MATLAB, what would be a good language for me to learn? C?
>>
someone give me an IoT memeproject to do with my microcontroller
>>
File: 50ad8da31c.png (15KB, 597x281px) Image search: [Google]
50ad8da31c.png
15KB, 597x281px
>>56020462
C#
>>56020477
Probably, it could mean I'm lying about all the mans being liars.
>>
>>56020451
>bool
>job at google
No. You better use an uint64 you fucking shitlord.
>>
>>56019939
except databases anon, oop is actually really good there.
>>
>>56020517
If you're in C# you should just use an enum
>>
>>56020517
looks like js too
>>
>>56020574
>I use /dev/null db
>>
>>56020451
0 - male
1 - other

can't go wrong
>>
>>56020595
I don't like enums that much, since the definition of the type must be knowed everywhere I'm going to use it.
>>56020610
A bit, just because I'm relying on "var" and LINQ.
>>
>>56020574
Actually how do Functional Programming languages handle multiple database abstractions?

It seems like a curious conundrum, they would need to create an abstraction, how is this done in FP, and how is it not considered OOP?
>>
>>56020662
And classes have to be known everywhere they are going to be used, what's the difference?
>>
>>56020693
You got me there, but it's a simplistic case so it's not worth using an enum, I know all the advantages of using enums but I'm lazy.
>>
>>56020502
Java
>>
>>56020502
C, yes
>>
>>56020095
>reading the spec
>"hey this is pretty well thought out, this guy knows his shit, it's just too bad they'll pick over all the little details and never accept--"
>username is gvanrossum
>IT'S HAPPENING.webm
>>
>>56020521
What about fractional genders?
>>
>>56021664
You're not a tripfag, go away bidet
>>
>>56020502
Learn C, get good at it, learn C++, and then ignore all languages newer than C++ because they're all useless memes
>>
>>56022086
Which C++?
>>
>What are you working on, /g/?

A raytracer.
>>
I'm trying to sum up the columns in a 2D array.

I can sum the rows, no problem, but how would I go about summing up the values in the columns?

Knee jerk reaction is to make a new 2d array and store each column value there then sum those rows since they will be columns, but instincts say that this is retarded and inefficient.
>>
>>56022179
fix your gamma
>>
>>56022197
Why?
>>
>>56022220
because it looks like shit
>>
>>56022233
Well, I'm working on it, but I still don't see what's the problem with the gamma, none of the colors defined in the materials even goes above half intensity.
>>
File: temp.png (16KB, 755x619px) Image search: [Google]
temp.png
16KB, 755x619px
>>56022256
it should look more like pic related, look at slither.io and how shitty the graphics look compared to other games, it's because it's not gamma corrected
>>
File: ok.png (11KB, 355x339px) Image search: [Google]
ok.png
11KB, 355x339px
>>56022294
Done, but besides being brighter, I don't see how it's an improvement, I could have tweaked the materials instead of post-processing the result.
>>
>>56022052
Do genders form an entire field?
>>
(defun postfix-to-sexp (&rest args)
(prog (item stack)
START
(if (null args)
(if stack
(return (pop stack))
(return NIL)))
(setf item (pop args))
(if (numberp item)
(push item stack)
(let* ((arg2 (pop stack)) (arg1 (pop stack)))
(push (list item arg1 arg2) stack)))
(go START)))

just kill me
>>
File: LinearLighting-1.jpg (71KB, 550x381px) Image search: [Google]
LinearLighting-1.jpg
71KB, 550x381px
>>56022362
>I could have tweaked the materials instead of post-processing the result.
no because then you get this disgusting mess

https://www.youtube.com/watch?v=g24fkMZMshk

everything is too dark and when you do have bright parts, they fade off to darkness too quickly, it's trash
>>
>>56022410
nvm
(defun postfix-to-sexp (&rest args &aux stack)
(dolist (item args (if stack (pop stack)))
(if (numberp item)
(push item stack)
(setf stack
(cons (list item (second stack) (first stack))
(rest (rest stack)))))))
>>
I hate my code right now and I know it can be improved, but I don't know where to start. maybe I should throw out the whole function I'm working on and rethink the approach. also I think i should drop the current OOP way of doing environments because it's led to some ugly ass code.
>>
>>56022426
I don't know, gamma correction looks too bright, and it's not accurate in regards to the scene settings.

Everything is too bright in your pic, and it makes you unable to discern facial features, like eyelids.
>>
>>56022479
Me and my colleague offer a code improvement service. We will improve your code for $6/hr.
>>
>>56022097

There is only one true C++, and that is ISO C++14.
>>
So at work in my downtown I've been messing around with C#. I wanted to start using it at home so I installed Visual Studio 2015 Community Edition and I went into start an ASP.NET MVC 5 project but I only have options for MVC 4. Pic related.

Anyone have any idea what I can do to fix it? My googling hasn't been particularly effective.
>>
So what does /g/ think of my setup?

The code's not great but I'm kinda just starting out
>>
File: 1466329334062.jpg (24KB, 258x263px) Image search: [Google]
1466329334062.jpg
24KB, 258x263px
>>56022578
>pic related
>>
File: aspnet 4 templates.png (25KB, 800x620px) Image search: [Google]
aspnet 4 templates.png
25KB, 800x620px
>>56022578

Crap, forgot the picture. Here it is.
>>
>>56022582
you're using Fedora. Good choice
>>
>>56022585

Yeah, I dun fucked up.
>>
>>56022582
>Fedora and C.
mein nigger.
>>
File: temp.png (57KB, 755x1238px) Image search: [Google]
temp.png
57KB, 755x1238px
>>56022499
the upper half of the head pic is the gamma corrected one, the lighting is done in linear space and then converted to gamma space

look at this pic, which sphere looks "half intensity" to your eyes?
>>
>>56022595
>>56022610
I'll be honest this is pretty fucking comfy
Got any decent iconsets?
I'd kinda like to get rid of the defaults, they suck just a teensy bit too much
>>
>>56022515
No thanks, Rajesh.
>>
File: Moon 9-21-2013 Labled 2.66MB.jpg (3MB, 8678x8379px) Image search: [Google]
Moon 9-21-2013 Labled 2.66MB.jpg
3MB, 8678x8379px
>>56022613
and which one more closely matches the relative brightness levels of a picture of the moon?
>>
>>56022613

I see what you mean.

The upper sphere is at half a pixel intensity but the eyes perceives it as being darker, while the bottom on is brighter but looks like a more neutral gray.
>>
>>56022582

>>56022595
>>56022610
any thoughts on the code?
>>
>>56019764
Been doing some low level Serial struct parsing with Python and C (using SWIG and ctypes as the glue). I'm even amazed myself how I got everything working. Seemed like impossible a week ago.
>>
>>56020671
I'm guessing things like Haskell's typeclasses or Rust's Traits could be used for this.
>>
File: puck shig.gif (44KB, 355x166px) Image search: [Google]
puck shig.gif
44KB, 355x166px
>>56022851
>rust
>functional
>>
What's the best language for digital signal processing, image processing, etc.? Any resources I can use?
>>
>>56020671
Here is one package used: https://www.stackage.org/package/persistent

I haven't used it though so I can't explain it to you
>>
Last time I posted here was about a year ago.

C, Lua, Entity Component System

It all works great, but I did get busy for a few months so I may have done some code I should not have. Talking to the lua VM back and forth multiple times each frame might not be a good thing. So, I would like to know any opinions on what I can change it to.

Right now the engine has a global
entity = {}
table in lua, and a global
g_entity_t
struct array in C. The C array holds the ID numbers of active indexes in the global table, and runs functions as needed (such as think, collide, etc.), it also holds some other variables like the entities name, the x y offset, the texture index, etc..

How i've been doing this is storing the ID of the index in the lua table in the array AS WELL AS storing that index number (redundantly) in the lua table index. When the internal part calls lua, it just needs to call the index. When the lua part calls an internal function, that function goes down the list and see what internal entity holds that ID and then does it's thing.

The ladder part might be why I have a slowdown. Is there a more optimized way to pass information between C and the VM without having to rely on the ID?
>>
>>56020671
>>56023105
Here is a tutorial for it: http://www.yesodweb.com/book/persistent
>>
>>56023045
It's not a purely functional language like Haskell, but it is heavily inspired by them, which is very obvious in it's type system.
>>
In C++ (hopefully without C++ features) what's the best way to resize memory without having to change pointers or alternatively resize memory with some construct that allows me to change pointers easily (first thing that comes to mind is to store a linked list pointing to every pointer with the data but that seems onerous).
>>
I have a python script inserting data into a mysql server located on the same computer (localhost) from many files.

The script always runs fine then suddenly loses connection to the server after a few thousand lines in the first file. The only error I get is something that says "MySQL server has gone away". This happens in all both cases:
>MySQL connection object initialized at very beginning, same one used throughout
>MySQL connection object initialized just before statement then closed just after statement.

I can still interact with the MySQL server through a different command line interface while the script is running and after it stops due to the error.

I have had long running python scripts before for massive inserting/updating MySQL databases before and this has never happened until now.

What is going on and how do I fix this?
>>
>>56023371
Make that a ? not a .

I'm aiming to have live asset reloading. I just realised that since its only pictures and I can have them stored uncompressed there's no real issue, since a WxH image will always be the same size in rgb. Still interested though.
>>
>>56023387
Actually, the error is:

"Can't connect to MySQL server on 'localhost' (10048)"
>>
>>56019939
>struct pointer abuse.
Explain?
>>
>>56019866
C's flaws are about how you're faced with inconvenient syntax when you do abstractions. But most languages do a poor job of improving the situation or add more problems.

C is of course not perfect. But it's the best I know of. While being picky about modern languages at least. They should do better because they're in a modern age.
>>
>>56023371
You could have a pointer/reference to pointer.
The pointer to the allocated memory can change after you do a resize and it wont matter since the second pointer points to the new memory location, and the second pointer will never reallocate/resize, only the pointer it points to will change value, so it will have the same location all the time.
>>
>>56023651
Here's an example with static pointer to dynamic pointer:
int **p = (int**)malloc(sizeof(int*));
int *data = (int*)malloc(10 * sizeof(int));
*p = data;

// somewhere else in the code
data = (int*)realloc(data, 1000 * sizeof(int));
*p = data;
>>
>>56023806
Yeah that's far nicer than my solution at least. Thanks.
>>
File: 1470743205649.jpg (136KB, 960x1280px) Image search: [Google]
1470743205649.jpg
136KB, 960x1280px
Quick, write a program to find the first consecutive pair of primes other than 2 and 3 or this girl will hack your waifu out of existence!
>>
>>56024080
>the first consecutive pair of primes other than 2 and 3
It doesn't exist. All even numbers, besides 2, aren't prime, so there cannot be two primes next to each other, besides 2 and 3.
>>
File: thatsthejoke.jpg (22KB, 480x360px) Image search: [Google]
thatsthejoke.jpg
22KB, 480x360px
>>56024112
>>
File: st_ignucius.jpg (550KB, 667x1000px) Image search: [Google]
st_ignucius.jpg
550KB, 667x1000px
>>56024080
All hail Emacs... Well it's old, slow and unstable. And its Lisp isn't the best example of a Lisp we know of. Maybe it's time for the congregation to move on. After all, what matters is Freedom, and as long as we live a pure and ethical life we're not in sin, right? Lua being the small marvel that it is, if NeoVim succeeds in cleaning up VIVIVI and embedding Lua into it, I'm forking this Church and going my own way. what do you think?
>>
Is there anything worse than people who think programmers are the same as IT? I hate being lumped in with those rejects who couldn't even tell you what dereferencing a pointer does but think that they are masters of computers
It's pathetic
>>
>>56024194
I hate being lumped in with other programmers more than I hate being lumped in with IT.

You guys are shit. At least people are grateful that IT exists.
>>
>>56020174
Any sources on this? I've heard of optional statics typing being proposed many times, but it never made it in.
>>
Why would anyone program in Erlang?
>>
>>56024343
Erlang has only one small niche that it is very very good at. If you need to write highly concurrent distributed systems with very good availability guarantees, nothing better than Erlang.
>>
>>56024343
https://www.youtube.com/watch?v=rRbY3TMUcgQ
>>
>>56024420
Not him but I'm thinking, is would erlang (without major hassle) be performing as well as a C or C++ implementation?

If not what purpose is there to having a language that does concurrency well?
>>
>>56024478

This video gave me a headache.
>>
>>56024080
while (1);
>>
>>56024478
>just sitting with proper posture and looking at the screen
I don't feel like we do that anymore.

I feel we're worse off for it.
>>
>>56024504
Hell no. Erlang is for things that must have zero downtime. Not because of crashes, updates, adding more machines to the cluster or high traffic. As an example most telephone management systems, many databases and messaging systems are written in Erlang.
>>
>>56024572
>Hell no
So it's pretty slow then?
Well if you don't have to go for high performance in C++ why would it be difficult to make it stable?

I get that there's been projects done in it for those reasons but in the modern day is there really any reasons left?
>>
>>56020095
ayyyy
Does that mean we also get parametric polymorphism based on types? Shit son, Python might just start to be bearable now.
>>
>>56024583
with sepples, to update you need to SHUT IT DOWN and load a different executable, but with erlang it just keeps going, it's made specifically for phone/messaging stuff
>>
>>56024625
>to update you need to SHUT IT DOWN
No, depends on how you write it.
But sure, having a language environment that's specifically built to do that is nice.
>>
>>56024583
It's not terribly slow. Java-tier, I guess.
The problem with C++ is it runs on the metal. Erlang runs in a managed VM, that can detect, if a process is taking too long, spin up more actors, if a certain task is uncer high load, properly handle crashed processes and distribute everything over a cluster. That all can be done in C++, but can you as easily guarantee it will absolutely work with zero downtime?
>>
So if I want to start programming and have basically no experience whatsoever, where should I begin?
>>
>>56024681
buy female clothing and begin to wear it
X
>>
>>56024681
Python or JavaScript, then C, then C++ or Go.
>>
File: 94ea70d4fd37b64de6bbf2fc2214271c.png (993KB, 1748x1181px) Image search: [Google]
94ea70d4fd37b64de6bbf2fc2214271c.png
993KB, 1748x1181px
>>56024681
Watch The New Boston C++ tutorials and code along with the videos.
>>
>>56024080
int main(){ return 0; }
>>
>>56024714
>Watch The New Boston
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

my advice about xdressing was better KILL YOURSELF NOW
>>
>>56024714
>code along with the videos.
That's just frustrating to do.
>>
foo = bar;


foo &= bar;


which is more efficient? mov vs and?
>>
>>56024723
What is wrong with him?

>>56024736
Code in between videos then. I like video tutorials better than text as long as they don't drone on too much.
>>
>>56024767
Your compiler will optimize that out, don't help it.
>>
>>56024768
>What is wrong with him?
too stupid, too normie, too easy stuff he talks about
his voice makes me feel he needs to die ASAP
>>
File: goobycheat.jpg (17KB, 400x247px) Image search: [Google]
goobycheat.jpg
17KB, 400x247px
>>56022527
>c++14
>>
>>56024774
if won't know if foo will always be true at that point, so it won't be able to do just the and
>>
File: 20130514110054-1_0_0.jpg (419KB, 1110x638px) Image search: [Google]
20130514110054-1_0_0.jpg
419KB, 1110x638px
>>56024681
>>
File: 24917374.jpg (133KB, 900x426px) Image search: [Google]
24917374.jpg
133KB, 900x426px
>>56024768
Never understood how anyone can learn through videos instead of reading a book/documentation/blog post.
>>
>>56024767
Why would binary AND be faster than mov instruction?
>>
>>56024789
I usually just google everything I need to unless I am learning a new language. Then I just watch someone code for a while and I can figure it out.
>>
>>56024768
His instructional style is basically "To do this, put this line of code here." and doesn't explain WHY any of it works— it's coding by rote memorization.

To put it in non programmer terms, it is like trying to learn a language by memorizing the dictionary. Sure, you might end up with a really deep vocabulary and know some really advanced words, but you won't be able to use those words together to produce anything meaningful.
>>
>>56024851
Sounds almost like codecademy.
>>
File: 1462786124776.png (1MB, 1280x720px) Image search: [Google]
1462786124776.png
1MB, 1280x720px
>>56023806
>>
what is the best programming language to master today,
I have some spare time and I just want to get good
>>
File: 1279165661008.jpg (15KB, 293x208px) Image search: [Google]
1279165661008.jpg
15KB, 293x208px
>>56024921
Makes the code compatible with C++
>>
>>56024946
Java, PHP or C. All are commonly used and in high demand.
>>
>>56024946
Read SICP, learn scheme.
>>
File: 139692137914.jpg (141KB, 563x364px) Image search: [Google]
139692137914.jpg
141KB, 563x364px
>tfw Anjana Vakil is not your gf
>tfw no fp gf at all
>>
>>56024681
Start with C. Learn memory management and pointers. Then move to Python and write fun stuff.

And there's no sense in watching videos to learn. If you prefer videos to documentation/books it doesn't matter because you're gonna have to use the latter anyway.
>>
>>56024860
Exactly my thoughts.
>>
>>56025005
My gf is imperative. Shit sucks. I wish I had a functional relationship. Hard to come by.
>>
File: 1470611194135.png (288KB, 563x563px) Image search: [Google]
1470611194135.png
288KB, 563x563px
>>56025005
>tfw that feen when gf ackchually means global foundries
>>
>>56024994
thought so, thanks
>>56025003
I did already program in some languages like C C# and some other but that was mostly basic, would this still be helpfull
>>
>>56025068
>thought so, thanks
Don't hear what he says, both Java and PHP are disasters.

>would this still be helpfull
Yes
>>
>>56025068
It's a programming Bible for functional people.
https://youtu.be/7Zlp9rKHGD4
This kind of cult.
>>
Working on a facial recognition app:
https://www.raskie.com#mememe

Bug reports and suggestions welcome. Would be cool if you could post them here:
https://www.raskie.com#on-notice
>>
>>56024681
read SICP
>>
>>56025079
Why would one consider them to be disasters?
>>
What are some good books on mathematical Statistics my niggers
>>
uppercase or lowercase for hex literals? 0xFFFF or 0xffff? 0x5F3759DF or 0x5f3759df?
>>
>>56025257
upper is easier to read
>>
File: turkgay_.jpg (29KB, 480x480px) Image search: [Google]
turkgay_.jpg
29KB, 480x480px
Exokernel for ARM64
>>
>>56022578
>>56022589
MVC 5 RUNS ON .NET 4.5

RTFM
>>
>>56024946
Pick one of the big 4: Java, C#, C++, Python

Learn SQL.

Bonus points for Javascript if you care about web dev at all.
>>
>>56025396
Retard
>>
>>56024787
This desu
>>
File: terry.png (29KB, 953x528px) Image search: [Google]
terry.png
29KB, 953x528px
What's the point of this thread?
You guys will never be like Terry.
>>
>>56025585
More people use software I've written than Terry.

Something something religion something something autism.
>>
Can you guys give me some fairly easy to understand implementations of pointers in C? Or maybe something to help me better understand their concept and use. It's just not clicking for me from the books I'm reading.

I need the pointer version of learning differentiation and integration from position/velocity/acceleration.
>>
Sometimes I wish the people at Stack Overflow would just straight up give me the answer to my question instead of fucking dancing around it in attempts to get me to learn shit.
>>
>>56025668
The first 3 answers to any question I've ever seen have been "here, copy paste this into your program".

Only after they have time to slap their answer down for the rep do they go back and add all the explanation.
>>
>>56025585
Good, he sounds like a smug autist.
>>
>>56025668
Have you linked boost yet?
>>
>>56025613
>I need the pointer version of learning differentiation and integration from position/velocity/acceleration.

You're good at physics? Think height or temperature difference vs absolute height/temperature. a pointer is absolute, but the reference point is something whacky that changes everytime you start your program. An array index, or a ptrdiff, is a a difference, then you see why you can or can't add a pointer with a pointer, etc. Or maybe points vs vectors in the plane. I know that's not an implementation, but I'm still going to offer what I have, it clicked that way for me.
>>
>>56025613
Pointers are literally just the address in memory to something. With *, you basically go to that address and get access to whatever that pointer type is.
>>
>>56025613
Pointers are just a kind of comonad
>>
Say you need a service or process to be running with as close to 100% uptime as possible.

What is the method of doing this on Linux, Windows, and OSX?

I've seen some applications utilize a 'helper service' or a 'process monitor' to basically keep an eye on the main service and reinitialize if necessary.
>>
>>56025613
See
>>56020355

Fuck's sake. If that pdf doesn't do it for you, you may be functionally retarded.
>>
File: hqdefault.jpg (14KB, 480x360px) Image search: [Google]
hqdefault.jpg
14KB, 480x360px
>>56025850
Do I look like a someone who knows what a comonad is?
>>
>>56026060
No, you look like someone from Reddit
>>
File: pt.png (515KB, 960x1033px) Image search: [Google]
pt.png
515KB, 960x1033px
Made it to the good bits bois!
>>
>>56026119
>not learning ANSI C

you can stop already
>>
>>56026133
> 2016
> shilling a standard from the 80's

You're broken anon
>>
>>56026153
Thou shalt not compute
>>
>>56026153
1998 was the last year anyone made a decent language usable for real work
>>
>>56026271
C++ is garbage.

>>56026133
It's fucking 2016, mate.
C has evolved, and has added lots of very useful features.
puts("test");
int a;

is invalid C89.

for (int i = 0; i < n; ++i) {
}

is invalid C89.

-10 % 2

is implementation defined behaviour in C89.

my_fn(a)
{
/* do whatever */
}

is valid C89.

etc.
>>
>>56026322
Keep on coding in Java, monkey.
>>
>>56026436
What?
That has literally nothing to do with what I said.
>>
File: 1456081404838.jpg (19KB, 1024x768px) Image search: [Google]
1456081404838.jpg
19KB, 1024x768px
How do I install a python script? I hate have to cd into its directory or writing long paths

\echo
echo.py


from sys import argv

if __name__ == '__main__':
print(argv[1])

lets assume that's what the script does. How do I install said and be able to run script from any dir as
echo 'Hello world'
>>
>>56026461
You can safely disregard any post like that.

I'm convinced that nearly every post kicking and screaming about anything higher level than C is made by NEETs.
>>
>>56026475
god you're a dumb one, ain't you?

Read what a path variable is and what a shebang is.
>>
>>56026475
google it
>>
>>56026475
PATH variables

>installing a python script
>>
>>56026490
>>56026502
#!/usr/bin/env python

I think you're the dumb one here. I never said executable, I said install as in add in the into bin folder or windows equivalent . If you don't feel like helping people, don't, instead you choose to throw insults.
>>
>>56026565
No, you're definitely the retarded one. What they were saying is exactly the thing you're talking about.
>If you don't feel like helping people, don't, instead you choose to throw insults.
Welcome to 4chan, now fuck off.
>>
>>56026565
Both of those posts gave you the keyword for EXACTLY what you need to accomplish this, assuming you've communicated what you're actually trying to do.
>>
Exokernel in ARM64 Assembly
>>
>>56026601
I really don't mind the light trapfaggotry, but this is definitely not blue board.

What is the point of an exokernel, and why are you bothering to write one?
>>
>>56026575
so let's say I've echo.py in my home folder and run 'echo 'whatever' ' in my Download folder, the script will run?
>>
Why is /dpt/ full of snek fags right now?

>>56026601
What the fuck
>>
>>56026613
i have to write one or they will kill me
>>
>>56026630
whatever
>>
>>56026625
Just google it.
I really can't be fucked explaining something as basic as PATH to someone, especially when it's ridiculously easy for you to find it out yourself, now that you know the keyword.
>>
>>56026625
PATH VARIABLES

GOOGLE THEM
>>
File: butimmale.png (259KB, 586x960px) Image search: [Google]
butimmale.png
259KB, 586x960px
>>56026613
>not doing things for the fun and pleasure of it
you are dead inside anon
>>56026630
it's a woman with a penis :^)
>>
>>56026670
kys
>>
>>56026670
I don't find low-level programming fun at all.

Fun programming for me is making something that people can interact with and use for a specific purpose.

Also, doing all this in a comfy language that allows me to manifest my thoughts into a working application without much fuss.
>>
>>56026705
Then, by the rules of this thread, you are a filthy webshit.

WEBSHIT WEBSHIT WHAT A TIT
BET YOU CAN'T EVEN USE GIT
ALL THE SJWS WILL HAVE A FIT
>>
>>56026746
I do not work with webdev in the slightest.

Try again.
>>
File: lmaoingatyourlife.png (189KB, 450x472px) Image search: [Google]
lmaoingatyourlife.png
189KB, 450x472px
>>56026680
>pic related
>>56026705
I do, I've done some cool things using the vga emulator, the low level registers are fun to fuck with
>>
>>56026748
Doesn't matter, you use high level languages, which are isomorphic to JavaScript.
>>
Best scheme?
>>
>>56026897
racket.

its logo becomes a heart on 14th February.
I freakin' love Racket.
>>
File: 1391718956645.jpg (9KB, 250x237px) Image search: [Google]
1391718956645.jpg
9KB, 250x237px
In C++ is it possible to use a std::unordered_map where values can be of any type, not fixed at compile time?
>>
>>56026670
kill yourself
>>
>>56026897
c
>>
>>56026995
"Hey son what's this racket up here, you playin with your meme programming languages again?"
>>
>>56026995
Isn't it meant to be slow?

Can it interface with C/C++ code?
>>
>>56027005
No.
>>
>>56026995
kill yourself
>>
>>56027038
all lisps are slow
>>
>>56027005
Wrap your values to a variant type or void *, you would need to implement it by yourself though.
std::unordered_map<K, VariantType>
std::unordered_map<K, void *>
>>
>>56027080
I thought chicken scheme was meant to be fast?
>>
>>56027012
why? my life is great and fun :^)
>>
>>56027098
you're pathetic and delusional
>>
>>56027109
you're a crab
>>
>>56027005
std::unordered_map<key, baseClass>
>>
>>56027155
Needs to be a pointer to baseClass.
>>
>>56027109
why so bitter and angry my friend? cheer up! no need to hurt yourself :^)
>>
>>56027155
Unless you store the value as pointer, any data member past the baseClass gets sliced off when it is stored in the map.
>>
>>56027196
>>56027215
i know, i missed that out by mistake
>>
Am I the only person using NixOS who isn't a Haskell dude?

I look at other people's dotfiles and it's GHC this, Xmonad that all over the place.
>>
File: current year kike.png (343KB, 692x630px) Image search: [Google]
current year kike.png
343KB, 692x630px
>>56026322
>It's fucking 2016, mate.
>>
>>56027248
Join us
>>
>>56027080
Schemes, maybe. SBCL is pretty fast.
>>
>>56025700
Use boost and jQuery :*)
>>
File: indians6.gif (60KB, 1024x874px) Image search: [Google]
indians6.gif
60KB, 1024x874px
>>56027341
>>
>mfw le strange loop man is a shitlib that complained about pronouns and sexism in non-gender-neutral terms
http://www.cs.virginia.edu/~evans/cs655/readings/purity.html
>>
>>56025068
>>56025079
Java is fine. PHP is a fucking disaster though.

Java is a coherent language that just happens to put arbitrary roadblocks in the way, which means you need to work around the language rather than working with the language. This is a comparatively small problem next to PHP's shit, though. Java code will generally do what you expect it to. PHP will coerce "" to null and use like 300 different naming standards in the standard library and shit like that.

Don't use PHP.

Search for "PHP: A fractal of bad design," since robomoot thinks I was trying to post spam.
>>
File: le php creator.png (335KB, 1280x720px) Image search: [Google]
le php creator.png
335KB, 1280x720px
>>56027372
dob geg >>55985459
>>
>>56019764
>What are you working on, /g/?

Trying to figure out how to make anime real so I can fill hime's boipuccy full with semen
>>
>>56027286
Maybe. I've been reading a little bit of Learn You A Haskell For Great Good.

I'd rather not join the shitposters on here who assert that it's the only good programming language in 2016, though. Language partisanship is for dorks.
>>
>>56027497
Some languages really are better than others.
>>
>>56027399
AYYYYYYYYYYYYYYYYYYYYYYYYY LMO


Strings can be treated as variable names? Hooooooly shit.

also I didn't know about the "hashing strings with strlen() thing," which obviously didn't last long but is still hilarious.
>>
>>56027399
python is similar except the creator is deluded into thinking it's good or he's really good at keeping up the charade for that $$$
>>
>>56027538
Well, yeah (see PHP discussion). But, I'd dispute the idea of a One True Language which is the best for every use case. Have fun writing a 3D videogame in Haskell, for example, where performance is essential and everything has to be mutable state. Or drivers / kernels. You can't write driver, kernel, embedded etc shit in a language that high-level.
>>
Guys what if i learned coding starting from F#? what would it be like?
>>
>>56027618
Go for something with higher kinded types.
>>
I want to make a program that connects to the microsoft sql server and displays some data on a GUI. I would like it to be cross-platform and i will eventually add support for remote servers.

Anyway, what's the best language for this? I tried to do something quick with c# and wpf, and it worked , but that's not cross-platform
>>
I'm getting paid to program in C#, using bootstrap and jquery.

And you?
>>
File: 1467143934863.png (513KB, 1280x720px) Image search: [Google]
1467143934863.png
513KB, 1280x720px
>only knowing scripting languages
>only knowing languages that are so slow, half the third-party libraries are just wrappers around native implementations written in a lower-level language, because a pure implementation would be unusably slow
>>
File: 1466607873587.gif (3MB, 160x120px) Image search: [Google]
1466607873587.gif
3MB, 160x120px
>>56027587
You have no idea what you are talking about.
>>
If language names are from the original names, like:

A is for assembly
B is for BASIC
C is for?
D is for?
F is for?
>>
>>56027668
>in C#
>using bootstrap and jquery
que

Are you transpiling C# to JavaScript?

>>56027587
I don't think Python is nearly as crazy-ass bananas as PHP is. I'm starting to think that duck-typing is a bad paradigm, and Python's GIL means it can never be parallelized, but that's not the same as PHP's "everything is fucked at every level of the language."
>>
>>56027713
I'm making a [spoiler]webapp[/spoiler] hosted on [spoiler]microsoft azure[/spoiler]
>>
>>56027713
>I'm starting to think that duck-typing is a bad paradigm
It is.
>>
>>56027687
holy shit when did horimiya get an anime
>>
>>56027704
Cool
Dumb
Faggots
>>
>>56027729
Oh so what you're saying is that you're writing the backend in C# and the frontend in JavaScript like a normal person.

I don't know why I jumped to the weird answer of "calling jquery from C#".

Microsoft Azure looks like some kind of MS Docker, is that right?
>>
>>56027756
No, Azure is actually good and not a meme.
>>
>>56027704
Cross-
Dressing
Faggots
>>
>>56019921
What's the difference between using obj.method() and method(obj)? Or you can't use associations?
>>
>>56027770
>No, Azure is actually good and not a meme.
I know pretty much nothing about webdev.

Docker is a meme?
>>
>>56019883
>coding a project in C
>somebody's argument for using C is just /pol/ shit

time to rewrite it in Rust lel

Go back to frogposting on your containment board for fuck's sake.
>>
>>56027814
The whole containerization meme is, well, a meme. It's going to result in a lot of unpatched security holes.
>>
>>56027587
Apparently he's having second thoughts: >>56020095
>>
File: 2r76ebq.png (35KB, 954x748px) Image search: [Google]
2r76ebq.png
35KB, 954x748px
>>56027875
>>
>>56027842
Someone's triggered.
>>
WHAT'S THE MOST EFFICIENT WAY TO USE LESS THAN 512MB FOR A 3D >>>/V/ IN C++?
>>
File: inoperable reddit cancer.png (53KB, 571x618px) Image search: [Google]
inoperable reddit cancer.png
53KB, 571x618px
>>56027896
Disgusting.
>>
File: 1453697514459.jpg (31KB, 331x473px) Image search: [Google]
1453697514459.jpg
31KB, 331x473px
Who /Matlab/ here?
>>
What language is the best for my wife's computer?
>>
>>56027927
just make it and don't put too many huge textures, video cutscenes, too much music, dialogue
>>
>>56027956
Coq
>>
>>56027875
Lipstick on a pig.
>>
will dpt threads ever evolve beyond community college/ babby's first semester level?
>>
File: 1470863365312.jpg (75KB, 440x660px) Image search: [Google]
1470863365312.jpg
75KB, 440x660px
WinAPI question

How do I go about highlighting text in a rich edit control that was found with the standard dialog box?

If I set the focus back to the richedit control then I can see the selection, but then the dialog box isn't selected, so I need to select it again. How do I make richedit process the EM_EXSETSEL message with the find dialog box still in focus? Should I resort to threads? How do I do it?
>>
>>56028021
no, there will always be summerfags/newfags, and the ones who git gud will leave or mostly just shitpost
>>
>>56027956
D
>>
>>56028033
>WinAPI
Killing yourself is always a viable option.
>>
>>56028021
So long as you are here.
>>
>>56028180
Can you elaborate?
>>
C++, just random exercises from stroustrups book like make a binary tree drawing algorithm using fltk, make an inherited class of Shape with a drawing function which fills a random closed polyline with vertical striping, and similar <100 lines of code exercises. I feel like a pleb still, considering this is my first programming language. Not counting matlab.
>>
>>56027927
>TO USE LESS THAN 512MB FOR A 3D >>>/V/
Memory?

Well, to be honest, senpai, you'll need to make it look like 1999.
>>
>>56027788
>associations
What the fuck is it? Haven't you thunk that maybe, because you haven't specified a particular programming language and some basic context, your question is incomplete, non self-contained and thus unRESTful? Die in a fire fag
>>
>>56028260
https://en.wikipedia.org/wiki/Association_(object-oriented_programming)

to replace INHERITANCE
>>
>>56028316
>obj.method() vs method(obj)
In what lang does that even make sense? PHP?

>This relationship is structural, because it specifies that objects of one kind are connected to objects of another and does not represent behaviour.
Wut? What language is that? French?

What are you on?
>>
>>56028316
Not him but isn't this just procedural programming?
How am I supposed to take advantage of polymorphism with this bullshit?
>>
File: zahnd-01 (1).jpg (89KB, 200x300px) Image search: [Google]
zahnd-01 (1).jpg
89KB, 200x300px
>>56028385
Don't question. Trust. Have faith.
>>
>>56028215
On a related note, how long does it take to master python for someone who knows c++.
>>
>>56022515
Is the offer still available?
>>
>>56028374
D has UFCS so obj.method() and method(obj) are equivalent

C++2x will probably have it as well

Don't know if that's what you lads are talking about
>>
File: spr_timecolor.png (766B, 100x40px) Image search: [Google]
spr_timecolor.png
766B, 100x40px
Anyone have any good colors for a day night cycle? Pic related is the cycle I made for the game Im working on but the evening colors just seem too sharp. Any ideas?
>>
File: 1466699976493.png (177KB, 367x321px) Image search: [Google]
1466699976493.png
177KB, 367x321px
>decide to do that thing i put off
>start doing it
>remember the reason why i never did it in the first place
>there are no constexpr trig functions
REEEEEEEEEEEEEEEEEEEEEEE
>>
>>56028476
Write your own
>>
>>56028497
i shouldn't have to, it's ridiculous
>>
it's probably easier to do it "by hand" in mathematica and manually plug in the numbers each time i change the formula... fuck's sake
>>
>>56025585
>What's the point of this thread?
to attack/defend java, C, FP languages, OOP, ...
to ask retarded questions
to do someone elses homework for free
to redefine "programmer" and "developer" once and once again

it's always the same shit. people here are obsessive and autists
>>
File: sample time clip.webm (159KB, 442x365px) Image search: [Google]
sample time clip.webm
159KB, 442x365px
>>56028473
Oh and heres a clip of what the color cycle looks like in game. Any suggestions on the evening colors?
>>
>>56025585
>you cannot possibly be like me. I wrote a compiler

but everyone who has taken a compilers course has written a compiler
>>
>>56028476
constexpr functions can only have a return statement, nothing more. I'm not sure how you would even write a constexpr trig function, given how complex they tend to be.
>>
>>56028563
it can have a body, it's basically a pure function

the function body must be either deleted or defaulted or contain only the following:
null statements
static_assert declarations
typedef declarations and alias declarations that do not define classes or enumerations
using declarations
using directives
exactly one return statement.
(until C++14)
the function body must be either deleted or defaulted or contain any statements except:
an asm declaration
a goto statement
a statement with a label other than case and default
a try-block
a definition of a variable of non-literal type
a definition of a variable of static or thread storage duration
a definition of a variable for which no initialization is performed.
if the function is a defaulted copy/move assignment, the class of which it is a member must not have a mutable variant member
>>
>>56028520
>Why isn't thing part of standard library?
>It should be! I refuse to do it!

If only it were that easy.
>>
>>56028473
I have a shader that samples a pixel bilinearly and uses that as the tint color.
>>
>>56028374
Im talking about implementation OOP in pure C. Did you even read a message I replied?
>>
File: tnt_ClearDay_0.png (182B, 32x2px) Image search: [Google]
tnt_ClearDay_0.png
182B, 32x2px
>>56028602
>>56028473

Here's the texture I use
>>
>>56028563
They can have simple while or for loops as long when you dont modify the arguments.
>>
what will you do when compilers are intelligent enough to understand natural language instructions from liberal arts majors?
>>
>>56028623
program compilers
>>
>>56028589
You should try using the trig functions anyways and check the disassembly. The compiler might do a compile time computation for you.
>>
how does my router know, when I connect with two devices to the same server lets say google.com, how to keep those two sessions apart ?

to clarify: how can a server handle two independent sessions to my network ?
>>
>>56028385
You dont need any advantages.
>>
>>56028240
How much RAM dies modern games take up?
>>
>>56028540
u forgot gay erp
*licks ur butte*
>>
>>56028453
>UFCS
I know. Fuck it. It's a meme.

Nim also does it, allthemore a memey. And it's never gunna work in C++, and there's absolutely no advantages to it, and knowing whether something is supposed to be in the current scope or not is important dammit!
>>
>>56019764
>What are you working on, /g/?
A distributed gossip platform over p2p. Kind of like a 4chan over p2p, minus the images. Or an anonymous twitter.
>>
NEW THREAD

>>56028612
>>
>>56028240
not really

>>56028703
AAA games probably take around 2-8 GB depending on the game and the settings
>>
>>56028671
Think of a packet as a candy, When you send it somewhere at every stop it gets wrapped in another layer of foil saying who wrapped it. Then when a packet is sent back it wraps it in the same multiple layers of foil and as devices unwrap a layer and send it to its next destination.

Going by this analogy when you send a packet saying you want to view google.com it will first say the socket on your PC that wants it (the program on your PC) Then it will say the MAC of your PC (which PC on your network). Than your public IP where you are on your ISP's network, etc.

Did I do good guys? I only took first year of CCNA three years ago and I think I remembered it right.
>>
>>56028606
>Im talking about implementation OOP in pure C.
How could I have guessed? WHERE is tgat written newfag? Fucking congrats on having telepathic powers, but me I don't.
>>
>>56028769
so basically the router is the wrapper ?
>>
>>56028790
Anything that implements one of the protocols.
That includes your kernel, router, switches, etc.
>>
>>56028813
alright thanks, I'll keep digging
>>
>>56028828
Ganbare.
I want to get into this stuff too.
>>
>>56028769
>Did I do good guys?
That's an absolute shit analogy that doesn't explain anything at all and doesn't answer the question which by the way does not mandate a childish analogy by any means. Just explain what device is doing what in virtue of what protocol, here you're just obscuring it. (proof:>>56028790) That's just intrinsically boring stuff that has to be explained in the boring manner IMHO.
>>
>>56028838
any books that you can recommend while were on the topic ?
>>
>>56028853
>books
Waste of time desu.
>>
>>56028850
can you explain it better ?
>>
>>56028853
Look for "TCP/IP" and expressions like "for dummies" in the title, it should do it and go just as deep. I have such a book but it's in French.
>>
>>56028870
>>56028870
sadly, it's the only medium I can use in my surrounding
>>
>>56028616
your problem is that the noon / reddish part of the day isn't long enough, hence why it looks weird.
>>
>>56028786
>How could I have guessed?

>if [b]C's[/b] perfect, how come people have made new languages to avoid it?
>Because pointers and manual memory allocation scare numales and women.
>what about object oriented?
>my message

Are you really unable to understand?
>>
>>56028873
Yup. Easily.

>how can a server handle two independent sessions to my network ?
In addition to the address of the sender and the address of the receiver, packets include two "port number" that are there specifically to discriminate between different networked programs running on the same host. There's one for the web server (the program not the computer), usually 80, and your browser has to specify it when it contacts the computer on which it runs. Your OS assigns your browser a port number when it does that, which the other operating system receives as part of how to respond to the computer that's contacting it. Now here's the twist: evwn though thousands of browsers may be talking to the same server on the same port, it can know who's who based on the return address and the port. I know that you know that your router only has one IP address, but it acts like a single computer when viewed from the internet, and maps port numbers differently than what they are from the inside, in order to make everything work. See, >>56028873, how it's done?
>>
>>56029067
What if you have two computers on your local network, and each computer has 1 browser running.
Isn't there a potential port clash there? how does the router resolve that?
>>
>>56022582
You should use vim, great amount of really useful plugins
>>
>>56028033
So nobody here knows WinAPI? Wow, you guys suck desu senpai.
Thread posts: 329
Thread images: 52


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