[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: 358
Thread images: 22

File: 9_EdFlyBebop2.png (318KB, 621x478px) Image search: [Google]
9_EdFlyBebop2.png
318KB, 621x478px
old thread >>57762899

what are you working on /g/?
>>
>>57769930
i think im bouta write an extension for gnome3 to fix this fucking title bar for windows. stupid arrow pisses me off i keep clicking it on accident

apparently you can use fucking javascript to mod gnome3. pretty nifty
>>
http://www.strawpoll.me/11767105
just gonna post this here :)
>>
>>57769930
please stop posting anime on a tech related discussion board.
>>
>>57769971
vote PHP
>>
>>57769979
that's not anime, that's edward
>>
>>57769979
Please cry more
>>
trying to build a bit torrent client. The problem is I can't figure out what it means by getting the sha1 hash of the bencoded file.

Some code I got -

d = bencoder.decode(torrent.read())

hashcontents = bencoder.encode(d[b'info'][b'pieces'])

new = hashlib.sha1(hashcontents).digest()

link = urllib.parse.quote(new)
print(link)
print(d[b'announce'])

send_to = requests.get('http://bttracker.debian.org:6969/announce?%9EH%06_%0Ag%60d%CBXy%FE%B8%97d%7D%20%E6R%15&peer_id=mememememememe&port=6883')
while True:
new_socket.listen(5)


Anyone have experience interacting with trackers? To my understanding they're supposed to give me a response with an encoded dictionary that will give me some peer addresses.
>>
>>57769962
>gnome3

Was a mistake
>>
>>57770032
gtk3 is a pile of shit I'll give you that but it does have some nice features. and somehow it's the least buggy DE for me. Less buggy than XFCE, LXDE, MATE and Unity.
>>
>>57769971
vote C or die

also
L O N D O N
O
N
D
O
N
>>
File: 2016-11-30_17:49:07.png (33KB, 461x235px) Image search: [Google]
2016-11-30_17:49:07.png
33KB, 461x235px
>>57770068
>forgot pic
I'm a worthless nigger
>>
should i prioritize 1920x1080 over 1366x768 for a programming laptop? i cant spend too much i was gonna spend around 640€ on something like this

i3 6100h
940mx
8gb ram
250gb SSD
1080p screen

is this okay or am i over rating higher res screen for coding?

btw the classifieds where i live are pure trash
>>
Could someone post the image where it shows a person programming in C # and in the other comic shows programming in Java and a monster appears?

Thanks advance!
>>
>>57770086
RAMBLA' LONDON

sounds like some black british rapper

https://www.youtube.com/watch?v=c2MiyZx8MTY
>>
>>57770102
ditch the GPU and get a 1080p screen with decent CPU
Also, must be lightweight, have keyboard backlight and 9+ hours battery life
>>
File: 1480494689392.jpg (61KB, 801x801px) Image search: [Google]
1480494689392.jpg
61KB, 801x801px
Which color of striped sock improves your programming skill the most?
>>
>>57770163
t. anonymous swedish shitposter
>>
>>57770102
res screen is VERY important.

And ditch the gpu if you are not gona play anything and go for higher battery life.

Tough you might also regret at some point why your piece of crap laptop doesn't run even the oldest game, so think ahead.
>>
>>57770246
>res screen is VERY important.
1360x768 werks fine for me desu. maybe if you have some eyeball disease it's important you freak
>>
>>57770246
He could always play Thief and Deus Ex.
>>
>>57770163
Rainbow.
>>57770179
t. the sole anon that dislikes this brilliant bit of board culture
>>
>>57770312
poopy poopie poo butthole tranny butt nugget stinky butt hole poo fumes
>>
>>57770377
Good post
>>
>>57770423
your arguments won't change the fact that your butthole does and always will stink, tranny

it will never smell like a pussy
>>
int independence; // declaration of independence 
>>
>>57770163
That's moronic.
Only knowledge and experience improve the programming skill.
>>
>>57770511
wow, what a bunch of crap.
>>
>>57770496
>implying independence wouldn't be a function
int independence();
>>
File: last.png (16KB, 524x326px) Image search: [Google]
last.png
16KB, 524x326px
Working on my terminal emulator, found there was a panic when I cat a JPEG by mistake, so I started catting /dev/urandom, found 5 panics, fixed them.

/dev/urandom has been going for few hours, didn't crash yet, need something better.

Trying to install docker to run american fuzzy lop against it, hopefully it will find more.
>>
Why does no one use D? It seems like C++ except everything fixed.
>>
>>57770709
because no one wants the D
>>
>>57769930
if test are intended to test code, then who test the test? and the test of the test? and so on?
>but muh agile
>>
>>57770709
It ended up being worse with all the stringly typed mixin bullshit.
>>
>>57770611
>american fuzzy lop
whats that?
>>
>>57770511
but those socks will get you a job
>>
>>57770752
How so?
>>
>>57770709
Because C may stand for cunt, while D may stand for dick. I ain't homo.
>>
So I've been almost only using visual studio so far, but now I'm in need of cross platform building so I'm thinking it's time to learn some sort of tool for this. What do you recommend? Cmake? GNU Make? I'm mostly interested in ease of use, I don't want to spend hours configuring the toolchain rather than actually code.
>>
Is tiobe index to be trusted?
>java first lol
>visual basic just the same rating as python
>assembler just beyond javascript
>>
>>57770866
If your projects are small then GNU Make is easy as hell.
But if you're working on bigger things CMake will make your life a lot easier. Trying to use GNU Autotools is a nightmare.
>>
>>57770866
just use CMake, it's easy to use and very powerful and you don't have to mess with the nightmare shitfest that is make
>>
>>57770866
I wrote a gnu makescript that compiles all .c to .o and links projects with multiple main files by building a binary for each main with all the other mains excluded.

I haven't felt the need to update it because it works so well.
>>
>>57770896
How easy is it to learn one if you know the other? Are they similar or entirely different?
>>
>>57770924
If you know GNU Autotools well enough you could probably learn any build system fairly easily, but it really is a nightmare.
Makefiles are fine for small projects, any bigger and you should use CMake.
By Autotools I'm referring to not just Make, but also configure scripts and the like.
>>
>>57770163
FUCKING
U
C
K
>LOSER
>>
>>57770785
A fuzzer, look it up.
>>
Which should I use: vim, gvim, or neovim?
>>
In your opinion, what kind of coding quiz can be done to stop unskilled people getting the job due to biased HR department? we got three girls in this month and they can't do shit, but they can't neither be fired, because pussy.
>>
I'm reading the GNU coding standards.

I was told that I should never assume an int is 32bit, and the only thing I could derive is that an int is <= a long int (in max size) and a short is <= an int.

But GNU coding standards says
>However, don’t make any effort to cater to the possibility that an int will be less than 32 bits. We don’t support 16-bit machines in GNU

Which one is right?
>>
>>57771126
what role in the company do they have?

what do mean they can't do shit?
>>
>>57770877
>Is tiobe index to be trusted?
No, it's pants-on-head retarded, depending on what you're discussing.

For example, it doesn't mirror the job market at all. If anyone uses tiobe as an indication of jobs, they might be retarded.

As for VB/Python, note that many colleges have dated CS101 classes that may still teach VB instead of C# or another suitable first language.
>>
>>57771163
Back end developer. Our team write some low level API in pure C to be used to retrieve data. I can't add more details.
They genuinely can't do shit. Data structures are very important, but they can't even connect (not even implement) a radix sort with some function and so we end to make ours and their job while they go to the roof to smoking.
>>
>>57771126
Good luck using a quiz like that, if your HR department is literally hiring your programmers without a technical interview done by you or your supervisors.

They'll say the quiz is sexist and racist if too few female/minority applicants are unable to complete it.

In any case, you should quiz the applicant not only on basic knowledge of a subject, but also their efficiency of finding the answer to something. In the past, I've had better results with candidates who were able to quickly research and solve a problem with some Googleing in the interview, rather than those who can spout off trivia and sort a linked list without a loop.
>>
File: trap programmer5.png (1MB, 1127x1600px) Image search: [Google]
trap programmer5.png
1MB, 1127x1600px
>>57770163
purple and pink
You get a 1.2x XP boost if your socks match your keyboard caps.
>>
File: ss.png (7KB, 556x375px) Image search: [Google]
ss.png
7KB, 556x375px
>>57771232
can't you complaint about it?

if you do their work what do they do all day !?

do they applied for a backend position or something else?

what the fuck
>>
>>57771187
>note that many colleges have dated CS101 classes that may still teach VB instead of C# or another suitable first language.

To expand on this, that means there are many first-year CS students and krishnus and vishnus that are asking StackOverflow and Google questions about the language
>>
>>57771267
>quiz is sexist and racist
They're not going to insinuate the idea that women are too stupid to take your quiz.

That would go against their narrative.
>>
>>57771314
someone already complained, but he got 10 hours of salary as "fine" (why even fining someone who worries about the future of the company)
>>
>30 tabs of winapi documentation open to make a 100 line program
xDDDDD
>>
>>57771362
>100 line winapi program
FizzBuzz?
>>
>>57771347
They're literally not allowed to dock your pay if you're a salaried employee because you're not allowed to receive overtime pay.
>>
File: giphy.gif (2MB, 390x285px) Image search: [Google]
giphy.gif
2MB, 390x285px
>>57771347
ultimate cuck

why don't you quit and find another job?

if you're a programmer you should find work just fine
>>
>>57771379
I just want to access a device context and save a bitmap file.
>>
>>57771384
because Italy
>>
File: RIGHT-ANGLED TERROR DEVICES.png (1MB, 1209x715px) Image search: [Google]
RIGHT-ANGLED TERROR DEVICES.png
1MB, 1209x715px
>>57771341
>This quiz has a strict emphasis on data structures. As we all know, things that are rigidly imposed and binary in nature tend to be a construct of the ruling class, which puts those who aren't white and male at a disadvantage.
>Please revise the quiz to include more measures of a good programmer, such as the ability to socialize and recognize non-binary sexual traits.

Also, pic semi-related.
>>
Can I not unbind/redefine a variable in my erlang program? Can I only do it in the shell or a session with f(variable)?
>>
>>57771393
Is that structure the NAP?
>>
File: 1478266778135.png (37KB, 1140x852px) Image search: [Google]
1478266778135.png
37KB, 1140x852px
redpill me on c++
>>
>>57771393
Computers only deal in absolute binary states, something cannot be both true or false at the same time.

Are you sure these people wouldn't rather work in a medium much more suited to creativity and non-binary expression, like playdoh and crayons?
>>
File: 1471378141086.png (150KB, 349x352px) Image search: [Google]
1471378141086.png
150KB, 349x352px
>>57769930
im trying to get into programming by learning c++. currently im just reading chapters on this site learncpp dot com (i swear im not shilling) but the progress is p. slow and i keep forgetting lessons from past chapters. can anyone recommend me a way of learning programming that is more interesting than what im doing rn? sorry for bothering you /g/uys
>>
>>57771439
it's shit
>>
>>57771439
it's shit
>>
>>57771439
Everyone is going to tell you it's shit

>>57771535
Skip over classes, you'll never need to use that 99% of the time.
>>
>>57771439
Rust is better.
>>
>>57771456
this isn't true at all
most computers only deal in bytes
"bools" in C have 256 possible values
>>
>>57771535
solve a problem you are interested and keep a reference (not a tutorial) of the language

I remember I lernen C because I wanted to simulate the trayectory of a rocket, so full featured force fields on the object. That project alone in high school made me pass with perfect score the C exam at college without attending lessons.
>>
>>57771535
>learncpp dot com
>p. slow
>rn
>sorry for bothering you
Please go back to whatever website you came from.

The most interesting way to learn is to actually create things. All you need is a basic understanding of how to create an application in your chosen language. Then, you can just Google what you're trying to do as you go.

C# is an easier first language to start with than C++, for what it's worth.
>>
>>57771592
>suggesting shart instead of c++ for whatever reason
>>
>>57771439
its good

but its hard as fuck
>>
>>57770752
"no"
>>
>>57771566
bools in C are literally
typedef enum _Bool { false = 0, true } bool;


enumerated values are signed 32-bit integers.
>>
>>57770709
Why use cut down C++ with GC instead of cut down C++ with FP and affine types and borrowing?
>>
>>57771663
>= 0

and actually, you're wrong
bool is Bool_

>An object declared as type _Bool is large enough to store the values 0 and 1.

false and true are macros

stdbool is shit
>>
>>57771566
>>57771663
>>57771710
Looks like you C cucks don't even have proper primitive types.
Why was C "tha best languege for tru hax00rs" again?
>>
File: kill.jpg (289KB, 1000x1095px) Image search: [Google]
kill.jpg
289KB, 1000x1095px
Using Swift for a project.
I'm trying to reuse a json parser I used on another project and can't seem to get it, any help?

It will throw bad json catch that I have set up.

here is my code
 
while self.i < 5{
if let json = try? JSONSerialization.jsonObject(with: data!) as? [String:Any],
//let results = json?[self.i] as? [[String:Any]],
let StudentId = json?["StudentId"] as? String,
let LastName = json?["LastName"] as? String,
let FirstName = json?["FirstName"] as? String,
let Major = json?["Major"] as? String,
let Year = json?["Year"] as? String,
let GPA = json?["GPA"] as? String{


here is sample of json
{"StudentId":"1121","LastName":"Smith","FirstName":"Pichael","Major":"CS","Year":"Freshy","GPA":"4.0"},{"StudentId":"1122","LastName":"Man","FirstName":"Fish","Major":"Yup","Year":"Senior","GPA":"1.0"},{"StudentId":"1126","LastName":"Brown","FirstName":"Bobby","Major":"Clown","Year":"Lol","GPA":"90990"},{"StudentId":"1128","LastName":"Test","FirstName":"Test","Major":"Test","Year":"Test","GPA":"1"},{"StudentId":"1130","LastName":"More","FirstName":"Some","Major":"Entries","Year":"Would","GPA":"Work"},{"StudentId":"1131","LastName":"Should","FirstName":"I","Major":"Have","Year":"Just","GPA":"Made"},{"StudentId":"1132","LastName":"To","FirstName":"Program","Major":"Auto","Year":"Add","GPA":"These Lol"}
>>
>>57771750
lowest addressable unit of memory is a 8 bits, you're better off making a packed bitfield of 8 bools if this is important to you.
>>
>>57771750
Name a language where bool's have two values
>>
>>57771814
Agda
>>
>>57771819
>language
>>
>>57771837
Agda is a dependently typed functional programming language originally developed by Ulf Norell at Chalmers University of Technology with implementation described in his PhD thesis.
>>
>>57771814
>Name a language where bool's have two values
Why would there be more than one value for bool in any language?
>>
>>57771849
>>>>>>>>>>>>>>>>>>programming language
>>
>>57771750
Now this is autism
>>
c# discord invite please....
>>
Does anybody know anything about demodulating discrete waves? I'm working on that right now instead of doing schoolwork:

http://collinoswalt.com/12
>>
File: image.jpg (48KB, 640x640px) Image search: [Google]
image.jpg
48KB, 640x640px
Please help me. Is lua a good first programming language to learn?

I already know markup langauges and bash scripting.

I am interested in lua specifically because there is a GPL game engine that uses it called löve
>>
>>57772150
Lua is pretty dece.
>>
>>57771988
https://discord.gg/SN6HZ
>>
>>57772150
Lua is very, very comfy.

t. used to write wow addons
>>
>>57772150
Terrible.
Doesn't even have bitwise operators.
>>
>>57772150
Probably the largest use-case of Lua is Garry's Mod, so you should read Garry Newman's thoughts on the subject:

https://garry.tv/2014/08/16/i-fell-out-of-love-with-lua/

If you want to use Love, then learn Lua, definitely. It's just that Lua does things weirder than most programming languages, so you may not get a very good feel for what most languages are like if you start out with Lua

That said, there are TONS of people over at http://facepunch.com in the programming section who are fucking ELITE and a lot of them started with Lua programming for Garry's Mod.

Definitely read the Lua programming language if you want to learn Lua. Not only is it well written, it's somehow _fun_ to read
>>
>>57772217
>muh bits
>>
>>57772232
>The Lua Programming Language

I meant "programming in Lua". That's the official book
>>
>Lua

The only language that's properly both functional AND object oriented?
>>
>>57772232
>should seriously consider using Javascript instead.
stopped reading there
>>
>>57772217
False.
>>
>>57772232
>JAVASCRIPT IS THE FUTURE
opinion discarded
>>
>>57772260
Lua isn't all that object-oriented aside from method syntax.
>>
>>57772276
> 2 & 3
stdin:1: unexpected symbol near '2'
>>
>>57772287
Lua is very object oriented. You're just used to C++ style (not OO) "OO"
>>
>>57771592
>i cant use links
>not using post ironic normcore meme language
>not using post ironic normcore meme language
>i dont frequent this board and i dont want to intrude too agressively
thank you for your help anyway
>>
File: k.png (12KB, 592x144px) Image search: [Google]
k.png
12KB, 592x144px
>>57772294
>using outdated software
>>
Which manual to read to learn elisp: introduction to emacs lisp, or emacs lisp reference manual?
>>
>>57772300
What's OO about it?
>>
>>57772330
Everything is a table / a hashmap.
That's an EXTREMELY OO idea.
>>
>>57772314
>it took Lua over 20 years just to add bitwise operators
I guess that's better than nothing
>>
>>57772353
Sounds table-oriented to me.
>>
>>57772369
And what are hashmaps/tables, where they have "fields" and "methods"?

Objects.
>>
>>57772356
you could still use them back before 5.3 just as a lib so you had to type a bit more
>>
>>57772397
Are things like numbers and strings objects? Are functions objects?
>>
>>57772410
In Lua? I don't know
Should they be in a language? Probably not
Should they be in an OOP language? Yes
>>
>>57772397
Isn't JavaScript the same way? Everything is an object in JavaScript
>>
>>57772397
>>57772410
Also where is the encapsulation? I know you can implement it with closures but it's not exactly by default.

C isn't object-oriented because everything except a primitive is a struct and structs are kind of like objects.
>>
>>57772428
Yes, but JavaScript is trash

>>57772434
Encapsulation is a meme, it's not integral to the concept of OOP
>>
>>57772448
Encapsulation is exactly the dividing line between objects and structs and functions with optional method syntax.
>>
>>57772434
Is a pointer a primitive
>>
>>57772448
>it's not integral to the concept of OOP
Yes it is, you stupid ass.
>>
>>57772428
JavaScript and Lua are the two biggest prototype-based OOP languages
>>
>>57772177
thanks
>>
>>57772471
>>57772483

>Encapsulation is exactly the dividing line between objects and structs and functions with optional method syntax.
No it isn't
>>
When are we collectively going to move past this meme that everything has to be categorized by some paradigm or other? Hardly anybody can even agree on what these paradigms even mean.
>>
>>57772504
>because we can't give a universally agreeable sentence describing it in reductive terms, it is meaningless
t. postmodernist marxist
>>
>>57772504
Never.

If you ever feel like destroying a thread, just ask what OOP is and watch both the FP fags and Java pajeets fail completely to describe the thing they love or love to hate.

Paradigm-fluid language master race.
>>
>>57772549
>Paradigm-fluid
What did xir mean by this?
>>
>>57772549
>claims to be paradigm-fluid
>thinks not-OOP is interchangeable with FP
>>
Has anyone worked with native windows development (#include <windows.h>) using clang on windows?
It complains about not finding windows.h and other headers.
>>
>>57772592
Do you actually have the windows sdk?
Windows.h doesn't come from nowhere
>>
>>57772571
Since when are FP disciples okay with functions having side-effects?

Or is there some weird form of OOP where methods are not allowed to change their object's state?
>>
>>57772592
Why not mingw?
>>
>>57772648
OOP is compatible with FP.
>>
>>57771302
>trap fuck finder
fund it
>>
>>57772674
Not pure FP, no.

It would be better to say that you can have some pure FP within a language that also uses and facilitates OOP.
>>
>>57772674
>
>>
>>57772674
How so?
I know it's possible in languages like LISP but those are multi-paradigm.
>>
>>57772602
I do. But I haven't looked for it. It's installed with visual studio.
But I want to use clang now. Was mainly wondering if someone had the solution before I poke around.
>>57772649
Ok yeah worth considering. But looking at it there's a lot of version fussing. I'd like to use the same headers ideally.
>>
>>57772745
Mingw includes windows.h and other such headers.
>>
>OOP
Why do people like OOP?
Why do you like OOP?
>>
>>57772695
Why not? OOP doesn't require mutation. In fact, it works better without mutation because you can have methods that, instead of updating and always maintaining the same concrete type, can return a new object of a potentially different type.

For example, you can actually have Circle subtype Ellipse because Ellipse's "setWidth" returns an Ellipse instead of modifying the object.
>>
What is "embedded" programming like?
>>
Looking to start reading K&R, which compiler should I use as a Windows pleb? There's several Mingw distributions, Microsoft's..
>>
someValue ? ++x, ++y : --x, --y


someValue ? ++y, ++x : --x, --y


Given that someValue evaluates to true, x will increment in both snippets even though it is the result in the second one.

B-but you just told me the right hand side of the coma gets discarded?
>>
File: baka_big.png (2MB, 2000x2000px) Image search: [Google]
baka_big.png
2MB, 2000x2000px
>>57772784
I like using object-oriented programming practices occasionally to model interactions of subsystems within a program I'm making.

If the interactions are sufficiently complex, require state, and benefit from things like polymorphism, inheritance, and encapsulation, then I'll use me some darn tootin' object oriented programmin', y'all!
>>
>>57772838
Depends on the constraints.
Your "libraries" are a giant web of preprocessor macros and bit mask flags.
Recursive functions are a BIG no-no.
Some shops won't let you use malloc at all because running out of memory freezes the IC and they don't want to take the risk.
>>
x = (x ? ++x, x++ : x--, --x) > x ;

>this is valid C
>>
>>57770709
But I do.
>>
>>57772839
Preferably don't use windows.
>>
>>57772888
>?
C has the ternary operator now?
I'm so behind the times.
>>
>>57772839
>Looking to start reading K&R
Don't fall for the memes.
>>
OOP in most languages is stupid because inheritance is tied to subtyping. Inheritance is about adding more information to an existing class but subtyping is about taking away information (making the type smaller).
>>
>>57772924
C had a ternary operator since it's inception.
>>
>>57772876
>Some shops won't let you use malloc at all

How do they get dynamic allocations then at all? or do most rely purely on the stack?
>>
>>57772838
More similar than you'd think if you don't use massive amounts of abstractions and junk in C++.
You're more dataoriented.
>>
>>57771654
in what way?
>>
>>57772924
They've been there since 1972.
>>
>>57772933
Well, what book then?
>>
>>57772812
I wouldn't call it an OOP language if you can't even change an object's state.

But all that shit is so ill-defined anyway so whatever.
>>
>>57772957
System calls, maybe? brk and sbrk, but thats fucking stupid
>>
>>57772844
Well, "a, b" has the following semantics: first, the expression "a" is evaluated. Its value is discarded by implicit conversion to void. Then there is a sequence point. Then the expression value is evaluated and its value becomes the value of comma expression. What is there to understand?
>>57772888
>>this is valid C
Incorrect.
>>
>>57772924
Whatever language you use with that ternary operator got it from C
>>
>>57769930
>join anonops IRC
>"You are free to discuss whatever you want on our network. "
>ask about distributing a ransomware decryption key
>get yelled at
>told I'm not allowed to talk about ransomware because talking about carding in any form is against the rules
i-is ransomware carding? and is there an IRC I can discuss developing malware?
>>
>>57773008
s/Then the expression value/Then the expression "b"/
>>
Ok, I figured it out.
When you're using WinAPI on pascal, when you need to pass a nil pointer to a WinAPI function, you don't pass nil, you don't pass NULL either, you pass 0.

Amazing discovery, was worth wasting 3 hours on.
>>
>>57773041
What do you think NULL, nil mean?
>>
>>57773072
I know what they mean.

Apparently, WinAPI headers for pascal don't.

They expect a longword, but nil in pascal is of type pointer (strong typing lmao), and using NULL, which is defined in the headers, causes an access error for some reason.
>>
>>57773072
Not zero, faggot.
>>
>>57773120
I see, thanks.
>>
>>57772844
>>57772888
Also, I have to note that the C grammar implies, that
x ? a, b : c, d

is
(x ? a, b : c), d
>>
>>57772682
Be the change you want to see in the world, anon. Write that app.
>>
File: this isn't kawaii.png (284KB, 578x565px) Image search: [Google]
this isn't kawaii.png
284KB, 578x565px
Do you ever get caught up trying to make your code look neat even though your dumb tricks result in logic errors that you have to debug?
>>
>>57773199
>Do you ever get caught up trying to make your code look neat even though your dumb tricks result in logic errors that you have to debug?
No?

If I go full autism to make my code look more neat, I generally don't change the way the program works in any way, only the formatting and language features I use.
>>
Increment and decrement were a mistake. Fight me.
>>
>>57772957
>How do they get dynamic allocations then at all?
They don't.
>>
>>57773199
If by neat you mean readable, then yes. I use unit tests to avoid breaking anything, though.
>>
Does there exist any real life situation where using multiple inheritance is a good idea? I ask this because every single forum post and every tutorial on internet always give these schoolbook examples like shapes, animals, etc...

The only case i can think of is when creating UI systems, but thats it
>>
>>57773266
They can only provide contrived examples because nobody actually needs multiple inheritance and polymorphism in real life.
They shoehorn it into their program designs because they were taught about it and think it's the RIGHT way to do things.
>>
>>57773199
No because I'm not dumb.
Never make code look 'neat'.
Aside from whitespace.
>>
how do people learn to do all the C++ template voodoo magic ala boost?
i've tried looking and there arent really any good online resources
>>
>>57773287
this.
But it's more about inheritance polymorphism than polymorphism.
Since polymorphism in general has its usage by using the same codepaths. Less duplication.
>>
>>57773266
Multiple inheritance is only really useful for mixins, where it's quicker than with composition.
>>
>>57773149
>>57773008
ELI5 Why is the value of "a" discarded?
>>
>>57773355
dumb reddit poster
>>
>>57773355
That's just how an expression (a, b) is defined to work.
>>
>>57773379
Maybe. However, those dubs should count for something.
>>
>>57773407
You're sorely mistaken.
Please leave.
>>
>all polymorphism is object-oriented
screaming
>>
File: last.png (16KB, 496x304px) Image search: [Google]
last.png
16KB, 496x304px
>>57770611
Here we go, already found a shitton of stuff.
>>
>>57773199
Usually I make code "neat" if it's too messy to find errors easily. It removes errors in the process.
>>
>>57773487
what is this?
>>
>>57773199
>go fmt
>rustfmt
no
>>
>graduate with a cs degree with a 4.0 at admittedly shit college
>had an internship at a webdev shop where I did fuckall in C#
>Apply for GoDaddy
>Screening goes well
>Get interview
>Get 2nd interview, this one is technical
>asks me to write a function that calculates a Fibonacci sequence
>A what
>Interviewer explains what it is and I'm becoming increasingly nervous
>He realizes I'm not going to answer this and gives me a different problem, asks me to detect a loop in a singly linked list without using any new variables
>I start to write code down, then realize that my solution isn't going to work
>Interviewer eventually helps me work it out but he seemed annoyed
What the hell man. I'm suspecting my education was a meme. Is there material that I can self teach all the important shit I didn't learn in college?
>>
>>57773541
>he went to college to learn programming

loving ever laugh
>>
>>57773541
> He doesn't know what the Fibonacci sequence is
Are you memeing, boy?
>>
>>57773541
>did CS but doesn't know what a Fibonacci sequence is
How?
>can't detect a loop in a singly linked list
I mean this is just plain reasoning.
>Is there material that I can self teach all the important shit I didn't learn in college?
Yeah it's called learning everything relevant to programming. Start with a programming language basics and go up from there.

Why you decided to go for a CS degree when you didn't want to do academia is beyond me.
>>
>>57773541
>detect a loop in a singly linked list without using any new variables
Don't recognize this from any of my CS courses either.

Only detecting loops in graphs was a thing.
>>
>>57773589
>the memes are real
CS grads literally cannot code things that weren't explicitly taught to them in a formal class, I can't fucking believe it.
>>
>>57773589
Kek, this made me feel better about myself
>>
>>57773541
>asks me to detect a loop in a singly linked list without using any new variables

not possible, the easiest method requires 2 variables
>>
>>57773541
>without using any new variables
how would you do this? my first instinct would be to store the nodes in an array of nodes and see if any of them point to a previous node
>>
>>57773630
recurse through the list and check if there's a stack overflow
>>
When you throw an exception, is it basically being thrown out of the method it was detected in? Or does it not work like that?
>>
>>57773644
It's being thrown where it's thrown. What kind of question is this?
>>
>>57773644
Depends on the language, fucboi
>>
>>57773581
>>57773584
Well, I do now.

>>57773628
>>57773630
Recursion with the base pointer and the current pointer as function parameters. I didn't explain it right
>>
>>57773615
Why would you care in CS if you don't use some constant number of variables or not?
That wouldn't add fuck all to asymptotic complexity
>>
>>57773654
A dumb question but sqt is dead. I'm still unsure about how it works.
>>57773662
Java.
>>
>>57773638
uhhh that sounds like an extremely pajeet solution
>>
File: kill self 28726.png (374KB, 657x720px) Image search: [Google]
kill self 28726.png
374KB, 657x720px
>>57773671
>CS retards get fast-tracked through the interview process because they have an irrelevant math degree
>nobody even replies to my resume because i'm self-taught
>>
>>57773683
every time you set up a try catch block, a control frame is put onto the stack. then the rest of the code continues executing. when an exception is thrown, it pops all the frames on the stack until it hits a control frame that can handle it. there's always a control frame at the very bottom regardless of what you do
>>
Working on ideas for shitty data structures / algorithms:

Hash Map with only one bucket. Optimized for space
Dijkstra's Algorithm, but like, reverse.Finds the longest path
>>
>>57773707
So what happens when you throw an exception from main?
>>
In WebGL, would anyone happen to know how to render vertices by pixel-coordinates, rather than decimal values?
Is there a name for with graphics programming in general?
>>
>>57773500
a shitton of stuff
>>
>>57773638
I'd hire you if you said that
>>
>>57773730
the control frame that's always at the bottom regardless of what you do catches it
>>
>>57773638
while very funny you are basically making new variables vi the stack with every function call
>>
>>57773638
>Check if there's a stack overflow
Is this even possible?
>>
>>57773699
Write something basic and put it on github.

You'd just kill yourself if you're hired by a company that doesn't even look at github.

>>57773630
Access the stack.
Though the answer he's looking for is that you can't probably.
>>
In this case the malloc function is cast to an integer pointer.
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv ){

int *pi = (int *)malloc(sizeof(int));
*pi = 5;
printf("*pi = %d.\n", *pi);
free(pi);
printf("Now it is %d.\n", *pi);
return 0;
}



This code will compile we leave out the cast. Why did the authors of this book (Understanding and Using C Pointers) decide to use a cast for malloc?
>>
>>57773769
Yes
>>
>>57773769
catch segfault signal and check if the address is near the stack
>>
>>57773785
for readable probably, idk.

You never need to cast a malloc
>>
>>57773785
Because they're selling snake oil? The more people that talk about pointers being hard, the more people will believe it.

Same as how the existence of a million and one monad tutorials make monads look hard.
>>
>>57773638
What if the list is longer than the stack but doesn't have a loop?

The better solution is to recurse through the list and then check if it would ever stop or not.
(Solving the halting problem is left as an exercise to the reader)
>>
>>57773785
When you're doing non-trivial multi-dimensional array allocation, it helps to visually reinforce what you're intention is by casting.
You won't always have the type on the left-hand side to clue you in.
>>
>>57773785
It's good form.

Always cast the malloc.
>>
Is there a compilation of interview questions?
>>
>>57773816
pointers are just indexes into a comonadic array
>>
>>57773785
Maybe to explicitly show what's implicitly happening. Who knows. I can't think of a real reason to cast malloc, but who knows.
>>
>>57773355
Well, tell me what do you think it should do with a value of the first operand? C doesn't have a tuple type (except maybe of complex types, which have the layout of two objects of the same type allocated as an array with two elements), so the comma operator can't construct a tuple value.
The comma operator is the sequential execution operator, but unlike lexical ordering of statements in the text of a program, it happens inside an expression, which can become a statement by following the expression by a semicolon. It's useful because structured programming statements of C grammatically require single statements. Consider the following excerpt from the C grammar:
if-statement := "if" '(' expression ')' statement [ 'else' statement ]
statement := [expression] ';' | '{' (declaration | statement )* '}'

Literal elements are enclosed in single quotes; the brackets are used for optional parts; pipes represent choices; parentheses are for grouping and the star is a quantifier for repetition.
You can write something like
if (e) {
expr1;
expr2;
expr3;
}

just as
if (e)
expr1, expr2, expr3;

The need for compound statement is eliminated when your branches are made of expression.
>>
>>57773744
Okay, thanks.
Can an exception be caught if it's in a method that hasn't been called? Or does it go back through the methods it's been called from?
>>
>>57773831
hmm good point
>>
>>57773833
>>57773837
Thanks!
>>
What are /dpt/'s recommended stimulants?
>>
>>57773891
coffee and striped arm warmers
>>
>>57773898
coffee is obsolete
speed is much more effective
>>
>>57773891
Crossgender furry porn.

Oh wait. You mean caffeine wise? Just black coffee no sugar. Everything else is for wimps.
>>
>>57773850
if the control frame hasn't been put on the stack, it's not going to be able to catch anything if that's what you're asking
>>
>>57773785
Why do you have a book dedicated to understanding something so simple?
Sure you can have a book explaining the uses but they're simply obvious. It's what you use to implement a lot of the stuff in datastructures and algorithms.

Why anyone needs to learn C pointers alone is beyond me.
>>
>>57773589
>Only detecting loops in graphs was a thing.

A LINKED LIST IS A GRAPH YOU MONG.
>>
>>57773944
>watery american coffee with no additional stimulants
Yeah, sounds like a very non-wimpy thing to do anon.
Just like 2.2% ciders compared to vodka.
>>
>>57773891
Jolt Cola is the official hacker's drink
>>
>looking through IT job ads
>"we're looking for an object specialist our system services unit"
why are IT recruiters so awful
>>
>>57773949

>Learning something so simple.
Counting to 10 is simple isn't it, yet many noobs have troubles with its concept when applying it to binary. Then when they finally understand how to count, they are amazed at how complicated counting to 10 really is.
>>
File: 1470539960577.jpg (96KB, 651x395px) Image search: [Google]
1470539960577.jpg
96KB, 651x395px
>>57773970
>watery american coffee with no additional stimulants
Best be joking. I buy the expensive dark roast coffee.
>>
Not sure whether I should post this here or in the stupid questions thread
But what's the point of shell / tcl / perl scripting?
>>
>>57773970
>American coffee

hardly such a thing. Only one state grows coffee in the USA, and it's Hawaii (a tiny fucking state). The US imports most of its coffee from Latin America and Viet Nam
>>
>>57774020
Easier than writing a full program to do all that shit for you. Used mostly by IT majors, though. Shell scripting is for community college dropouts
>>
>>57774020
To avoid getting stuck in the arms of the wrong girl.
>>
>>57774008
Bet you use a bunch of water though. You make an entire 'cup'. An entire cup of Italian coffee would just be irresponsible.
>>
>>57774055
How much is a cup to you?
>>
I might build an 8080 emulator and I have a few questions

How exactly does it start? does it just access memory address 0x00 and start running from there?

also were in memory is the stack stored?
>>
If I want to compile library that you can use with c header file what language choices do I have other than C and C++?
>>
>>57773785
Never cast mallocs in C. Casting malloc call value is very mauvais ton, because if you forget to include stdlib.h, then if you use an old standard, like C90, or your compiler provides extensions to support the old behavior, an implicit declaration of the function will result. Cast will remove a useful warning about conversion of an integer to a pointer type here. And the program will contain undefined behavior.
>>
>>57774051
I'm studying electrical engineering (electronics) and saw it pop up in a few internship offers even though we've had 0 training with it
So I'm assuming Perl / TCL > Shell ?
>>
>>57774091
>I might build an 8080 emulator
just dont dude, either you're an autistic code wizard or you're not
>>
>>57773960
And our loop-detection for our generic (didn't even have to be connected IIRC) graphs used new variables.
>>
>>57770012
Google python sha1. There's a lib for it.
>>
>>57774020
OS's have many ways of letting programs communicate. The shell is often a simple way of letting sys-admins or users insert their own user specific code in-between the communications.

For instance you can parse wget to get specific links from a webpage which you pass to an application that handles those links.

Often scripting languages are more suited for these kinds of light operations.
>>
>>57774108

it isn't that hard, stupid
>>
>>57774107
I don't see why an electrical engineer would ever need to do shell scripting. Perl is great for parsing text files, and shell scripting is about running cron jobs and... server shit. That's IT sysadmin bitch work, not engineering work.
>>
>>57770163
Yes
>>
>>57774093
Try English
>>
>>57774055
>Bet you use a bunch of water though
I actually buy it in Kcups, so it's the same amount of water each time. I was just running out so I'm currently buying some more.
This is what I usually get.
https://www.amazon.com/dp/B008ZEHNPS

I bought a dark roast variety pack a while ago. I tasted each one and this turned out to be my favorite. Do you have another recommendation? You know, one that isn't like 2 dollars a cup.
>>
>>57774105
Interesting, thanks.
>>
>>57773945
Thanks for your help man.
>>
>>57774170
>kcups

You're destroying the environment anon
>>
>>57774008
you on that folgers black silk, breh?
>>
Making a csv parser thing to import stock data from yahoo finance to train a test nn with, IDK what I'm expecting, but at least the normies will think I'm some leet matrix hacker.
>>
>>57770163
jag kommer ihåg dig din jävel
mizaki?
>>
>>57774239
>folgers black silk
I'll buy a pack and test it out. I usually get eight O'Clock >>57774170
>>
>>57772977
its not.
>>
>>57774277

Oh and also fuck AMD, Canonical and the Linux Kernel, I wasted 8 fucking hours yesterday trying to get OpenCL to work with Torch7 on my RX-480
>>
>>57774277
>csv parser
>yahoo finance

Don't they have a JSON or XML option?
>>
>>57770866
I believe the Xamarin update allows you to use C# for cross platform development such as Android and iOS. I have yet to try it but I'm planning on to soon.
>>
>>57774292
>kommer ihåg crossdressare
bögar ej välkomna
>>
>>57774354
transvestiter är väl det rätta ordet, din amerikaniserade jävel

kommer ihåg honom från sverigetråden på /int/
>>
>>57774329

Not that I can find it, anyways, it isn't very difficult, I just hacked something together with Lua patterns and some for loops and now I just need to finish the method that would cut up the data in to training sets.
>>
>>57774354
>>57774389
Breva inte på svenska.
Tack.
>>
>>57774400
if you use torch7 for storing data as tensors you just need to slice the tensor, or even better, sample a portion of the observations.
>>
>>57774277
If you want, I can let you use my implementation. I'll need an hour or so to get home to copy it over.

It's not challenging to do, but it's a waste of a few hours.
>>
What book should I read to learn C and what compiler under Windows?
>>
>>57774504
>8:12AM
>import csv in torch7
>slice tensor
>setup basic nn (because whoever asked this don't know much deep learning)
>train network
>store network information
>8:16AM (because crappy csv is only 100MiB)
>>
>>57774513
If you're already familiar with programming, then The C Programming language by K&R.
>Windows compiler?
I don't know. But I hear Visual Studio is used by many.
>>
>>57774513
K&R
MSVC
>>
>>57774563
The whole IDE or just the commandline?
>>
>>57774217
Don't listen to >>57774105

Every C program I've looked at uses that type of behavior. At the very least you should cast malloc when not defining the data type in the same line. For example, from GNU's GMP library.

mp_limb_t *ap;
/*
code
*/
ap = (mp_ptr) malloc (sizeof (mp_limb_t)); // if you didn't include (mp_ptr), future maintainers would have to go back and forth, trying to remember what type ap is.
>>
in java, can there only be one stream open at any one time? i.e. you can't create an output stream if you haven't closed the input stream first?
>>
>CSV

",",","
","

How is that parsed?
>>
>>57774577
IDE probably. you want a debugger.

The commandline is OK too obviously. But there's no real point in not having VS if you're not harddrive space constrained.
>>
>>57774588
[ ","; "," ]
[ "," ]
>>
>>57774585
I don't know but that sounds really odd. I'd assume that isn't the case. Hardly any operating systems have those constrains and as much as anyone should dislike Java it can't be that terrible.
>>
>>57774584
If you don't prototype malloc correctly by not including stdlib.h, then instead of casting a void to a pointer, you will be casting an integer to a pointer and the compiler will never complain. As a result, the code is seriously borked.
>>
>>57774644
>by not including stdlib.h
Then include stdlib??????????
>>
I was asked by my boss to learn scala for monday. I'm using haskell right now in my job. How fucked am I?
>>
>>57774669
yes lol
Not including it and chosing to use malloc is just silly.
>>
>>57774670
>Scala
it will make you want to kill yourself
>>
>>57773541
Some interviews are like that. You should try searching for "common interview programming questions" or some such and practicing them.
>>
>>57774670
>I'm using haskell right now in my job
Do you wanna know how I can tell you're a troll?
Saged. Hidden. Reported. Triangulating your IP
>>
>>57774670
>I was asked by my boss to learn scala for monday.
???
is your boss retarded or what
>>
>>57774733
>still in high school
>wondering if all those "fizzbuzz" and code quiz are only a meme that media likes to spread
I think is just a meme, if not then I got my job so easily and lost respect for everyone of you.
>>
>>57774737
>Do you wanna know how I can tell you're a troll?
because you are salty envious that can't get a haskell job?
>>
>>57774584
As a rule of thumb, your functions shouldn't be larger than one screen and global variables should be avoided. Also, defining object at the place where they are initialized is a good practice.
Defining an object allocation wrapper would also be more appropriate.
Thank you, for reminding how much GNU MP is poor.
>>57774692
You can include stddef.h and its including headers and declare malloc explicitly.
>>
>>57774547
I'm finishing secondary education this year so you can't exactly expect me to have deep knowledge of NN's and a library that I found out about a week ago, geez
>>
>>57774895

Also the fucking documentation on Torch is god awful
>>
>>57774852
>shouldn't be larger than one screen
??
>>
>>57774852
>your functions shouldn't be larger than one screen
No that's a terrible way to determine if you should have a function or not. you determine by how you're gonna reuse. Breaking thing out into function because it's visually too big is not a good excuse because all you're really doing is making the reader have to go look for the code in the new function you introduced.

If there's reuse you can write a function or if for some reason you want to make the reader not concern themselves with a segment of code you can block it off so local variables don't escape (if appropriate, but declaring them just above the new block scope is not bad, capturing expressions could be used if language supports it).

Overall people have too much of a fancy for refactoring into functions. Giving the reader the appropriate context is more important than that. And often your function is doing nothing but that if you have this 1 page rule. You just have to give it a name. Something a comment could easily do.
>>
>>57774772
It is a toss up. I have interviewed with probably 10 companies now. Only about half of those ever asked me to program on paper, a white board, or computer during the interview.
>>
Am I using the right method to free the memory allocated?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv ){

char *name = (char *)malloc(strlen("Susan")+1);
char *ini = name;

strcpy(name,"Susan");
while (*name != 0)
{
printf("%c", *name);
name++;
}
free(ini);
return 0;
}
>>
>>57775116
since both ini points to the originally allocated memory it can be freed fine but don't a make mistake and go back to using name now that you freed the memory it's pointing to
>>
>>57775116
Yeah it works fine.
But as a stylistic preference I'd probably just leave the name pointer where it is and advance the ini pointer. Then free the name pointer.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv ){

char *name = (char *)malloc(strlen("Susan")+1);
char *ini = name;

strcpy(name,"Susan");
while (*ini != 0)
{
printf("%c", *ini);
ini++;
}
free(name);
return 0;
}
>>
>>57775163
Thanks :)
>>
>>57775185
Gotcha, thanks!
>>
File: sa.png (72KB, 327x304px) Image search: [Google]
sa.png
72KB, 327x304px
So I'm making my first real OSS project that I think actually serves a purpose other than "look at this bullshit I did". But I'm not using version control at the moment because I'm afraid that it will show my embarrassing development history. It may be a little bit before I reach something usable.

Should I just man up and commit when it's not finished, or work until I have a minimum product and then commit?
>>
>>57773848
Thanks for the thorough explanation.
>>
>>57774584
ap = malloc(sizeof(*ap));
>>
>>57775228
>man up
>not using version control
You are more courageous than 100 lions in a panzer, I would kiss your balls out of respect for being a very manly living being with such valor to confront with inminent danger and not knowing what fear is.
>>
>>57775228
git allows you to easily rewrite the history so you can make any amount of retarded commits you want and when you want to publish it to the world you can cleanup/squash/reword any commits you want.
>>
>>57774752
Not him, just wondering: is scala so hard? I would pick just for fun and as a challenge if it is.
>>
>>57775296
Future maintainer: "What type is ap, again?"
>>
File: 1472512657580.jpg (3MB, 3872x2592px) Image search: [Google]
1472512657580.jpg
3MB, 3872x2592px
Hi /dpt/ !
I'm pretty good with R and Matlab when it comes to maths, quantitative finance and statistical analysis, and I know these languages weren't design to build applications, just mentioning it let you know that I have a somewhat good understanding of basic programming concepts and thinking.

The thing is I'd like to learn how to develop plugins (for websites, through Greasemonkey and the likes). I know I should learn JS, JQuery and such, but I can't possibly find good resources that teach me how to tinker with APIs and shit, and I feel like if I go through a plain JS book, I'll know something about the language but then I'll be let loose with no explanations on how to use that knowledge.

So I'd like to know if there are some books/websites/etc that aim to teach JS and its tools specifically for buiding plugins ?
>>
How would I go about setting multiple variables from a file? How could they be spaced and discerned from one another?
>>
>>57775315
Crippling social anxiety is a hell of a drug. (I am keeping poor man's backups, fwiw)

>>57775352
That's true, but I suppose I'm also asking when I should also publish it. I get the feeling that I'm never going to feel it is "ready".
>>
how do you get into open source?
i've made a few attempts on projects that look cool, but they're always really huge and would take weeks before i understand how they work, let alone make changes to it
>>
>>57775429
Do it anyway. Good experience for the job market
>>
>>57775378
Casting malloc doesn't help you with that, it only delays the question, and it increases maintenance burden if you ever want to change the type of ap.
At the end of the day, if you forget the type of ap, you look where it's declared and/or defined, there's no other way unless you intend to litter the code with comments of what type ap is everywhere it's used.
>>
>>57775429
Yeah sadly that's the case with poorly designed open source projects.
Keep looking.
But plenty of open source projects have some kind of "contributor" page where they explain things so they could get more contributors. That's the goal anyway.
>>
>>57775378
Definition ap {A B:Type} (f:A → B) {x y:A} (p:x = y) : f x = f y
>>
>>57775452
ap = (mp_ptr) malloc (sizeof (mp_limb_t));
/*
Gee. Now I know ap is being casted as a mp_ptr and of size mp_limb_t. Funny how that works
*/
>>
This is more of a winternals question, but you guys are probably the only ones on the board that would know.
So x86 on window x86-64 is emulated through WoW64, not ran natively; are there any benchmarks about the emulated perf vs running it on native x86?
>>
>>57775543
>Gee. Now I know ap is being casted as a mp_ptr and of size mp_limb_t. Funny how that works
Until you don't.
Wasn't that your argument of forgetting it from where it was defined?

The real solution is: Don't write gigantic functions, keep declarations/definitions and initialization (and ideally usage) of data close together.
>>
What are the differences between Scanner and BufferedReader in java? I can't see any differences between using one over the other when reading from a file.
>>
In C (or C++), are there any types for the native word size that isn't a pointer? (due to pointer arithmetic, casting defeats the whole point).
Is size_t and ssize_t good enough?
>>
>>57774978
>refactoring, reuse
Well-well.
Well, you know half of the reason why functions exist. Reuse is actually somewhat less important than establishment of algorithmic invariants. By defining a function, you are promised that the state is modified only through global variables and arguments. Blocks don't provide you such a promise: you are allowed to modify any variables of the outside scope.
>>57775469
Hello, Thierry Coquand.
>>
>>57775600
The actual execution isn't emulated, the only difference is that syscalls are ran through an abstraction layer. The performance difference minor.
>>
>>57775611
>The real solution is: Don't write gigantic functions, keep declarations/definitions and initialization (and ideally usage) of data close together.
Confirmed for having only written fizzbuzz programs
>>
>>57775638
on windows you can use ULONG_PTR
>>
>>57775664
Projection.
>>
>>57775654
>By defining a function, you are promised that the state is modified only through global variables and arguments. Blocks don't provide you such a promise: you are allowed to modify any variables of the outside scope.
Except a block is right there so you can see if you're doing that. And this is only relevant if you plan to work with retards who need more than spoken/written guidelines to not wreak havoc.
>>
>>57775638
Neither C nor C++ has any concept of a 'native word size'.
But types that will probably work in practice are: size_t, ptrdiff_t, (u)intptr_t
>>
So the video bios is below the motherboard bios in memory right? if I boot my computer with only integrated graphics, the video bios will be mapped to the integrated graphics hardware. But if I put a dedicated graphics card in there and boot the video bios will be mapped to that dedicated card.
How does that work? aren't those mappings physically built into the motherboard? I know that PCI devices are assignment dynamically so I guess my real question is, how does the motherboard dynamically change mappings like that?
Does the mobo have an internal read-write table of mappings that it uses to lookup devices from addresses? if so, I'd like to know what techniques and algorithms a motherboard would use to achieve the lowest overhead for looking up a mapping so I can implement it in my virtual machine.
>>
New thread:
>>57775764
>>57775764
>>57775764
>>
>>57775692
I said C or C++. not winapi.
>>
Clojure uses Java's types.

How do I use bytes, shorts and floats instead of longs and doubles?
>>
Learning Java here.

How do I print out a description of a class or object in Java?
Can't seem to find the answer here.
>>
>>57775720
>you can see if you're doing that.
I know what I'm doing, in general. I'll be fine with writing noodle code for a single use. The question is about other people's code or code I've forgotten structure of.
Also, you said about not concerning with a piece of code, so what you say now is irrelevant to the condition you've put before (exactly not reading the code, so its presence isn't important).
>>
Using a malloc cast is good practice because:
1. They document the intention of the malloc function.
2. They make the code compatible with C++ and earlier compilers, which require explicit casts.
>>
>>57775654
Well I wasn't assuming we were actually talking about pure functions as we normally are not. Sure, if what you're refactoring into is a pure functions there's some additional information gained if we know the function is pure. But if we list the modified variables at the top of the scope we have the same effect.
Why i mentioned lambda expressions

I hate you half-wit FP programmers though.
Because you make assumptions all the time yet you work in a framework that discourages it.

Disgusting useless achademics the lot of you.
Thread posts: 358
Thread images: 22


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