[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: 330
Thread images: 28

File: dpt_flat.png (102KB, 1000x1071px) Image search: [Google]
dpt_flat.png
102KB, 1000x1071px
Old thread: >>57162274

What are you working on /g/?
>>
>>57165960
First for C.
>>
>>57165960
first for J
>>
>>57165976
>C is faster, yet again
>>
>>57165960
4th for D
>>
File: weebsuckits.webm (944KB, 1920x1080px) Image search: [Google]
weebsuckits.webm
944KB, 1920x1080px
some ui thing for i2pd
weeb suckits are breddy great
>>
>>57166004
Why are your webm so shit? Do you think I can watch pixels fucking each other?
>>
File: 7kaq.png (8KB, 375x375px) Image search: [Google]
7kaq.png
8KB, 375x375px
I'm giving up on Java.

There's too many technologies, JSF, JPA, JasperReports, PrimeFaces, Websphere, MAVEN, Hibernate, JDBC, Spring, CDI, JUNIT, Richfaces, Jasper

I just can't go on, please, somebody help me to stay in the road.
>>
File: weebsuckits-hq.webm (710KB, 1920x1080px) Image search: [Google]
weebsuckits-hq.webm
710KB, 1920x1080px
>>57166021
compression is HAAAARD man, D:
>>
>>57166038
>I just can't go on, please, somebody help me to stay in the road.
No, giving up would be a good idea.
>>
>>57166038
do it faggot
>>
File: f78.gif (1MB, 765x540px) Image search: [Google]
f78.gif
1MB, 765x540px
>>57166038
baka baka baka baka
>>
>>57166038
Nah, use a better language
>>
>>57166004
>>57166054
You've got a whole 3 megabytes for that shit.
Up the bitrate, lower the resolution, shorten the duration, or do all of them,
>>
>too many technologies
you should see node.js
>>
sdf
>>
>>57166038
What road? As you said. The road is trampled and not maintained. You're left with mud.
>>
>>57165875
void reverse(char *str, int n){
if(2>n) return;
for(int i = 0; i<n/2; i++) swap(str[i],str[n-1-i]);
return reverse(str,0);
}


Solved it within the problem specifications.
>>
File: Screenshot_20161020-162427~2.png (128KB, 1446x928px) Image search: [Google]
Screenshot_20161020-162427~2.png
128KB, 1446x928px
>>57165824
>It doesn't, actually. It uses precisely as much ram.
What did he mean by this?
>>
>>57166126
Biased benchmarks.
>>
>>57166125
Yeah I'm not sure they will be pleased with that.
>>
File: 1459372013720.jpg (226KB, 869x1776px) Image search: [Google]
1459372013720.jpg
226KB, 869x1776px
can this be """coding girls""" thread?
>>
>>57166153
But if you look at it really hard, you should be able to spot the real solution hiding in there.
Hint: pointer arithmetic is a thing
>>
>>57166174
p. sure this was fake
>>
>>57166174
This is stupid. Are you implying because one of them is retarded they all are?
That stupid thinking is basically food for feminists. Stop memeing.
>>
>>57166174
karlie is doing a good thing dbh
>>
File: codinggirl.png (139KB, 728x631px) Image search: [Google]
codinggirl.png
139KB, 728x631px
>>57166211
>>
>>57166174
only if you post oc and no pasta
>>
>>57166232
that's not a girl, that's a girl (male)
>>
>>57166232
You don't get my point. Males can be as much retarded as females.
>>
File: 1459384379485.jpg (82KB, 780x873px) Image search: [Google]
1459384379485.jpg
82KB, 780x873px
>>57166211
>one of them
>>
>>57166248
I'm pretty sure he got that given he posted a long haired dudes stupid code
>>
>>57166250
Confirmation bias. You don't associate male retardation with gender but you do with girls.
>>
>>57166126
>yfw Lua is nearly matching C, Ada, Pascal, and Rust
Mike Pall is our generation's Dennis Ritchie.
>>
>>57166232
you know, the tranny has shipped a commercial product
>>
>>57166276
Do you know what these benchmarks are?
>>
>>57166258
Get off and let me bask in my chauvinism.

It's not like that bias has no roots in real facts
>>
>>57166276
Actually I am
>>57166289
And it was garbage
>>
File: SICP is a meme.png (6KB, 480x278px) Image search: [Google]
SICP is a meme.png
6KB, 480x278px
>>57166248

It's just that there's a higher density of women pretending to be nerds who know literally fuck-all than there is of men.

Men don't do gombuter seance to get girls, that's for damned sure.
>>
File: rev 60.png (134KB, 334x293px) Image search: [Google]
rev 60.png
134KB, 334x293px
>>57166289
>>
>>57166293
It's the pidigits one. Or are you asking a loaded question?
>>
>>57166299
>Actually I am
Okay.
>>
>>57166315
I feel like that picture should have a spurdo face
>>
>>57166340

It should, but I did it in MS paint and didn't have Paint.NET or anything to probably put the spurdo face in there.

Please do so.
>>
>>57166174

I love this image but really, it has to be fake.
>>
>>57166295
Just like religion I guess?
>>
>>57166353
>it has to be fake

never underestimate the stupidity of people
>>
>>57166353
I love how she perfectly choses the male algorithm. It most be irony.
>>
>>57166330
Do you know what a loaded question is?
I think I'm asking what you think a loaded question is but I think you're wrong about that.
>>
File: 1471438162975509398.jpg (408KB, 1357x1281px) Image search: [Google]
1471438162975509398.jpg
408KB, 1357x1281px
>>57166353
so that's fake too?
>>
>>57166405
the image you just posted is real, right now there's a large paragraph sitting at the top of the comments whinging that she's still learning and women don't get to program enough or something
>>
>>57166405

That one is 500% real, but something about the comments (code comments) and even being able to find that 'what the fuck said Carmack' code she is comparing hers to just seems far fetched.
>>
>>57166405
Okay, posts your most used commands everyone
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl |  head -n10


I'll start
     1    164  20.297%    make
2 102 12.6238% ab
3 95 11.7574% cd
4 85 10.5198% man
5 74 9.15842% ls
6 48 5.94059% sudo
7 38 4.70297% reset
8 31 3.83663% ssh
9 20 2.47525% clang
10 16 1.9802% rm
>>
>>57166405
Well this girl we know is paid to promote women in programming and its not her career. She's a true shill by the definition of the word.
The other one is shopped I'm sure. The fast inverse square root. Is too unlikely an example to pick at random like that.
>>
>>57166426
     1    78  14.2336%   vim
2 68 12.4088% ls
3 50 9.12409% cd
4 37 6.75182% sudo
5 22 4.0146% make
6 15 2.73723% tmux
7 13 2.37226% rm
8 12 2.18978% xfreerdp
9 10 1.82482% su
10 9 1.64234% ip
>>
>>57166426
Not even a sudo rm -rf * in there?
I'm disappointed.
>>
>>57166404
>Or are you asking a loaded question?
>but I think you're wrong about that
So, yes.
>>
>>57166426
     1    164  20.297%    fuck
2 102 12.6238% fuuuuuu
3 95 11.7574% fuuck
4 85 10.5198% cd
5 74 9.15842% ls
6 48 5.94059% sudo
7 38 4.70297% rm
8 31 3.83663% ssh
9 20 2.47525% make
10 16 1.9802% man
>>
>>57166426
 python -c 'import pty; pty.spawn("/bin/sh")'
>>
>>57166441
This, and even she wouldn't be so dumb as to think the fast inverse sqrt is an example of "poor" programming. It's a minor miracle. Hers could be written as a single return statement.
>>
>>57166469
shh, quiet.
>>
>>57166446
>vim
still falling for that meme
>>
>>57166472
Maybe? I don't know what you mean anymore. A loaded question means a question that incriminates you in some way regardless of the answer. That doesn't make sense here.

I was just being condescending towards you because you're making a very brave statement based of a rather poor benchmark.
>>
>>57166482
isn't that just a convoluted way to do /bin/sh or even just "sh"
>>
>>57166426
>Using Apache Benchmark 102 times
Stop DDos 4chan idiot.
>>
>>57166503
what else would I bother to learn and use, and why?
>>
>>57166525
emac obviously.
>>
>>57166509
Well you are talking to two people, so there's that.

And you had to go down this path instead of just saying why you think the benchmark isn't sound?
>>
>>57166514

It's a way (one of many, but the first one I always try) to spawn a TTY shell when you exploit a machine and have a non-interactive shell.
>>
Newbie here. What is the proper way to do this, or how would you handle this:

>I have a page to edit a specific document in Db. It takes an `id` param.
>I have a class to regroup all validation functions, one of them checking if the id exists in Db.

I felt like if I were to check if the id exists in Db, and only after fetch the entire document, it would be a waste. That's two Db request a bit for nothing.
So right now, I do something like this:

>The validation function returns false or the object.

And in my controller, there's now something like this:

if($document = Validation::id($id)){
// ...
}


Is that okay? I don't really like the fact that my validation function returns a bool or an object. I think it should be either one.
But searching for the id to see if it exists, then searching it again to get the document seemed like a waste of time.

How would you do it? Is there a proper way to do this?

>inb4 ditch php
>>
>>57166538
>emacs
embrace the future, luddite. Nobody uses your deprecated software anymore, old man. Bet you still write programs in C and refuse to learn an actually usable language like Ruby, too.
>>
>>57166525
Continue learning vim, maybe spacemacs if you give a damn. I'm just too accustomed to vim to transition.
>>
>>57166566
>usable language
>Ruby
Hmm
>>
>>57166565
ditch php
>>
>>57166581

Nice meme.
>>
>>57166605
>http://benchmarksgame.alioth.debian.org/u32/compare.php?lang=yarv&lang2=gcc
Hmm
>>
>>57166551
Because I wanted to be cool and
>imply
Stuff like the other kids ;_;
>>
>>57166551
I'm the other guy. I agree it's not a fantastic benchmark. I wrote one of them. Basically, the benchmark comes down if your language has a package or can link to a package to do the work for you. Not actually doing pidigits, just how well the language can link to other packages.
>>
File: Untitled.png (17KB, 1242x255px) Image search: [Google]
Untitled.png
17KB, 1242x255px
How do I submit this to iOS or android?
>>
>>57166630
I see now that it uses GMP with as minimal a binding abstraction as possible. No wonder it's so fast.
>>
>>57166649

Android: Drag and drop .apk file to phone. Open .apk file in file browser. Install as normal.

iOS: Not a fucking clue.

>>57166566

I use C and Ruby. Both of them are perfectly usable, but should not be used for tasks where the other is used. Their use cases are completely different just as the use cases of dark chocolate and cheddar cheese are different in recipes.
>>
>>57166729
Yes, one is useless and is only used to feed fat people while the other contain nutrients.
Great post, Ruby-chan.
>>
>>57166670
But I think it should stay and is generally good, because it does show differences in language implementations that largely do the same thing. Such as why rust uses 4 times the ram as C? Why is lua slower? Things like that.
>>
>>57166755

>one is useless and is only used to feed fat people while the other contain nutrients.
Truly now... I am curious which one you think is which.
>>
is it impossible to get a qt gf in this field?
literally only two females in class and both pajeets
>>
>>57167049
They're only pajeets if they're fucking useless at programming. Do you know this for a fact?
>>
In an abstract sort of sense, how would I be able to find all reachable points from a point in a 2D array? Reachable meaning all points around a point that are within a certain deviation
>>
>>57167090
reachable in what sense?
>>
>>57167109
You can traverse from one point to the next if it's within a certain deviation (ie. +- 5) from the first point's value
>>
>>57167090
r = sqrt(x^2 + y^2 + z^2)
>>
>>57167049

You're going to have to settle for a pajeet qt.
>>
>>57167282
He could meet a girl somewhere else.
>>
>>57167293

If he were capable of that, he wouldn't post here asking about it.
>>
>>57167049

Try dating women outside of your career path. You'll have a much better chance of getting a good one.
>>
File: 1465870741820.png (2MB, 1920x1080px) Image search: [Google]
1465870741820.png
2MB, 1920x1080px
I'm planning on getting a new laptop budget is around $600-$700 totally new to programming before I can even start I have to get a new computer (one I'm on isn't mine) because I have no work station or personal computer.

Best OS if I'm going to be learning C, C++, Java? I'm a complete autist looking to make a living by learning a language and going into some form of sysadmin or webdev maybe. I'm 19 and poor as fuck, but I have about a year to learn and get a job, after that I'm homeless.

Pic unrelated just best girl.
>>
could somebody post that programming challenges roulette?
>>
>>57167293
You think that's possible for this guy? It's like you haven't tried talking to girls outside of school/work/family
>>
>>57167525
>laptop
kys
just build a 50 dollar pc and use the rest of the money for materials/premiums and freelance investments

libgen to pirate and sponge all knowledge you can, and boom you can make a living within a year
>>
>>57167525
Windows.
Also, one year to learn programming is too little, and even more since you're saying that you wanna learn three languages. Jump straight into web development if you have such a tidy deadline, good luck.
>>57167560
http://better-dpt-roll.github.io/
>>
>>57167573
>materials/premiums and freelance
Kys.
Just use your brain to make something creative actually helpful toward the society instead being a greedy cancerous subhuman.
>>
>>57167282
>>57167293
Do you know each other irl?
>>
>>57167525
>Best OS if I'm going to be learning C, C++, Java?
For Java it doesn't really matter. For C++ I prefer Linux because of its tooling, because installing libraries on Windows is a bitch, and because you effectively have one compiler on Windows. There's MinGW etc. on Windows but if you're using those, you might as well get the real deal and install Linux.

For C it's no comparison, C development support on Windows is non-existent.
>>
Meant to quote
>>57167309
>>57167312
>>
>>57167580
>http://better-dpt-roll.github.io/
thx
>>
>>57167590
what
he is about to go homeless

might as well charge 500 dollars to a retard that can't set up wordpress sites
>>
>>57167525
Linux, Linux and Windows, in that order for those languages. I would recommend dual booting, or if you cannot for disk space, virtualize Linux inside of Windows.
>>
>>57167606
[spoiler]He should kill himself then[/spoiler]
>>
>>57167603
>Bootstrap
Kys.
>>
File: 1.jpg (672KB, 1000x1057px) Image search: [Google]
1.jpg
672KB, 1000x1057px
>>57167615
>>57167606
>>57167599
>>57167590
>>57167573
The laptop has a 256gb SSD, I can make the primary partition Windows and make a smaller partition some form of Linux for projects with C, it'll also give me a chance to explore a linux distro, something I've never done before.

Well since I don't know what I'm talking about in the end, what do you guys recommend I do in this situation, as in ultimately, what language or thing should I look into for a job in one year? (Cant do physical work, broke my back, only light cardio).

I do have an external HDD to backup shit so no worries there.
>>
>>57167672
Are you that german guy?
>>
>>57167683
>being specific
>>
>>57167615

Why Windows for Java? Pretty much every decent Java IDE runs on Linux just fine.
>>
>>57167693
He nailed it down to approximately 1% of the world population. It's plenty specific.
>>
>>57167729
No actually 0.5% my bad. Forgot the 'guy'
>>
>>57167743
Actually less than that, not every german browse /dpt/
>>
>>57167761
Not everyone posts at 4am either.
>>
what can someone do in functional programming that one can't do in OOP?

yeah, just what I thought
>>
>>57167781
Any 'oriented' paradigm can do anything because it accepts you move outside the paradigm itself.
>>
>>57167781
(You)
>>
>>57167781
Write code that adapts to changing requirements. OOP only works if you can plan everything out ahead of time and stick with that plan.
>>
>>57167621

What's wrong with bootstrap? It jest werks.
>>
>>57167831

We'll never know if that's true because a large software package has never been written in a functional language, nor will it ever be.
>>
>>57167866
>It jest werks.
Filtered.
>>
>>57167878
Where does large come into it? The latter property holds for OOP even with small codebases.
>>
>>57167878
He only spoke about OOP though. Did you catch an exception at an inappropriate time and post the wrong buffer?
>>
>>57167049
It's all about the girls in the Marketing. Top notch qts there
>>
>>57167913
>He only spoke about OOP though.

The question was 'what can functional programming do that OOP can't' and the response was that it can adapt to changing requirements.

Learn how to read, dear.

>>57167904
>Where does large come into it?

You'd actually have something of scale to measure up adaptability to changing requirements. Chances are, your super neat fizzbuzz will never change, and so you haven't got a good frame of reference.
>>
>>57167930
But are they qt in the head?
>>
>>57167935
No idea, I've never talked to them B)
>>
>>57167781
Proofs, not worry about state, write hello world in less than 50 lines of code, etc.
>>
i am going to *try* learning a language for the first time. is C ok? any books you might recommend?
>>
>>57167933
>Chances are, your super neat fizzbuzz will never change
But not because it's small.
>>
Whenever I am with C++ programmers they always need to tell me that C++ can do nearly everything C can do and even more than that, and that I should just switch to C++.

To which I always reply that I could start writing in C++, but then it would basically just be C again. And then those programmers would start foaming from their mouths because I don't use their static/reinterpret/dynamic/const/whatever casts and use templates only when necessary, which is almost never.

In other words: I am not using C++ not for my sake, but for others'.
>>
>>57167952
C is indeed okay. C Primer Plus is an okay book because it will introduce you to memory and how compilers work early on, which is good.
>>
>>57167953

That's really not an argument. Large projects are, as a rule, more susceptible to change than smaller projects.
>>
>>57167975
It's for both of your sakes. You obviously don't want them to start having pseudo-complaints about the code rather than a neatly bundled 'you're using the wrong language'. That's why I stopped using C++.
>>
>>57167995
Well, obviously. In any case, "a large software package has never been written in a functional language" isn't true in the first place.
>>
>>57167995
Technically, no. The relative amount of change is smaller the bigger the codebase.
This is what happen when you dig your own shithole out of fallacy.
>>
>>57168002
>'you're using the wrong language'

If that was the case they wouldn't tell me that I should switch to C++ in the first place. To them, anything should be solved in C++.
>>
File: 1416274434807.jpg (32KB, 480x454px) Image search: [Google]
1416274434807.jpg
32KB, 480x454px
>group webdev project due tomorrow for class
>haven't started yet
>teammates are clowns
>don't know any javascript

h-how fucked am i?
>>
>>57168017

The scale of the change and susceptibility to change are two ENTIRELY different things. Do you even know how to read? Your posts are really making me think.

>>57168013

Prove it.
>>
>>57168037
/wdg/

fucked, btw
>>
>>57168037
>"""don't know any javascript""""
A lot.
>>
>>57168037
>web
>not at scale
>no security needed
what's hard about this
>>
>>57168037
>h-how fucked am i?
Very.
>>
>>57168037
>procrastinates
>can't even do a simple school project
and you expect to make it now? you do not know how hard it is to get in if programming isn't your hobby, as in you actually wish to code outside of work/school
>>
>>57164194
bretty neat. I've just been looking into playing around with some fractal stuff. you have any good docs/links for the math and implementation of an l-system or IFS? what did you use to draw it?
>>
>>57167878
>What is Linux
>>
>>57168080
Can you stop shilling yourself?

>Processing
>>
>>57168044
>>57168045
>>57168058
i am freaking out
p-please help

>>57168050
i don't even know where to begin
i stopped attending lectures a while back and didn't do any of the homework, and now there's a project for 30% of my grade

how much javascript could i realistically learn in 12 hours?

>>57168077
i enjoy lower level programming, and i have chosen my degree concentrations to reflect that. really liked my os and compilers classes, but all this "design pattern" garbage in this class triggers my autism and i want nothing to do with it, that's all
>>
>>57168096
Just change your major, you're not going to fucking make it.
>>
reminder javascript is the best functional programming language
>>
>>57168096
>p-please help
>Help? How do you think he can be helped?
>By being allowed to continue to live? Or by being chosen by me?
>>
>>57168085

I'm not sure I follow.
>>
>>57168096
// This is comment

var this_is_variable = "this is value";

function this_is_function() {
return 4; // This is procedure
}

while ( /* this is true */) {
// do something
}


There, you know everything about Javascript. Now don't waste your short life and learn C.
>>
>>57168096
How the heck do you want help? You have an assignment due tomorrow, you have no idea how to use the language it's due in and nobody IRL to help? Just accept failure. A bunch of randos on dpt aren't gunna get you an A in a night.
>>
>>57168096
I am serious

college is a fucking joke, if you don't even take that serious how do you expect to make it?
>>
>>57168043
Jane Street. Coq. Agda. Idris. Facebook (Sigma). BAE (SAFE). And that's just OCaml and Haskell in production. You will often hear about how FP is great for prototyping and rapid development, i.e. without things being meticulously laid out beforehand. That's my experience with using those languages as well.

Though I'm sure your idea of "large" has been warped by overengineered OOP codebases. Large should refer to scope, not LoC. Functional languages are also great at expressing a lot with a little.
>>
>>57168147
>college is a fucking joke, if you don't even take that serious how do you expect to make it?
Retard.
>>
>>57168100
>>57168147
i enjoy programming in my free time, i've just never been anywhere near web-related stuff, outside of a toy http server i wrote a year back. i just can't bring myself to take "muh design pattern" shenanigans seriously.

>>57168140
i just want a book or website recommendation that takes you through javascript really fast, assuming you already have some experience in other languages.

>>57168134
looks simple enough, thanks
>>
>>57168123
Linux kernel isn't oriented object.
>>
>>57168134
also

var x = '3'+3.2
!isNaN(x)
x == 33.2
>>
>>57168161
In my college days I used to speedrun MMX 1 - 3 on a fucking emulator, and I still managed to get my degree.

I agree, college is too easy.
>>
>>57168085
Written in C?
>>
>>57168179
He will reply that it isn't functional, either, but to be honest it's pretty much not-OOP in general that handles changing requirements well. OO code is uniquely brittle by construction.
>>
>>57168180
Don't
>>
>>57168179

It's not functional.
>>
>>57168197
>uniquely
Makes me interested if there's more godawful paradigms I haven't heard of I should be aware of.
>>
>>57168197
This.

http://harmful.cat-v.org/software/c++/linus
>>
>>57168179
Linux is object-oriented. It just does not use a fancy language to do OOP.
>>
The only purpose of OOP is to expose an API. Thinking with algorithms in OOP is impossible and doesn't make any sense.

>Design patterns
>>
>>57168173
be more specific about what it is you need to do
>>
>>57168173
>>57168220
this

post the project
>>
The one "killer feature" of OOP, encapsulation, is basically irrelevant now that we have dependent types. Instead of maintaining an invariant by hiding implementation details, you just put the invariant in the type and code that breaks the invariant will simply not type check.

Of course, there's also hiding implementation details for the purpose of abstracting yourself away from them (e.g. for cross-platform) but that's not an OO-specific thing at all.
>>
>>57168214
Sort of in line with this. But when people say that they're C++ 11 programmers and 'only use useful abstractions' what should I be weary of especially?
>>
File: 1445910073905.jpg (94KB, 1440x810px) Image search: [Google]
1445910073905.jpg
94KB, 1440x810px
>>57168218
>Thinking with algorithms in OOP is impossible

Alright, you got me.

10/10.
>>
>>57168247
Well encapsulation failed in OOP and nobody pretends it doesn't.
Dependant types doesn't seem ready for use though.
>>
File: 1477013207236.png (425KB, 2400x1650px) Image search: [Google]
1477013207236.png
425KB, 2400x1650px
>>57168258
Stupid frog poster.
>>
File: 1470930629427.png (34KB, 700x471px) Image search: [Google]
1470930629427.png
34KB, 700x471px
will programming help me with my anxiety and crippling depression?
>>
File: 1457215227538.jpg (37KB, 348x342px) Image search: [Google]
1457215227538.jpg
37KB, 348x342px
>>57165960
guys how do i get into android shit

i know a decent amount of programming stuff but whenever i try making something in android it just seems really confusing to me
>>
>>57168276
No.
>>
>>57168213
Pretty much anything with some kind of hierarchy as its model. Inheritance is the root of many evils.
>>
>>57168276
no, literally nothing you do will ever change the fact that life is retarded and boring and everybody claiming to find inner happiness is also just in some form of denial like everyone else is, whether it be through being a bitter salty loser posting on 4chan from his basement or a retarded vegan blonde normie skeleton claiming to find "peace" from stretching her legs in yoga pants for 6 hours a day
>>
>>57168276
I don't know. I have been anxious and socially awkward all my life and I don't recall not programming.

>Really makes me think
>>
>>57168302
This really... activated my almonds
>>
>>57168269
>nobody pretends it doesn't.
If that was true nobody would use OOP because without encapsulation you don't really have any objects without twisting the definitions, i.e. a function is an object that responds to the "call" message.

>Dependant types doesn't seem ready for use though.
If by "ready for use" you mean "implemented in a mainstream language" then no. But that's only because the languages haven't taken off, for the same reason all new languages have a hard time taking off.
>>
File: [email protected] (16KB, 512x298px) Image search: [Google]
screenshot-20161021@042804.png
16KB, 512x298px
Working on my terminal emulator, got a bunch more vttests working, and weechat is fully working now; as a side effect mutt working as well.

Next up either making ligatures render or completing keyboard handling.
>>
>>57168220
>>57168244
basically have to make a couple pages using something called "d3.js" that shows visualizations and updates the data in real time.

we can access weather data, and we have to pull forecast data and present/update it without having the user reload the page
>>
>>57168289
Android is a mess, honestly. That won't change. Think signals, think events, think XML and just kind of roll with it. There's not much reason why it makes you do stuff, it just does.
>>
>>57168258
>not impossible
What is encapsulation, abstraction, inheritance and bloat?

OOP has it uses. Letting everyone being able to program is not one of them.
>>
>>57168321
honestly it sounds like you can just google for an example that does exactly this. i would put money on it
>>
>>57168323
>tfw I fell for the NDK will be good soon meme
Android is hell
>>
>>57168344
>Java is hell
Took you long enough.
>>
>>57168350
well he did say NDK
>>
>>57168358
well he did say Android
>>
>>57168340
yeah, i'm looking over a few examples now, and javascript looks a lot simpler than i expected it to be. I'll also look up some d3.js examples, thanks.
>>
How the fuck are classes stored in memory?

 
class A{int x;};
class B{int x;};
class C : public A, public B{int x;};

int main()
{
C *P=new C;
A *P2=dynamic_cast<A*>(P);
B *P3=dynamic_cast<B*>(P);

std::cout<<P<<"\n"<<P2<<"\n"<<P3;

delete P;
delete P2;
delete P3;

return 0;
}


Output:

0xa11558
0xa11558
0xa1155c
>>
>>57168376
I'm not an insane masochist, so I don't know a huge amount about C++, but I think it's top do with a hidden vtable that C++ adds.
>>
To be honest, I would be programming in OOP if there were no encapsulation and no overhead.
>>
>>57168406
>if there were no encapsulation
That's literally the entire point of OOP.
Too bad it doesn't work though.
>>
>>57168406

Sounds like you actually want C, lad.
>>
>>57168421
>That's literally the entire point of OOP.
Not necessarily though.

>>57168432
But I do
>>
>>57168096

if you get a CS degree 90% sure your job is going to be doing web related bullshit. maybe backend, but even that is javascript heaviy with node.js and then ruby. If you want to develop actual applications that professionals and not hip kids in palo alto use then good luck finding an enterprise job with nothing to show in your portfolio. git gud.
>>
>>57168299
yes, the way the advertising economy works is by making people think they're missing out on something. Even if you don't consciously believe in Ads, you're still inundated by stories of people "rising to the top" and can probably recall more names of famous people than real people you've met in your life. The pantheon serves to keep you vulnerable and buying things.

if you actually want a real sense of achievement just do project Euler problems or some shit
>>
>>57168406

Just do C++, but make everything public (use struct, rather than class)
>>
>>57168258
Consider the following: OOP is like drawing with a ruler while C is hand-free.
This is what I meant by "inhibits algorithm thinking".
>>
File: Problem 8.png (65KB, 622x380px) Image search: [Google]
Problem 8.png
65KB, 622x380px
pls help. :S
>>
>>57168487

That doesn't really mean anything, but thank you for clarifying.
>>
>>57168393
First: this
Second: there are also padding bytes inserted by the compiler to make memory accesses faster. Everything that is align to the native word size of the processor will usually have the best speed (unless we're talking about special things like SSE/AVX)
>>
in C++ why can literals be strings, but to store them you need the library?
what the fuck
>>
>>57168515
You don't need the library. You can keep them on the static data segment of your application (which is really fast) rather than using the library and thus heap memory (which is really slow).

Also, it's a C thing.
>>
>>57168515
The literals are just a faster way of writing
 'f''o''o''b''a''r''\0' 
. It's not C++ and you can use the char type with this.
>>
>>57168488
a, c, e, f, h, j are true
>>
>>57168488
101
>>
This would be my dream language:
>No variables (kind of Haskell)
>"No objects" as in "instance of class"
>Only manipulating sets
> >Primitive set (Integer [-inf; +inf], Double, String (All possible string of infinite size))
> >Subsets, inherits or composition
> > >Regex to define subsets of String
> > >Define subsets of Integer with [a; b]
>Define operations between sets
>Lazy computed and safe
>Compiles without overhead

TL;DR: Basically mathematics and its syntax.
>>
>>57168660
Set theory sucks, though. Type theory is where it's at, and there are already languages based in it.
>>
>>57168316
Yes. What people call OOP isn't actual OOP. OOP programmers break encapsulation all the time.
>>
>>57168564
ty man.
>>
Rust is joke, completely unsafe while claiming the opposite.

https://blog.rust-lang.org/2016/10/20/Rust-1.12.1.html
>>
>>57168668
>Type theory
Literally Javascript
>>
>>57168693
How does that say anything about safety?

There were regressions caused by MIR, so they disabled it and released a point release to avoid making people wait 6 weeks to see the regressions they were being affected by fixed.
>>
>>57168660
>>57168668
Also, lazy and zero-overhead are kind of in contention.

>>57168705
Is this a joke about Javascript's types being only theoretical or something?
>>
>>57168660
>This would be my dream language:
>>No variables (kind of Haskell)
>>"No objects" as in "instance of class"
>>Only manipulating sets
>> >Primitive set (Integer [-inf; +inf], Double, String (All possible string of infinite size))
>> >Subsets, inherits or composition
>> > >Regex to define subsets of String
>> > >Define subsets of Integer with [a; b]
>>Define operations between sets
>>Lazy computed and safe
>>Compiles without overhead
>TL;DR: Basically mathematics and its syntax.
How about you make the language yourself? You've obviously abandoned any hope of producing anything that runs super fast so just go for it. You'd be out of luck in the 70's and 80's but now you can just do whatever, fling shit on the walls. Have every variable in a hash table at runtime and just say fuck it.

Just write your God dammed front end. If it's good enough people will clean up for you when you're done.
>>
>>57168729
>Is this a joke
Yes, everything is

>lazy and zero-overhead are kind of in contention.
I don't think their is a proper answer to that. Basically P=NP.

>>57168748
>This would be my dream language:
>Dream
>Not real
Hello
>>
>>57168768
>I don't think their is a proper answer to that. Basically P=NP.
Thinking about it some more, you're probably right.

That said, it's because "compiles without overhead" is kind of meaningless. Overhead is relative.
>>
>>57168723
Rust devs keep on going about their fearless concurrency and 100% safety. Reality disagrees. Rust has no benefits, is good for nothing (Why do Rust programmers virtue signal in bold like breathing?)
>>
>>57168768
'don't let your dreams be dreams.'
To quote a famous YouTube philosopher I don't remember the name of.
>>
>>57168786
This has nothing to do with concurrency or safety, these are regressions, they're bugs.

It's not claiming to remove every possibility of bug, it's just claiming to remove a family of them.

I hope you're just memeing.
>>
>>57168786
>Why do Rust programmers virtue signal in bold like breathing?

It's a result of their inner SJWism.
>>
>>57168783
You have never compiled Firefox, then. g++ takes a STUPID amount of time compiling ONE source file.
>>
>>57168786
If Rust were 100% safe, it would be useless. That's why there's really two Rust languages: safe and unsafe Rust. Safe Rust is guaranteed to never produce a memory error, assuming the compiler is performing to specification. Any memory error has to come from somewhere within unsafe Rust.

It's a mistake to think that unsafe Rust poisons the safety of safe Rust. There is a DMZ between the two, and that is "unsafe {}". If there is a memory error, there is either a problem with some unsafe Rust somewhere or the conditions of the boundary were violated.

That is all Rust claims.

>>57168830
Oh, you mean compiler performance and not the performance of compiled code. Still, "overhead" is meaningless without a baseline.
>>
>>57168804
>This has nothing to do with concurrency or safety, these are regressions, they're bugs.
Yes, and the rust compiler is written in Rust, so it should have no bugs. You should never believe the malicious, autistic lies of "rustaceans".
>>
>>57168843
There are more problems than just memory errors and Rust doesn't purport to eradicate them all. Just memory errors.
>>
Whats the fastest way to parse html in java. Im not a java programmer so I cant really tell whats good/fast. Jsoup keeps coming up a lot.
>>
>>57168843
>>57168854
And that's only safe Rust.
>>
>>57168859
Just do it. Why would you care? Develop your feature set and fix performance later.
>>
>>57168843
Anon, please, at least read what you're replying to.

Those bugs aren't memory or thread safety related, they're logic bugs.
>>
>>57168842
I was only referring to your
>That said, it's because "compiles without overhead" is kind of meaningless

statement, which I think is wrong. Because it's not meaningless if you need to use a really slow compiler.
>>
>>57168876
Slow isn't meaningless. Using the term "overhead" without a baseline to compare to is.
>>
>>57166094
He didn't say that. Also the road is not trampled, the rocks are. And it is not maintained because you won't get off of it.

Your*
>>
Y'all posting in a bored and violent girl thread. Also she may be part of the africa bumbbody
>>
>>57166038
Pajeets have saturated the market though. The Java migraine isn't even worth the 45k salary which is like a fortune in rupees.
>>
>>57168916
Why do you want us to care?
>>
What's the new meme language?
>>
>>57168935
C, as always.
>>
>>57168935
whatever it is it definitely compiles to javascript
>>
>>57168931
Wasn't listening to your kind of autist. Please. Go back. Or try living there before you try to bring it over here.
>>
>>57168967
>butthurt beyond measure
>>
>>57168916
what
>>
File: Problem 5.png (33KB, 769x73px) Image search: [Google]
Problem 5.png
33KB, 769x73px
idk how to use the char pointer in this problem. Would I make an array of chars and use some loop to swap first letter and last?
>>
>>57168974
No, not really but it's pointless listening to you because unless there's a cock in your mouth you won't see where anyone but halalma is coming from.

You guys are like protexting some shit right?
>>
>giving (You)s to a Markov chain
>>
>>57168989
Didn't anon give a solution already?
Like he putted a complete function to do that.
>>
>>57168993
I already had problems understanding your second post, but this one beats it. What the fuck are you talking about?

I don't care if this is a thread made by a black chick or not. I am not here for the chick, I am here to learn new stuff, so go away and stay go.
>>
>>57168989
Pass the address of the array to the function, that's what the parameter is there for. By the way, the name of an array is the address of the first element and subsequent iterations of that address give you the elements.
>>
File: HJZFzvI.png (59KB, 420x248px) Image search: [Google]
HJZFzvI.png
59KB, 420x248px
>>57169012
>I am here to learn new stuff
Sorry, Anon.
>>
>higher position dev honestly believes global warming isn't made by humans but nature and it is a conspiracy by policy makers and scientists to make more money through regulations
I don't know how to feel about this.
I respected that guy so much.
>>
>>57169084
>falling for the global warming meme
fuck off liberal scum, that guy gets a million times more pussy than you
>>
C++ is the best programming language. There can be no argument.
>>
>>57169099
I agree, it's the best at being shit.
>>
>>57168989
Anon I solved it last thread but in words no code.
Maybe think up a way to reverse a string step by step on paper. Try and reproduce it.

When is this due?
>>
>>57168037
>clone a gitgud project from some unknown faggot
>claim it's yours
>profit
>>
>>57169084
>I'm a whiny liberal fag

Okay.
>>
>>57169119
This is how it feels to use libraries.
>>
>>57169109
Java, C#? They can't even compete.
>>
>>57169084
>respectED
Rude anon.
He surely has good reasons to believe that if you respected him to begin with.
>>
>>57168869
I dont really know where to start. Do I search the file for the <p> tag? Thats the only idea I have right now.
>>
>>57169126
Mummy, why do you use C# when C++ is more powerful?
>>
>Java is my main programming language with python on the side.
A-Am I fucked?
>>
>>57168488
a) ok
b) error
c) warning
d) warning
e) ok
f) ok
g) error
h) ok
I) error
j) warning
>>
>>57169169
No, you gonna be alright. Maybe learn a bit of JS.
>>
>>57169169
s/fucked/employable/
>>
>>57169176
Explain to me why JS is so valuable. CS major here, taking data structures atm.
>>
>>57169163

C++ is more of a clusterfuck, though in some ways, undeniably more powerful.

The thing is, I just don't use it very often.
>>
>>57169188
Because companies love webshit right now.
>>
>>57169114
tomorrow, I'm having trouble understanding pointers. I know that it's used to obtain the memory address of a variable, but idk how to apply this with an array. I'll look back at old thread.
>>
https://gist.github.com/aclements/4b5e2758310032dbdb030d7648b5ab32
can someone explain this to me?

>Preliminary experiments show that this can reduce worst-case STW time to under 50µs, and this approach may make it practical to eliminate STW mark termination altogether.
sounds nice
>>
>>57169096
>>57169126
how is global warming related to being left or right of the spectrum?

that is like automatically labeling me into a party for saying forces have an equal size and opposite direction

facts are facts
>>
>>57169231
It's just a theory bro
>>
>>57169231
>opinions about things that aren't proven are facts

yep, it's a liberal. move along.
>>
>>57169231
>facts
>>
what are some cool applications that require little or no server-side resources (i.e., no heavyweight calculations, state tracking, etc, other than serving files)?
for example, (non-networked) games, maps, ...
>>
>>57169291
You could install mednafen and play NES, SNES, GBA and PSX games (among other platforms). Accurate, takes up only little resources, and fun.
>>
>>57169209
Anon, a pointer simply is the memory address of a variable. When you write

int x = 3;
int *ptr = &x;


You're saying that the value of x should be 3. Then you're declaring a pointer with * (don't let this mix you up with a dereference, they're completely different), and assigning it the address of x. You get the address of x with &.

A dereference

printf("%d\n", *ptr);


"Dereferences" by following its memory address to the actual thing and printing that out. Think going to a house instead of just reading the address.

int array[3] = {2, 4, 7};


Declares an array of 3 integers. When you use just the name "array", you're actually given the address of the first element IN that array. So "array" refers to the address of 2. Cool part here, increment the array by one gives you the next element in line, so the address of 4.

You can pass this array and any other pointer to anything just by giving the address over to a function

function toThree (int *p) {
*p = 3;
}

function .. {
int i = 2;
toThree(&i);
}
>>
>>57169236
yeah, but a scientific theory. That means it is consistent with a whole bunch of other theories and a whole bunch of experiments & data supporting it and those other theories.

So yeah, saying that it is just a theory doesn't quite cut it
>>
>>57169316
well, I meant browser app, but yeah, I guess you can actually play snes in your browser
>>
File: 2016-10-21-012625_493x41_scrot.png (5KB, 493x41px) Image search: [Google]
2016-10-21-012625_493x41_scrot.png
5KB, 493x41px
common lisp newfag here
I want to ceil a number
but the standard function
is pic related
not sure what the return value is
is it just a list with the car being the quotient,
and the cdr being the (remainder . nil)???
>>
>>57168321
look up xhr requests and openweather api.
>>
>>57169209
cum dumpster/ bum in a dumpster
>>
>>57169362
>application
>browser app

Die in a fire, faggot.
>>
>>57169409
>muh webdev is bad!
here, yet another elite programmer of /dpt/
kys retard
>>
>>57169236
>>57169241
>>57169246
>Earth is flat bro, talk to my pastor and stop your liberal crap
>>
>>57169450
>you're a fucking white male!
>current year!
>how is global warming a matter of opinion? are you fucking kidding me??
>>
>>57169447
You are the retard, and you deserve to be gutted like the degenerate pig that you are. You deserve to be mauled and sliced and exploded until even Himmler wouldn't be able to see any jew in you anymore.

And then you deserve to be shit on and pissed on and stamped on and being burned to a crisp so that your ash can be released in the open world so that there is never going to be any more trace of a retard such as you.
>>
>>57166729
The tumblrinas to be are here. I think it's v bait time for the university girls that don't want to learn what they're supposed to be learning and party instead. Notice the hardware thread has a base head with a sonic weapon.

I had to make sure I wasn't the only one.
>>
>>57169473
>only whites are dumb religious people

>>57169481
man, did you forget to take your meds today or something?
>>
>>57169504
No, I have a file with insults that I sometimes copy+paste texts from for people who deserve death.
>>
>>57169513
oh, ok, cool
don't forget to take your meds today, btw
>>
>>57167715
Just for the noise. They're shilling to bumbbody tonight. I guess money really does talk cause I'm stuck here wondering why anyone would help those slimebucket scumbags.
>>
>>57168482
Don't forget that static functions take the trouble out of the prep time.
>>
>>57169370

Bleh, had to look this up for you. Looks like common lisp is silly and allows multiple value returns, instead of just returning a list or a vector or some sort of product type for everything.

https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node94.html

The functions you're looking for are values and nth-value.
>>
File: CvH9gfFWcAA2knK.jpg large.jpg (29KB, 594x249px) Image search: [Google]
CvH9gfFWcAA2knK.jpg large.jpg
29KB, 594x249px
>>
>>57169504
>all people with common sense and skepticism of theories are religious
call me when the earth is dying, until then keep spending, goyim!
>>
I'm learning python at the moment and I just learned about the format strings

So I have a variable that prints out '12345' 10 times

A_variable='12345'
print '%s' %(A_variable+Variable_2) *10

and when it prints it gives me 123451234512345 and so on

how can I put a space between each time the variable is printed?
I made a variable that was just a space '_' and concatanated that with 12345 but it seems like there should be a better way.


what is the purpose of the %r formatter?
>>
>>57169694
I don't into python but in most languages I'd just put a space after the %s
>>
>>57169618
https://www.youtube.com/watch?v=UTzW_XrWzoY
already is
>>
>>57169711
Just looked outside, all good here mate, dunno what you're tripping on but I'm not gonna watch your stupid youtube arm-chair scientist explain that in fact everyone's eyes deceives them and everyone is dying of climate change right now.
>>
>>57169597
thanks
>>
>>57168037
>clowns
has it occured to you that you are also a clown
>>
>>57169724
yeah I enjoyed that 35C temperature today when its almost winter
>>
>>57168037
>clowns
GET OUT OF THERE
>>
>>57169786
>your random temperature in god knows what location, at any time of day, being somewhat high for a winter, is an indication that the entire world is spiraling towards doom

Have you ever considered going in for a check about skitzophrenia?
>>
>>57169481
Why would you say something so terrible?

bleblebulbulbullbullbulllllllllll
>>
>>57166205
It is, the original's been posted before.
>>
>>57169799
>consistent increase in temperature change across years
>random
lol
>>
>>57169816
>your random temperature in god knows what location, at any time of day, being somewhat high for a winter, is an indication that the entire world is experiencing some form of consistent temperature "change", whatever that may be, of any significance
no really dude, you actually could have skitz. i know you're just going to think im a "conspirator" or whatever too, but this kind of behaviour is a really common symptom, if not one of the defining ones
>>
>>57169773

No problem. As a protip, you should learn to figure out how to use Google intelligently to solve problems like this. For me, it was the first result for common lisp multiple value return.
>>
>>57169829
why are you continuing to attack an anecdote instead of presenting facts?
what next institutions like the NOAA, doctors in their field, are not calculating correctly nor are their computer simulated tests? or are you just thinking of a small time frame that doesn't span past your lifetime?
>>
>>57169694
i think you're expecting too much out of this syntax, which i think they're trying to phase out anyway
and you're not really using it! something like print('a ' * 3) does the same thing
>>
>>57169958
>instead of presenting facts
signed yours truly, anonymous skitophrenic that keeps stating the world is collapsing and everyone who doesn't think so is religious

What tests? It's a bunch of hippies looking at an extremely mild CHANGE, not for better nor worse, and exclaiming the world is imploding. Like u
>>
>>57169974
https://www.youtube.com/watch?v=5gqHTlBp6iY
peace
>>
>>57169618
I joined the conversation out of context, and didn't even mention climate change
>>
>>57169991
>skip into video
>"trolling is essentially cyber bullying"
>still nothing to do with global warming
weird dude, but seriously,

http://www.helpguide.org/articles/schizophrenia/schizophrenia-signs-types-and-causes.htm#diagnosing

Check this section out because a lot of it sounds like it might apply to you. My grandmother passed from complications of skitz recently, and she said very similar things.
>>
>>57170013
>skip into last sections
>"If you think that someone close to you has schizophrenia, you can make a difference by showing your love"
>still nothing that says global warming is not a fact
weird dude
>>
>>57170049
Not an argument.
>>
Next thread, use when this one dies.

>>57170056
>>57170056
>>
>>57170062
thank you for agreeing at last, you can't argue against facts.
>>
>>57170070
What fact?
>>
Would it be possible to add these two lines of code with assembly editing, or is assembly editing only for simple tweaks and deletions?

public static Equipment FC_AnchorCannon;
EquipmentManager.FC_AnchorCannon = new Equipment("Anchor Cannon", EquipType.FixedCannon, 1f, 2, AbilityManager.L_AnchorCannon, false, new StatModifier[0]);
>>
>>57169970
thanks for your response.
I'm pretty much a total beginner so I have no idea what can and can't be done
Thread posts: 330
Thread images: 28


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