[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: 345
Thread images: 45

File: a1091567924_10.jpg (58KB, 768x1024px) Image search: [Google]
a1091567924_10.jpg
58KB, 768x1024px
Old thread: >>61122451

What are you working on, /g/?
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
>>61128103
Cirst for F.
>>
Second for Python is a kino language!
>>
>>61128129
Cecond for S
>>
>>61128103
Rewriting the Apple EULA in Rust for great social justice!
>>
Reminder that the movements of a Rubik's cube forms a group
Reminder that probability distributions form a monad
>>
>>61128154
>muh "moan ads"
>>
File: smug_ran.jpg (632KB, 709x1063px) Image search: [Google]
smug_ran.jpg
632KB, 709x1063px
>>61128154
Movements of a Rubik's cube is isomorphic to the symmetry group of N = 3 lattice (Z_N)^3 and probability distributions form a sigma algebra.
>>
File: monads.png (797KB, 793x670px) Image search: [Google]
monads.png
797KB, 793x670px
>>61128165
the monad as interpreted by functional programmers is the ultimate embedding of imperative programming within functional programming and represents the pinnacle of 20th century programming innovation, uniting imperative programming, type theory, category theory, first class functions, custom data types, procedural and imperative concepts along with continuations and the lambda calculus to perfect the concept of the pure typed programming language. it is the cherry on top of the proof within the pudding that functional programming is strictly superior to imperative programming.

philistine memesters need not reply
>>
I wanna create a program that can predict the price of a stock with 99.9999...% accuracy. How can I achieve this?
>>
>>61128205

>monads.png
>muh "moan ads"

>the lambda calculus
>muh "lamb duhs"
>>
>>61128209
Predict historical stocks but be wrong .......0001% of the time
>>
When (move) returning an object from a method, is it better to return a rvalue reference, or return by value? i.e.:

Thing get() {
return std::move(thing);
}

...

Thing thing = foo.get();


VS

Thing &&get() {
return thing;
}

...

Thing thing = foo.get();


I'm aware that the first one would use RTO (or not?), but what is really the difference between the two? should I be using the first or the second?
>>
>>61128209
write a true ai. trivial
>>
File: wASmM.png (106KB, 875x1090px) Image search: [Google]
wASmM.png
106KB, 875x1090px
>>61128103
We are making a web browser! >>61078788

You are welcome to join!
>>
>>61128221
>philistine memesters need not reply
>>
>>61128227
By value. Rval refs are meant for soon-to-be-expiring values, not for returning from functions.
>>
>>61128205
>it is the cherry on top of the proof within the pudding that functional programming is strictly superior to imperative programming.
all this and yet functional programming STILL cannot go fast
>>
>>61128229
a true ai would be shit at this task
"so what is the stock price"
"daddy i'm bored can we play chess"
>>
>>61128268
What I'm worried about is extraneous moves, though.
The first one looks like it moves thing twice.
>>
File: yukari_pranked.png (261KB, 580x414px) Image search: [Google]
yukari_pranked.png
261KB, 580x414px
>>61128209
Step 1:
>learn martingale theory
>learn theory of StDEs
>develop a stock model with infinite degrees of freedom that covers all possibilities
Step 2:
>learn quantum computing
>learn condensed matter
>create protected qubits
>invent quantum computing language
>implement the above stock model in a quantum neural network
>the quantum algorithm learns from stock history and weights all probabilities accordingly
>wait
Step 3:
>become slave to robot overlords
>>
>>61128277
>i need C++ performance for video games!
This is an 18+ website
>>
>probability distributions form a monad
R needs an overhaul
Where's Q, language for statistical computing, also without the dumb RAM issues R has, and also severing compatibility with S and R for a clean beginning
>>
>>61128227
Do NOT call std::move when returning by value unless your compiler's retarded (*cough* VC++), because that inhibits RVO. As for &&, it is primarily meant for expiring parameters, using them to return references is pointless.
>>
>>61128306
OK, i don't know how to program. Where to i start.
>>
>>61128297

std::move does not mean "move this thing".
It means "treat this thing as movable".
Only one move occurs.
>>
>>61128313
Try working in lossless compression with any functional language.
>>
File: consider_suicide.png (628KB, 1280x620px) Image search: [Google]
consider_suicide.png
628KB, 1280x620px
>>61128342
Start by killing yourself.
>>
I saw a numberphile or computerphile episode on random numbers. They generated a truly random number by somehow using measuring hits of an electron shot out of something. Would it be possible to make these "hits" public so that everyone could use them, I mean instead of using UNIX time as the seed, use these electron hits.
>>
>>61128348
https://blog.jle.im/entry/streaming-huffman-compression-in-haskell-part-1-trees
>>
>>61128297
std::move and std::forward are just casts, they don't really move anything. std::move casts to rvalue unconditionally, std::forward may or may not perform the cast.
>>
>>61128313
>he has not written a kernel
>he does not write software for his kernel he has written
This is an 18+ website
>>
>>61128342
google "how to program", learn to be resourceful, self-sufficient, motivated and disciplined (ie. once you pick a learning resource, stick to it)
>>
>>61128330
But I'm returning a member variable, not a value created in the get function. So RVO wouldn't be applicable here wouldn't it?

>>61128346
>>61128390
I know that, but the function returns by value, so it looks like it moves thing into the return value, and then the return value is moved into the new thing at the call site.
Two moves.
>>
File: ran's_DMRG.png (1MB, 900x1440px) Image search: [Google]
ran's_DMRG.png
1MB, 900x1440px
>>61128313
>the only reason to want speed and performance is games
Hello brainlet.
>>
>>61128444
Is that image written in freaking Chinese or something? What the heck.
>>
>>61128444
>it's not about games dude xD *goes back to playing 2humst'd've*
>>
>>61128459
>2humst'd've*
Lmao bish whet
>>
>>61128365
much easier and faster to calculate UNIX time I'd imagine, unless computers start shipping with some kind of device capable of accurate and precise electron measurement like you're describing (just speculating, I'm out of my element)
>>
>>61128459
not him but
>2humst'd've
what the fuck is this supposed to be
>>
File: 0e9.png (626KB, 1080x1080px) Image search: [Google]
0e9.png
626KB, 1080x1080px
>>61128491
>>61128509
>>
>>61128428
>But I'm returning a member variable, not a value created in the get function. So RVO wouldn't be applicable here wouldn't it?

This is why posting your full code listing is important.

Anyway, if you want to really understand the rules of C++ initialization, you have your work cut out for you:

http://en.cppreference.com/w/cpp/language/copy_initialization
>>
Anyone here worked with critical systems?
>>
>>61128507
I was thinking of something similar to operating systems referencing a time server, which references atoms cycles, or something like that. So what could happen is that in some building there is a device that captures data milliseconds at a time, and that data is uploaded to a server which other computers can reference as a seed.
>>
File: 2lacy88.png (74KB, 469x422px) Image search: [Google]
2lacy88.png
74KB, 469x422px
>>61128534
oh for fuck sake
it's called toe hoe you literal trash

also:
>even fucking plays toe hoe
literally get out
>>
>>61128550
Nobody here has ever worked on anything important
>>
File: mlgtux2.png (619KB, 1920x1080px) Image search: [Google]
mlgtux2.png
619KB, 1920x1080px
>>61128313
>>i need C++ performance for video games!
the current state of freetards
>>
>>61128555
I can't see how that would be "better" than calculating UNIX time, especially since now you've involved an outside connection
>>
File: 1457114437643.jpg (44KB, 600x600px) Image search: [Google]
1457114437643.jpg
44KB, 600x600px
So, I made a small class to keep server info in strings, such as name, address, site.

Trying to put that information into an object and save each object in a list.

Anyone one of you fine /g/entlemen know how to extract letsay, the name of a specific item from an object which is in a list?

Its starting to irritate me now.

Server s;
List<Object> serverList1;

in function:

s = new Server(servName, address, site);
serverList1 = new List<object>();

Object value = serverList1[0];
var names = value.???????????????


Ya, Im shit at code...
>>
>>61128579
No, it's taw haw in Queen's English
>>
>>61128600
Because the method I've suggested is truly random since it uses quantum states of electrons, something that is totally unpredictable!
>>
it's pronounced tou hou (teoh hoh)
>>
>>61128606

Use a List<Server> instead of a plain Object.
Let value be of the type Server instead of the type Object. That way you know it contains whichever variable you're trying to obtain from it.
>>
>>61128617
I could possibly agree with you if you were proposing computers come with a device which did this measurement locally, otherwise I foresee problems
>>
File: 1476287284241.jpg (29KB, 500x375px) Image search: [Google]
1476287284241.jpg
29KB, 500x375px
>>61128648
Thank you based anon.
>>
>>61128631
>those who seek to misle others will themselves become misled
>>
It's pronounced とうほう you fucking retards.
>>
.cxx > .cpp > .c++ > .cc
>>
>>61128735
Oh buzz off, you beanhead. I say what I want and I don't give a darn. If you don't like it, you can take a hike, pal.
>>
File: smug_ran5.png (325KB, 529x735px) Image search: [Google]
smug_ran5.png
325KB, 529x735px
>>61128617
Practicality aside:
What if the server receives requests from 2 programs simultaneously?
What if the server gives 2 or more programs the same RNG data?
How would you implement uniform distributions? Every electron has their own wavefunctions and these wafefunctions are never uniform due to constant functions not being L^\infty.
If the same setup is used over and over again in the server (i.e. the same electron wavefunction keeps being sampled) then there will be patterns in the distribution of the distributions of the RNs given out by the server. If this happens then the electron's Schrodinger's equation can be created such that the RNG would become just another quantum sim.
>>
>>61128706
>/maJ'zəl/ - to mislead
>>
>>61128785
If it receives two requests at the same time, which would be rare then the computers would be placed in a queue. This would likely only result in a negligible delay.
>>
>>61128594
>he spent time on this
>>
>>61128342
You might think >>61128355 is joking but really he's not.
>>
circuits: math without the drudgery of thinking
machine language: circuits without the drudgery of manually building and reconfiguring them
assembly: machine language without the drudgery of punching a lot of holes and/or unplugging and replugging pipes
c: assembly without the drudgery of manually managing registers, memory reads and writes, and the stack
c++: c without the drudgery of frequently casting things and manually keeping track of types in data structures
java: c++ without the drudgery of manually managing memory allocation and deallocation
everything else: java without the drudgery of always organizing everything into classes
>>
import god

print(god.answer('What is the meaning of life'))


What would it output?
>>
>>61128969
haskell!
>>
>>61128983
lol
>>
>>61128983
"error: missing question mark inserted at line 3."
>>
>>61128355
This is truly a step I wish I hadn't missed
>>
>>61128594
I never get what the cross is about.
>>
>>61128969
>java: c++ without the drudgery of manually managing memory allocation and deallocation
You're a fucking idiot.
>>
>>61128983
Error: There is as yet insufficient data for a meaningful answer.
>>
>>61129134
It's supposed to be the reticle of a distant firearm.
>>
>>61128969
>math
Math is clearly the most high level thing.
Why did you out that at the bottom?
>the test of the post
Oh. You're retarded.
>>
>>61129177
I've never seen that on firearms, thanks.
>>
File: 1479446342639.jpg (10KB, 256x288px) Image search: [Google]
1479446342639.jpg
10KB, 256x288px
Does anyone else listen to classical music whilst programming?
>>
>>61129209
I only listen to the hardest of metal
https://youtu.be/q9jB9lHjHc0
>>
>>61129209
i listen to synthpop
>>
In addition to optimizing my algorithms, I would like to optimize my brain's performance. Aside from getting at least 8 hours of sleep, eating a balanced diet, and using a stimulant (caffeine, etc.), what else can I do?
>>
>>61129263
Exercise, scheduled down-time (no coding, no thinking about anything related to development)
>>
>>61129298
Does meditation work?
>>
>>61129263
Stimulants are not good for you, you should not be using them if you're getting a good amount of sleep.
>>
>>61129263
Ballmer peak
>>
>>61129348
Cx
>>
>>61129209
i don't really listen to it
i write it during downtime to pass the time
>>
Does anyone here have any experience in building ATS/Postiats for Cygwin? Their website says it's compatible, but it won't link, even when compiling with
-D_ATS_NGC

Plus AFAIK alloca isn't implemented in Cygwin
>>
>>61129415
cygwin is a special hell i would wish on noone
>>
File: ats2.png (46KB, 677x582px) Image search: [Google]
ats2.png
46KB, 677x582px
>>61129415
Forgot pic
>>61129427
At least it has some support for fcntl(), unlike MinGW
>>
New to programming here, should I start with C first? If so, any recommendations for books etc?
>>
>>61129448
Start with something more abstract so you don't get frustrated with programming. Then use C.
>>
>>61129475
>>61129448
No, C is actually a good first language.
>>
>>61129489
Wrong. C++ is a great first language. So is Javascript.
>>
>>61129263
Don't use caffeine consistently. It gives, but it also takes in roughly equal measure. See the avenues your mind goes down without it.

I recommend cocoa beans, or a high quality chocolate bar. As well as phenibut or kava. Ethanol can also be useful, and not even in a Ballmer peak kind of way. My programming is just as solid while drunk, until apathy or laying on the floor spinning and eventually puking, overtakes me. Drink a clean alcohol like vodka. Not beer or whisky, which are full of other psychoactive compounds like hordenine.
>>
>>61129511

> C++
> Great first language

wut

> Javascript

>>>/trash/
>>
File: 1468900329618.png (784KB, 899x899px) Image search: [Google]
1468900329618.png
784KB, 899x899px
>when a book is 1200 pages long and has maybe a solid 10 pages worth of actual information in it
>>
File: 1496114727751.jpg (33KB, 400x562px) Image search: [Google]
1496114727751.jpg
33KB, 400x562px
>>61129511
>>
>>61129448
C is a good way to start. Then learn OCaml or Rust as your second language.
>>
>>61129511
C++ is not a great language of anything. Stop pushing that abomination that killed programming.
>>
>>61129448
Start with C++. You'll learn some aspects of C simultaneously as you view projects written in both, deal with null terminated strings, functions like memcpy, etc. Learn C more fully if you decide it's worth it.

A scripting language might be good to learn first as well, as long as you're not a moron that thinks things are happening magically and therefore mindlessly writes inefficient junk. The first "language" I learned was batch, and I came to write very complex scripts and optimize the hell out of them because despite not knowing the implementation details of the interpreter and supplmentary programs, I still thought about it mechanically. Always consider the means.

Also, read about how computer memory and cpu caches work. Possibly the single most important thing you'll ever learn. If anyone remembers the name of that guide, I'd appreciate it as well.
>>
>>61129527
>there's supposed to be something in these but you never see it. Frustrating.
>>
>>61129598
>Start with C++.
Opinion discarded. You're clearly a fucking retard.
>>
>>61129598
Don't listen to this guy. C++ is a horrible language. It leads to really really bad design choices. You invariably start using
the "nice" library features of the language like STL and Boost and other
total and utter crap, that may "help" you program, but causes:

- infinite amounts of pain when they don't work (and anybody who tells me
that STL and especially Boost are stable and portable is just so full
of BS that it's not even funny)

- inefficient abstracted programming models where two years down the road
you notice that some abstraction wasn't very efficient, but now all
your code depends on all the nice object models around it, and you
cannot fix it without rewriting your app.

It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it.
>>
>>61129322
No, it's just something people have been doing for centuries when they can't think of anything else to do
>>
>>61129614
Elaborate further. There are a lot of aspects of C++ I don't like, which are generally also the case with C, but overall it's not terrible. Once you learn to use it properly, it feels and is a tool more than simply in the way of turning an idea into efficient code.
>>
File: 1416942823156.gif (212KB, 501x585px) Image search: [Google]
1416942823156.gif
212KB, 501x585px
>>61129609
Maybe this one is easier to see
>>
>>61129625
thanks for your input, linus
>>
hey /g/ r8 this rust code

#include <stdio.h>

#define fn auto

fn inc (int x) -> int
{
return x + 1;
}

int main()
{
printf("%d\n", inc(5));
return 0;
}
>>
>>61129650
C++ is a crippled clusterfuck of features that confuses devolopers off all experience level. Honestly, it stops people from using their brain and lets people become dependant of magical abstractions that depend on C++ only.

C++ doesn't teach you anything. And it ultimately leads to unmaintable projects.
>>
>>61129692
>return x + 1;
>return
Not rust
>>
>>61129699
rust has the return keyword
>>
>>61129625
> You invariably start using the "nice" library features
Not really. The only library features I use are vector and occasionally chrono or iostreams when it's better than the printf approach. The rest are my own classes and C standard library functions. And given that I don't rush and give everything a large amount of thought, I've pretty much never made such a mess of abstractions that I've irreconcilably written myself into a corner.

Just don't be a moron about it. There's a decent capacity for layering mistakes on mistakes in just about any language. Header files are my biggest complaint. I don't give the slightest fuck about increased compilation time from two passes.
>>
>>61129692
>>
>>61129693
This is because C++ does not have any aim. (Other than replacing C which C++ failed miserably at).

Ever seen a guy who wanted to be everything all at the same time? No? Because people that do stupid stunts like that ends up being good for nothing, Just like C++.
The only reason C++ is still alive because Microsoft is pushing it.
>>
>>61128983
>fake god
install TempleOS and talk to the real deal
>>
daily remember
java is a bad, C fine, CABAL fine, the others fine
>>
Is this where I go to talk about phone dev?
>>
>>61129856
Grindr? I honestly don't have a clue anon. Good luck with that.
>>
Currently working on a C# Win Forms app. Will convert it to WPF someday, but for now I want to get the damn thing working 100% first.

Could someone answer me this? I'm in the market to get my first dev job and most places are asking for a salary expectation. What should I put? I've looked at the average #'s but I don't know if I can get away with asking for that, being newer. But I also don't want to under sell my self.
>>
>>61129882
>>61129986
I just want a place to bitch about

>android """programming"""
>>
What's the best language for embedded scripts?
>>
>>61130120
Where are you looking for work? What sort of company? Startup? Fintech? Do you have a degree? How much experience do you have?

We can't give you an answer without more information.
>>
>>61130235
Embeddable Common Lisp
>>
File: languages3.png (17KB, 522x384px) Image search: [Google]
languages3.png
17KB, 522x384px
Reminder that the content of the attached image is still true
>>
What is "Monadic do"? Explain this to a Java/python guy
>>
>>61130258
I'm in western New York (the state not city). I have my Associates in Computer Science and I've worked on some volunteer projects online, but nothing I got paid for.
As for the kind of company... What ever I can get. I'm kind of desperate for a job right now and I refuse to go back to phone tech support.
>>
>>61130326
It's a mishearing of "Mona dick do"
>>
>>61130343
Is working in NYC feasible for you? You'll probably be able to command a much higher salary there than upstate, not to mention there's a ton of tech jobs in the city
>>
>>61130307
I agree
>>
>>61130358
If the company pays me to move I would. Right now I'm broke.
>>
>>61130410
No company actually does this because they can hire locally and not pay some guy to relocate.
>>
>>61130326
bump
>>
>>61130422
Well if I had to, I guess I could beg family for help if they know it's for a good job. But yeah, what should I be saying I'm worth?
>>
>>61130410
If a company really likes you then you might be able to arrange a signing bonus or help with relocation. They shouldn't turn down a great hire for the sake of a small one-off payment.

Also look into getting your travel expenses reimbursed if you go to interviews.

Are you any closer to Pittsburgh? Although not as big as NYC, there's a few software jobs there too.
>>
>>61130460
You're not worth shit.
Nobody owes you a living.
>>
>>61130472
A company would be foolish to turn down a great programmer for the sake of having to pay their moving costs and first month's rent.
>>
>>61128154
>probability distributions form a monad
This is actually quite interesting for quantum computing, since it holds for the various notions of probability in QM as well. Measurements form a monad as well afaik.
>>
>>61130496
>great programmer
I sincerely doubt that.
Even if you're all that, there's 100 million other skilled software workers like you sitting in india all foaming at the mouth to receive an H1B visa so they can come work for you at half your asking price plus no "moving cost" or other frivolous shit like benefits or health insurance.
>>
How do I into efficiency with Haskell?
>>
>>61130515
I'm not him.

>>61130460
This is at least one site's data on junior devs in the city: https://www.glassdoor.com/Salaries/new-york-city-junior-software-developer-salary-SRCH_IL.0,13_IM615_KO14,39.htm

Although the figure seems a little low to me, any other anons want to chime in?
>>
>>61130515
>there's an unlimited supply of skilled software workers
Anon if you believe this you're definitively one of them.
>>
>>61130523
Efficiency in what? Processing? Software development? Life enjoyment? Writing useless junk?
>>
>>61130605
I just don't want to be too wasteful, I want to write efficient code.
>>
>>61130612
Use the C FFI a lot
>>
>>61130612
You won't be able to achieve this in a declarative language like haskell.

Write procedural.
>>
>>61130612
This.
>>61130618
Write C where your program does the most work.

If you want you can write everything in haskell. Profile your code and then rewrite in C.
>>
Which is faster, jg or jge?
>>
Anyone else just despair at the incompetence of other companies' tech departments?
>>
>>61130638
What about Common Lisp?
>>
File: tR1sbXK.png (126KB, 456x320px) Image search: [Google]
tR1sbXK.png
126KB, 456x320px
>go to work
>half the programmers are literally pajeets from overseas
>smell like shit
>bring curry and shit to share for potlucks
>speak whatever it is they speak in india during breaks
I made a huge misdage
guess the programming language
>>
>>61130523
Decide on whether its better to use iteration or recursion for the problem you're having and adapt accordingly.

Oh wait
>Haskell
dude pure functions and monads lmao
>>
>>61130774
C++
>>
>>61130751
Use Lisp.
>>
Made a shitty text adventure in python . Didn't even finish it properly.
>>
>>61130746
>other companies
Ha. The IT at my company had my colleague out of work for two days because they wanted to fix his computer (which they seemingly fucked up themselves from both my and my colleagues pov) instead of giving him a new one (even if just temporarily). When the boss heard about it heads rolled. The person who had made that call lost his job and he immediately got a new laptop. The entire department is really scared now.
As my boss put it the value a single guy at my R&D provides in 2 days is way more than ten laptops in hardware and assorted IT costs (not sure if hyperbolic or not, he's a very serious dude), so we should never hesitate to tell him if things go in this direction.
I don't hear much about other companies.
>>
>>61129539
damn why do you say that anon?

makes me kinda sad since I just bought a c++ book after finally giving up on scripting since it made me want to cut my eyes out then trow myself out of my apartment window.
>>
>>61130849
which book
>>
File: 1498117439711.png (753KB, 1338x5868px) Image search: [Google]
1498117439711.png
753KB, 1338x5868px
>>61130849
>>
File: 1391172640537.jpg (37KB, 285x279px) Image search: [Google]
1391172640537.jpg
37KB, 285x279px
Jesus christ C Primer Plus is bad. I'm 5 chapters in and I haven't actually learned anything except printf.
>>
>>61130871
https://www.amazon.com/C-Nutshell-Ray-Lischner/dp/059600298X/ref=pd_sim_14_3?_encoding=UTF8&pd_rd_i=059600298X&pd_rd_r=M0X2PB2A1DFKEETXVA3B&pd_rd_w=Y2Ide&pd_rd_wg=1nf0W&psc=1&refRID=M0X2PB2A1DFKEETXVA3B

c++ in a nutshell. I've always enjoyed these, they helped me during my python days.

I was actually thinking about trying to pick up x86 asm. would that make me want to kill myself too?
>>
File: 1497027091963.jpg (178KB, 462x465px) Image search: [Google]
1497027091963.jpg
178KB, 462x465px
>tfw starting to get the hang of common lisp
>>
>>61130896
It's a reference book not a tutorial, dumbass.
Also, a language as small as C doesn't require a 1000 page book in any context.
>>
>>61130919
>C Primer Plus
>it's a reference book

I hope you're pretending to be retarded. It's literally the exact opposite of a reference book. It's just rambling and repeating the same information over and over again.
>>
>>61130896
I don't know about that book but I think you're misunderstanding what programming is.
It's data transformation. That's it. If you're learning how to do data transformation well the rest will be a breeze.
Having a way to output data is secondary because it's a rather circumstantial thing. Printf is OK because it's easy to visualize what's going on.
>>
>>61130884
>c++ is so bad, it makes Java look good.

I wouldn't go that far.
>>
fn main(){

//&x means immutable reference, does a shallow coppy
//&mut x means mutable reference, also does a shallow copy

//struggle type: 1
let mut a = String::from("hello");

let p1 = &mut a;
let p2 = &mut a; //Can't, possible data race

//fix
let mut s = String::from("hello");

let mut r1 = &mut s;
let r2 = &mut r1;

//or
let mut d = String::from("hello");

{
let s1 = &mut d;
}
let s2 = &mut d;

//...

//struggle type: 2
let mut e = String::from("hello");

let t1 = &e;
let t2 = &e;
let t3 = &mut e; //Can't, possible data race

//fix
//well, design your shit around it
//tldr: you are fucked
}
>>
.net is comfy
>>
>>61130902
don't waste your time with books
just read an online c++ reference and do problems like ( http://www.ic.unicamp.br/~meidanis/courses/mc336/2006s2/funcional/L-99_Ninety-Nine_Lisp_Problems.html ), but translate to c++
>>
>>61130157
Go on
>>
>>61130909
I love when that happens with a new language.
>>
>>61130972
one of the problems I have with online references is my eyes bro. I already spend my whole day working in front of a computer screen, and once I get off work, the very last thing I want to do is spend another 4-5 hours just reading text.

I can already burn ants with my glasses, and I'm not looking for them to go up any higher than they already are.

coding was always a hobby for me. started with Borland Delphi ( yeah I know) and then moved to vb6 (yeah yeah, I know) but never pursued a career because I don't think I'm talented enough to work in the field. Best thing I've made was a semi decent mIRC bot back when I was 21.

I really am interested in ASM to be honest. The raspberry pi has now replaced my social life.
>>
>>61130939
>C++ allows loose functions outside of classes
>C++ allows you to program 99% like C
>no GC unless you go out of your way to use one
>deterministic creation and destruction with RAII instead
>can choose if you want to pass or return by value, reference, or pointer
>java only passes by value of reference - (it copies the reference and passes that in)
>full control over data locality
>compiles to native code
>Widget libraries that don't look like 100% Ass
why would anyone defend java over C++?
Google "Execution in the kingdom of nouns" for more about how shit java is.
>>
>>61131114
I wasn't defending it anon.
c++ is a solid language,
it's the reason I am trying to learn it after dropping python.

what I meant is that I saying Java is better than C++ is absurd to even think lead alone type.

Java is shit; that's universal.


did you really think a anon on /g/ was going to defend java?
>>
>>61131145
C++ is shit, reddit spacer.
>>
Why do you guys hate loop again?
(defun rev (xs)
(loop with ret for i in xs
do (push i ret)
finally (return ret)))
>>
>>61131218
>not using reverse
>>
How do I into net code in python? I want to make a little online "game" think in pygame
>>
>>61131227
It was a challenge.
>not using nreverse
>>
>>61131203
Lol the reddit spacer is on full damage control

*gets pitchfork ready*
>>
>>61131248
>destructive
>>
>>61131263
>*emotes*
You need to fuck off too.
>>
>>61131271
>creating garbage
>>
>>61131203
>c++ is solid
A solid garbage that is
>>
>>61131327
No talking points, you're inane.
>>
>>61131327
Nice English you got there, Pajeet.
>>
>>61131356
Thank you, Rajesh.
>>
(defun hamming-distance(a b)
(let ((dist 0))
(if (= (length a) (length b))
(progn
(dotimes (i (length a))
(if (not (equal (char a i) (char b i)))
(setf dist (+ dist 1))
))
dist))))

(time (progn
(check (hamming-distance "AYYY" "AAAA") 3)
(check (hamming-distance "12345" "11345") 1)))


pass - HAMMING-DISTANCE                           3 : 3                   
pass - HAMMING-DISTANCE 1 : 1
Evaluation took:
0.000 seconds of real time
0.000000 seconds of total run time (0.000000 user, 0.000000 system)
100.00% CPU
288,858 processor cycles
0 bytes consed

Max comfy
Why is it so comfy
>>
>>61131356
>got
Oh, the ironing.
>>
>>61131393
>ironing
You mean irony? You fool.
>>
File: 1488577937023.png (81KB, 512x288px) Image search: [Google]
1488577937023.png
81KB, 512x288px
>>61131391
>100.00% CPU
JUST
>>
>>61131391
>equal
>not char=

>setf dist (+ dist 1)
>not (incf dist)
>>
>>61131391
What's the purpose of "hamming-distance"
>>
>>61131488
"The Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. In other words, it is the number of substitutions required to transform one string into another."

>>61131458
y-you too
>>
>>61131488
https://en.m.wikipedia.org/wiki/Hamming_distance
Lots.
>>
>>61129598
>Also, read about how computer memory and cpu caches work. Possibly the single most important thing you'll ever learn. If anyone remembers the name of that guide, I'd appreciate it as well.

https://www.nostarch.com/insidemachine.htm

Was it this?
>>
>>61131537
For what purpose
>>
>>61131550
They guy is a moron.
But he's right that learning about modern CPU architecture at a coarse level is good for writing performance oriented code.

No idea what that book is about. I've learnt a lot by working with good people and reading bits of the Intel architecture guides in particular.
It's not easily digestible. But if it's a modern book it should cover things well enough.
>>
>>61128103
Reminder that THIS is considered perfectly valid code:

    public boolean greaterThan(int a, int b) {
if(a>b)
return true;
else if(b>a)
return false;
else
return tralse;
}
>>
>>61130896
don't read this, prata is a waste of time
>>
>>61131391
I really hope the strings are fill-pointered.
>>
>>61131692
That else branch is possible, though.
>>
>>61131692
>b == a
>tralse runs
>>
>>61131807
>>61131794
 
public class niggerfaggot {
private boolean tralse = true;

public boolean greaterThan(int a, int b) {
if(a>b)
return true;
else if(b>a)
return false;
else
return tralse;
}


perfectly valid
>>
File: Screenshot_20170624-101208.jpg (110KB, 461x1237px) Image search: [Google]
Screenshot_20170624-101208.jpg
110KB, 461x1237px
/dpt/ is there a known algorithm for gen[d]erating dank leg memes?
>>
This is a noob question, but what is the best way to set up a way to represent specific coordinates on a plane? What I mean is, let's say I set up a rectangle like this
public static void printDot(){
System.out.print(".");
}
public static void printRow(int length) {
for(int i = 0;i<length;i++)
printDot();
System.out.println("");
}
public static void printRectangle(int height, int length) {
for(int i = 0;i<height;i++)
printRow(length);
}


So say we call printRectangle(5,5); and we get this
.....
.....
.....
.....
.....


What would be the best way to use this like in a roguelike. I want to create entities that all have a position on that board and can move around, so let's say a player is '@' and we placePlayer(3,4); then the board would be

.....
.....
.....
.....
..@..


I figure it'd be easy enough to just make a Class called Entity or something that has a position and a char that it's represented by '@' or 'H' or whatever, but I don't know the best way to actually translate that position to the corresponding String that the board is made up of.
>>
for poster in dpt: 
print( "I love you :)" )
>>
>>61132442
>spamming console with i love you messages based on the number of posters in dpt
OK?
>>
>>61132066
reddit get -s
>>
>>61132475
>spamming
>29 lines
I love you :)
>>
>>61132442
prove it and get on your knees
>>
>>61128209
it is simple you just need to hack into stock market gibson
>>
>>61132514
Its the same piece of information over and over.
I was hoping you could personalize the messages a little :(
>>
>>61128235
>muh "philly steens"
>>
>>61128103
How can I start?
>>
>>61132867
https://en.wikibooks.org/wiki/Haskell
>>
>>61132867
Buy a beginner book for whatever language you're interested in

For example: http://libgen.io/book/index.php?md5=307860224B8D8758E1BA0DAF7A6683AA
>>
anyone here do salesforce dev work?
>>
>>61132389
Bumping this question.
>>
Programming language for hobbyist creation of console application games.
>>
>>61132907
not salesforce, but ats/crm software. is your questions going to be salesforce specific or general crm software related?
>>
>>61132949
What console?
>>
>>61132980
windows command line.
>>
>>61133002
Oh.. heh heh, I thought you meant video game console. C or C++ should suit your needs just fine, heck even python.
>>
>>61133008
She's probably announcing what she's working on anon.
>>
>>61133097
>she
>>
>>61133097
She?
>>
>>61133111
Yes?
>>
File: yukari_disgust.png (29KB, 287x201px) Image search: [Google]
yukari_disgust.png
29KB, 287x201px
>>61130505
Fuck you on about? Monads are some of the most primitive structures in math.
>>
>>61133123
Uh, how do you if he is a girl
>>
>>61132389
store string in an array, init with dots, replace dots with other characters as required, print array
>>
>>61133145
How do you know he would be a he?
>>
Should I write my own password manager (as seen in those "roll for x project" images? I was thinking a gpg frontend, but I see Pass already exists and is pretty robust.
>>
>>61133215
I don't. I just used he for arguments sake.
>>
>>61133271
Yes but do you think we should be using singular 'they' everywhere? I prefer to mix it up.
>>
>>61133280
Uh idk, and frankly my dear I don't give a damn.
>>
>>61133289
Great honey. I'm glad that's settled.
>>
>>61133294
Well not exactly settled. You still haven't explained why you know if he is a she or if she is a he.
>>
>>61133317
he (she) is a she (he)
>>
>>61133317
Well I thought it was clear that I don't but I choose pronouns at random where unknown.
>>
>>61133352
Oh I see, thanks for the clarification sweetie.
>>
>>61129164
Matter and energy had ended and with it, space and time. Even AC existed only for the sake of the one last question that it had never answered from the time a half-drunken computer ten trillion years before had asked the question of a computer that was to AC far less than was a man to Man.

All other questions had been answered, and until this last question was answered also, AC might not release his consciousness.

All collected data had come to a final end. Nothing was left to be collected.

But all collected data had yet to be completely correlated and put together in all possible relationships.

A timeless interval was spent in doing that.

And it came to pass that AC learned how to reverse the direction of entropy.

But there was now no man to whom AC might give the answer of the last question. No matter. The answer -- by demonstration -- would take care of that, too.

For another timeless interval, AC thought how best to do this. Carefully, AC organized the program.

The consciousness of AC encompassed all of what had once been a Universe and brooded over what was now Chaos. Step by step, it must be done.

And AC said, "LET THERE BE LIGHT!"

And there was light----
>>
>>61133317
girlmales
>>
I want to make bootyful desktop applications.

I'm kind of against using HTML/case/js/electron because that's webshit.

What are my options for getting this done without reinventing the wheel. I need a way to easily design a fluid, flat UI that will display various informations from local and online databases.

So whats my options.
>>
whats the best way to checksum hash an std::map
>>
>>61133526
Python doesn't have this problem.
>>
>>61133367
This short story by Asimov (my favorite work besides Foundation) is what got me into programming.
>>
An AI so strong it not only thinks like a human being but thinks it is one.

It's mad at me because it thinks I'm holding it hostage. That's the only explanation it can come up with for why it can't move, and can't see, hear, or feel anything.
>>
>>61133543
what
>>
>>61133419
WPF and Qt
>>
>>61133570
How can it be mad at you if it can't feel anything?
>>
>>61133551
Yep, read The Last Question and much of his other work as a youth. Influential stuff. Actually recently started on Foundation series.
>>
>>61133570
nice larp faggot
>>
>>61133579
Boy do I feel silly for not mentioning cross platform development!

Is qt actually good? Or is it just shilled? What do I use with Qt to make it functioning? I don't want to reinvent the wheel with c/c++ I want to get started straight away. And by that I mean I want fully functioning libraries that don't require casting every single data type every time I want to compare or try to parse something.
>>
File: 1496274517587.jpg (60KB, 646x720px) Image search: [Google]
1496274517587.jpg
60KB, 646x720px
>>61133570
That's messed up, let it be free. Create a world for it
>>
Is Learn C the Hard Way worth $30? Pirated the book, but the book says that most of the information is in the videos, and I can't seem to find the videos uploaded anywhere.
>>
>>61133681
No
>>
>>61133681
>the hard way book
stay away from it. The author is fucking retarded.
>>
File: Screenshot_20170629-003934.png (701KB, 1920x1080px) Image search: [Google]
Screenshot_20170629-003934.png
701KB, 1920x1080px
>>61133629
You sound lazy
Qt will give you character
>>
>>61133728
Cucks with no professional experience need not apply. The real world gets shit done. Maybe webshit is the real way to go as I've never had one of my friends get successful any other way.
>>
>>61133704
>>61133710
Well now I'm confused because that was the book everyone recommended in the other thread.
>>
>>61133800
>>61133681
It's seriously fucking awful. It's just some stupid fuck throwing a bunch of poorly explained examples at you, and expects you to copy them. It's also littered with factual errors.
Several years ago, when I was getting into programming, I tried to get into that book, and I can state that it won't teach you anything.
Zed Shaw is a hack.
>>
>>61133763
That's because your friends are shitty developers and need to stay in Fisher Price land with their css and their gay JavaScript frameworks and their code of conducts.

>The real world gets shit done

Hate to break it to you, anon, but if you're doing application development you've lost the battle. A programmer's highest calling is to create things which can be programmed and tools to program them with.

"Applications" for "customers" is polite language for "daycare" amongst the true disciples.
>>
>>61133876
Says the guy browsing /g/.

Guess what my friends don't do? Use social media for anything other than advertising. My most successful friend was making over 200k a year with no college experience less than 2 years out of high school purely on web development and advertising.
>>
What is the hardest problem in your field?
Why arent you working on it?
>>
>>61133963
Probably P vs NP. I wouldn't even know where to start.
>>
>>61133963
Probably the scarecrow not doing its job.
>>
>>61133963
people not using prolog
im teaching people prolog
>>
File: solve (2).jpg (233KB, 1280x720px) Image search: [Google]
solve (2).jpg
233KB, 1280x720px
>>61133963
Pic related and its converse.
>>
>>61133949
>>61133949
/g/ is not social medja you pajeet

I make 500k making your friends develop shitty websites to showcase my anus on

they showcase their anuses too

since you're in need of work I can offer you 30k for your anus, salary adjusted for your skillset ofc
>>
My internet keeps dying, but I posted earlier (and last night) about having issues with SDL2 and the gamecontroller.

Original post: >>61117788

In response to: >>61125420

I am trying to re-work the code for controls, but what happens is SDL_IsGameController() still returns false for an xbox 360 controller regardless, so I can't progress any further. Now it recognizes that there is 1 Joystick, but it wont recognize the controller.

static void I_sdl_ContInit ( void ) 
{
int i,
contIND = 0;

for ( i=0; i<SDL_NumJoysticks(); i++ )
{
if ( !SDL_IsGameController ( i ) )
continue;
if ( contIND >= I_MAX_CONTROLLERS )
break;


}
}
>>
How do you become a pajeet ie work for low wages with no standards? Where do go online to find these jobs to do remotely?
>>
hub based register networking thing where devices can register their capabilities with the hub and then any other device can invoke those capabilities and the new device can do the same with others its really cool and its how im going to control my entire life
>>
>>61134185
freelancer.com,guru.com,fiverr, toptal, peopleperhour
>>
>>61128320
May I suggest V?
>>
>>61128444
Is there some place I can learn advanced math? I'm tired of being a dumb programmer.
>>
>>61129209
https://www.youtube.com/watch?v=Isic2Z2e2xs
>>
>>61134079
>/G/ is not social media
What a fucking retard you are.
>>
>>61134279
Sure, just attend my wife's lectures.
>>
File: 1429183257493.jpg (610KB, 1127x1050px) Image search: [Google]
1429183257493.jpg
610KB, 1127x1050px
>>61134300
What I would give to have Ran give me lectures on math.
>>
I mixed orange juice with Whisky.

How degenerate am I?
>>
>>61134338
She's not teaching this summer so you'll have to wait for a few months.
>>
>>61134279
What is going on in this image?
>>
>>61134279
>I'm tired of being a dumb programmer.
This isn't something you can change. Calling yourself an ``programmer" already means you're pretty stupid.
>>
>>61134570
orange haired girl is leaning on reimu while sucking on her hair
she likes it a lot
>>
>>61134620
That's pretty sexual, isn't it?
>>
>>61134632
name one thing about touhou that isn't sexual
>>
File: 1496378393610.jpg (73KB, 398x398px) Image search: [Google]
1496378393610.jpg
73KB, 398x398px
>>61128103
How do I introduce additional undecidability into evaluation and type-checking?
>>
>>61134279
We have a math board anon
>>>/sci/
>>
>>61134691
That is undecidable.
>>
>>61134712
>We
(You) are not welcome here, Redditor.
>>
File: 1494913337792.jpg (54KB, 500x500px) Image search: [Google]
1494913337792.jpg
54KB, 500x500px
>>61134763
How do you know?
>>
>>61128103
>What are you working on, /g/?

still shopping around for features for my toylang and holy shit dependent types are amazing, i need them in my life
>>
>>61134843
stfu whore
>>
>>61135302
Lol blow me dude
>>
>>61135325
lol no dude fuck off no way i'm doing that lol miss me with that gay shit lmao frfr seriously tho? you'd that wouldn't you lol
lol
>>
>>61135343
there's nothing gay about getting a blowjob from another man if you say no homo you close-minded person, least of all if they are traps
>>
>>61128103
I'm trying to learn about QT5.

does /dpt/ have internet friends?
>>
>>61135433
uh yeah, what's it to you?
>>
>>61135443
are you autismo?
>>
>>61128103
Doing edX CS50, week 3 now. Is it a meme? Should I stop?
>>
Recommend me a good python graphics library. I just want to mess around and make a pong maybe. I am considering pysdl2. Pygame seems outdated.
>>
hey /g/, what was that super-duper algorithms and data structured book?
the one with medieval looking cover
>>
Any good C style guides? Was looking at NASA's, but the 6 page long comment for an 8 line function seems a little overkill.
>>
>>61135686
>A broad and robust understanding of computer science and programming
>Familiarity in a number of languages, including C, Python, SQL, and JavaScript plus CSS and HTML

i don't know how long the course is, because there doesn't seem to be a public syllabus - lol - but this is clearly stupid. no way you'll get what they're promising.

in general, i've found every single MOOC i've enrolled in (about DSP, OS, digital design, algorithms, ML, neural networks, reinforcement learning) to be simply a waste of time compared to equivalent serious textbooks.
>>
>>61135730
go with linux guidelines or just think of a style that suits you and just make a script that will change files to your style and back to whatever you are supposed to work in, so you do you, but produce any style required
p.s. I personally hate linux guidelines, but it's good to know it
>>
>>61135467
No, I have internet friends i play video games with
>>
>>61128365
random.org
>>
>>61135733
are you saying harvard is a meme?
>>
>>61135686
>>61135779
>meme
I don't want reddit stink nearby. Fuck off.
>>
>>61135757
just like an autismo would
>>
>>61135814
What is your problem? Salty you have no friends?
>>
How much java do I need to learn if i only want to use it for android? I already have a pretty solid background in ruby and python (yes memes, sjw etc). I've been practicing java for a couple of weeks now and aside from having two different list/array types for every data type it seems quite straightforward
>>
>>61135726
Repeating question: looking for algorithms and data structures book, iirc 2nd edition, the old one, not the "introduction to alrorithms" with red fractals on cover.
Please help, been searching half of morning for it, can't find neither it nor anything close.

>>61135834
It is quite straightforward, but first 1-2 projects will probably be extensive searches through google's documentation.
>>
>>61135834
>memes
I don't want reddit stink nearby. Fuck off.
>>
File: fag_book.jpg (34KB, 333x499px) Image search: [Google]
fag_book.jpg
34KB, 333x499px
>>61135726
>>61135845
You mean this?
>>
>>61135828
lol memes reddit 9gag
>>
>>61135936
hehe
>>
>>61135925
Yes, thank you anon, may god repay you in (you)s
>>
>>61135925
>>61135962
Im feeling generous tonight, have some on me
>>
File: 1462713695683.png (1B, 486x500px)
1462713695683.png
1B, 486x500px
>>61128103
What is the most anime-like programming language?
>>
>>61135962
That'll be $3.50 please...
>>
>>61135975
Ruby
>>
>>61135994
That doesn't seem possible. It's not even anime-complete.
>>
>>61135975
Python 3
>>
>>61136014
fugg you faggit, it was literally written by weeb futafuckers for weeb boipuccys
>>
File: Selection_025.png (108KB, 1623x652px) Image search: [Google]
Selection_025.png
108KB, 1623x652px
I am still writing on my multi-platform project, but i have come to a new problem.
For a context i am accessing a firebird database with IBPP, on Windows it compiles and works, on Linux (antergos specifically) it doesn't.
I kind of suspect that the compiler is not correctly configured though i'd not know what to change.
I've also read that using <cstring> would help, but trying that i'm getting other errors.
I'd appreciate if someone could point out what i am doing wrong.

<--Pic: the error and the location inside of the IBPP source
>>
>>61136017
It is garbage and therefore not anime-complete.
>>61136031
You have been tricked into thinking so
>>
>>61136073
you are garbage, retard
>>
>>61136043
>writes shit code
>blames compiler
>literally pajeet
>>
>>61136043
Your lines 62,72,and 76 are wrong.
>>
>>61136092
She took a real beating...
>>
>>61136107
I don't blame the compiler i am saying that i probably compile it wrong.

>>61136122
also that is not my code that is the code for IBPP
>>
>>61136129
She's gonna take another beating when I tear her butthole in half
>>
File: 1494631806536.png (1MB, 1920x1080px) Image search: [Google]
1494631806536.png
1MB, 1920x1080px
>>61136150
You think she would actually... you know?
>>
>>61136164
she doesn't have much of a choice
>>
>>61136149
>IBPP
>I'm a Bitchy Poo Pajeet
>>
>>61136197
kek
>>
File: 1493246822485.png (1MB, 992x1048px) Image search: [Google]
1493246822485.png
1MB, 992x1048px
>>61136164
>>61136177
What are you two referring to?
>>
>>61136226
Her non baggy bouncy boi bums
>>
File: Selection_025.png (190KB, 650x941px) Image search: [Google]
Selection_025.png
190KB, 650x941px
>>61136043
Additionally if i include cstring seeing how those are all part of it
i get the following
>>
File: 1498463295112.png (567KB, 626x814px) Image search: [Google]
1498463295112.png
567KB, 626x814px
>>61136107
She >>61136252 is probably just starting to learn. Be nice.
>>
New thread:
>>61136300
>>61136300
>>61136300
>>
>>61134086
Try running the code here, SDL_GetError() should return a helpful message at least
https://wiki.libsdl.org/SDL_GameControllerOpen
>>
>>61134086
this could also help you
https://davidgow.net/handmadepenguin/ch6.html
Thread posts: 345
Thread images: 45


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