[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: 319
Thread images: 47

What are you working on, /g/?
Old thread: >>58510588
>>
First for D
>>
Second for anything but D
>>
File: 1474736705064.png (17KB, 259x224px) Image search: [Google]
1474736705064.png
17KB, 259x224px
>>58516662
Thank you for using an anime image!
>>58516677
>>58516695
Thank you for making anime posts!
>>
>>58516711
>Thank you for making anime posts!
But my waifu has hooves?
>>
Euclidian distance between 2 vectors in python
euclidian = lambda v1,v2: (sum([(a-b)**2 for a,b in zip(v1,v2)])**0.5)
print euclidian([0.4,0.2,0.3],[0.5,0.6,0.7])

output
0.574456264654

post your version in any language you like
>>
Rust is shit.
>>
what's a good anime to watch when your high & programming at the same time??
>>
i poo in all the loos!
>>
ITT: Professional programmers having useful, engaging discussions about technical topics
>>
What are some must read books for intro to programming, or compsci ones.
>>
>>58516740
>one-liner
Doing everything within a line is not cool or understandable at first sight, why would you do it? Are you mentally challenged? Please do not reproduce
>>
File: 1476603443980.jpg (82KB, 960x843px) Image search: [Google]
1476603443980.jpg
82KB, 960x843px
>>58516835
Too late I'm your dad!
>>
>>58516835
>I don't like your coding style therefore you and your family need to die
I love this website.
>>
>>58516835
mata-te
>>
>>58516662
Okay guys, about to learn C. wish me luck!
>>
>>58516858
Yeah... There's a lot of nasty trolls like him here
>>
>>58516858
Just explain me the benefits of one-liners
>>
>>58516934
more readable
>>
>>58516925
sup, how about you fuck off back to your subreddit?
>>
>>58516934
They look more concise when you're one-lining something that's actually readable (like in his post)?
>>
File: easy.png (4KB, 324x155px) Image search: [Google]
easy.png
4KB, 324x155px
>>58516740
>>
Wife is learning OOP with Java in college. Fuck I did not miss that language.
>>
>>58516934
>explain me

I keep seeing this. Are there more third worlders on the internet these days or do people actually say this now?
>>
>>58516983
is she an anime? if not, you have to leave immediately
>>
>>58517000
*tips fedora*
>>
>>58516983
what do you prefer
>>
>>58517000
of course shes an anime, what the hell else would she be?
>>
>>58517016
>>>/r/ibbit
>>
>>58516983
>wife
>in college
beat you, mine's still in kindergarden
>>
>>58516952
because reddit is for queers
>>
>>58517031
good. you can stay matey
>>
>>58517031
I prefer C# (career), and would rather have her learn C++ from the start than Java, but i'm just a cranky fuck.

>>58517035
jelly
>>
>>58517032
>>>/a/nal
>>
>>58517035

> t. Abdul Allah Ahmed
>>
>>58517055
see >>58517032
>>
>>58517085
see >>58517055
>>
>>58517098
refer to >>58517032
>>
>>58516887
see >>58516784
>>
File: 1467658840808.jpg (359KB, 1280x1156px) Image search: [Google]
1467658840808.jpg
359KB, 1280x1156px
Thread's going good so far senpai
Keep it up
>>
>>58516992
Which verb would you prefer dear autistic anon? Describe? It wasn't my choice to be born in the shithole I live in nor it was my choice to not choose English over any other language. Well, I was going to reply "do not reproduce" to you too but you aren't going to reproduce anytime soon anyway
>>
>>58517161
say me more
>>
>>58516992
pretty sure she's a spic or something.
>>58517161
don't post until you learn at least the basics. there's no need to subject other people to your retardation
>>
>>58517166
The only significant thing you'll have in your entire pathetic life is the digits you got right now
>>
>>58517189
Are you upset?
Would you be mad if I had more digits?
>>
>>58516934
i don't like lambdas and the dumbass FP stuff (sum, zip etc) but like the 2d euclidean distance is just sqrt((ax - bx)^2 + (ay - by)^2) which fits in one line
>>
>>58517222
>not being at least white
>>>/p/lebbit
>>
Polls:
http://www.strawpoll.me/12023125
http://www.strawpoll.me/12097496
>>
File: YotsubaCloseup.png (104KB, 500x282px) Image search: [Google]
YotsubaCloseup.png
104KB, 500x282px
>>58517297
Wow you are angry ^___^
>>
>>58517338
which shithole are you from though? i'm really interested
>>
>>58517381
>It wasn't my choice to be born in the shithole I live in
>which shithole are you from
You're projecting, sweetie.
When you grow up you'll just because you have issues doesn't mean other people do.
>>
>>58517222
>trips
**click** Noice

>>58517381
I'm not this poster >>58517338
It's Turkey. Don't worry, I won't bother with reproducing either.
>>
>>58517426
literally couldn't read this post. might wanna try again, third worlder.
>>58517429
>I won't bother with reproducing either.
good, we don't need any more of your kind.
>>
>>58517429
The only good thing about Turkey is Anzu.
>>
>>58517473
>literally couldn't read this post. might wanna try again, third worlder.
Pretty ironic coming from the guy who can't speak English and calls his own country a shithole.
>>
>>58517473
>>58517488
Jesus christ ya dingus, I'm not him. Can't you even spot the differences between the posts?

>good, we don't need any more of your kind
Yee, you've got enough niggers to get cucked by five of them at the same time already
>>
>tfw you realize there are black people on this board right now
>tfw you've probably read and agreed with posts written by a black person

should black people be allowed to use the internet?
>>
>>58517541
>you've got enough niggers
we don't have them over here
>>
>>58517618
You're using the internet right now, and you're probably a code monkey ;^)
>>
>>58517640
I'm not an animalistic nigger or a white barbarian though.
>>
>>58517618
Only if their IQ is higher than 95.
>>
>>58517662
so no?
>>
>>58517477
Nice dubs, but you'll have to use a bigger bait

>>58517628
Good for you
>>
File: jessica kylie2.gif (2MB, 400x595px) Image search: [Google]
jessica kylie2.gif
2MB, 400x595px
Think I'm going to try out some Rust today, just to see what it's like
>>
File: thinkcucks btfo.png (430KB, 800x1280px) Image search: [Google]
thinkcucks btfo.png
430KB, 800x1280px
what's a good programming laptop?
>>
>>58517783
Expect a good language, SJW and poorly written libraries.
>>
>>58517801
i wouldn't use a laptop if i didn't have to. but maybe you could get one of those hybrid/tablet things and use a small external mechanical keyboard. but it depends on how portable you need it to be
>>
File: YlwgJwA.jpg (1011KB, 4160x2340px) Image search: [Google]
YlwgJwA.jpg
1011KB, 4160x2340px
>>58517947
like this maybe

but if you're not using it for extended periods of time or if you don't care much about the keyboard you could probably get away with using a laptop keyboard
>>
>tfw just parsed my first text file with node

feels_bretty_john_goodman.jpg
>>
>>58518163
>node
>text files

why
>>
>>58518175

easier and more powerful than bash scripts that old people use
>>
I have to learn Lua to use some machine learning package.

Someone tell if Lua is good or not and where I can learn it.
>>
>>58518207
lua is shit

doesn't python have machine learning stuff too?

python is shit too but at least it's more popular than lua
>>
File: 8Z6xfE1.png (225KB, 1026x623px) Image search: [Google]
8Z6xfE1.png
225KB, 1026x623px
>>58518202
>more powerful than bash scripts
>for parsing text
>>
Is Chapel really the best language?
>designed for high performance parallel systems
>first class parallel objects
>lambdas
>manual memory management with optional reference counting (the thing sepples fags wet themselves over even though it's literal shit)
>backed by DARPA
>fucking DARPA
>>
>>58518281

its true
>>
>>58518221
Yeah, Python has Tensorflow, Theano and Keras while Lua only has Torch. However, a lot of open source ML projects are written in Torch as it was the first decent ML package and now everyone refuses to budge. I'm sure Tensorflow will take over eventually, but I already know Python so I'm not too worried about that. Most of the libraries are the same, it's just using Lua that's the issue.

Lua has Torch.
>>
Should I learn Python 2 or Python 3?
>>
>>58518423
3
>>
>>58518423
3.
>>
>>58518207
if you've programmed in python before you'll have no problem with Lua, it is one of the most generic boring dynamically typed programming languages
>>
File: maid_dragon.png (3MB, 1920x1080px) Image search: [Google]
maid_dragon.png
3MB, 1920x1080px
>tfw your anime has actual code in it
>>
>>58518202
No one uses bash scripting for text parsing.
There is special practical extraction and reporting language for such cases.
>>
>>58518537
tfw no qt tomboycake QA python tester gf
>>
>>58516740
Norm
>>
File: Screenshot_2017-01-16_16-27-06.png (502KB, 3200x1080px) Image search: [Google]
Screenshot_2017-01-16_16-27-06.png
502KB, 3200x1080px
>>58516662
I'm a bit confused about how interrupts work. Presumably, you can receive an interrupt at any time, which means the contents of the registers can be changed at any time, which means undefined behavior, or do you yield to them(????), or does IRET restore the registers?
>>
>>58518744
A kernel saves the state of the currently running process before running the interrupt handler
>>
>>58518744
You can receive an interrupt at any time, and the OS has to tell the CPU how it's going to receive them during boot.

Then when the CPU receives an interrupt it looks in a table which handler function to call, it pushes the old value of the registers on a special interrupt stack, and it starts executing.

On return the OS does an IRET to restore the registers saved on the stack.
>>
>>58518804
So IRET restores the registers?
>>
File: Screenshot_2017-01-16_22-34-02.png (69KB, 550x739px) Image search: [Google]
Screenshot_2017-01-16_22-34-02.png
69KB, 550x739px
Formatting is hard (for some).
>>
File: snap122.png (198KB, 1365x742px) Image search: [Google]
snap122.png
198KB, 1365x742px
>>58518870
>So IRET restores the registers?
Among other things, yes. It can also perform (hardware) task switches, privilege level switches and even mode switches.

You really need to read the Intel Software Developper's Manual if you're going to write an emulator, or an OS, or whatever this is.
>>
File: 1484455191389.png (134KB, 439x519px) Image search: [Google]
1484455191389.png
134KB, 439x519px
>>58518537
>tfw they mention 'high level' and 'low level'
>>
>>58518870
https://software.intel.com/sites/default/files/managed/a4/60/325383-sdm-vol-2abcd.pdf
Find IRET and read up senpai. An interrupt will push the eip, cs, EFLAGS and maybe an error code onto the stack before moving to the interrupt handler, while IRET will pop these back off
>>
Why is high level programming frowned upon here? Ignoring the few functional language programmers.
>>
>>58518999
it's shit
>>
>>58518999
Most of /g/ is delusional enough to believe that their custom implementation of a function is more reliable, secure, and quick than the standard means provided.
>>
>>58518999
It's not frowned upon in general, it's just that some languages put limits on you and completely ignore the hardware in the name of being high level.

Being both low level and having powerful abstraction is what makes C++ the best language for every use case ever ;^)
>>
File: 1424116310569.png (512KB, 2958x1461px) Image search: [Google]
1424116310569.png
512KB, 2958x1461px
>>58519027
>what makes C++ the best language for every use case ever
this guy gets it
>>
>>58518921
I'm making my own architecture, and using the x86 interrupts as a basis for my own. I already knew flags, ip, and cs were popped off, but doesn't that mean e** are lost?
>>
>>58518999
Universities and "experts" generally discourage low level programming, so the epic contrarians at /dpt/ do the opposite. True patricians realize that you can think at a high level while operating at a (potentially) low level.
>>
>>58519145
e** as in the general purpose registers?
They're not lost when the CPU jumps to the interrupt handler, so it's the OS's job to save them on the stack and restore them later iff the OS plans to use them.

If the interrupt handler doesn't need to use a register, then it'll still be there at the end.
>>
File: Occlusion matrix wrog.gif (3MB, 837x465px) Image search: [Google]
Occlusion matrix wrog.gif
3MB, 837x465px
Alright guys, I never do this, but I REALLY need help with this one problem.
Unity calculates culling matrices incorrectly. From the matrix, it seems to generate the actual occlusion culling itself scaled proportionally to the projection matrix, at least when it comes to the near clipping plane. This can typically be fixed by simply calculating a new projection matrix with half the clip plane distance, but my problem is unfortunately not that simple. I want to calculate an oblique culling matrix, and this near-clip-doubling is totally fucking me over. I cannot figure out how to counter-compute against the multiplication that Unity uses.
Here is the code that is being used to calculate the oblique matrix

//clipPlane is a vector4 in camera space (direction + distance from camera)
Matrix4x4 CalculateObliqueOcclusion(Matrix4x4 projection, Vector4 clipPlane, float signSide) {
//signSide determines whether it is the near or the far clipping plane that moves to the clipPlane
Vector4 q = projection.inverse * new Vector4(
signSide,
signSide,
1.0f,
1.0f
);
Vector4 c = clipPlane * (2F / (Vector4.Dot(clipPlane, q)));
//Left/Right sizing
projection[2] = c.x - projection[3];
//Top/Down sizing
projection[6] = c.y - projection[7];
//Near/Far clipping plane adjustment. Used to move far clipping plane.
projection[10] = (c.z - projection[11]);
//Scale adjustment- used to move near clipping plane
projection[14] = (c.w - projection[15]);
return projection;
}


In the attached video, clipPlane is being calculated off of the cube
Please, if anybody here is good at matrix math and/or projections, please help me with this. My eye just isn't trained enough to be able to infer what I need to scale, and blindly firing has wasted me almost two days.
>>
>>58519145
Look up interrupts on OSDev, it's up to the OS to save the state of the process being interrupted
>>
>>58519203
Also: What it should be doing is simply moving the near clipping plane of the occlusion matrix to the exact location of the cube, and then making said near plane rotate when the cube does. You can't see it, but this is what the projection matrix is doing.
>>
>>58519203
If I were you I'd post that on Stackoverflow
>>
File: guido.png (1MB, 800x1200px) Image search: [Google]
guido.png
1MB, 800x1200px
Can one trust this man?
>>
>>58519207
my head hurts
>>
>>58519265
Welcome to the INTEL IA32(tm) architecture.

If you want some sany, don't copy it and the decades of legacy that come with it, make something simple right from the start.
>>
Just do away with preemptive multitasking for fuck's sake.
>>
>>58519294
So just make my architecture actually restore the registers?
>>
>>58519250
Which section in particular might I want to ask it in? The language section, or in the linear algebra area?
I have to admit that I've never used the website before, since I don't typically like asking for help.
>>
>>58519329
http://gamedev.stackexchange.com/

Even if you're not actually making a game in unity that's where you should go.
>>
>>58519259
remember the transition from 2 -> 3 that nobody went trough with?
I wouldn't trust that Guido could even kill himlself, the guy woult manage to fuck it up somehow.
>>
>>58519297
Preemption entirely, is what I meant. No more interrupts, just polling.
>>
>>58519297
Why?
>>58519322
Do whatever, it's your VM. It would be much more flexible if you let the OS take care of saving process state, but more convenient if you have the hardware do it
>>
I'm upgrading some documentation and creating a handler for inbound data requests for my decentralized TV project (BasicTV), as well as making it possible to respond with a "yes" when the data is on the node, rather than fetch everything, to make disconnecting nodes smoother.

I also made an IRC channel for the project (#basictv on Freenode).
>>
>>58519297
That's incredibly retarded. Interrupts are already opt-in (mostly), and unless you have very high load polling is plain wasteful.
>>
>>58519369
All preemption does is enable shitty, lazy programmers (and even then, any managed language's VM could do the yielding for the programmer) while reducing the performance of applications that do really need exclusive access to resources (e.g. games) and complicating operating systems.
>>
>>58519363
Interrupts make more sense though, otherwise the OS is wasting time with polling
>>
>>58519369
Maybe have a flag enable/disable it?
>>
>>58519398
So what, you want cooperative multitasking?
Programmers can't even be trusting to get regular multithreading right, how well do you think that would work.
>>
>>58519409
That's definitely an option, and I don't imagine it would be too difficult to program
>>
>>58519354
Thanks anon
Would it serve me to ask there as well as on the basic site or does that make people butthurt? I know that stackexchange questions can be thrown out for almost nothing, as I've seen time and time again.
>>
>>58519397
>>58519404
Light applications can yield.

>>58519413
Because it would be the status quo and they'd be forced to do so. And like I said, the shitty programmers are using interpreted languages anyways and the VMs can be programmed to be cooperative.
>>
>>58519446
I don't think it really matters. Just tag your question well.
>>
>>58519454
>Because it would be the status quo and they'd be forced to do so. And like I said, the shitty programmers are using interpreted languages anyways and the VMs can be programmed to be cooperative.
That's rich.
>Programmers will suddenly become good if we give them dangerous tools, because they'll have to
No they won't. They fucking won't, just like they didn't manage to write secure software in C.
>>
>>58519466
Alright. thanks anon.
Hopefully I can get this solved. I still have no idea how Unity even managed to fuck it up.
>>
>>58519471
No, the bad programmers will simply not be allowed to work where their code needs to be cooperative.

The only preemption should be to kill the process in case it's badly behaved.
>>
>>58519454
>the shitty programmers are using interpreted languages anyways
I don't know what planet you are from but here most programmers are crap. Regardless of language. And in the languages without safety nets they just produce more bugs.

Removing preemption just means you will have to restart your computer more often because some application never yields.

And that includes the applications that you'd think get a major advantage from no preemption like games. They're buggy too.
>>
>>58519524
Of course, that's totally realistic.
You're one of those people who seem to think everyone else is stupid for not seeing their simple solutions to a complicated problem, without realizing you can't just handwave away all the problems.
>>
just installed and ran tensorflow on bash on ubuntu running natively on windows

this really is the future
>>
>>58520038
Enjoy the shit performance, though
>>
>>58520044
why would it perform shit? it's not in a virtual machine
>>
>>58516934
I'm with you, man. I actually program as my daily job. That kind of code would only reduce the quality of our code long-term.
>>
>>58518999
Because most people in here don't actually solve any real world problems with their coding. They are just doing it for fun, and they think they code is "clever" although they don't actually solve anything with it.
>>
>>58520059
Because it's a shim running for every syscalls that has to do the translation to a roughly-equivalent windows API.

So instead of having the very optimized native implementation in the Linux kernel, you get to go through layers of abstractions and bloat.
>>
>>58520059
Tensorflow is notorious for poor performance out of all the ML libraries. It's been getting better but it's nothing compared to Caffe/Torch.
>>
Any of you guys have experience with chrome extensions?
I'm trying to inject a script as soon as a specific element loads.
I can't run at document end because that's too slow, and I can't run at document start because then none of the content that the script depends on would have loaded.
>>
>>58520081
>Because most people in here don't actually solve any real world problems with their coding.
I'm not sure why people come into /dpt/ expecting this
>>
>>58520081
Most people posting stuff here are working on projects that are either commercial or open source.
>>
Should I drop I/O ports on my cpu for all mmio, or keep them as legacy?
>>
How does dynamic casting work in c++? What exactly am I doing when I say p = dynamic_cast<child*>(&x);
>>
>>58519176
>Universities and "experts" generally discourage low level programming,
What? My software engineering degree literally forced us to take our first-year programming courses in C
>>
>>58520369
You shouldn't use dynamic cast. Only static cast.
>>
>>58520369
You're invoking checks using RTTI.
>>
>>58520387
That's CE, CS profs advise against using low-level in professional settings. You should still learn it, but unless you're writing USB controllers there's just no need to use, say, C.
>>
File: wut.jpg (13KB, 318x345px) Image search: [Google]
wut.jpg
13KB, 318x345px
>>58520038
>on bash on ubuntu running natively on windows
>>
>>58519376
Now i'm hoarding stats for network peers trying to get a statistical likelihood that they have the information i'm looking for, as well as ping times, bandwidth, and other stuff. After that I should be pretty set on basic networking
>>
>>58520230
Use greasemonkey + waitForKeyElements
>>
>>58520369
You check if x is convertible to a child* by looking at the vtable
>>
>>58520369
>>58520402
Also, regardless of performance, you are making a huge mistake if you are ever downcasting.
>>
>>58520575
I can't even read half of the shit on your screen
>>
>>58519176
Couldn't agree more. At uni all we learned was Java and fucking Ruby.
>>
>>58520754
Was fucking Ruby any fun?
>>
>>58519176
If that's what you like to pretend
>>
>>58520678
good
>>
>>58516934
They're like your mom-- short, ugly, but very satisfying to finish off.
>>
>>58520835

Sounds gay.
>>
>>58520878
Only if you're a girl
>>
File: coding_in_Lua.png (841B, 170x85px) Image search: [Google]
coding_in_Lua.png
841B, 170x85px
What's the proper way to incorporate commits made with a detached head into a branch? What's any way (that works)?
t. git user
>>
no really guys should i implement legacy IN/OUT style i/o
>>
>>58521021
>should i implement legacy _
no
>>
>>58521021
Read from stdin, write to standard out, errors and diagnostics to stderr.
You really don't need to do any shit other than that.
>>
File: dff.jpg (35KB, 837x736px) Image search: [Google]
dff.jpg
35KB, 837x736px
Inheritance > Composition
>>
>>58521114
Is the Pope a Catholic?
>>
>>58521114
multiple inheritance is like a more powerful version of composition anyway, two birds with one stone
>>
>>58521021
It sure is easier than DMA, but also sucks for anything serious
>>
Any tips getting some projects going?
I have couple months of spare time but don't know where i want to start with programming.
Gonna start with HtDP2 tomorrow maybe that will give me a beter idea.
>>
https://www.youtube.com/watch?v=wfMtDGfHWpA

This guy explains why composition is better, you inheritance hipsters should watch it.
>>
>>58521114
>>58521237

just use functions as values bro
>>
>>58521021
For a VM it would be completetly useless.
And even for real hardware they are largely redudant unless you have extreme address space concerns where you need lots of data and i/o addresses at the same time in say an 8 or 16 bit world.
For all other cases (i.e 32 or 64 bits) you can get by with just memory mapping and dma.
>>
>>58521237
he's wrong tho
>>
>>58521237
What's wrong with just having murderRobotDog create a dog object and then setting its poop function to undefined/null?
>>
Guys , What kind of Project Agenda do you call a mobile app that is a guide for a video game? I have difficulties on what kind of Agenda it is, Its for a thesis.
>>
>>58521421
Gay agenda.
>>
>>58521114
OOP is garbage, you stupid frogposter.
>>
File: 1484407747933.jpg (285KB, 500x690px) Image search: [Google]
1484407747933.jpg
285KB, 500x690px
>>58521483
excellent post
>>
>tfw composition is harder to read than inheritance but it's what the cool kids are doing these day
>>
>>58521521
>composition is harder to read than inheritance
is it tho
>>
>>58521267
How does MMIO work? I'm kind of confused by it.
>>
>>58521768
When you read/write memory, the CPU has to figure out what hardware that corresponds to. Usually the memory address space is backed by RAM, but it can also be ROM, or some other device's memory.

MMIO is when a device maps its own memory or registers in the main address space, so you can talk to it by just directly accessing main memory.
>>
>>58521812
oh god this is going to be an issue with my vm
>>
>>58521836
It's even worse than it looks in practice, go read some of the bullshit the Coreboot project has to deal with if you want a taste of the insanity.
>>
>>58521768
It's literally what it says it is - some address, for example 0xABC is mapped to an i/o device, say a keyboard and reading a byte there gets the next key or something.
>>
>>58521848
It's only a clusterfuck because bios and efi is a clusterfuck in how devices are discovered and configured.
If he's making his own vm/architecture he can design it in a sane way from the start and make mmio a breeze.
>>
>>58520967
please respond
>>
>lost my first job in three months
>five months later and still can't get work

is it time to end it already?
>>
>>58521930
literally just git merge
>>
>>58521935
No, just watch more anime.
>>
>>58521959
I don't want to merge, merging is a pain in the ass and it doesn't keep the original date and time.
>>
>>58521979
the next ep of LWA isn't for another week. I need the sweet release of death now
>>
>>58521930
git cherry-pick
>>
>>58522008
It does thought. You can also rebase, but that changes things.
The third option is cherry pick manually, which sucks.
>>
>>58522020
They finally made it? It'll be shit like everything else you've expected in life.

You're right, killing yourself is the only remedy for your shit taste/life.
>>
File: Untitled.png (5KB, 841x99px) Image search: [Google]
Untitled.png
5KB, 841x99px
I moved to c# for my project, but I cannot for the life of me find a simple way to get a file open from a program like handle.exe can.
The only problem with handle.exe is that it doesn't support those fancy moon runes, so it's useless. Would appreciate help or anyone with knowledge on the subject of handles.
>>
>tfw had to work until 8:30pm on MLK day
College never told me about dealing with non-tech people
>>
>>58522126
Just carry a firearm and politely ask the negroes to get out of your way.
>>
>>58522156
wut?
>>
>>58522166
Shoot the MLK nigger ralliers.
>>
>>58522095
It's actually pretty good. the first ep was just okay but in the second they completely embraced the fact it's a harry potter ripoff and started making it story about not growing out of the stories that inspired you as a kid

>>58522193
start with yourself
>>
File: 1474595871338.png (603KB, 738x1054px) Image search: [Google]
1474595871338.png
603KB, 738x1054px
SUBtyping vs. row polymorphism
>>
>>58522193
*CIA
>>
>>58522084
I tried it already, it didn't keep anything from the detached commit except the content.
>>
File: 1475128292920.jpg (65KB, 1280x720px) Image search: [Google]
1475128292920.jpg
65KB, 1280x720px
>>58522212
>comparing row polymorphism to le reddit le frog
>>
>>58522193
It's nothing to do with them, I had to work today because clients sent a bunch of support requests that they should have been able to figure out by themselves.
>>
File: Screenshot_2017-01-16_20-49-45.png (28KB, 676x378px) Image search: [Google]
Screenshot_2017-01-16_20-49-45.png
28KB, 676x378px
i'm ok with this
>>
File: spj.jpg (31KB, 224x223px) Image search: [Google]
spj.jpg
31KB, 224x223px
>>58522242
>FP
>>
File: blackjackDonkey.jpg (123KB, 720x540px) Image search: [Google]
blackjackDonkey.jpg
123KB, 720x540px
>>58522242
>if (x) while (x)
What are you doing
>>
>>58522242
>std::function
AHAHAHA
>>
>>58522202
So harry potter anime? Sounds great! Excellent taste, killing yourself is definitely not the wrong way to go.

The film was generic but alright, never expected the anime to come about but assumed it would suck if it did.
>>
>>58522242
Use a condition variable instead of that while-sleep loop.
>>
>>58522306
what
>>
>>58522306
>>58522242
Just use wait/notify.
>>
>>58522242
>>58522306
>>58522317
Just use a hardware breakpoint
>>
File: Screenshot_2017-01-16_21-00-32.png (25KB, 1279x1023px) Image search: [Google]
Screenshot_2017-01-16_21-00-32.png
25KB, 1279x1023px
it all just werks
>>
>>58522339
Now write a JIT for it
>>
Are there any decent Vim plugins for Eclipse?

We're required to use it for this semester, but it feels so primitive to write code without Vim keybindings.
>>
File: terry a davis.jpg (321KB, 1971x1971px) Image search: [Google]
terry a davis.jpg
321KB, 1971x1971px
>>58522222
>tfw noone checks your quints
>>
>>58522317
>>58522328
Even better is a spinlock in every thread waiting for your condition to come true.
>>
>>58522345
Use Intellij IDEA instead of wasting your time
It's required so idiots won't be lost following basic instructions, but if you're looking for a vim plugin probably you know better
>>
>>58522101

I can help. Explain your problem a little bit more.
>>
>>58522358
>Not programming a FPGA coprocessor and waiting for an interrupt from it
>>
>>58518423
neither
>>
How do I motivate myself to write code after yet another harrowing day at work?
>>
>>58522382
Take a nap or go for a short walk, then close everything on your computer and open your editor.

Or if you have even a modicum of self-control, just open your editor.
>>
>>58519023
>>58519176
>>58520081
>projecting this hard
>>
>>58519259
lol no, this whole python thing is such a joke, it's such a terrible and unnecessary language
>>
>>58522371
>interrupts
Get a load of this fag and his premature optimizations. Every condition will become true and every operation will happen if you just wait until your processor catches fire.
>>
>>58519259
>guido
>faggot
pick 3
>>
File: dpt-poll.png (13KB, 660x249px) Image search: [Google]
dpt-poll.png
13KB, 660x249px
påminnelse
>>
>>58519446
i don't think it'd belong on stackoverflow because it's too specific to unity
>>
>>58522425
Real programmers use GPU shaders to wait on a condition in a thousand simultaneous threads
>>
File: 1483035918361.png (786KB, 1000x1300px) Image search: [Google]
1483035918361.png
786KB, 1000x1300px
>>58522363
I'm not at all familiar with Java and my professor seemed to have his shit sorted out so I didn't give much thought about it and decided to roll with Eclipse, but now that you mentioned it I'll give IDEA a go and see if it's any better. Thanks.
>>
>>58522462
don't fall for the shill, eclipse is fucking great and there's plenty of vim plugins for eclipse and you can set keybindings manually too of course
>>
>Enumerating process handles hidden in NtQueryInformation, and is barely documented
>C# Process class does't expose this
>WMI doesn't expose this

Holy shit.
>>
>>58522505
shame it's a Java IDE
>>
>>58522516
it can do C++ and other languages just fine
>>
File: fermi.jpg (56KB, 640x426px) Image search: [Google]
fermi.jpg
56KB, 640x426px
>>58522461
I see you work for nvidia, keep fighting the good fight.
>>
>>58522312
So you don't rape your OS scheduler.
>>
>>58522515
Why not come to the dark side and use C++?
>>
>>58522548
it's shit
>>
>>58522544
how do?
>>
>>58522548

I mean, it'd be no different than using PInvoke and I'd still have to use NtQueryInformation.
>>
File: 8c3.jpg (146KB, 496x496px) Image search: [Google]
8c3.jpg
146KB, 496x496px
>>58522561
>C++ is shit
>C# isn't shit
>>
>>58522575
You're putting words in my mouth
>>
File: stl.jpg (99KB, 600x800px) Image search: [Google]
stl.jpg
99KB, 600x800px
>C++
Why is it always the people that pretend to care the most that care the least?
>>
>>58522564
mutex
>>
>>58522564
A condition variable is essentially what that loop is, except it has explicit kernel support and when you wait on a cv the OS knows this and doesn't have to keep running your thread every N microseconds to check a flag.
>>
>>58522615
Some people care about backwards compatibility, and that means you can't change some things without breaking some retarded ENTREPRISE QUALITY codebase.

People who give a shit don't use things like get_temporary_buffer in the first place
>>
>>58522615
this is why I don't show people half-assed work unless it's funny
>>
File: 1480675928173.jpg (33KB, 600x564px) Image search: [Google]
1480675928173.jpg
33KB, 600x564px
OOP is fucking garbage
>>
File: 1484610947860.png (618KB, 738x845px) Image search: [Google]
1484610947860.png
618KB, 738x845px
>>58522743
i like this post
>>
>>58522743
>OOP
>POO
>Pajeet
really makes you think
>>
>random outbursts of hate towards something that isn't even mentioned in the thread
It's almost like we have a meta-channel to this place that discusses how to try and force stupid discussions.
>>
File: 1483612379290.gif (662KB, 292x300px) Image search: [Google]
1483612379290.gif
662KB, 292x300px
>>58522754
and I like your post!
>>
>>58522778
>he doesn't know about meta/dpt/
>>
>>58522778
How often are OOP questions asked in /dpt/?
Maybe 1 or 2 times a day.
>>
but really though
poo IS fucking trash and anyone who even suggests otherwise is mentally ill
>>
>someone calls themselves a programmer
>only knows java and or python
>>
>>58518207
Use Lua only for Torch. Use it only if you need to replicate Deep Learning papers.

>>58518388
>>58518221
Torch's main backers are Facebook and academia. Tensorflow's are Google, and way more hobbyists (who, importantly, replicate stuff in Torch pretty quickly). OpenAI's kind of whatever, but shifting towards Tensorflow.

I've heard rumbling of Torch with Python bindings coming in the near future, so there's that.
>>
Anime music holder guy, get on dpt discord, I'll give you a hand.

https://discord.gg/d4V8v
>>
>>58522847
Sorry, I'm not a plebbitor.
>>
>>58522743
>>58522758
>>58522820
>>58522833
(You)
>>
>>58522855

I.. don't follow.
>>
>>58522855
why not?
>>
>>58522873
I think I've stated it pretty clearly. I'm not from plebbit.
>>
@58522858
thanks, pajeet
>>
>>58522505
>there's plenty of vim plugins for eclipse
Care to give some examples? All of the plugins I found are either incomplete poorly made shit or paid plugins (not going to pay for a plugin).

>you can set keybindings manually
Vim-keybindings is more than hjkl for navigation. Not only would I have to learn how to introduce new functionally into Eclipse but also waste an absurd amount of time programming all of the commands I use.
Also if no one has ever written a decent Vim plugin for such a "great" IDE it's probably not that great nor worth anyone's time.
>>
>>58522845
why wouldn't it have python and C/C++ bindings in the first place? surely the business logic is in C/C++ and not freaking lua?
>>
>>58522858
Literal rebbit-tier pajeet spotted
>>
>>58522907
>business logic is in C/C++
Why would anyone do that?
>>
>>58522918
kys
>>
File: Untitled.png (192KB, 663x500px) Image search: [Google]
Untitled.png
192KB, 663x500px
>>58522847
people are shitting around, what's your name on discord? I'm Grey.
>>
>>58522924
It's a perfectly valid question.
Why pick C++ over most other languages?
>>
>>58522962
Compatibility, you can get a C++ compiler for most targets

Small footprint, you don't need a massive runtime like Java or C#
>>
>>58522962
it's literally the best language and it gives you control over performance. if you're doing """"AI"""" you should care about performance. the justification for math libraries etc in python is that they're backed by C/C++ code behind the scenes and the python part merely acts as a script to tie it all together at a high level
>>
>>58522907
>>58523002
Actually the language of choice in the "mathematical kernel" niche would be FORTRAN.
>>
>>58522462
>main = do
> putStrLn "Hello"

>do

For what purpose
>>
>>58523024
fortran is mostly irrelevant these days outisde of legacy code. most people know C/C++, not fortran. any performance benefit of fortran comes from incompetent programming
>>
File: wew.jpg (96KB, 882x645px) Image search: [Google]
wew.jpg
96KB, 882x645px
fml

being a noob sucks
>>
>>58523052
Why do you keep perpetuating that learning multiple languages is hard?
>>
>>58523052
>any performance benefit of fortran comes from incompetent programming
To get the major benefits of FORTRAN you have to write restrict everywhere possible (which isn't even standard in C++).

The truth is nearly all pointer usage is non-aliased so it's ridiculous that you have to annotate it and not opt-out.
>>
>>58522982
>compatibility
It's not as good as interpreted languages or Java
>footprint
For business logic?
That's a rather ridiculous claim.
>>58523002
>C++ da best man just use it it has all the performances and I just wrote my first int averaging function that ran in less than a second per pair
Jesus.
I think we're not on the same page of what we're doing here:
https://en.wikipedia.org/wiki/Business_logic

Business logic excludes most of what C++ excels at. It's not a language that's conveniently expressive. The domain we're in often does not require much in terms of performance and more often than not you aim to have a high level of abstraction because the underlying data is less important than the control flow that gets you your result.

C++ and C are among the worst fits I can think of. And the fact that you're arguing against this reflects incredibly poorly on C++ programmers. Not that anyone who proudly presents themselves as such had much value in my eyes to begin with.
>>
>>58523072
It is anon, how many languages do you speak? Most Americans are monoglots.
>>
File: muh fortran.png (74KB, 647x373px) Image search: [Google]
muh fortran.png
74KB, 647x373px
>>58523072
>>58523081
kys
>>
>>58522515
just see what processhacker does
https://github.com/processhacker2/processhacker2
>>
>>58523086
Do you understand what "business logic" for deep learning networks and other high performance mathematical computation means?
>>
>>58523103
He's a Pajeet, obviously.
>>
>>58522948

I just messaged you, boss.
>>
>>58523048
you can it without the do
>>
>>58523103
I'm not gonna explain what business logic is and how you're misusing the word anon. If you're writing a NN and you're littering your code with problem specific logic instead of establishing an interface to your NN and working with it in the abstract from outside you've got a perverted idea of what programming is.
>>
>>58523160
>If you're writing a NN and you're littering your code with problem specific logic instead of establishing an interface to your NN and working with it in the abstract from outside
And how do you implement the NN itself, huh?
>>
>>58523176
>asks me to implement something for him
No thanks anon. You do your own crappy job.
>>
>>58523204
If you weren't autistic you would have realized that's what the original anon meant by "business logic".
>>
>>58523149
I know, that was my point
>>
>>58523093
> Ada is still third with a three year old compiler
>>
>>58523212
Oh so you mean he used a word incorrectly and I'm supposed to know what flavor of completely wrong he is? That's far too clever for me anon.
>>
Sounds like you guys would enjoy Clojure.
>>
>>58523275
it's the business logic of the ML library, not the business logic of your application
>>
File: 1484077194203.gif (3MB, 633x351px) Image search: [Google]
1484077194203.gif
3MB, 633x351px
>>58523406
>>
>>58523441
This man, completely unhinged from reality.
What a bliss.
>>
guys, ive got an existing system that doesnt work, has unreferenced codepaths, event drivent driven elements that immediately pull the program from its current state onto a seperate codepath. how do i properly represent this shit as a diagram if i want to illustrate the design of the program?

im thinking UML activity diagrams, but i dont know if thats appropriate or not for this kind of thing.
>>
File: 1458239867725.jpg (58KB, 699x468px) Image search: [Google]
1458239867725.jpg
58KB, 699x468px
>>58523467
>>
I've been writing different sorts of finite state machines lately.
Here's a really obscene one for clang that I just finished:

enum {UP, DOWN, PRESSED, RELEASED};

int button(int st, _Bool in)
{
return (int (^[])(_Bool)){ [UP] = ^ (_Bool in) { return (int []){UP , PRESSED }[in]; }
, [DOWN] = ^ (_Bool in) { return (int []){DOWN, RELEASED}[in]; }
, [PRESSED] = ^ (_Bool in) { return (int []){DOWN, RELEASED}[in]; }
, [RELEASED] = ^ (_Bool in) { return (int []){UP , PRESSED }[in]; }}[st](in);
}
>>
>>58522847
fresh one?
(different guy)
>>
>>58523544
what
>>
>>58523544
Haskell?
>>
>>58523566
it's really cool and not useful, now you can implement everything inside a single subexpression.
>>
>>58523544
No offense meant but I really wish I got excited over stuff like this like I used to. It was so much fun.
>>
Kan jeg stille et spörsmål? Jeg vil lære Idris. Finnes det noen böker skrevet på norsk?
>>
File: 1476906609749.png (67KB, 1456x1108px) Image search: [Google]
1476906609749.png
67KB, 1456x1108px
>tfw you're probably using my code on a daily basis
>>
>>58522845
I'm >>58518207.

I'm in academia myself. I was mainly learning Torch/Lua so I could look at deep learning implementations and could copy the good bits.
>>
>>58523591
that's certainly not haskell
>>
>>58523737
It's about as legible
>>
>>58523633

more hints pls
>>
File: 1477575632002.jpg (32KB, 700x400px) Image search: [Google]
1477575632002.jpg
32KB, 700x400px
>>58523850
>>
>>58523948

video player?
>>
>>58523948
VLC?
>>
new thread: >>58524074
Thread posts: 319
Thread images: 47


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