[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: 314
Thread images: 31

File: timetocode.webm (2MB, 1152x648px) Image search: [Google]
timetocode.webm
2MB, 1152x648px
This is /dpt/, the best subreddit of /g/

In this thread:
r/programming
r/compsci
r/ReverseEngineering
r/softwaredevelopment

/!\ ** Read this before asking questions ** /!\

http://mattgemmell.com/what-have-you-tried/
http://www.catb.org/~esr/faqs/smart-questions.html


What are you working on?
>>
>>61833713
First for D
>>
File: zeromq-logo.png (5KB, 402x146px) Image search: [Google]
zeromq-logo.png
5KB, 402x146px
I need some ZeroMQ help.

I want clients to connect to a server, make requests, and get replies. Naturally, I tried the REQ-REP pattern. It worked, but there was a problem: requests have to be processed one by one (since ZMQ sockets aren't thread-safe).

Solution: ROUTER-DEALER pattern. Clients connect to the router, which sends all requests through a DEALER that distributes requests to any number of connected workers.
New problem: DEALER fairly distributes requests to workers, whether they're idle or busy.

Example:
>two workers
>1st worker gets a long request from a client, it will be busy for a while
>2nd gets a short request from another client, it replies
>1st worker still has not replied
>new request comes in, DEALER puts it on the 1st worker's queue
>2nd worker is idle, while the 1st one is still busy with the old request, as well as a new one

How can I avoid this?
>>
>>61833734
Depressing
>>
File: s.png (84KB, 1680x1050px) Image search: [Google]
s.png
84KB, 1680x1050px
>>61833713
>What are you working on?

Final day of advent of code. Also, exploring the deepest, darkest corners of Racket.
>>
>>61833713
dumb reddit poster
>>
>>61833266
>thats not an argument.
>macros are an awful relic
You probably use C where the CPP macros are complete garbage. Either way your "argument" is a fallacy. Print is a macro because that way it can correctly type the format parameters at compile time, and trait resolution allows it to resolve appropriate formatting functions. These formatting functions can even be automatically generated (derived, a concept borrowed from Haskell), which is really nice for debugging.
The C "solution" is a huge hack and has all sorts of weird coercement behavior, requires special cases by the compiler to prevent user errors, and has an entire class of exploits dedicated to invalid format strings.

>There is no reason for nested comments to exist,
It's just a minor convenience for when you comment out one block and then you want to comment out a larger block.

>>61833154
> having more than one type of string.
Yeah this is kind of weird at first, but Rust generally tries to enforce a thing about having owned mutable (resizable) things, in contrast to borrowed fixed things. e.g.
Vec<T> vs &[T]
String vs &str
PathBuf vs Path
The variants on the left have length and capacity, and can be resized (e.g. push onto a vector, insert onto a string, add to the end of a path). The variants on the right have only length, can't change size (you CAN take substrings of str's though, unlike with C strings).
Another important point is that String is implemented by the standard library, while str is built into the language.


I like Rust, I think its a huge improvement over C++, however I think that it doesn't always occupy the niche of C, and I think that there are some major complexity issues that are going to be too big of a barrier of entry for most shitter programmers. However I think most of your points are shit
>>
>>61833780
>deepest, darkest corners of Racket
Like what?
>>
can I get in legal trouble with goodreads if I release my multitag search extension? it doesn't use their rated limited API
>>
>>61833780
>that font
kys yourself then leave the thread and never comeback
>>
the difference between a "programmer" and a software engineer is that a programmer defines himself by which languages he knows, while a software engineer defines himself by what he can program.

a programmer thinks it's enough to know how to use a hammer and saw
a software engineer realizes that knowing how to build a house is what's actually valuable

debate me
>>
>>61834416
>debate me
People who go to school for software engineering are often not able to build metaphorical houses.
People who view themselves as programmers often have.
>>
>dichotomies
>hardware analogy
id rather not
>>
File: 2017-08-10-181134_1639x854_scrot.png (228KB, 1639x854px) Image search: [Google]
2017-08-10-181134_1639x854_scrot.png
228KB, 1639x854px
We did it, reddit! we saved Christmas.

>>61833906
>>61834216
Please don't bully.
>>
>>61834435
>People who go to school for software engineering are often not able to build metaphorical houses.
>People who view themselves as programmers often have.
the problem is that very often they can't build real houses, and have trouble with the metaphoricals as well
>>
>>61834416
>debate me
No, I agree with you.

This extends to any professional with some sort of domain- or industry-specific knowledge that can leverage a programming language to solve real problems.
>>
>>61834416
no. software engineers design the interface/specification of the program and then manage the programmers who will implement that interface.
>>
>>61834481
So, what's your verdict on Racket?
>>
>>61833780
Can you do that in whatever language you want?
>>
>>61834416
A software engineer, or better: architect, knows the program.
A programmer knows the components.
>>
>>61834653
advent of code? yes

http://adventofcode.com/2016/
>>
>>61834674
cool, might give it a go
>>
connection error
>>
I need to read a matrix, send it to a function and add the elements from the first row and second columns

But
somalinha+=matriz[i][j];
and
somacoluna+=matriz[i][j];

Are producing garbage wtf
REEEEEEEEEEEEEEEEEEEEEEEEEEE
pls help

https://pastebin.com/sMVb4yj0
>>
someone should make a programming language based on JSON
>>
>>61834835
Because somalinha and somacoluna are not initialized? Dont your compiler give you warnings about it?
>>
>>61834842
JSON = JavaScript Object Notation
>>
>>61834481
this is so cute.
>>
>>61833713
We are making a web browser! >>61834915

Join the IRC channel if you want to collaborate.
>>
File: 1405655941443.png (34KB, 633x758px) Image search: [Google]
1405655941443.png
34KB, 633x758px
>>61833713

Halp /g/.... been stuck on this simple problem for hours.

Every time I output my code to a file all the headers show up for each file read in.

How do I suppress the header to only the first index?

Here is my code:
http://dpaste.com/164R131

What output I should be getting: http://dpaste.com/23YFSG7.txt

What my crappy code is getting:
http://dpaste.com/2MMY224.txt

Edit: I deleted line 6 but it still does nothing.

Edit2: base just prints out the filename without .csv suffix. I used base = os.path.basename(input_file).

My csv files look liket this: http://dpaste.com/0M06WWD.txt

Any ideas /g/?
>>
>>61834937
Any new exciting features/milestones?
>>
>>61834937
Why not use WebKit, Blink or Servo?
>>
i'm writting a parser and sometimes strings get returned like this
<a href="#p316099" class="link">&gt;&gt;316099</a><br>this is a test


i only want the "this is a test" part.

do i have to write a regex for this? how can that be done?
>>
>>61834957
They are working on opengl for what I see on the IRC, also debugging.
>>
>>61834937
Is this the one with the racist fast food chain celestial body or another one?
>>
>>61835007
don't use regex for aich tee emm ell
>>
>>61834949
Not enough info. But my guess is that you execute this part for every input file and it writes header every time as you order it to.
>>
File: moonicon32.png (295B, 32x32px) Image search: [Google]
moonicon32.png
295B, 32x32px
>>61835019
>discriminating a logo
Some of us don't care what obscure reference you remember but we like it looks cool. Is not the only logo anyway.
>>
>>61835025
what do then?
>>
File: 1465519075030.png (230KB, 548x642px) Image search: [Google]
1465519075030.png
230KB, 548x642px
>>61834835
this code is wrong on so many places I can't believe it actually compiles
>returning multiple values from soma
>not storing the return value in main
>using uninitialized variables
>return(0) without ;
also it's seems you don't know what "scope" means. a tip: use -Wall -Werror -pedantic when compiling C code, it will save you a lot of trouble sometimes.
>>
>>61835066
Just asking because I decided not to contribute because of how poorly associating yourself with fastfood would reflect on you.
>>
>>61835088
>moving the goalpost
I see what you did there.
>>
File: 1502384158143(1).png (160B, 32x32px) Image search: [Google]
1502384158143(1).png
160B, 32x32px
>>61835066
YOUR PNG IS NOW OPTIMIZED
>>
Might implement protobuf in Racket
>>
>>61835053

what more info do you need? I import all the files using glob.glob and then use a for loop to arrange the data, and then output it to file
>>
>>61835133
How did you do that?
>>
>>61835008
Are they building it completely from scratch?
>>
>>61835150
I believe they do now but originally they borrow from links2 codebase.
>>
>>61835149
magic
>>
>>61835179
Thats not a very good idea, web browsers these days are as complex as operating systems. And 80% of what you want to do with a web browser is just conform to the spec (or the unofficial spec that everyone else is conforming to) so you gain a LOT by leveraging someone elses efforts e.g. webkit.
Good luck, I guess
>>
>>61834891
Didn't work, ant there was no warning

>>61835078
Thanks
>>
>>61835213
The idea is not to reinvent the wheel each time you depend on some new thing on the web but to reuse applications already in your computer.
Like for example they take from the unix philosophy to send media like videos to a video player you already have installed.
I particularly like this idea.
>>
>>61833713
Go to hell, animetard.
>>
>>61835252
Found the problem, I used a global variable
>>
>>61833780
>vectors
Ew
>>
>>61835324
what's wrong with vectors :)
>>
>>61835356
They're not nearly as flexible as lists. And it's not just that you're using vectors, but that you're using vectors as association tables.
>>
>>61835007
>trying to use regex to parse html
>writing your own parser in the first place
There are some cases where you are most definitely not going to write anything that's better than an existing library, this is one of them. If you're doing it as a learning exercise, don't. There are simpler markup languages you can write parsers for.
>>
>>61835260
Have you heard of suckless's surf?
>>
>>61835497
i got around using BeautifulSoup

string = """<a href="#p315998" class="quotelink">&gt;&gt;315998</a><br>this is a test"""

print (BeautifulSoup(string,"lxml").get_text())

but still outputs some garbage
>>315998this is a test
>>
>>61835506
That looks nice, very lightweight. It did crash on me but worked youtube at the end. I read on the manpage that has plugins and scripts? Nice.
I didn't see any bookmarks, maybe if I see a script to have my firefox bookmarks I'll use it instead of FF.
>>
>>61834916
ah so javascript is based on JSON
>>
>>61835672
Instead of bookmarks you can just make bash aliases.
alias surf-g='surf >>


I used surf for a while and I liked being able to directly customize stuff (especially custom search engines) with very little hassle, didn't have to learn weird extension APIs etc. But I stopped using it because it was too buggy, had rendering issues and didn't display alot of pages correctly. This is probably webkit's problem
>>
https://github.com/ron-rs/ron
Why aren't you using the Rusty Object Notation, /g/?
>>
>>61834842
You could basicaly encode lisp using JSON, just replace symbols with strings and lists with arrays. You'd have to do some more work to get string literals, pairs etc.

["define", ["length", "lst"],
["if", ["null?", "lst"],
0,
["+", 1, ["length", ["cdr", "lst"]]]]]
>>
>>61835822
I have a shitton of bookmarks ( > 30 MB in html) so is not an option for me. Maybe I can use the html file and browse the file somehow.
I still want NetRunner, is too good of a concept and somewhat similar to surf, theck their feature list.
Posted from surf.
>>
>>61835831
>not using scribble
http://docs.racket-lang.org/scribble/index.html
>>
>>61835899
> > 30 MB in html
Christ. If you still really want to go minimal you could use 2-line bash scripts as bookmarks
$ cat book/google
#!/bin/bash
exec surf https://google.com

$ cat book/4chan/g
#!/bin/bash
exec surf >>
>>
File: c.jpg (79KB, 633x480px) Image search: [Google]
c.jpg
79KB, 633x480px
Can I use XML to store information (the parameters) about loudspeaker drivers?
>>
>>61836128
Yes. Its kinda bloated though.
>>
>>61836128
this>>61836185
just use regular old csv
>>
>>61834416
>>debate me
>arguing semantics
you already lost
>>
>>61835952
That is more like quickmarks in dwb (the browser). I think I stay with just surfraw, but still no replace for a bookmark system.
>>
File: 1502059925736.jpg (293KB, 3000x1692px) Image search: [Google]
1502059925736.jpg
293KB, 3000x1692px
in c++ theres cout, cerr and cin. cout writes to cin but how do i read cerr? does it also write to cin? how to differentiate between normal output and errors?
>>
>>61835896
You could basically encode any AST in JSON for any language.
>>
>>61836433
>>>/g/fglt
>>>/g/sqt
>>
>>61833713
>This is /dpt/, the best subreddit of /g/
>the best subreddit
>subreddit
>reddit
You have to go back.
>>
File: 1485451626806.jpg (23KB, 480x443px) Image search: [Google]
1485451626806.jpg
23KB, 480x443px
should i fall for the oop meme?
>>
>>61836529
>doesn't recognize world's most obvious bait
you're the one who has to go back
>>>/r/eddit
>>
>>61836483
>cout writes to cin but how do i read cerr?
cout writes to stdout by default, cerr to stderr. Read about pipes and stream redirection in order to understand how to make the link between the output of a program and the input of another.
>>
>>61836534
No please don't. It's not helping at all. It's just a way for software architects to not have to program anything and present something that looks pretty to the client. But from a programmer's perspective, it's a nightmare, nowhere near what's hyped about OOP.
>>
>>61836534
>>61836625
Specify what you mean by OOP.
>>
>>61836635
I think he means Object Oriented Analysis, not OOP
>>
>>61836599
the problem here is that my program uses cin to read text and the other, redirected program sends error messages over cerr, what do?
>>
>>61836730
Redirect stderr rather than stdout to stdin.
>>
>>61836737
but it sends valid text over stdout and errors over stderr, i want to read both, is there no standard way to do this?
>>
>>61836787
You can redirect both to stdin but I don't know how you'd handle both.
>>
>>61833713
>This is /dpt/, the best subreddit of /g/
It's a bunch of pajeets and juniors and schoolkids who are trying to look smarter than they are by means of denying actual production tools like OOP, imperative languages, scripting languages etcetera in favour of their own personal preferences for their school or amateur projects.

I've never seen here actual discussions about real algorithmic or computational problems or about denotational semantics, workflow organisation and collaborative processes, or internals of a CPython virtual machine, etc, etc.

All you care about is fucking around programming languages and showing off slivers of knowledge in some fields.

I'm actually now working on CUDA and multithreaded acceleration of a serial code for a computer graphic tool and on a Linux kernel driver for an input device but I've never had a desire to discuss it with the shitty habitues of this thread.
>>
>>61835324
i need random access, not sequential access.
>>
>>61836906
You so cool, where can I subscribe to your blog?
>>
>>61836906
Let's talk about denotational semantics, friend. What are your thoughts on this issue?
>>
>>61833713
how the fuck do I into natural ordering of strings the way an OS does it?

ASCII sort ordering is fucking pants on head retarded, yet so much software uses it. And come to think of it, so do standard collection libraries.

It is almost always the wrong way to sort things.
>>
>>61836969
i prefer python
>>
>>61836906
>>61836906
I'd rather have a nice chat about workflow organisation and collaborative processes, that'll fit nicely in the /daily programming thread/ about what programmers are actually working on.
>>
>>61836994
What do you mean? How is the alphabet wrong?
>>
>>61836906
There are quality discussions on /dpt/. It depends on the time of day.
>>
>>61836906
>internals of a CPython virtual machine
crap
>>
>>61837018
> t.non programmer
>>
>>61836185
>>61836199
Was thinking of something like this:
<?xml version="1.0"?>
<LoudspeakerDriverData version="0.01" driver_type="dynamic">
<Parameters>
<Mechanical>
<Parameter type="diameter" unit="cm">17.4</Parameter>
<Parameter type="weight" unit="kg">2.75</Parameter>
</Mechanical>
<ElectroMechanical>
<Parameter type="voice_coil_travel" unit="mm">1.0</Parameter>
<Parameter type="magnet_type">Feroba 2</Parameter>
<Parameter type="qms">0.291</Parameter>
</ElectroMechanical>
<Electrical>
<Parameter type="voice_coil_resistance" unit="ohm">7.1</Parameter>
</Electrical>
<Acoustic>
<Parameter type="efficiency">3.5</Parameter>
<Parameter type="sensitivity" unit="db">93</Parameter>
</Acoustic>
</Parameters>

<Measurements>
<Measurement type="impedance" unit="ohm">
<Datapoint freq="10">7.5</Datapoint>
<Datapoint freq="20">7.8</Datapoint>
<Datapoint freq="30">8.3</Datapoint>
</Measurement>
<Measurement type="frequency_response" unit="db">
<Datapoint freq="10">60.1</Datapoint>
<Datapoint freq="20">62.5</Datapoint>
<Datapoint freq="30">73.4</Datapoint>
</Measurement>
</Measurements>
</LoudspeakerDriverData>
>>
/dpt/ is a bunch of pajeets and juniors and schoolkids who are trying to look smarter than they are by means of denying actual production tools like OOP, imperative languages, scripting languages etcetera in favour of their own personal preferences for their school or amateur projects.

I've never seen here actual discussions about real algorithmic or computational problems or about denotational semantics, workflow organisation and collaborative processes, or internals of a CPython virtual machine, etc, etc.

All you care about is fucking around programming languages and showing off slivers of knowledge in some fields.

I'm actually now working on CUDA and multithreaded acceleration of a serial code for a computer graphic tool and on a Linux kernel driver for an input device but I've never had a desire to discuss it with the shitty habitues of this thread.
>>
>>61837035
Can you enlighten me?

Are you referring to things like underscores coming between capital and lowercase ASCII letters, and being sorted the same regardless? Or what?
>>
>>61837059
Use JSON instead.

Mixing XML attributes and values is cancer.
>>
>>61837018
>>61837077

He is talking about a common problem where lists of strings containing numbers are ordered non naturally, they value the numbers in the strings using their ASCII values.

Almost every standard Collections library does it this way.

so the collection (rfc1.txt, rfc202.txt, rfc81.txt) would be ordered in that way. not;

rfc1.txt
rfc82.txt
rfc202.txt

which makes way more sense to humans, hence the name natural ordering.
>>
Is there a way for a student to get free MS isos for malware analysis learning?
>>
>>61837113
That's the only sane way to treat those 3 values you just wrote.

Are you expecting the sort algorithm to randomly start parsing ints/longs/doubles(!!!) from strings?
>>
>>61837096
>JSON
I will take a look at that, thank you Sir.
>>
>>61837059
Thats exactly what I had in mind when I said
> bloated
But its up to you what to use.
Also you piling too much work on youself by having varible units. Just decide on the unit you will store as default and convert those when you need to display them if the need will arise.
>>
>>61837122
Talk to your school's IT department. Usually, they have some MSDN licensing to work with. Otherwise, you might just go use the Dev Essentials (and/or whatever they call Dreamspark these days) free Azure credit to stand up VMs and use those.
>>
File: xml.png (26KB, 496x320px) Image search: [Google]
xml.png
26KB, 496x320px
>>61837059
>>
>>61837143
you are a fucking retard lol.

That or, a pajeet.

Have you ever fucking used a file manager before? /g/ is full of complete mongoloids.
>>
Which language comes closest to lambda calculus?
>inb4 pen&paper
>>
>>61837375
scheme
>>
>>61837375
Typed or untyped?
>>
>>61837375
Coq, it just add a fourth constructor: forall
>>
>>61837412
untyped
>>
>>61837433
https://people.eecs.berkeley.edu/~gongliang13/lambda/
>>
I've got a little bit of knowledge about js and now i want to test it. And I think that making simple game sounds to me like a good "logic" experience. What framework should I use? Ofc first I will learn about it before I start but I would like to hear your propositions.
>inb4 js =/= games
I don't want to make next minecraft but just put my knowledge for test and play with language.
>>
>>61837151
>>61837096
I took a look at the JSON format and you guys really weren't memeing. It looks much more clean and easier to work with than XML. I definitely like it more than XML.
>>
>>61837478
Make a duck hunt clone with vanilla JS and webGL.
>>
>>61837478
use the canvas
>>
Anyone here have experience with KD trees? I was reading about SAH but I don't really get it.
Do I calculate SAH for each axis then pick the best and split recurse like that?
Also am I supposed to store the bounding volume for each sub tree or recalculate it each time?
>>
>>61834200
You can get "into legal trouble" with anyone for any reason. Anyone can sue you for completely retarded reasons and it's up to you to make your defense and it's up to the judge to decide if it's retarded or not. If you're doing anything rewarding (= money) in life at all, assume you will be sued for it, and worry about winning the case instead.

Note that having or making money will paint a huge legal target on your back, due to the simple fact that they can ask for damages. It's a state-mediated redistribution of wealth opportunity, bordering on legal extortion, where someone finds an angle to sue you and claim damages, and if the judge agrees he orders you to pay the guy. Pressure to settle out of court will be great, they will make paying some relatively small sum of money seem attractive to the idea of dragging it out in court and possibly losing and having to pay more. It's pretty much an industry at this point. The more money you have, the more money they will ask. If you're a NEET, you can pretty much disconsider this risk. What the fuck would they sue you for? There are better targets for frivolous, trollish litigation.

If you are in another country in relation to the affected party, you can pretty much ignore that risk as well. There are easier targets than you. They will have to jump through so many hoops to reach you it's not even funny, and even then there's the fact your country's justice system gives exactly zero fucks about american laws, and it's not like they will extradite you to america just because you violated a contract.

Really, if you're a 4channer, chances are the only reason someone'd want to sue you is it's personal and they want to fuck with you so much they're willing to pay lawyers to do it. I doubt you autists have pissed anyone off that much. You worry about legal trouble if you graduated medical school and are making 300k a year. You're scraping some shitty site's HTML from your computer at home.
>>
I have written a program (in Python, using Requests), that makes a HEAD request to a server to obtain some header information. Pretty simple stuff.
Now the thing is, for reasons that I don't want to disclose, I am doing this approximately 360,000 times in a row.
I have done some estimations based on previous experiments, and in the worst case, this could take 1 seconds per try, leading up to a total time of half a week of running time.
This is not desirable.

How can i speed this up? I don't think multi-processing will work, because i still have to make a connection to the same server, and if i "spam" it, it wll time me out and that might break the program
>>
Rustaceans,

is there any better way to make a runtime-sized uninitialized buffer to pass as a pointer to C than:

let mut buffer: Vec<whatever> = Vec::with_capacity(size);
buffer.set_len(size);
foo(buffer.as_mut_ptr());
>>
File: 1494699047278.jpg (51KB, 640x640px) Image search: [Google]
1494699047278.jpg
51KB, 640x640px
>>61838123
>Rustaceans
that's just sad, anon
sad and hilarious
>>
>>61838162
dumb anime poster
>>
File: tenor.gif (2MB, 498x278px) Image search: [Google]
tenor.gif
2MB, 498x278px
>>61833713
Is Umaruchan, dare I say it... /ourgirl/?

Also, working through an R book
>>
For some reason I have code that compiles and runs perfectly fine, except for "runtime error: member access within misaligned address 0x00000067706a for type 'struct XXXX', which requires 4 byte alignment"
but it runs to completion and works perfectly otherwise. When I removed the struct and had identical variables, I get a segfault and the process does not complete.

Does misaligned address mean a pointer is off?
I was just using the struct for easier malloc and free, but I hadn't malloc'd all of the variables that were inside the struct yet, could that be causing it?
>>
File: 1400017667085.jpg (14KB, 224x324px) Image search: [Google]
1400017667085.jpg
14KB, 224x324px
>>61838223
What did you just say about me, you stupid baka? I’ll have you know I am the best of the Brit/pol/ Karenposters, that I’ve been involved in numerous secret raids on Alice threads, and that I have over 300 confirmed Karen images. I am trained in cute warfare and I’m the top desu in the entire Japanglosphere. You are nothing to me but just another senpai. I will cute you the dess out with kawaii the likes of which has never been seen before on this Earth, mark my sugoi words. You think you can get away with saying that about me over the Internet? Think again, baka. As we speak I am contacting my secret network of Karenposters across 3D and your school is being traced right now so you better prepare for the transfer, senpai. The transfer student that karen watashi desu your rude life. Your heart will stop. I can be anywhere, anytime, and I can kawaii in over seven hundred ways, and that’s just with my voice. Not only am I extensively trained in being cute, but I have access to the entire cast of Kiniro Mosaic and I will use it to its full extent to send you back to not-cute-ville. If only you could have known what totemo kawaii reaction images your little "kuru" comment was about to bring down upon you, maybe you would have held your tongue. But you couldn’t, you didn’t, and now you’re paying the price, baka. I will desu~ all over you and you will drown in it. desu.

https://www.youtube.com/watch?v=60mLvBWOMb4
>>
>>61838308
take your meds
>>
What does the '~' mean?

#define REDRAW_STATUS      1 << 2
/* [...] */
tmp->update &= ~REDRAW_STATUS;
>>
>>61838441
logical NOT
>>
>>61838123
Looks about right, you could mem::uninitialized, but what you did looks good to me.
>>
>>61838448
so it flips it?
>>
>>61838448
yes
>>
>>61838441
>>61838448
bitwise not mb?
>>
>>61838494
bitwise
>>
File: 1483073157801.jpg (110KB, 1280x720px) Image search: [Google]
1483073157801.jpg
110KB, 1280x720px
Employed Haskell programmer reporting in
>>
File: Без име.png (99KB, 1366x728px) Image search: [Google]
Без име.png
99KB, 1366x728px
>>61833713
trying to understand dynamic memory on c, after 4 days I managed to finally break thru the **p.
Tomorrow starting with "passing matrix by reference to functions"
wish my luck anons
>>
>>61838588
PROTOTIPO MEMORIA DINAMICA
>>
>>61838588
good luck
>>
>>61838588
Isn't there an automatic identation in the editor, anon? It looks awfully inconsistent
>>
should I learn scheme (sicp) or haskell (undetermined book) as my first language? I have a very strong math background but no programming experience.
>>
>>61838656
Scheme is a bit too practical and useful for mathematicians like yourself, you should learn Haskell using the wikibook
>>
>>61833738
What the hell is zeromq
>>
>>61838656
do you want to program computers? C
do you want to "program"? pick something else
>>
>>61838656
If you go on
http://rosettacode.org/wiki/Rosetta_Code

You can look at various problems and their solutions in various languages

Compare scheme and haskell
>>
>>61838656
Important differences

>Haskell is pure and is known for having a strong type system
>Scheme is impure and is known for metaprogramming
>>
>>61838656
C, then Haskell. The former is a pretty small and simple language and will give you an idea of how computers fundamentally work.
>>
>>61838614
>programming in spanish

I seriously fucking hope you gays dont do this
>>
>>61838732
He's a mathematician, he doesn't need to know that
>>
>>61838732
>C
>learning programming
pick one
>>
>>61838561
Иди дoмoй, ты пьян.
>>
>>61838308
Karen deserves the zyklon
>>
>>61838752
I had some background in ruby then I moved to C.
So far hasn't been easy but once you start "thinking in C" everything starts to fit in.
>>
Hey lads, I'm off to college in a few days and was looking for a good project that I can do in the meantime. What are some good ideas? I can't use the programming challenges picture because a friend of mine has already done the interesting ones (verlet cloth, constructive solid geo, and other stuffs) >:^(

No language of choice, but no more webdev projects. Maybe something to try out a new language (ocaml, haskell, cpp)
>>
>>61838656
>should I learn scheme (sicp) or haskell (undetermined book) as my first language? I have a very strong math background but no programming experience.
If you would believe in the study plan of my university then you should learn:
Assembler (x86, protected), C, C++, Assembler (real mode and writing an OS).
Yes, in this order. Yes we are 'mathematicians' after all.

Try something easy for fun. Programming should be fun, or you'll dump it soon.
Pick python, after year of practice or so proceed further.
>>
the fuck is this doing

xt = int('%1X%1X%1X' % (kd[0], kd[1], kd[2]), 16)
>>
>>61838656
Math background here. Scheme. Scheme is a language that's very axiomatic in its design.

The language specification is incredibly short and readable (40 pages vs 150 pages) and designed so that a shocking variety of things are just libraries built on top of the language.

Also the metacircular evaluator will turn you on.
>>
>>61839118
Have you tried Haskell?
>>
>>61839067
reading a string as a base16 number
>>
>>61839124
Yes I don't like its syntax.

Scheme is a handful of special forms plus combination with some primitives. Beautiful stuff.
>>
>>61833713
I'm currently working through pic related and would like to verify my understanding using arrays as function arguments. (i'm on p.28, section 1.9)
After talking about how functions use pass-by-value for normal variables, the text then says:
The story is different for arrays. WHen the name of an array is used as an argument, the value passed to the function is the location or address of the beginning of the array - there is no copying of array elements. By subscripting this value, the fucntion can access and alter any element in the array. this is the topic of the next section.
This makes sense to me. Now, here is the example code they use in the next section:
https://hastebin.com/nojivowiti.cpp
So, my questions are:
When passing the array line[MAXLINE] to getLine(), i get we are passing an array of length MAXLINE, but what are the entries of the array if we haven't declared them yet? Are they null characters?
second question: i understand that in getLine() we are changing the actual entries of line[] even though we are using s[], but how do line[]'s entries get reset when we pass it pack to getLine() on the next loop? Maybe i can make this question more clear with an example. suppose we enter input that contains two lines, where the first is longer than the second, why doesn't line[] contain the excess letters of the first line?
any help would be most appreciated.
>>
>tfw just got a job offer from my first interview for a junior developer job ever hours after the interview today
Just wanted to thank you guys for being the place I went to during my years of studying CS to talk about code and other shit. You guys are awesome.
>>
>>61833713
What techniques can one use to simplify a program?

I have this 7ksloc piece of code that I believe can be implemented in just 2k or 3k lines but I don't know how to proceed.
>>
>>61839212
Congrats. What's the job?
>>
>>61839234
First of all, what is your belief based on?
>>
>>61839168
I disagree.
If you look at the actual core of Haskell, it's a very simple syntax (in combination with primitives).
I think Lisp style syntaxes are often more awkward.

You can say that you think Haskell is more involved, but Haskell has a strong type system.
Most of the stuff in the report is libraries.
The actual forms are very simple, whether you're dealing with patterns, expressions, types or declarations.

Here's the core of GHC expressions:
data Expr b    -- "b" for the type of binders, 
= Var Id
| Lit Literal
| App (Expr b) (Arg b)
| Lam b (Expr b)
| Let (Bind b) (Expr b)
| Case (Expr b) b Type [Alt b]
| Cast (Expr b) Coercion
| Tick (Tickish Id) (Expr b) -- source annotations
| Type Type


Most of the values (including control structures) in Haskell could have been defined by the user. (All if you use FFI.). You could write Haskell code "without primitives".
>>
>>61839301
the guy who implemented it is a web designer and he himself admits he just hacked something together and didnt really know what he was doing most of the time.

i have fixed and optimized multiple pieces of his code over the last 7 months.
>>
Redpill me on Lazarus faam

My older colleagues are nostalgic AF about Delphi
>>
reminder that microsoft azure is a scam

they actively avoid informing you about how exactly their services work and what limitations they have
>>
>>61839396
Ah, probably a fair, if slightly ambitious estimate.
If it smells like overly long or repeated functions, factor the smaller bits of functionality out. If it smells like looping over arrays, consider converting them to Array methods like map/filter/reduce/forEach/some/every, or bring in lodash for some serious concision. If it smells like callback hell, consider bringing in a promise library. That's just what comes to mind off the top of my head.
>>
>>61839474
>No, you've been brainwashed by CS people who thought that Niklaus Wirth actually knew what he was talking about. He didn't. He doesn't have a frigging clue.
Linus Torvalds
>>
>>61839490
Like every products coming from M$? People like that.
>>
>>61839184
>When passing the array line[MAXLINE] to getLine(), i get we are passing an array of length MAXLINE, but what are the entries of the array if we haven't declared them yet? Are they null characters?
line was allocated on the stack, so it's initial contents are whatever random values were there in memory at the time.
>second question: i understand that in getLine() we are changing the actual entries of line[] even though we are using s[], but how do line[]'s entries get reset when we pass it pack to getLine() on the next loop?
They don't get reset.
>Maybe i can make this question more clear with an example. suppose we enter input that contains two lines, where the first is longer than the second, why doesn't line[] contain the excess letters of the first line?
The longer string's characters are still there after the '\0' that ends the new shorter string.
>>
What are /dpt/'s thoughts on Prolog?
>>
File: Thinking_Face_Emoji_grande.png (143KB, 600x600px) Image search: [Google]
Thinking_Face_Emoji_grande.png
143KB, 600x600px
Is it possible to take the assembly output of a non-c language and compile it with a C compiler, taking advantage of the optimizations?
>>
>>61839658
Yes
>>
>>61839659
No.
>>
>>61839670
Any alternatives, then?
>>
>>61839658
Pretty good language

or so I would have said, but then Satan said it was good >>61839666

So now I'm against it.
Use Haskell and LogicT instead.
>>
Everyone ITT only pretends to love C but in reality they would rather not use it.
>>
Should I study a system technician degree then move to CS?
>>
File: 1497561904744.gif (2MB, 330x250px) Image search: [Google]
1497561904744.gif
2MB, 330x250px
>>61839666
Oh you
>>
>>61839695
are you trying to take my job?
>>
>>61839684

There are plenty of things I'd be perfectly fine using C for.
>>
>>61838874
anything lads ?
>>
>>61839684
I actually like C, though.
>>
>>61839821
Like what?
>>
>>61839821
>>61839840
I'm guessing you also like open source? So why does this bug continue to exist? >>61837134

Isn't this a chance to use your skills for something useful?
>>
>>61839678
rewrite it in C
>>
>>61839885
Fuck no
>>
>>61839874
I'm not touch GTK/Glib trash.
>>
>>61839899
It's C
>>
>>61839911
Yes? Just because I like C, it doesn't mean I like everything written in C.
I personally think Glib is fucking stupid, and I go out of my way to avoid using it.
>>
>>61839945
C's stdlib is too small, hence a high level library is required for desktop apps
>>
>>61839874
how is that a bug?
>>
>>61839972
I hate every "standard library replacement" library.
They're always bloated beyond your worst nightmares and infect your entire project.
Write a library that actually has a fucking focus.
>>
>>61840011
glib doesn't replase stdlib though
>>
File: Spectacle.M21225.png (666KB, 1920x1080px) Image search: [Google]
Spectacle.M21225.png
666KB, 1920x1080px
Rate my first C++ program
>>
>>61840304
>no return 0
>>
>>61840304
>C++
Stop now, before it's too late.
>>
/dpt/ is a bunch of pajeets and juniors and schoolkids who are trying to look smarter than they are by means of denying actual production tools like OOP, imperative languages, scripting languages etcetera in favour of their own personal preferences for their school or amateur projects.

I've never seen here actual discussions about real algorithmic or computational problems or about denotational semantics, workflow organisation and collaborative processes, or internals of a CPython virtual machine, etc, etc.

All you care about is fucking around programming languages and showing off slivers of knowledge in some fields.

I'm actually now working on CUDA and multithreaded acceleration of a serial code for a computer graphic tool and on a Linux kernel driver for an input device but I've never had a desire to discuss it with the shitty habitues of this thread.
>>
>>61840037
replace*
>>
Hey guys, I'm trying to write PVP for a multiplayer game of mine, and I can't figure out how to handle it.

The problem is that one client sends the server that they own X, but another client says that they took control of X from that client. Due to that conflict, the ownership doesn't change.

What do?
>>
>>61840333
trips of truth
>>
>>61840304
>using io streams
>>
>>61840304
Looking breddy good
>>
>>61840373
I was just wondering, is there any sugar for creating arrays like {0 ... 6} or something, instead of writing {0, 1, 2. 3. 4. 5} ?
>>
>>61840342
Is this something that can be handled clientside or should be handled serverside?
>>
File: Clipboard01.jpg (11KB, 500x181px) Image search: [Google]
Clipboard01.jpg
11KB, 500x181px
>deprecate one class
>recompile
>mfw
>>
>>61840342
kill yourself
>>
>>61840333
yikes /dpt/ eternally BTFO

Hacker news and stack overflow are far superior to /dpt/ for this reason
>>
>>61840342
obviously keep track of X on the server side
>>
>>61840534
Stop samefagging
>>
There is nothing wrong with programming Python and anyone who disagrees is a pseudo-intellectual who thinks programming fizzbuzz.c makes them superior
>>
>>61840534
those sites are gay wastes of time too
>>
>>61833713
Trying to write a guide to compile then run several .cpp files

I have the following files:
main.cpp
V_A.cpp
V_A.hpp


main.cpp depends on V_A.cpp and V_A.hpp.
When I compile main.cpp using
 g++ main.cpp 
I get linker errors, so I'm not sure what I should be doing.

Should I use a Makefile?
>>
File: stopwrongfagging.png (25KB, 518x272px) Image search: [Google]
stopwrongfagging.png
25KB, 518x272px
>>61840545
>samefagging
Wrongfag
>>
>>61840583
#pragma once
>>
>>61840541
In general, conflict resolution should be handled server side?
>>
>>61840393
You can use recursion maybe ? Not worth in your example tho.
t.brainlet python beginner
>>
>>61840594
that's the only way to be sure because clients can send complete bogus information. but you can give the client some amount of trust when you need to minimize latency
>>
File: komplexitet.jpg (44KB, 396x283px) Image search: [Google]
komplexitet.jpg
44KB, 396x283px
Can someone explain why both of these algorithms have time complexity of O(n)?
The second one does two operations for every "round", it should have O(2n)
>>
>>61840757
>The second one does two operations for every "round", it should have O(2n)

When talking about Big-O notation, we don't care about factors, so O( c * n) == O (n) (where c is an arbitrary factor). We don't care about factors because we're only focused on the order of growth (linear).

If you double the input size of the algorithm, the running time doubles.

In addition, when talking about Big-Oh in iterative loops, you do the following to calculate the total Big-Oh:
{Number of iterations } * {largest Big-Oh inside the loop }

So if you had an operation that took log(n) time to complete (such as searching in an ordered set), a for-loop that runs the operation n times runs in O(n log n) time

Hope this helped

>>61840591
Still getting the linker errors despite doing #pragma once in the header file
>>
>>61840757
O(2n) = O(n)
>>
>>61840393
The easiest I can think of is as follows (but again, I'm a brainlet when it comes to python)
size_of_array = c
int_array = [0] * c #initializes array of size to all zeros

for ind in xrange(len(int_array)):
int_array[ind] = ind


There's probably an easier way of doing this with list comprehensions but I can't be bothered to give a shit
>>
>>61840870
I'm a fucking moron
int_array = range(c)
>>
>>61840845
>Still getting the linker errors despite doing #pragma once in the header file
If main.cpp calls functions in V_A.cpp, you will have to either compile them both in the same command
 g++ main.cpp V_A.cpp [\code] or compile each to object files, then link them
g++ main.cpp -c
g++ V_A.cpp -c
g++ main.o V_A.o
[\code]
>>
>>61840757
Ordo notation doesn't measure the actual time it takes for an algorithm to complete, but how much the completion times grows depending on input.
>>
Can someone post one of those diceroll images where you program something based on your post number? I want to start learning to program but I can't FUCKING stand all these "hello worlds" and "input johnny retard's grades then calculate the average" baby steps, it's fucking killing me. I'd rather dive right into some puzzle-tier challenge.
>>
File: Smiles.jpg (18KB, 500x375px) Image search: [Google]
Smiles.jpg
18KB, 500x375px
>>61840956
This helped! Thanks, man!!
>>
>>61840342
You have to run the game state on the server. The clients should be only slightly more sophisticated than a monitor and a gamepad.
>>
File: ProgrammingChallenges, 4.0 (HD).png (2MB, 3840x2160px) Image search: [Google]
ProgrammingChallenges, 4.0 (HD).png
2MB, 3840x2160px
>>61840979
>puzzle-tier challenge.
Project Euler: https://projecteuler.net/
Rosalind: http://rosalind.info/problems/locations/
Python Challenge: http://www.pythonchallenge.com/

Diceroll Image is attached
>>
>>61841029
Thanks, anon.
>>
>>61840979
Then upgrade to a harder book anon. It's a bad idea to try to learn programming without a good foundation.
>>
>>61839868

Low level libraries.

>>61839874

That's not a bug, that's a lack of a feature. A bug would be where the program does not behave as intended.
>>
>>61833713

Is there a plugin that does a better job of managing the emacs buffers? Why does opening REPLS open in the current buffer where I'm working.
>>
File: awkward_programming_neet.jpg (164KB, 620x500px) Image search: [Google]
awkward_programming_neet.jpg
164KB, 620x500px
Quick, print baka in your favorite programming language!
package main

import "fmt"

func main() {
fmt.Println("baka")
}
>>
>>61841062
Yeah, I can see myself missing out on important shit, like arrays, by teaching myself. I'd have to come back to lesson plan or book to learn it. Who knows what else I might miss so I'd have to go through all of it anyway. Thanks for the advice.
>>
>>61841292
#include <stdio.h>
main()
{
printf("baka");
}

>>
>>61841347
>implicit int
Please, anon.
>>
>>61841292
print("b-baka")
>>
>>61841347
.text
.global main
main:
push {r7, lr}

mov r0, #1
ldr r1, =string
mov r2, #5
mov r7, #4
svc #0

pop {r7, pc}

.data
string: .asciz "baka\n"
>>
C++, looping trough the char's of string, what is better:
for loop that uses indexes and string size vs for loop that uses iterator.
>>
>>61841292
#include <iostream>

auto main() -> int {
std::cout << "baka" << std::endl;
}
>>
>>61841292
print("baka")
>>
>>61841486
iterator.
Unless you need to use the index for something.
>>
>>61841486
range-based for loop
>>
Assuming equal competence in programming skill, would you rather work with a group of normies who are diverse in gender and race, or a group of mostly white and asian dudes plus one trap (we'll say they're a 7/10), who are the type of people who view /r9k/ and/or /jp/?
>>
>>61841798
depends how you define "normies". plenty of normies have annoying social dysfunction, it's just not the sort of thing that we meme about on 4chan
>>
>>61841029
roll
>>
>>61841824

The kind of people who aren't the opposite extreme to the /r9k/ and /jp/ dudes.
>>
>>61841798
>equal competence in programming skill
Normies. They're more likely to be capable of setting themselves to a schedule and doing their share than a bunch of robots and weeaboos.
>>
>>61841798
If pay is the same, then i'd take the second option, it's a no-brainer. I'm more comfortable with people like me than ```diverse''' peoples I share no connection with.

But if the normie job pays substantially more, I'd take that.
>>
>>61839577
Interesting. Most appreciated anon.
>>
>>61841292
puts "baka"
>>
>>61841292
10 PRINT "BAKA"
RUN
>>
>>61841292
.section .data
baka:
.ascii "baka\n\0"

.section .text
.globl _start
_start:
movq $4, %rax
movq $1, %rbx
movq $baka, %rcx
movq $6, %rdx
int $0x80

movq $1, %rax
movq $0, %rbx
int $0x80
>>
>>61841455
what kind of gay architecture is this for?

>>61842101
more like it
>>
>>61841292
(print 'baka)
>>
>>61838694
It's a network-transparent IPC system. Look it up and be enlightened.

>>61833738
Try the "load balancing" pattern. Workers should pull work via REQ from a ROUTER broker. Clients should submit work as REQs via a (optionally separate) ROUTER on the broker.
>>
Spent the last few days extended a bash script for work, I want to fucking kill myself.
>>
Why would anyone begin a new project in Java these days?
>>
>>61841292
ID DIVISION
PROGRAM-ID. BAKA.
PROCEDURE DIVISION
DISPLAY 'BAKA'.
GOBACK
>>
>>61833713
>This is /dpt/, the best subreddit of /g/
>the best subreddit of /g/
>subreddit of /g/
>subreddit
Go back.
>>
>>61842472
are you meta-trolling now
>>
apart from mechanical keyboards, /g/ has never led me astray.

What is the best place to learn a new programming language as a complete novice? There are so many fucking options out there
>>
>>61842502
have there not been enough threads across the entire space of the internet with this question to supply a sufficient answer?
>>
>>61842535
what the fuck else is the point of this thread if not programming?
>>
If dynamic types are so great then why are most dynamic languages so slow?
>>
Redpill me on TDD. I just tried applying it to one of my projects and it seems like an enlightening experience
>>
>>61842547
It's great but sadly only feasible with languages like Idris currently
>>
>>61842547
>redpill me
No. Sage
>>
>>61842540
Not him but there is more to programming than "what is the best place to get started".

Frankly, this type of question is just annoying now. Can't you just google it?
>>
File: 1498969887514.jpg (110KB, 521x521px) Image search: [Google]
1498969887514.jpg
110KB, 521x521px
#define _USE_MATH_DEFINES // for C++
#include <cmath>

why do i need to do this???
>>
>>61842558
Explain? It's basically writing the tests before the code, how is it only feasible in an obscure language like that? Pretty curious, is it because it's not scalable to large projects or something?
>>
>>61842614
It's because for most functions you'd want to write, you need dependent types in order to write a sufficiently precise and refined type that the language can automatically and usefully help you to write the implementation. The search space is just too huge in languages with less powerful type systems.
>>
>>61842547
artificially constraining and annoying.
>>
File: DGz0TSdWsAE_Rms.jpg (108KB, 960x660px) Image search: [Google]
DGz0TSdWsAE_Rms.jpg
108KB, 960x660px
>>61841798
the choice is easy, the diverse group of course
>>
>>61841798

idk anon, i think weaboos and faggot are more fun to be around than normies who only cares about their twitter personality
>>
>>61842502
/g/ often gives terrible advice or downright troll advice fyi

https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
>>
>>61842657
dear god
>>
if I have to use C++ and am operating on plain structs, should I use malloc or new?
>>
>>61841798
weeb autists for sure
>>
>>61842701
stack allocation or new[]
>>
>>61842606

answer this question or this girl will have her house checked for radioactivity.
>>
>>61842677
What's a twitter personality?
>>
>>61841292
(display 'baka)
>>
>>61842742
the person they make up and project outward. the person they spend so much time pretending to be, they never find time to actually become
>>
>>61839659
No, but you might be able to decompile and optimize it with LLVM.

>>61840333
Sounds fun akshully.
>needing a linux kernel driver for an input device
geg, y u no like USB HCI?

>>61842427
>favorite
vomit.gif
>>
>>61842606
you only need it for the math constants

#if defined(_USE_MATH_DEFINES) && !defined(_MATH_DEFINES_DEFINED)
#define _MATH_DEFINES_DEFINED

/* Define _USE_MATH_DEFINES before including math.h to expose these macro
* definitions for common math constants. These are placed under an #ifdef
* since these commonly-defined names are not part of the C/C++ standards.
*/

/* Definitions of useful mathematical constants
* M_E - e
* M_LOG2E - log2(e)
* M_LOG10E - log10(e)
* M_LN2 - ln(2)
* M_LN10 - ln(10)
* M_PI - pi
* M_PI_2 - pi/2
* M_PI_4 - pi/4
* M_1_PI - 1/pi
* M_2_PI - 2/pi
* M_2_SQRTPI - 2/sqrt(pi)
* M_SQRT2 - sqrt(2)
* M_SQRT1_2 - 1/sqrt(2)
*/

#define M_E 2.71828182845904523536
#define M_LOG2E 1.44269504088896340736
#define M_LOG10E 0.434294481903251827651
#define M_LN2 0.693147180559945309417
#define M_LN10 2.30258509299404568402
#define M_PI 3.14159265358979323846
#define M_PI_2 1.57079632679489661923
#define M_PI_4 0.785398163397448309616
#define M_1_PI 0.318309886183790671538
#define M_2_PI 0.636619772367581343076
#define M_2_SQRTPI 1.12837916709551257390
#define M_SQRT2 1.41421356237309504880
#define M_SQRT1_2 0.707106781186547524401

#endif /* _USE_MATH_DEFINES */
>>
>>61842764
Sounds kinda silly
>>
>>61842742

you know how people always post good shit online, like everythings cool.

yeah i have friends like that. they even tell you not to say shit about whaty they are ACTUALLY doing
>>
>>61842787
>yeah i have friends like that. they even tell you not to say shit about whaty they are ACTUALLY doing
what the fuck anon

what sorts of things are they actually doing?
>>
>>61842766

i know, but why? why cant i just use them? what does it not defined under c/c++ std have to do with anything
>>
>>61842798

things that are different than what they say they are doing online, it varies, like you didnt actually travel but you said you travel.

or you dont play video games but you actually do.

it creates unnecessary drama
>>
>>61842781
It is, but it's cheaper than self-improvement yet provides most of the self-esteem boost.
>>
>>61842816
I don't understand, anon. What exactly do they gain from lying?

Also, what about if this happens?

>A, lying: omg so cool just got back from my week in Japan
>B: sounds awesome, got any photos?
>A: errrr
>>
>>61842840

twitter popularity? i mean they have lots of followers for sure

twitter follower counts are like reddit upvotes or (You)s
>>
>>61842804
they're gross unix/bsd holdovers, they pollute the namespace, you can use constexpr constants instead of filthy macros
>>
>>61842840
I travel a lot and I rarely take photos.
>>
>>61842850
I'm afraid I still don't get it, anon.

Does having twitter followers pay the bills these days?
>>
>>61842854

so its simply there to prevent conflict if i define M_PI myself or something like that?
>>
>>61842863
>t.hitman
>>
>>61842868
>attention
>social status
>trying to become some kind of celebrity and profit from it
it's dumb but not dumber than posting on 4chan
>>
>>61842896
Well I always take a picture to confirm the kill.
>>
https://twitter.com/Jonathan_Blow/status/894404095909347328
>>
Directsound newbie here

//The point in the buffer at which Windows will read and play the sound buffer
DWORD play_cursor;

//The point in the buffer at which Windows will write what we want to the buffer
DWORD write_cursor;

//If allocation of this is successfull
//global secondary buffer is an LPDIRECTSOUNDBUFFER
if (SUCCEEDED(global_secondary_buffer->GetCurrentPosition(&play_cursor, &write_cursor)))
{
//do something
}


are we guaranteed to have &write_cursor > &play_cursor ?? since the buffer is cyclic its entirely possible to have it write it at lower values but its effectively ahead of the play
>>
>>61842502
https://makeawebsitehub.com/which-programming-language/

Here's a huge infographic with basic information about various programming languages, and will give you a better idea than most posts on /g/ might. Pick your poison and google a tutorial. If you have problems, you're expected to put in effort to figure it out yourself before asking anywhere.
Documentation is your friend.

Making an account over at Stackoverflow is worthwhile.
/sqt/ here on /g/ might be better for beginner-type questions than /dpt/, as well.
>>
>>61843326
>Python
>Java
>C
>C++
>JS
>C#
>Ruby
>PHP
>Objective-C
What a dire, outdated selection of languages.
>>
File: cobal.png (52KB, 316x332px) Image search: [Google]
cobal.png
52KB, 316x332px
>>61843326
>COBAL
What the fuck
>>
>>61843350
yeah you should learn idris instead
>>
NEW THREAD

>>61843381
>>61843381
>>61843381
Thread posts: 314
Thread images: 31


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