[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: 336
Thread images: 14

File: 1422394896484.jpg (740KB, 728x2080px) Image search: [Google]
1422394896484.jpg
740KB, 728x2080px
This is the [daily programming] thread, a discussion place for /g/ finest.

Previous thread >>57126084

discord: https://discord.gg/7FNDh

What are you working on ?
>>
>>57130506
first for GCC
>>
Can /dpt/ prove 30 + 30 = 60?
>>
ITT: Disregard performance of compiler technology, find the best pet
>>
>>57130553
define prove
>>
File: 1454865402468.jpg (30KB, 526x199px) Image search: [Google]
1454865402468.jpg
30KB, 526x199px
>>57130553
done desu
>>
>>57130598
How is 1 + 1 = 20 related to 30 + 30 = 60?
>>
>>57130611
inductively?
>>
>>57130616
I don't think that can work.
>>
>>57130611
The proof is generalized to any two numbers
>>
>>57130566
[/code]define function prove
(theorem)
=> (proof)[/code]
okay, now its your turn to implement it.
>>
>children these days think adding two integers is work

back in my day we had to average two integers
>>
>>57130631
This is trivially reducible to Gödel's incompleteness theorem, so your definition is a contradiction.
Hence 30 + 30 != 60.
>>
>>57130636
I've already averaged n integers for n in \N. Proving 30 + 30 = 60 is another beast.
>>
>>57130648
That was a trick post faggot, it's impossible to average two integers

Did you fail first grade mathematics or something
>>
what actually is the number 2
>>
>>57130657
Let 2 = 1 + 1.
>>
>>57130657
S S Z
>>
>>57130657
It's the set {{}, {{}}}
>>
>>57130657
the total number of people in the world who will ever care about you
>>
>>57130686
Implying samefag. But >>57130670, >>57130677 and >>57130679 posted in less than a minute's interval.
Consequently, more than 2 people cared.
You are mathematically wrong.
>>
>>57130701
>implying I didn't post from my PC, my phone, and my girlfriends phone at the same time.
>>
>>57130701
they cared about your post, not you
>>
>>57130553
open import Data.Nat

thirty : ℕ
thirty = suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (zero))))))))))))))))))))))))))))))

sixty : ℕ
sixty = suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (zero))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

theorem : thirty + thirty ≡ sixty
theorem = refl


>>57130636
Averaging two N-bit integers is just adding them into a (N+1)-bit number where the last bit is fractional.
>>
>>57130716
>Implying I didn't report you for violating >>>/global/rules/14
                                                                                                                                                             I actually didn't


>>57130718
I'm actually >>57130679 and not >>57130657. Checkmate, semantics fag.
>>
File: 1472582006253.png (260KB, 620x640px) Image search: [Google]
1472582006253.png
260KB, 620x640px
writing an ftp server/client in c. trying to get the file transfer to work. would the methods that handle file transfer on the server and client look the same?
>>
>>57130729
>
sixty = suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (zero))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

Is that so.
>>
But how can the average be real if addition isn't real?
>>
>>57130745
Yes. 60 = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0.
>>
In python
why
A = 15/100

Is different from
A = 15.0/100
>>
>>57130767
Some validation seems to be in order.
>>
>>57130778
Validation of what?
>>
>>57130780
>60 = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0
>>
>>57130789
That's sixty ones. Count them if you don't believe me.
>>
>>57130769
Ritchie did this
blame him
>>
>>57130769
because 15 and 15.0 are different, one is an integer literal, one is a floating point literal.

int / int returns int, in this case it will be truncated ("rounded down") so you get 0 instead of 0.15.
float / int returns float so you get 0.15.
>>
>>57130797
>60 is defined as the sum of 60 ones
hmmm
>>
>>57130812
Well, yes. We have fixed 60 to mean what it means.
>>
>>57130812
No, 60 is defined as the successor of 59.
>>
>>57130769
because floating point arithmetic circuitry is different from integer arithmetic circuitry
>>
>>57130818
>>57130825
I'm not convinced guys. Mathematics using the number 60 seems to be standing on shaky grounds.
>>
This "prove 30 + 30 = 60" meme is very boring. It always devolves into this "definition of numbers" shit.

At least averaging 2 ints has some nuance.
>>
>>57130841
I told you
60 is the successor of 59
>>
>>57130846
Not really. The average of two ints doesn't have to be an integer.
>>
File: sa.webm (3MB, 720x405px) Image search: [Google]
sa.webm
3MB, 720x405px
daisuki~

Don't forget to ask your favorite programming literate anything (IAMA).

>tfw no question

>>57130769
Both return the same result.

>>57130657
http://mathforum.org/library/drmath/view/51551.html

>>57130522
>>57130555
GCC is obsolete now, clang and llvm are much more clever.

>>57130506
Thank you for using an anime image.
>>
>>57130849
But what is 59?
>>
>>57130801
>thinks C invented this behaviour
not everything can be blamed on C, it was as much a victim of copying behaviour as languages today are of copying C.
>>
>>57130862
The successor of 58
>>
>>57130807
I see thanks.
When doing math does ( ) matter in python?
Or it will follow basic math logic?
>>
>>57130875
for the most part it will follow "basic math logic", but you can always use ( ) to ensure precedence is handled like you'd expect.

See https://docs.python.org/2/reference/expressions.html#operator-precedence for the actual precedence of operators in Python.
>>
>All those babby questions on SO that boil down to "you don't know about the cache"
Don't schools teach hardware anymore nowadays?
>>
>>57130946
"Hardware" is too phallic.
>>
>>57130946
not anymore, now schools teach how to ask on stackoverflow.
>>
>>57130657
An object, everything is an object.

5.times { 
puts 'KYS'
}
>>
>>57131059
is . an object
>>
>>57131086
Yes.
It's the mother of all objects.
>>
>>57131096
why are you assuming gender?
>>
>>57130657
it follows naturally, via a simple inductive proof -- which is trivially provable, and left as an exercise to the reader. QED
>>
>>57131096
is ... one object or three
>>
>>57131142
its two, .. and .
>>
>>57131160
is two objects one object or three
>>
how old were you when you discovered floating point numbers are satan
>>
>>57131180
depends on the time of day
>>
>>57131184
I was 20.1f
I remember being 20.100000381469727 and thinking "Where did those extra seconds go?"
>>
>>57131184
>tfw Python is only pretending to be sane, but will stab you in the back if you do anything more

>>> 1./3*3
1.0
>>> 1./3*100*3/100
0.9999999999999999
>>
>>57131207
top kek
Also they are perfectly fine when you don't give a flying fuck (most cases) about minimal inaccurasies
>>
>PHP in a Nutshell p.277
>Creating flash
l i t e r a lly w h y
>>
>>57131226
That's floating point numbers for you.
>>
>>57131248
>Release Date: October 2005
>>
What would be a good programming language to start on for trying out little machine learning projects?
I only know Python and Matlab, which some people say is fine (matlab, not python), but wouldn't a compiled language like C perform better?
>>
>>57131380
Paskell
>>
>>57131380
Python because TensorFlow.
>>
>>57131401
Neat. Didn't even know that existed.
>>
>>57131380
python
>>
Album is an odd word. album. It looks wrong.
>>
>20 job emails today
>all senior positions
>all in places I would never even consider living in
>no calls

Yeah, I'm not getting a job any month soon, am I?
>>
>>57131451
Lumbar
>>
>>57131380
Low level languages like C aren't good for high level things like machine learning.
>>
Working on learning java.
I've been using C for the past two years and I used C++ briefly.

How long should it take me to get a firm grasp on this shit?
>>
>>57131451
https://en.wikipedia.org/wiki/Semantic_satiation
>>
>>57131472
Java is very consistent and easy to learn.
>>
>>57131341
Floating point is dumb.

>>> 1.1+2.2
3.3000000000000003
>>> from decimal import Decimal as D
>>> D('1.1') + D('2.2')
Decimal('3.3')
>>
 
template<typename ...types> class Fizz : types...{public: virtual ~Fizz(){std::cout<<"Fizz";}
class Buzz : types... {public: virtual ~Buzz(){std::cout<<"Buzz";}
};};
void FizzBuzz()
{Fizz<Fizz<Fizz<>,Fizz<Fizz<Fizz<>::Buzz>>,Fizz<Fizz<>::Buzz, Fizz<Fizz<Fizz<>>, Fizz<Fizz<Fizz<>>::Buzz>>>,Fizz<Fizz<>>>>::Buzz fizzy;}


>2016
>not using c++
>>
>>57131487
Binary is easy and consistent and you can do everything in binary that you can do in base 10. Using 10 different digits is obscene if you ask me.
>>
>>57131515
Binary is shit.
Hex is the superior system.
>>
>>57131504
Haskell provides Ratio
>>
>>57131525
Binary is to Hex as Java is to C++.
>>
>>57131515
suck
my
cock
dude
>>
>>57131515
I know you're just having a laff, but that's completely true for circuit design
>>
>>57131380
Also www.youtube.com/channel/UCWN3xxRkmTPmbKwht9FuE5A/videos
>>
>>57131380
>matlab over python for ml
kek
>matlab for anything
kek
>>
>>57131506
That's probably one of the worst indention jobs I've seen.
>>
What does Internal compiler error mean?
Is my compiler borken?
>>
>>57131592
Yes, buy a new one.
>>
>>57131599
commented out three lines of code, and it compiled fine.
then i uncommented back the same three line, and the internal compiler error went away
>>
>>57131569
Many thanks
>>57131584
H-hey, don't shit on Matlab. It's the only language that I actually have to know how to use for work
>>
>>57131626
What were lines?
>>
Matlab is great for it's primary intended purpose, numeric matrix operations, and it's also pretty good for producing plots.
For anything else, it's crap.
>>
>>57131682
Matlab is excellent for micro heat kernels.
>>
>closed languages
>>
>>57131671
an #include and two dependent function calls.
>>
>>57131689
I don't even know what that is, so i'll just shut up now.
>>
>>57131700
>regular languages
>>
>normie languages
>>
>>57131719
It's a joke, senpai. A heat kernel is a solution to some mathematical problems that cretins like yourself don't need concern themselves with. A micro kernel is something out of systems programming.

Fucking /dpt/ I don't even.
>>
Rewriting the Linux Heat Kernel in Pascell
>>
>>57131750
Wow congratulations you must feel so smug knowing two possible meanins of "kernel".

Teach me your way, senpai. I want to become an arrogant kid too.
>>
////////////////////////////////////////////////////////////
/// \brief Read from a data stream
///
/// \param[in] ptr Pointer to a buffer to read data into
/// \param[in] size Size of each object to read, in bytes
/// \param[in] maxnum Maximum number of objects to be read
///
/// \returns Number of objects read, or 0 at error or end of file
///
/// \see http://wiki.libsdl.org/SDL_RWread
///
////////////////////////////////////////////////////////////

virtual size_t Read(void* ptr, size_t size, size_t maxnum) = 0;


What's the deal with this three forward slash style comment block anyway?
>>
>>57131808
Doxygen.
>>
>>57131802
>you must feel so smug
As a matter of fact, I do. But not because of heat kernel which everyone learns about in babby's first PDE class.
>>
c++ sure is interesting

#include <vector>
#include <iostream>

void foo() try {
std::vector<int> x;
x.at(5);
} catch (std::exception& e) {
std::cout << e.what() << '\n';
}

int main() {
foo();
}
>>
>>57131869
shouldn't there be an extra {
>>
>>57131869
>he doesn't pass -fno-exceptions -fno-rtti
enjoy paying for what you don't use
>>
>>57131830
Since you seem to know a lot about micro kernels, here's some code you should take to heart before posting: 0xFCEBF490
>>
>>57131592
You're most likely running low on RAM and/or swap and the compiler crashed because it ran out of the memory.
>>
/babbysfirstprogram/

I have values between -pi/2 and pi/2 and I need to convert them to integer values between -39 and 39
>>
>>57131880
but he's clearly using an exception?????
>>
>>57131901
Divide them by pi/2 and multiply them by 39.
>>
>>57131901
Multiply by 39, then divide by Pi/2
>>
>>57131914
He needs to learn about muh algebraic data types.
>>
>>57131914
Have you heard the good news?
Have you heard of Monads?
>>
>>57131915
>>57131919

Mein negers, thanks
>>
>>57131941
are monads a runtime exception?
>>
>>57130611
Change 1 to 30 and proof is in the pudding.
>>
>>57131901
Multiply by 78/pi.
>>
>>57131915
>>57131919
Well, which is it?
>>
>>57131901
wtf you should have learned this in elementary school math class
>>
>>57131971
...
>>
>>57131971
Neither, the answer is 42.
>>
Hey guys, is there a book commonly considered the best on functional programming? Preferably haskell.
I'm basically looking for the K&R of functional programming.
>>
>>57131989
but what is the question?
>>
>>57131971
It's actually a multiplication by 24.828
>>
>>57131996
SICP probably, if you don't mind a meme book
>>
>>57131999
how many dicks does a haskell programmer suck a day
>>
>>57131877
no. its perfectly valid.

struct foo {
foo(bar& b) try : b(b) {...} catch (...) {...}
private:
bar b;
};
>>
>>57132010
makes sense, with all that cum you'd definitely want to know where your towel is.
>>
>>57132000
No, it's a division by 0.040277
>>
>>57132046
Enjoy a shit precision
>>
>>57131877
http://en.cppreference.com/w/cpp/language/function-try-block
>>
Is there a way to have python run in sandbox on linux?
I'd like to install some modules and mess around but I don't want to fuck up my default install.
>>
>>57132059
24.828 and 0.040277 both have five digits of precision.
>>
>>57131930
Please explain what you mean.
>>
>>57132082
I mean using muh adts instead of exceptions.
>>
>>57132075
virtualenv
something you should have used from get go
>>
>>57132075
Yes. Virtualenv. Also works on Windows.
>>
>>57132080
The further you get from 0, the less precision an IEEE754 floating-point number has.
>>
>Lisp has had rationals built into the language for years and years, yet you still have to argue about IEEE floats in your shitty python code
>>
holy fug cellular automaton is cool as fuck
>>
Would it be cheaper to train a codemonkey from scratch than hiring a cs if it's just high level programming for generic apps?
>>
>>57131941
>using a shitty way of expressing computations borrowed from a language where that was the only sensible way to express computations, even though your language already has computations and doesn't need monads
>hasn't heard of effect systems
>hasn't heard of continuations
FUCK why does everything fucking suck
can't we just throw everything the fuck away and start over
>>
>>57130506
Is that manga real or are they just mangaka or something with edited text?
>>
>>57132089
>>57132100
I'm speechless.
I've been using python for almost a year.
Why none of the tutorials mention this?
>>
>>57132199
its not edited.
>>
>>57132088
What?
>>
>>57132234
muh adts
>>
>>57132180
Sure we can. In 150 years we'll be right back where we are.
>>
>>57132180
monads are continuation style
>>
>>57132250
Are you having a stroke?
>>
>>57132207
>https://docs.python.org/3.5/tutorial/venv.html
You mean you're speechless because some random tutorial on a random website probably written by some student not knowing what he's taking about was actually bad?
I guess that's your lesson to use proper resources.
>>
>>57132293
He wants you to pass the SOAP
>>
Writing an equation solver for Chem so I don't have to screw up my math any more.
Currently working on inverse functions. Next will be automatic unit conversions and then finally a parser and plug-and-solve equation solver, with units & significant figures

; currently:
(displayln
(eqn-solve 'n
`(mul P V) `(mul n (mul R T))))
; ->
(div (mul P V) (mul R T))
>>
>>57132216
Source?
>>
WHERE DO I LEARN HOW TO MAKE COOL ASS APPS AND MINECRAFT MODS FUCK

Or just generally program you know.
>>
>>57132434
https://www.google.com
>>
File: snow.gif (2MB, 1000x512px) Image search: [Google]
snow.gif
2MB, 1000x512px
>>57132434
The only skill you need is how to search and answer you own questions instead of relying on people handholing you.

Have some curiosity, for fuck's sake.
>>
>trying to learn Elm
>doing the official tutorial
>babby steps mode for the first few exercises
>suddenly, it expects you to fully understand what -> does
>you have to understand stuff like
Random.generate : (a -> msg) -> Random.Generator a -> Cmd msg

>doesn't explain
>even the full documentation on syntax glosses over it

Does learning a functional language automatically make you a bad teacher?
>>
>>57132529
Random.generate has type

(a -> msg) -> Random.Generator a -> Cmd msg
or
(a -> msg) -> (Random.Generator a -> Cmd msg)

i.e.
given a function from a to a msg, and a Random Generator of a's, it will give you a message
>>
>>57132529
>>57132546
so for instance
fun :: a -> b
is like
b fun(a param);

but it's functional, so you end up with stuff like
fun2 :: a -> b -> c
(b->c) fun(a param);
c fun(a param)(b param); // imagine calling it twice at once
>>
>>57132434
Anon we don't need people like you, the industry is filled with uncreative autists (minecraft player).
What we need is pioneers.
>>57132514
>>57132457
You guys are being idiots though, theres a boatload of junk out there and this asking people who you have more faith in what they found to work is perfectly viable and absolutely not something google can replace.
>>
>>57132529
Good thing there's a section of that same guide called "Types" that you can find in the sidebar.
>>
>>57132565
mathoverflow is for research-tier questions only
>>
>>57132514
I think that this skill should be thaught in schools.
How to properly find knowledge on the internet, how to productively use google, and how to evaluate ligitimacy of resources find online.
>>
>>57132529
>>57132561
basically you can just read it as "to"

(a to msg) to RandomGenerator<a> to Cmd<msg>

So you give it an "<a> printer", and then you give it an "<a> generator" and it gives you a printed <a>
>>
>>57132592
Instead, teachers just spout "WIKIPEDIA ISNT A VALID SOURRRRCE" and then tell you to go to the library or something
>>
>>57132546
>>57132561
>>57132602
Stop being so helpful. I want to stay mad.

>>57132581
You're all right with me, anon.
>>
>>57132584
>tfw no web site where you can exchange undergraduate-level math homework answers (too simple for career mathematicians to bother answering, but too complex to be solved just by typing it in to Sage) for handjobs
>>
>>57132648
Are you saying career mathematicians don't want handjobs?
>>
>>57132648

How do you plan to give someone a handjob through the Internet?
>>
>>57132565
But starting out asking a question like "HOW I PROGRAMZ?" is an obvious indication they have done little to no research on their own yet. Plenty of people here learned from their own research, that doesn't mean we will dismiss any questions but they should demonstrate they have done more more to learn themselves than just posting in /dpt/.
>>
>>57132666
No, they ascribe prestige to not helping clueless undergraduates.
>>
>>57132682
Visio on Office 365
>>
>>57130506
why they bully poor coder ;_;
>>
>>57132610

You never cite Wikipedia. You look through the Wikipedia article for its sources and use those instead.
>>
>>57132696
>You never cite Wikipedia
Why?
>>
>>57132328
can't remember the source but it's not a manga about programming.
>>
>>57132718
Because anyone can edit it, and it's constantly changing.

The revision you're reading probably didn't go through a panel of experts to verify there isn't anything wrong in there.
>>
>>57130506
>What are you working on?
A login automation program for work with a GUI in python. I've learned why people use Qt over tkinter.
>>
>>57132738
>The revision you're reading probably didn't go through a panel of experts to verify there isn't anything wrong in there.
Don't make me laugh. 50% of studies reviewed by panels of experts can't be reproduced.
>>
>>57132753
You're adding another layer of error on top of the mess that is "peer-reviewed research."
>>
>>57132684
Anon is basically asking "as experienced people in the field that have already gone through the initial trials of learning, what can you recommend as a good starting point?" There's nothing wrong with standing on the shoulders of giants. No doubt anon has already done initial searches and is overwhelmed by the options, so he is looking here to figure out what people here might think is an exceptionally good guide or material. Anon didn't need to express this because we are all adults and this is implied by that virtue
>>
>>57132770
You first have to prove that expert review reduces the number of errors in a significant way.
>>
>>57132738
The odds of a study being wrong are much higher than the odds of a wikipedia article being quoted being maliciously edited just before you reference it.
>>
>>57132776
>because we are all adults
>WHERE DO I LEARN HOW TO MAKE COOL ASS APPS AND MINECRAFT MODS FUCK
>>
>>57132794
Yeah. Well, that's just exaggerated immaturity, he is memeing, it's a 4chan thing
>>
/dpt/ does this sound like shit? I was so confident it was a smart way to frame it last week but now it seems awful

>why were you at this job for three months
>well, it was a trial period. they hired a number of other programmers at the same time and were trying to decide which one of us to keep. ultimately they went with another guy
>>
>>57132825
hence, a meme reply:
https://www.google.com

If they want real replies, ask a real question.
>>
>>57132833
Yes
>I lost my job because I wasn't a good enough programmer
>>
>>57132833
It wasn't the environment you were looking for, so you quit.
Simple.
>>
Hey anon, I'm making a YouTube player in node webkit however it doesn't have support for extensions. I've looked a bit into NPAPI plugins however can't really find anything helpful. Does anyone have any ideas on how to include an ad blocker other than making it myself.
>>
I'll just say it was a contract role from here on out, even though it's a blatant lie
>>
>>57132884
that always brings follow-up questions in which I have no choice but to either say something bad them or about myself
>>
>>57132788
That may be, but who is marking your report (professor who is doing peer-reviewed research or grad students who are trying to do peer-reviewed research)?
>>
File: 1470699494562.jpg (115KB, 1080x1080px) Image search: [Google]
1470699494562.jpg
115KB, 1080x1080px
What is the best tutorials around for OpenGL?

I've seen learnopengl.cl, open.gl, and opengl-tutorial.
>>
>>57132991
>2016
>opengl
>>
File: I7jd1MQ.jpg (34KB, 500x667px) Image search: [Google]
I7jd1MQ.jpg
34KB, 500x667px
>>57132991
https://capnramses.github.io//opengl/
>>
>>57132991
http://learnopengl.com/
>>
>>57133010
I fucking hate kittens. Whenever I see one I just want to stomp it until there is nothing left but blood and pulp.
>>
File: 2016-10-18-215349_623x392_scrot.png (65KB, 623x392px) Image search: [Google]
2016-10-18-215349_623x392_scrot.png
65KB, 623x392px
>>57133006
>>
>>57130506
Nothing... for like a week... I think Im depressed... Its sort of registering just now =/

I want to get a functioning request handler in Java (leaning towards Spring atm) written up for a mobile app I am working on, but Ive instead been lounging and pondering a noose. Ill try to do something tonight, I guess...
>>
File: catintears.jpg (11KB, 261x192px) Image search: [Google]
catintears.jpg
11KB, 261x192px
>>57133022
>want to kill defenseless and harmless animals
psychopath
>>
>>57133036
>>57133036
>d-d-d-don't learn Vulcan, leave it to the pros.

What next, don't learn C because it requires half a brain cell?
>>
a=1;
b=a++ + ++a;

You have ten seconds to tell me what b equals
>>
>>57133095
https://www.youtube.com/watch?v=443B6f_4n6k
>>
>>57133095
undefined behavior
>>
>>57132885
that's the most retarded idea ive read in a while here
>>
>>57133095
Nasal demons
>>
>>57133095
> Implementation defined :^)
What did Richie mean by this?
>>
>>57132169
Yes, this is what a lot of places actually do.
>>
>>57133104
>we will never see the end of this video
>you will never know the truth
>>
>>57132991
Learn Vulkan.
>>
>>57133090
>>57133020
>>57133036
>>57133010
>>57133006
Or you can just use DirectX which has a lot more stuff than OpenGL, easier to program, faster to run, and has MS to back it up.


Vulcan is just another sad attempt at making OpenGL matter, which it won't. The Industry decides what matters and it's DirectX. You can thank Carmack for turning on OpenGL more than a decade ago killing it off.
>>
Who here /secretlyajapanesemiddleschoolgirlwho'salsoageniusprogrammer/?
>>
Why is epoll so hard yo use edge-triggered?
>>
>>57133142
i wish
>>
>>57130644

This is not how shit works.

Incompleteness doesn't mean you can't prove anything within the theorem. It means you can't prove everything.


>>57130553

Too lazy too make it accurate, but here is a cheap shot:


1. We define a set of symbols A = {0,1,2,3,4,5,6,7,8,9} with two boolean operators "<" and "+". For example <(0,1) is true, <(1,0) is false, =(1,1) is true, =(1,0) is false and so on.

1.a ) LEMMA 1: The operator "<" is transitive, so that (a < b) and (b < c) implies (a < c).
Proof left as excercise for the reader.

2. We define A* as sequence of symbols from A.

3. We define the operator S(A*) -> A* so that each element "a" from A* has exactly one element SUCCESSOR. We also define that "a" is called the PREDECESSOR of S("a"). We define:
<(a,SUCCESSOR) = true
<(SUCCESSOR,a) = false
<(a,PREDECESSOR) = false
<(PREDECESSOR,a) = true

S() is defined as follows:

DEF S(a)
(a(1),..,a(n)) = SPLIT(a), so that a(k) is an element of A
k := n
WHILE TRUE
IF NOT EXISTS( a(k) ) CREATE a(k)
IF a(k) != 9 THEN
a(k) = "{1-->2, 2-->3, .. }"
ELSE
a(k) = 0
k = k-1
END WHILE
END DEF

4. We define the operator "+" as follows:

DEF +(a,b)
IF <(b,a) THEN
SWAP(a,b)
END IF

WHILE NOT =(a,0)
b := S(b)
a := x so that =(S(x),a)
END WHILE
END DEF

4a) LEMMA:
=(60, +(30,30)) is true
(Left as excercise for the reader.)
>>
>>57133156

Sorry, mistake:

The first sentence has to be:

>1. We define a set of symbols A = {0,1,2,3,4,5,6,7,8,9} with two boolean operators "<" and "=".
>>
>>57133156
>This is not how shit works.
I wasn't very clear in my memeing, let me rephrase that.

Anon's definition of proving is producing a function that turns any theorem into a proof. By this definition, proving is impossible since such a function can not be produced due to the Incompleteness theorem.
That is, there exists some theorems for which the output of this function would not exist.
The definition is a contradiction, hence it can not be proved that 30 + 30 = 60.

>Incompleteness doesn't mean you can't prove anything within the theorem. It means you can't prove everything.
Roughly, yeah.
>>
>>57133095
I think it's fucking disgusting this is allowable
>>
>>57133080
That's what i call The Enterprise Programmer Syndrome
Try coding something interesting in your favorite language of choice. It will ease the depression.
>>
>>57132718
Not for the reasons this douchebag:
>>57132738
"cited" (no pun intended), but because douchebags like:
>>57132738
*think* it is an unreliable source, and the fastest and easiest way to get them to stop talking, other than presenting them an erect penis, is to just cite the sources in a wikipedia article, literally because *they are not wikipedia*. Sad that this is the world we live in that we actually have to work around retards... so it goes.
>>
>>57133194
It's not allowable, this program is ill-formed.
A compiler may or may not reject this program.
>>
>>57133104
That's why exceptions are good.
>>
>>57133141
>has a lot more stuff than OpenG
no
>>57133141
>easier to program
no
>>57133141
>faster to run
no
>>57133141
>has MS to back it up.
yes

>>57133141
>Vulcan is just another sad attempt at making OpenGL matter, which it won't. The Industry decides what matters and it's DirectX. You can thank Carmack for turning on OpenGL more than a decade ago killing it off.

directx is only available on microsoft products, retard. ps3, ps4, nintendo 3ds, wiiu, android, ios, linux, freebsd, Northrop/boing/lockheed martin/nasa/... simulators, pixar, dreamworks, ... all of those are not using directx.
>>
>>57130679
wouldn't it be |M|, when M= {O, {O}}
>>
>>57133156
>4a) LEMMA:
>=(60, +(30,30)) is true
>(Left as excercise for the reader.)
I would say
>I hope you're just meming
but you wrote
>all that shit
so I'm afraid you're not.
>>
>>57133080
>TFW coding a server from scratch in C is easier
>>
>>57133199
Have you seen the amount of vandalism in Wikipedia articles?

And, no, vandalisms aren't corrected immediately, especially on lower-traffic articles.
>>
>>57133224
I think the point is precisely that |M| is M
>>
>>57133229
you know that wikipedia has a history log for each page, right?
>>
>>57133195
Interesting... is this a common thing? I may try that tonight. I think the reason I have made zero progress on my entrepreneurial is because I get so excited to try a new framework or API that will (allegedly) cut down my work time by half, and 90% of the time, I find out the hard way that it is an abandoned project that never worked out-of-the-box, and I am left fiddling with settings for an hour or two getting pissed off, and Im just so tired of doing that over and over again =/

To boot, Ive been applying for jobs like a mad man with a resume' that everyone seems to like, and yet I have not gotten a single call back from even the lowliest of positions. Feels like shit, man... I want to drink tonight.
>>
>>57133229
>>
>And, no, vandalisms aren't corrected immediately, especially on lower-traffic articles.
Actually, it is. Wikipedia has some EXTREMELY effective bots that insta-revert most vandalism.
>>
>>57133258
Prove it. Edit an article and post the link
>>
>>57133258
Not just bots, I think there are several regular editors that hangs around the recently updated-list spying for stupid edits.
>>
>>57133156
How about:
If sally has 30 apples and jack has 30 apples and they place all their apples on a table, there will be 60 apples on that table.
Where is my nobel prize??
>>
>>57133095
3
...literally cant post because of timer

>>57133229
Yeah, maybe in 2006

>>57133228
got a good tut? I would gladly read it. I really just want something I can deploy to Google Cloud easily and that can query a database. Everything else is secondary. I am actually quite proficient in C. Dont get me all excited, now
>>
>>57133120
How so?
>>
>>57133153
It's not all fun and games
>>
File: snap046.png (124KB, 1118x629px) Image search: [Google]
snap046.png
124KB, 1118x629px
>>57133267
>Prove it. Edit an article and post the link
I'm an Editor, I'm not going to commit vandalism.
Picrelated is Cluebot NG's activity log. It finds and reverts several vandalism edits per minute, with a very low false positive rate.

>>57133277
Yeah that's the "RC patrol" fags, people who lurk the recent changes page: https://en.wikipedia.org/wiki/Special:RecentChanges
It's mind numbing work, but at least they're contributing to something instead of shitposting to 4chan, I guess.
>>
>>57133309
>I'm an Editor
Does wikipedia have a left/degenerate bias?
>>
>>57133291
the only reason you';d ever want a dedicated youtube player would be to get rid of the browser overhead
so whats the point of wrapping a player in a browser again?
>>
>>57133309
>I'm an Editor,

So, you're a pedophile?
>>
>>57133280
https://www.ietf.org/rfc/rfc2616.txt
http://www.wangafu.net/~nickm/libevent-book/
HTTP is quite simple actually. Also, having full control on your application really feels nice.
>>
>>57133250
I do java webshit for work, and I know it's easy to forget why computer science and programming was interesting to me in the first place.
Just take some fun language and code whatever you deem interesting in it.
>>
>>57133319
In my opinion, a little bit. For example on SJW-related articles the neutrality is pretty questionable.
But then again feel free to engage in an autistic edit war if you think you can be more neutral.

>>57133330
Yes. I buttfuck teenagers who think replacing every other word of an article with "penis" is funny.
>>
>>57133349
>But then again feel free to engage in an autistic edit war if you think you can be more neutral.
You can't fight systematic bias. Isn't that what the degenerates have been telling us?
>>
Best python books?...for a beginner like myself that coded some scam websites with PHP but doesnt understand Python. I type a few python commands but dont understand how to compile it or what to do. pls respond?!
>>
>>57133309
So I'm currently developing an automated vandalism bot with recurrent neural networks. What should I know to get optimal efficiency?
>>
>>57133204
I was referring to having increment statements in assignment statements
>>
>>57133365
just read this
https://docs.python.org/3.5/tutorial/
you can thank me later
>>
>>57133365
Really do anything including killing kittens but just don't learn PHP.

Also >>57133382
>>
>>57133358
Wikipedia is all about spending ridiculous amounts of times arguing over trivial shit for weeks on ends.
If you've spent any time on 4chan, you should practically have a career in arguing.

>>57133375
You need to train your neural network to post something that looks like non-vandalism posts.
Cluebot is trained to recognize vandalism, just make sure your posts are different enough I guess.
>>
>>57133382
i wont thank you later i will do it now.
thank youuuu
>>57133397
dont worry i forgot most of it anyway
>>
>>57133141
Vulkan has fuck all to do with OpenGL. It's a whole new cross-platform graphics API by Khronos.
>>
>>57133441
Vulkan is basically Mantel 2.0 forced all over again
>>
>>57133380
babby doesn't know about registers and assembler
>>
If I hate OpenGL and vilkan sucks, is there good reference for GC ASM programming?
>>
>>57133461
What? Mantle was just AMD's answer to Nvidia's AZDO initiative, except that instead of extending the fundamentally flawed OpenGL they made a whole new API.
>>
>>57133473
retard doesn't know how compilers work
>>
>>57130657
Whatever you want it to be.
: 2 ." hello" ; 

2
hello


If your language doesn't let you name functions as literal numbers it's shit.
>>
>>57133502
Stockholm syndrom
>>
>>57133493
and what if i play around with compiler flags or the contrary: i don't?
>>
>>57133528
Did you have a fucking stroke?
>>
>>57133474
https://en.wikipedia.org/wiki/Standard_Portable_Intermediate_Representation
https://www.khronos.org/spir
>>
>>57133546
yeah, your mum stroked my anaconda lmoa
>>
>>57133485
>the fundamentally flawed OpenGL
how so ?
>>
>>57133580
> ?

Anime and EDM are technology: https://www.youtube.com/watch?v=fzQ6gRAEoy0
>>
>>57133580
It barely represents how a GPU actually operates. It's like comparing Ruby to C.
>>
>>57133613
Why would I want to know exactly how the GPU works? The whole point of OpenGL and DX9 was to abstract that shit away
>>
>>57133580
You have to load OpenCL program as a text file or string inside your C program and then pass it to the GPU driver to have it compile at runtime.

The dev workflow is a complete mess because of this.

It's the primary reason CUDA won.
>>
>>57133632
>The whole point of OpenGL and DX9 was to abstract that shit away
The abstraction is leaky. That's the problem.
>>
File: 1458304714606.jpg (181KB, 1345x750px) Image search: [Google]
1458304714606.jpg
181KB, 1345x750px
>tfw accidentally pushed a commit to a school project using your default weeb git alias and cock.li email instead of your school alias and email.
>>
>>57133632
For efficiency. If that doesn't matter to you, then you don't need to use Vulkan or D3D12.

And it's still pretty abstracted. The big changes are that a) it doesn't pretend asynchronous things are synchronous and b) it doesn't pretend that the graphics pipeline is malleable when in reality the whole thing needs to be swapped out to make most changes.
>>
>>57133681
git revert @^; git push --force
>>
>>57133681
>tfw no cute 2d goddess to save you

>weeb git alias and cock.li email
It's based desu.
>>
weebshits need to die
>>
Top tier programming food?
>>
>>57133681
pull the trigger
>>
File: guE7LX0.png (51KB, 657x527px) Image search: [Google]
guE7LX0.png
51KB, 657x527px
>>57133681
What's wrong with a cock.li email? It's a free legit email service and is great.
>>
>>57133702
Are you upset?
>>
>>57133691
I already changed the author of the commit and force pushed, but bitbucket shows recent activity on the sidebar including the old commit I just rewrote.
i-i hope they don't notice.
>>
>>57133727
Make a new branch. Push a hundred test commits to clear the recent activity. Delete the branch.
>>
>>57133740
That's definitely not suspicious at all.
>>
>>57133567
Thanks for the link. Really liking this. Is it good for neural networks and accelerated computing?

>inb4 CUDA
Meh
>>
>>57133762
I mean you're free to reveal your powerlevel too if you want, I won't judge.
>>
>>57133772
That anon is a retard and you still need some way to communicate between the CPU and GPU. SPIR is just a GPU "assembly" spec.
>>
>>57133789
Haha no. Why would I want slow CPU as bottleneck? Anything can fully run on GPU.
>>
>>57133827
You don't have a choice.
>>
Static vs Dynamic typing
Weigh in you fags
State non-meme reasons
>>
>>57133984
Dynamic typing can be recovered with static typing but not the other way around.
>>
>>57133984
Static obviously.
>Better performance
>compile time error checking and optimisations
>actually simpler and more explicit
>>
>>57133333
Nice quints! And yeah, I just learned about binomial heaps and I am learning about fibonacci heaps now. Binomial heaps are dope af and Fibonacci heaps are starting out really interesting. I want to come up with some nifty applications for them and put them to work out of curiosity.

>>57133714
Candy and pornography

>>57133332
Ill give these a look later. I really just need a shit hello world server on Google cloud. Once I have that, I dont mind coding every instance by hand. Thanks for the posts though! I hope I can get it to work for me. Im thirsty for the real world, and since no one will fucking hire me, it looks like im going to need to just hire myself with a multi-million dollar application company. Sounds plausible... that or I shoot myself in the brain
>>
>>57133727

It could be worse. You could have accidentally pushed to a project not associated with your real name, with a school email. I did that once. Was a nightmare trying to fix that before people could find out who this mysterious "Ruby" person is.
>>
Should I force myself to go to sleep at fixed time everyday? Am I the only with the "muh one more line of code" syndrome?

Why am I productive only when I'm tired...
>>
>>57134035
Yet you broadcast your apparent real name on /g/.
>>
>>57133984
Static is obviously superior, no point arguing.
>>
Can /dpt/ average two ints in C?
>>
>>57130506
I got an assignment today to make a rock paper scissors game.
I made it but it's all if statements in a big while loop.
Is that okay?
>>
>>57134022
>Candy
Wouldn't you tire out?
>>
>>57134022
HTTP/1.1 200 OK\n
Content-Type: text/html\n
\r\n
<!DOCTYPE html><html><body><style>body {font: 40px sans-serif;}</style>Hello world! ;)</body></html>


That's literally all you need, even in production. Just open a TCP socket listening on port 80 and serve as text.

You want to use libevent to prevent your server from being locked to one request at a time (which is obviously dumb).
>>
>>57134090

None of you have a clue what my real name is.
>>
>>57134150
Haha whatever you say, Ruby.
>>
>>57134150
Sure thing, Steve.
>>
>>57133613
>It barely represents how a GPU actually operates
opengl is just here to send/get data to/from the gpu and to send commands. the gpu is actually programmed with shaders (glsl)

>It's like comparing Ruby to C.
doesn't make any sense


>>57133653
cuda won because they gave free hardwares and free supports to top universities. opencl also does support offline compilation
>>
>>57134035
too late
>>
>>57134176
>opengl is just here to send/get data to/from the gpu and to send commands.
And it doesn't represent the process of doing that very well.

>>It's like comparing Ruby to C.
>doesn't make any sense
Ruby is high-level and doesn't give you much control over low-level stuff. C does, at the cost of requiring more code and being less safe.
>>
>>57134115
What language? There are cleaner ways to do it, for example each type can be an object, struct, etc. and know what types it beats. That way you can determine the winner with a concise subprogram like : if (player1choice[choice_id] == player2choice[what_type_can_beat])
player2 wins
else player1 wins
>>
>>57134150
Get back to work, Dave. These horses aren't going to jerk themselves off.
>>
>>57134176
>opencl also does support offline compilation

That's an option that came about way later after CUDA took the entire market, and still not the default way of doing things.
>>
>>57134213
c#
3 weeks into the course
I gotta have the player choose Rock/Paper/Scissor and match that against a random number 1-4 that the computer generates.
>>
>>57134213
that is in no way cleaner nor better. it all boils down to simple if/else tests so what anon did is the most robust and idiot proof way to do it without over engineering as fuck almighty
>>
>>57134150
Emma please
>>
>>57134246
Oh yeah, you probably don't know about objects yet. You could use 3 arrays
>>57134264
code re-usability, anon. Next week it might be rock, paper, scissors, lizard, spock. Get your head out of your ass.
>>
File: 1465871665826.jpg (112KB, 987x741px) Image search: [Google]
1465871665826.jpg
112KB, 987x741px
>Final assignment in CS class is to write a java parser
>In java
I hate everything about this assignment

The worst thing about it is that the best one might be used to replace software made by Pajeet, the other section's professor.
>>
>>57134213
>>57134264
data Throw = Rock | Paper | Scissors deriving Eq
data Result = Win | Tie | Loss

opposite : Result -> Result
opposite Win = Loss
opposite Tie = Tie
opposite Loss = Win

play : Throw -> Throw -> Result
play Rock Scissors = Win
play Paper Rock = Win
play Scissors Paper = Win
play x y
| x == y = Tie
| otherwise = opposite $ play y x
>>
>>57134302
i already anticipated this answer since you got your head too deep in the oop anus.
be honest here anon, how likely do you think it is that this piece of code will ever be re-used, expanded?
>>
>>57134304
Why are you paying to waste your time?
>>
>>57134320
Actually, I'm dumb.
data Throw = Rock | Paper | Scissors deriving Eq
data Result = Win | Tie | Loss

play : Throw -> Throw -> Result
play Rock Scissors = Win
play Paper Rock = Win
play Scissors Paper = Win
play x y
| x == y = Tie
| otherwise = Loss
>>
>>57134350
This class is a prerequisite for other, more advanced classes. Universities don't want you to jump straight into the shit that's truly difficult without making sure that you have at least SOME foundation, or else the classes would get super bogged down and their failure rates would be high.

What we really need is a placement test for programming, just like math/english/every other subject has

At least I'm taking other classes in which I'm actually learning stuff at the same time (Data structures and algorithms)
>>
>>57134302
I figured I could replace the ifs in the ifs with switch.
or can you put switch within switch?
if (playerchoice == rock)
{
if (computerchoice == rock)
do this
if (computerchoice == paper)
do this
if (computerchoice == scissors)
do this
}
>>
>>57134338
You don't think its more concise to do the logic once instead of:
if (i choose rock and you choose paper)
you win
else if (you choose rock and I choose paper)
i win
else if (we both choose rock)
we are both losers
else if (you choose paper and I choose scissors)
i win
...?
>>
NEW THREAD!

>>57134410
>>
>>57134119
Every time you crash, just eat more so you get a new sugar rush. Totally safe. Can be used indefinitely.

>>57134129
Jesus I know nothing about computers. All these algorithms falling out of my pockets, and no practical knowledge... =/

Where do you guys learn all this stuff? Is there a book that serves as "the standard"?
>>
>>57133327
Learning node webkit
Screen space
Aesthetic
Learning JavaScript
>>
>>57134436
Basically, I'm trying to convey the idea that it's easier to debug your program if you have full control over it. Unlike when using some bloated framework or library that supposedly make things easier.

"The C programming language 2nd edition" is the only book you will ever need.

>Also, python, not Java
>>
>>57134408
the game has a very limited set of inputs and an even more so limited set of outcomes, the game has not changed since first conceived
and you're trying to build some elaborate framework around it for literally what fucking purpose? because you can? lmao anon, what you are suggesting is classic over engineering
>>
>>57134505
Good points. I guess I can't help it, but obviously it can be done with the most basic of logic structures. Once you realize that you don't think, "how else can I do it?" I mean if he was getting paid to write shit, okay bang it out and move on to the next one. But as a student, it would be good practice to over-engineer stuff, especially when they give you projects that an actual child could write.
Thread posts: 336
Thread images: 14


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