[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: 322
Thread images: 41

File: 1499398209850.jpg (212KB, 727x822px) Image search: [Google]
1499398209850.jpg
212KB, 727x822px
Old thread: >>61316134

What are you working on, /g/?
>>
not this fucking rust shill again.
>>
Is there some simple way to check whether a font supports certain unicode characters on loonix?
>>
I want to learn a meme lang

Haskell, Erlang, Go, Julia

Which one first /dpt/?
>>
>>61321394
>simple way
>on loonix
You're using the wrong OS if you're lookign for "simple ways" of doing things, lad.
>>
>>61321406
Nim
>>
>>61321406
ATS
>>
>>
>>61321410
yeah I figured. It doesn't really matter since it's only for a toy program
>>
>>61321347
get that terrorist shit off /g/.
>>
>>61321406
D

but better get better at a real language instead
>>
>>61321544
>>>/global/3
>>
>>61321426
My dick is hard right now
>>
File: rust.jpg (43KB, 500x438px) Image search: [Google]
rust.jpg
43KB, 500x438px
>>61321591
The OP's image is already breaking the rule, though.
>>
File: muslim.jpg (38KB, 359x558px) Image search: [Google]
muslim.jpg
38KB, 359x558px
>>61321347
>>
>>61321394
>>61321410
>>61321503
or it is easy?

https://wiki.archlinux.org/index.php/fonts#Preview_and_temporary_changes
>>
File: muslim2.jpg (470KB, 730x1095px) Image search: [Google]
muslim2.jpg
470KB, 730x1095px
>>
File: brain.jpg (39KB, 600x367px) Image search: [Google]
brain.jpg
39KB, 600x367px
Rust
>>
File: muslim3.jpg (12KB, 300x250px) Image search: [Google]
muslim3.jpg
12KB, 300x250px
>>
>>61321544
>>61321654
>>61321679
>>61321698
Why is it so easy to trigger /pol/?
>>
File: monk.jpg (53KB, 368x500px) Image search: [Google]
monk.jpg
53KB, 368x500px
That feel when your program is POSIX compliant and Valgrind clean.
>>
>>61321718
>implying only pol finds islamic ideas objectionable

that shit is incompatible with freedom and western civilization
>>
I'm hungry. It's 2:40 AM and it's cold.
>>
>>61321766
So is any religion pretty much.
>>
>>61321718
>no (You)s
>have to resort to replying to yourself and making shit up
It must be a real pain to be you.
>>
What's a good way to learn assembly?
>>
>>61321766
Not programming related.
>>
File: muslim4.jpg (11KB, 257x196px) Image search: [Google]
muslim4.jpg
11KB, 257x196px
>>61321766
but Islam is free as in freedom
>>
>>61321779
that's why islamic countries are so free and civilized
>>
>>61321814
> Thread about Programing
> Discussion about Islam

When did /pol/ migrate to /g/
>>
>>61321814
Hi, I live in Dubai. AMA.
>>
>>61321847
What are you working on?
>>
>>61321835
hey Muhammad, I didn't start this discussion

attack those that post Islamic propaganda

oh wait, that was you
>>
>>61321851
Tech support for a wireless company.
>>
OP is a /pol/tard and he's just trying to get people triggered towards muslims.

KYS OP
>>
which is better

if(foo) {
bar();
}


or

if (foo) {
bar();
}


i've been using the former for years but i'm thinking of making the switch to the latter. the latter seems to be more common in style guides and it's arguably more readable. what do?
>>
>>61321847
Dubai the capital of sex slave trafficking playground of rich savages?

so civilized

http://abcnews.go.com/2020/story?id=3932740&page=1

http://www.bbc.co.uk/news/world-middle-east-23381448
>>
>>61321888
i use the latter. Its pretty much a non issue though just use what you like famalam
>>
File: worst girl.png (2MB, 1920x1080px) Image search: [Google]
worst girl.png
2MB, 1920x1080px
>>61321347
Can we just go back to making fun of Indian ethnicities instead?
>>
>>61321888
I like the latter. if is not a function.
>>
>>61321892
>getting your panties in a wad over some thots
Can you spell cuck?

>>61321888
Objectively the second. Use spaces after keywords to make your life easier when you're searching for something or trying to run your source through a regexp for whatever reason...
>>
Somewhat new to programming here. Finished my core classes and now I'm moving on to major related courses in uni. I transferred to a better school and now I have to retake the first Programming Principles class.

I need to take a Computational Science class where we use Matlab and all and I've never done a course like that before.

Would I be taking a big risk in taking that course along with Programming Principles and some other non programming courses like Statistics?
>>
>>61322003
No, matlab is fucking easy. It's like python if python was made even more just werkz.
>>
File: 10414542.png (244KB, 638x540px) Image search: [Google]
10414542.png
244KB, 638x540px
>>61321909
Renge is ok, Komari is objectively the best
>>
>>61321888
neither. Put spaces inside your ().

if( foo ) {
bar();
}
>>
>>61322039
I literally only see pajeets do this.
>>
>>61322022
Ah ok. I was under the idea that matlab was some confusing shit. Thanks anon.
>>
>>61321888
no one really cares, don't worry
you might put that open bracket to a new line though, some code quality tools actually consider that a violation
>>
>>61322063
Hello sir?
>>
File: Git-Logo-2Color.png (6KB, 910x380px) Image search: [Google]
Git-Logo-2Color.png
6KB, 910x380px
Say I have three folders in my bare git repo

a
b
c


and I wanna do a manual checkout of a and b whilst slightly transforming the folder structure

checkout a -> ./
checkout b -> ./stuff/


c should not be checked out at all. Is this possible with git or should I just do a checkout and manually rename the folders?
>>
>>61321347
How do I get a muslim gf?
>>
>>61322064
I mean it's gonna be new, and some of it is a bit klunky, but if you're willing to learn and google, you should have no problem. The easiest way to learn matlab is to use it, so use it for all your mathematics for that semester. If you find yourself doing something that feels unnecessarily slow or copy-pastey you can almost certainly do it a better way, and it'll be an educational experience.
GNU Octave is a mostly complete copy of Matlab, so if you need Matlab for your workstation, and your school doesn't provide free licenses, check that out.
>>
File: image_1.jpg (742KB, 1536x2056px) Image search: [Google]
image_1.jpg
742KB, 1536x2056px
>>61321766
>western civilization
>>
File: programming.jpg (9KB, 259x194px) Image search: [Google]
programming.jpg
9KB, 259x194px
>>61321347
>>
>>61322177
Habeeb it
>>
>>61321347
>literally shaming The Sussman by mudslime shit
you need to leave
>>
>>61322127
I've actually already done all of my mah classes so I'm solely able to focus on computer science courses. I'll check out GNU octave stuff thanks
>>
>>61322198
That's very proactive of you. In that case, if you want a bit of a challenge, you can look on StackExchange or Project Euler for difficult math problems, and use those to help learn Matlab. These are just two websites that offer math problems, I'm sure there are others. /sci/ might have more information on this matter.
>>
>>61322125
don't be fat, its haram
>>
>>61321718
>only pol hates Islam!
You obviously live in a wealthy, homogeneous, perhaps even gated area.
>>61321779
>So is any religion pretty much.
Can you substantiate that argument? In the case of Islam, and Protestantism, it is obvious that they can not be practiced in a secular manner and exist along side other groups. Doesn't mean other groups are incapable of secularism.

You stupid kid
>>
long time;

heheeheheh
>>
>>61322117
push
>>
Trying to do the Pythagorean triplet problem in Project Euler.

"A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
a2 + b2 = c2

For example, 32 + 42 = 9 + 16 = 25 = 52.

There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc."

This is what I've come up with so far but I only get the result "None" when I run it:

def triplet():
a=1
while a<1000:
b=(a**2-1)/2
c=((a**2-1)/2)+1
trip=a**2+b**2
sum=a+b+c
product=a*b*c
if trip==c and sum==1000:
return product
else:
a+=2
print(triplet())

Could someone explain what's wrong?
>>
>>61322450
You not using alt-c
>>
>>61322125
>go to an north african country
>convert to islam
>get married
>get back to your country
>???
>profit
>>
File: triplets.png (21KB, 639x530px) Image search: [Google]
triplets.png
21KB, 639x530px
>>61322450
Sorry for the cancerous formatting. Here's a screenshot of my editor. It outputs "None" with exit code 0.
>>
>>61322514
I don't know which is worse, that font rendering, those colors or the code being python.
>>
>>61322392
short dick;

heheeeeheheeeheheheehehehee
>>
>>61321394
gucharmap, select a font, select show glyphs only from this font
>>
>>61322555
enjoy getting fired for that line.
>>
C doesn't support supercompilation! What a shitty language. And you fucks like to talk about it being "fast" while it doesn't even support things like map fusion.
>>
>>61322514
yer got to the end of ye old function, never return nuffin
>>
>>61321347
How does 'apply work? I can't see the code with this stupid girl in front of it
>>
>>61321347
I can absolutely not fathom why you'd make an OP like this. The image is supposed to be attractive or funny, on other boards maybe even informative. This one is none of these. Don't start whining when anons make threads with pics of the prophet in retaliation. You asked for this.
>>
>>61322514
Why are b and c like they are?
>>
>>61321888
(if foo
bar)
>>
>youtube fucks up music sound quality (even more than plain 128kbps mp3) with shitty volume normalization algorithm
>some videos are still several times louder than others
gee thanks google
>>
>>61321698
It does look cute.
>>
>>61322700
proprietary code do not steal
>>
>>61322700
it takes a function and applies it to a list of arguments.
(apply '+ '(1 2 3 4 5))
15
>>
>>
Why did lisp have to die, /dpt/?
>>
What functional language should I learn?
>>
>>61322849
All things have their time, and LISP machines failed.
>>
>>61322849
it was made way too early and computers at the time couldn't handle all the high level concepts.
>>
>>61322849
“Don't cry because it's over, smile because it happened.”
>>
>>61322711
Ladies and gentleman, the Ameritard.
>>
>>61322829
pysharts BTFO
>>
>>61322877
ATS
>>
>>61322877
C++
>>
>lisp is dead
is this the newest meme?
>>
>>61322823
Please provide the full implementation of apply
>>
>>61322849
Dynamic typing sucks. Macros suck. You suck. kys
>>
>>61322923
it was new over 20 years ago...
>>
>>61322923
It's a meme almost as old as Lisp itself.
>>
>>61322923
Not a single lisp dialect is in Tiobe's top 50. That's pretty fucking dead.
>>
>>61322607
Wtf even is supercompilation or map fusion?
>>
>>61322958
things C doesn't support
the reason why C is so slow
>>
>>61322958
undescriptive words that smug haskell weenies spout in hopes of sounding "academic".
>>
>>61322926
This is how SBCL implements it:
(defun apply (function arg &rest arguments)
"Apply FUNCTION to a list of arguments produced by evaluating ARGUMENTS in
the manner of LIST*. That is, a list is made of the values of all but the
last argument, appended to the value of the last argument, which must be a
list."
(cond ((atom arguments)
(apply function arg))
((atom (cdr arguments))
(apply function (cons arg (car arguments))))
(t (do* ((a1 arguments a2)
(a2 (cdr arguments) (cdr a2)))
((atom (cdr a2))
(rplacd a1 (car a2))
(apply function (cons arg arguments)))))))
>>
>>61322935
You're partly right. Latent, optional typing is nice and allows optimizations. Macros do suck, the real thing is FEXPs.
>>
>>61322958
>>61322982
https://en.wikipedia.org/wiki/Metacompilation
https://en.wikipedia.org/wiki/Map_(higher-order_function)#Optimizations
C babies need to learn that their beloved language is overrated and far from perfect.
>>
>>61321888

Easy, declare this wrapper
int
doSomething(void(*sub)())
{
(*sub)();
return 0;
}


Then just do
foo && doSomething(&bar);
>>
>>61322982
>I don't understand it therefore they're wrong
Hahahahaha pathetic
>>
>>61322237
>Can you substantiate that argument? In the case of Islam, and Protestantism, it is obvious that they can not be practiced in a secular manner and exist along side other groups. Doesn't mean other groups are incapable of secularism.

Not that guy, but as soon a masses of believers of Religion X becomes poor enough they inevitably will get more fanatic and incapable of secularism.
>>
>>61323008
What esoteric programming language is that?
>>
>>61323066
Common Lisp
>>
>>61322982
You can just admit that you don't know...
>>
Common Lisp is not so common.
>>
>>61323020
>the wiki article is just a stub thst makes no sense

Probably nothing important.
>>
>>61323118
clojure is not lisp.
>>
File: 6.png (741KB, 1277x719px) Image search: [Google]
6.png
741KB, 1277x719px
do you see it
>>
>>61323118
>believing the merits of a programming language positively correlate with its popularity
>>
How can I print numbers from 1 to 100 and then from 99 to 1 recursively, in a single function (C)?

I know how to do it separately, but in the same function it's a different thing.
>>
>>61323137
Is that the only non-lisp language you can pick out on that graph, retard? It's a functional language graph.
>>
>>61323161
clojure is pretty dysfunctional though
>>
>>61323142
>not using fabs
REEEEE fuck you nigger jap
>>
>>61323142
>comments in native language
>>>/trash/
>>
>>61323142
>0.f
that's not a number
>>
>>61323020
>Metamemezation is a memetation which involves metameme transitions (MMT) from a memetating meme M to a metameme M' which controls, analyzes and imitates the memery of M. Memetics-based meme transformation, such as partial memeing and supermemezation (SMP), is metamemetation.
>>
>>61322911
you can't use C++ that way without being ridiculed and called a brainlet
>>
>>61323193
you can initialize your floats like than in C++

me thinks
>>
>>61323193
it's the same as 0.0f
>>
>>61323193
it's zero in float type
>>
>>61321347
CAN YOU FUCKING STOP REPOSTING AND REGURGITATING THE SAME SHIT POST OVER AND OVER AGAIN
WHAT ARE YOU THE GOVERNMENT TRYING TO FIND OUR JOBS AND SPY ON US
>>
>>61323263
Calm down, Alex! Take your meds and go back to bed, the frogs are gonna be just fine and not become gay at all...
>>
File: Smashed-computer-image.jpg (40KB, 450x301px) Image search: [Google]
Smashed-computer-image.jpg
40KB, 450x301px
WHY THE FUCK ISN'T HASKELL MORE POPULAR? IT'S NOT FAIR! HASKELL WAS THE CHOSEN ONE! IT'S FASTER THAN C! IT'S FASTER THAN C!
>>
>>61322911
Being really good at C++ is like being really good at using rocks to sharpen sticks. – Thant Tessman
Arguing that Java is better than C++ is like arguing that grasshoppers taste better than tree bark. – Thant Tessman
There are only two things wrong with C++: The initial concept and the implementation. – Bertrand Meyer
C++ has its place in the history of programming languages. Just as Caligula has his place in the history of the Roman Empire. – Robert Firth
C++ is history repeated as tragedy. Java is history repeated as farce. – Scott McKay
C++ is like jamming a helicopter inside a Miata and expecting some sort of improvement. – Drew Olbrich
C++ is the only current language making COBOL look good. – Bertrand Meyer
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. – Bjarne Stroustrup
C++: Simula in wolf’s clothing. – Bjarne Stroustrup
C++ will do for C what Algol-68 did for Algol. – David L Jones
Historically, languages designed for other people to use have been bad: Cobol, PL/I, Pascal, Ada, C++. The good languages have been those that were designed for their own creators: C, Perl, Smalltalk, Lisp. – Paul Graham
I consider C++ the most significant technical hazard to the survival of your project and do so without apologies. – Alistair Cockburn
If C++ has taught me one thing, it’s this: Just because the system is consistent doesn’t mean it’s not the work of Satan. – Andrew Plotkin
If you think C++ is not overly complicated, just what is a protected abstract virtual base pure virtual private destructor and when was the last time you needed one? – Tom Cargill
I invented the term Object-Oriented, and I can tell you I did not have C++ in mind. – Alan Kay
>>
>>61323158

just make one of the arguments a bool for increasing or decreasing

int f(int num, bool increase, const int max, const int min) 
{
printf("%d\n",num);
if (increase && num < max) {
f(num+1,true,max,min);
} else if (num > min) {
f(num-1,false,max,min);
}
}
>>
>>61322911
It has been discovered that C++ provides a remarkable facility for concealing the trival details of a program – such as where its bugs are. – David Keppel
Java is, in many ways, C++–. – Michael Feldman
Java, the best argument for Smalltalk since C++. – Frank Winkler
PL/I and Ada started out with all the bloat, were very daunting languages, and got bad reputations (deservedly). C++ has shown that if you slowly bloat up a language over a period of years, people don’t seem to mind as much. – James Hague
The last good thing written in C++ was the Pachelbel Canon. – Jerry Olson
To me C++ seems to be a language that has sacrificed orthogonality and elegance for random expediency. – Meilir Page-Jones
Whenever the C++ language designers had two competing ideas as to how they should solve some problem, they said, “OK, we’ll do them both”. So the language is too baroque for my taste. – Donald E Knuth
Within C++, there is a much smaller and cleaner language struggling to get out. – Bjarne Stroustrup
{Major-Willard} C++ damages the brain … – EWD
C++ is the best example of second-system effect since OS/360. – Henry Spencer
C++ is an insult to the human brain – Niklaus Wirth
>>
>>61322911
All new features added to C++ are intended to fix previously new features added to C++ – David Jameson
C++: glacial compiles, insane complexity, impenetrable errors, laughable cross-platform compat, basically useless tools. – Aaron Boodman
Life is too long to know C++ well. – Erik Naggum
If you like C++, you don’t know C++. There’s a mutual exclusion going on here, and I’ve yet to see a counter-example other than possibly a few of the members of the standards committee. – ssylvan in reddit.
*Oh, definitely. C++ may not be the worst programming language ever created, but without a doubt it’s the worst ever to be taken seriously. – Mason Wheeler
C++ is to C as Lung Cancer is to Lung.
I think maybe the guy who invented C++ doesn’t know the difference between increment and excrement. – smcameron
C++ is more of a rube-goldberg type thing full of high-voltages, large chain-driven gears, sharp edges, exploding widgets, and spots to get your fingers crushed. And because of it’s complexity many (if not most) of it’s users don’t know how it works, and can’t tell ahead of time what’s going to cause them to loose an arm. – Grant Edwards
>>
>>61322911
C++: an octopus made by nailing extra legs onto a dog. – Steve Taylor
I believe C++ instills fear in programmers, fear that the interaction of some details causes unpredictable results. Its unmanageable complexity has spawned more fear-preventing tools than any other language, but the solution should have been to create and use a language that does not overload the whole goddamn human. – Erik Naggum
I may be biased, but I tend to find a much lower tendency among female programmers to be dishonest about their skills, and thus do not say they know C++ when they are smart enough to realize that that would be a lie for all but perhaps 5 people on this planet. – Erik Naggum
C++ is a language strongly optimized for liars and people who go by guesswork and ignorance. – Erik Naggum
c++ is a pile of crap. – Theo de Raadt
With C++, it’s possible to make code that isn’t understandable by anyone, with C, this is very hard. – Mike Abrash
Whenever I solve a difficult problem with C++, I feel like I’ve won a bar fight. – Michael Fogus
C is C++ without the BS. – SocialPhatology
>>
>>61323352
>Arguing that Java is better than C++ is like arguing that grasshoppers taste better than tree bark. – Thant Tessman
wat
>>
>>61323383
exactly
>>
>C++ haters have nothing better to do than spam the thread with memes
lmaoing
>>
>>61323137
How the fuck is it not Lisp?
>>
File: ThreeColorResultOne_0.png (22KB, 518x311px) Image search: [Google]
ThreeColorResultOne_0.png
22KB, 518x311px
>>61323352
*tips fedora*
>>
File: 1456205750415.jpg (84KB, 1000x928px) Image search: [Google]
1456205750415.jpg
84KB, 1000x928px
>>61323362
>It has been discovered that C++ provides a remarkable facility for concealing the trival details of a program – such as where its bugs are. – David Keppel
>>
File: 1498117439711.png (753KB, 1338x5868px) Image search: [Google]
1498117439711.png
753KB, 1338x5868px
>>61323433
>>
>>61323449
fucking retarded quote, he's clearly a brainlet and doesn't know the language
>>
>>61323433
Java is far superior and much more popular.
>>
>>61323362
>C++ damages the brain … – EWD
this, basically
>>
>>61323443
/thread
>>
>>61323357
Sanks.
>>
>>61323161
Not to mention that clojure in combination with java is goddamn ugly.
>>
File: 1468698974413.jpg (62KB, 750x736px) Image search: [Google]
1468698974413.jpg
62KB, 750x736px
>>61323352
>I invented the term Object-Oriented, and I can tell you I did not have C++ in mind. – Alan Kay
>>
>>61322713
http://www.friesian.com/pythag.htm

Going off of those formulas because the normal way didn't work for me either
>>
>>61323352
>I invented the term Object-Oriented, and I can tell you I did not have C++ in mind. – Alan Kay
I'm familiar with this quote, so I'm going to pick it out and disregard the rest of your post since the rest of it is probably bullshit too. You're completely misrepresenting his point to fit your agenda. What he said could have been said about ANY of the object-oriented languages we commonly use. Alan Kay envisioned OOP as something very different from what we're used to today.
>>
this captcha is just pathetic lmao

google is clearly having problems with their self-driving meme and they're desperate for training data

enjoy your memeing circlejerk since you obviously prefer to shitpost instead of actually doing any programming in your shitty FP langs
>>
>>61323552
>TlDR: damage control
>>
WHY IS HASKELL DEAD? WHYYYYYYYYYY????
>>
File: 1497305697332.png (40KB, 1620x774px) Image search: [Google]
1497305697332.png
40KB, 1620x774px
>>61323362
>Within C++, there is a much smaller and cleaner language struggling to get out. – Bjarne Stroustrup
It's called C
>>
>>61323352
Grasshoppers are probably tastier than tree barks actually
>>
>>61323572
>TLDR: I'm a brainlet
>>
>>61323599
>C
>clean
lol
>>
File: 15626159.jpg (81KB, 893x960px) Image search: [Google]
15626159.jpg
81KB, 893x960px
>>61323371
>All new features added to C++ are intended to fix previously new features added to C++ – David Jameson
>>
>>61323352
>abstract ... pure virtual ...
what the fuck
>protected ... private
pick one faggit

Trying to be comedian too hard.
>>
>>61323634
yes very funny

kys brainlet samefag
>>
>>61323573
it isn't?
>>
>>61323640
Protected inheritance of a class with a pure virtual private destructor.
No idea why you'd ever do that though. I don't believe you'd ever be able to instantiate that class because you can't implement the destructor.
>>
>>61323647
>C++ is a language strongly optimized for liars and people who go by guesswork and ignorance. – Erik Naggum
>>
>>61323352
>>61323362
>>61323371
>>61323380
Absolutely saved
>>
>>61323546
That's a good one.
>>
>>61323690
see >>61323552
>>
>>61323599
>It's called C
no, we need the comfy containers and algorithms in some form in a moder language
>>
>>61323668
>autism
>>
>>61323443
someone use this for the next OP pic
>>
File: 1456923792222.png (202KB, 400x474px) Image search: [Google]
1456923792222.png
202KB, 400x474px
>>61323352
>C++ will do for C what Algol-68 did for Algol. – David L Jones
What did he mean by this?
>>
>>61323733
We need the templates, constexpr and RAII semantics.
The last thing we need, funnily enough, is the OOP shit.
>>
>>61323219
you can't use C++ without being ridiculed and called a brainlet
FTFY
>>
i just wrote this to scroll to posts with some replies.

;(function(){var postInfo=document.querySelectorAll('.postInfo'),i=0,interedasting=[],minposts=2;
postInfo.forEach(function(el,i){if(el.querySelectorAll('.backlink span').length>=minposts) interedasting.push(el);});
document.addEventListener('keydown', function(e){if(e.key === "n" && e.altKey)location.hash=interedasting[i++].id;if(i === interedasting.length) i=0;})
}());
>>
>>61323791
fuck off Bjarne.
>>
>>61323807
You know I'm right.
>>
>>61323548
Thanks, here's the problem:
>The first rules that I became aware of for determining a subset of Pythagorean triplets are as follows:
>subset of Pythagorean triplets
i.e. you don't get all triples

Try a bruteforce solution first, you can optimize later
>>
>>61323676
I'm thinking of getting these quotes in my bash_profile.
>>
>>61323371
>All new features added to C++ are intended to fix previously new features added to C++ – David Jameson
Let's take lambdas as an example. What do lambdas fix?
>>
>>61323853
Lack of lambdas
>>
>>61323853
Function pointers.
>>
>>61323805
Neat
>>
>>61323799
who cares, the opinion of literal fucking haskell/rust/lisp/javascript/python brainlets in /dpt/ is worthless
>>
>>61323885
I think Java pajeets are smarter than C++ "programmers"
>>
C++ killed programming.
>>
>>61323469
>YELLOW++
You end up with compile error faggit. Also enum classes.
>>
>>61323668
Why write something unusable like you don't understand what words mean?
>>
File: pepe hoodie.jpg (74KB, 357x357px) Image search: [Google]
pepe hoodie.jpg
74KB, 357x357px
Maybe you guys can give me some advice:

I'm 27 and basically a NEET. I do have some things going for me, but I'm still pretty much a NEET.

I do want to fix my situation, preferably without joining the military. I'm a bit more mature now than I was then, and I think I can probably pull it off if I work hard enough. My plan, a work in progress, is to learn software development over the next few months and then get a slave-tier job (by software dev standards, anyway) making whatever someone will pay me, wherever I can find it.

My main concern is that I have no real work history. I've worked some supermarket and burger jobs before I was 21... and that's it. Can I lie and say that I've been a caretaker for my elderly family members who I live with? I'm not going to starve to death by tomorrow, but if I can't make something happen within the next six months, I'll definitely be squarely in despair territory. Maybe I should just get any burger job that will take me and try to claw my way up from there.

tl;dr: Assuming I can do the job, will anyone actually hire me as a dev with no credentials and no work history? I honestly don't care if I have to take minimum wage. Can I put together a portfolio and accomplish this, or am I screwed?
>>
>>61323981
Because you're a brainlet criticizing C++'s complexity by pointing a literally useless situation that would never arise.
>>
>>61323992
It's unlikely but not impossible so long as you have a solid history on github
>>
>>61323791
I used to know all the OOP shit and what it was about but haven't used it for years and have almost no idea now

so it's not like someone forces you to do OOP
>>
>>61323874
Function pointers aren't actually broken
>>
File: shig--;.jpg (661KB, 2000x2000px) Image search: [Google]
shig--;.jpg
661KB, 2000x2000px
>current year
>not using C--
>>
>>61323799
>implying the whole world is /g/
>>
>>61323874
Function pointers is one of the nicest things in C.
>>
>>61323992
I forgot to add, I already have some basic programming skills. I have a basic grasp of OOP, etc., I can whip up some simple Python programs as long as there are libraries out there that I can use to do what I want to do. I can't always do it in the most efficient way possible, but I'm starting to understand big O and such. I can solve most novice-level programming challenges without too much difficulty.

>>61324022
>not impossible so long as you have a solid history on github
I'm basically just starting out. What kind of history do I need on github in your opinion?
>>
>>61323869
>lack of lambdas
>new features
>>61323874
You clearly do not know what lambda is.
>>61323992
>Can I put together a portfolio
If you are asking question like this you are probably screwed. Yes you fucking can.
I jave no idea about what's job market in your area. If you have no preference in programming you should get one and train it and be prepared to be flexible in what you can do.
>>
>>61324009
Wrong reply target faggit.
>>
>>61324054
>If you are asking question like this you are probably screwed. Yes you fucking can.
Well, some industries are heavily regulated and/or limited to new entrants. I can't just walk into an electrician job for example. So even if that's a stupid question, it helps to have someone give me a straight answer.
>I jave no idea about what's job market in your area. If you have no preference in programming you should get one and train it and be prepared to be flexible in what you can do.
I've got mobile development in mind since there seems to be a lot of demand based on job postings and it's relatively young and untapped compared to a lot of alternatives.

But frankly, I will move across the country for ten bucks an hour at this point, as long as there are actual opportunities in dev for a guy with no serious work history at 27.
>>
>>61324042
Simon fuck off, nobody likes you or haskell.
>>
>>61324022
>plan is to learn software development over the next few months
There's gonna be no solid history on his git - if s/he actually has one.
>>
Memes in Haskell.
encode str = map (\g -> (length g, head g)) $ group str
decode str = concat $ map (\(x,y) -> take x $ repeat y) str
>>
>>61324022
>>61324114
I have an empty github account, I signed up years ago (not even thinking that I'd use it) but only decided to look into development recently. As I said here >>61324092 I think I'll take a stab at mobile dev and get a few apps on the app store and go from there. It's better than burger flipping (which I will also do if I have to).
>>
>>61324123
Haskell is a meme.
>>
>>61324123
encode = map (head &&& tail) . group
decode = concatMap (uncurry $ \x -> take x . repeat)
>>
>>61323142
I'm guessing that the damage should only be dealt at the end of calculations, where right now you take an extra instance of damage for every debuff you have on you, and having 0 debuffs makes you immune to damage
>>
>>61323992
If you learn basic hipster shit like react, git, vue, unit testing, html and css, do some hobby projects and host them on github and apply for a lot of jobs I'm pretty sure at least one would take you.
>>
File: Indian-app-programmer.jpg (81KB, 508x339px) Image search: [Google]
Indian-app-programmer.jpg
81KB, 508x339px
Open your browser's developer console and paste this:

([]+{})[!+[]+!![]]+(!![]+[])[-~[]]+(![]+[])[-~[]]+([][[]]+[])[-~-~-~-~-~-[]]+([][[]]+[])[-~-~-~-~-~-~-[]]+(![]+[])[-~-~-[]]+(!![]+[])[-~-~-~[]]+(!![]+[])[+[]]
>>
>>61323352
>>61323362
>>61323371
>>61323371
>>61323380
fucking triggered
>>
>>61324196
No
>>
>>61324196
Thanks for formatting my system hard driver douchebag
>>
>>61324196
don't do this it creates mustard gas
>>
File: pepe comet.gif (2MB, 500x281px) Image search: [Google]
pepe comet.gif
2MB, 500x281px
>>61324190
>basic hipster shit like react, git, vue, unit testing, html and css
heh, thanks. I'm honestly losing my mind a bit with the realization and the full weight of what I've done to myself. Even tiny encouragement ITT helps alleviate some of the pressure desu.
>regrets
Oh well, onward and upward
>>
>>61322063
You are literally an idiot.
>>
>>61324294
dumb frogposter
>>
File: err_no.png (131KB, 500x450px) Image search: [Google]
err_no.png
131KB, 500x450px
>>61324196
._.
>>
Why the sand nigger OP? Trying to develop a more effective bomb timer?
>>
File: 1451667033909.gif (1MB, 780x400px) Image search: [Google]
1451667033909.gif
1MB, 780x400px
>>61324310
>frogposter
picked at random, have a more interesting gif
>>
>>61323992
You're not so old, stop kicking yourself. You're gonna be 37 and even 47 like everyone and still needing shit to do. That's plenty of time to learn shit and gain decades of experience.
If you have something in mind, become laser focused and don't let anyone, any amount of initial rejections stop you. Learn from them, that's what they're for and nothing else. Its free lessons in life.
>>
>>61324228
What's the matter? Don't trust that your browser sandboxes js properly?
>>
>>61324349
source on gif?
>>
>>61324443
undertale
>>
>>61324450
I don't think that's correct
>>
I have some free time and want to read a book, what subject should I read about?
ML, security, new language, graphics, something else what?
>>
>>61324483
The Little Schemer
>>
>>61324443
a poster on /vg/, I believe
it might be called "react 5" or something similar but I'm not sure
>>
File: Purple_dragon_book_b.jpg (41KB, 325x492px) Image search: [Google]
Purple_dragon_book_b.jpg
41KB, 325x492px
*blocks your path*
>>
>>61324501
I already know scheme and common lisp and have read the schemer series and SICP.
Also the little schemer is kind of bad book and only really teaches recursion.
>>
>>61324349
that can't actually be a terminal program bc of the mouse, right? really cool regardless.

>>61324190
>unit testing
>hipster shit
REEEEEEEEEEEEE
>>
>>61324515
>and SICP
prove it
>>
>>61324526
http://invisible-island.net/ncurses/man/curs_mouse.3x.html
>>
>>61324530
I achieved SATORI.
>>
File: 1420500175412.jpg (438KB, 900x2134px) Image search: [Google]
1420500175412.jpg
438KB, 900x2134px
Is this list missing anything?
>>
>>61324573
it's very out of date
>>
File: 1494375294349.jpg (955KB, 1822x2048px) Image search: [Google]
1494375294349.jpg
955KB, 1822x2048px
Hey /dpt/ how can I implement something like ctrl+D in protected mode.
So far I call a pause in the keyboard interrupt but then, further keys are not recorded-

pls respond.
>>
>>61322063
Hello sir, i am a representative of the microsoft company and we have detected a virus on your system. Please download the tool from https://pajeetinjector.org/download to allow me tuu help yoo.
int main (    int argc, char **argv    )
{
if ( argc > 2 ) printf( "%d", argc );
}
>>
Write a program that takes a file name from the environment and prints a random line from the file
>>
Working on android studios.

Basically I'm working on a sequence of blinking lights, and each light needs to be delayed from the next. It activates via a function call, and then stops.

My issue is I can't get these lights to go in sequence. In the function call I have a postDelayed Runnable that makes the lights pause for 1000 ms.

Is there a way to queue up these lights so it's in a proper sequence? The sequence is randomly decided by a list of values ranging from 0~5, but if I toss the list at the function all the lights will go off at once for 1000 ms. I need to have one go off for 1000 ms then the next 1000 and so on.
>>
File: lattice.jpg (19KB, 640x400px) Image search: [Google]
lattice.jpg
19KB, 640x400px
is there a mathematical way to determine the center of a N x N grid like pic related stored in an 2d array?

it just needs to be in the center, no clear boundaries. i just hardcoded it.
>>
>>61321544
this
>>
>>61324747
what the fuck is this
>>
>>61324779
spin configuaration of a N x N lattice.
think about it as of a matrix
>>
>*CURRENT-YEAR*
>not programming in zimbu

FUNC Main() int
IO.print("Hello, World!")
RETURN 0
}
>>
>>61324814
>zimbu
sounds like some african garbage
>>
>>61324573
>dragon book
How to write a compiler front-end the book. Useless (for writing a compiler, for learning to write a lexer it's pretty ok).
>Unix programming
Bad ideas
>hackers delight
Good book.
>The science of programming
Waste of time for anyone with half a brain frankly. (see pic)
It's not that anything said is untrue it's just that it's extremely verbose in saying very little. This is just a picked example.
>>
>>61324732
function rand1 {
shuf $1 | head -n 1
}
>>
>>61324747

1/2x 1/2y ?
>>
>>61322063
if(poo.enabled==true){
poo.location=loo;
}
>>
>>61322039
>Put spaces inside your ().
Why.
Please don't say "easier to read". That's very subjective.
>>
>>61324732
Dunno if it works, but fuck it, wrote quickly
import argpass as cl
import random as rand

def get_random(file):
lines = {}
i = 0
with open(file, "r") as _file:
for line in _file:
lines[i] = line
i += 1
return rand.choice(lines)

parser = cl.ArgumentParser(description="Print out random line from inputfile")
parser.add_argument('file', metavar='FILE', type=str, nargs='+=', help='Get a random line from file FILE', action='store_const', default=get_random)
>>
File: 1499753101682.png (157KB, 1500x783px) Image search: [Google]
1499753101682.png
157KB, 1500x783px
>this is netrunner's "parser"
I can't stop laughing.
>>
>>61324839
>a book called Compilers: Principles, Techniques, and Tools is useless unless you want to write a compiler
whoa... you just blew my mind.
>>
>>61322958
haskell memes
>>
>>61324862
rather x/2 y/2 and then hardcode the neighbour elements up,down,left and right
>>
WHY IS HASKELL DEAD??? IT'S NOT FAAAAAIIIIIIRRRRR! IT'S BETTER THAN C!!
>>
>>61324952
it's not dead
>>
>>61324979
>>61324952
To be dead, it must have been at some point alive.
>>
>>61324979
https://www.tiobe.com/tiobe-index/
>#41
>not dead
lol k
>>
>>61324920
Happy to help.
People recommend it for compiler writers though and it's certainly viewing itself as such. So that's why I have to discredit it as such.
>>
>>61324894
you don't need to construct a list with a for loop. the file object already has a readlines() method. but if you were making a list, you shouldn't use a dict, just make an empty list and use .append()
>>
>>61324999
>lower than COBOL and Fortran
hahahahaha
>>
>>61324898
Everybody has to start from somewhere.
>>
>>61325009
Ah, thanks. Never really use python, so thats neat.
>>
>>61324898
there is nothing wrong with this retard

what would you change here?
>>
>>61325022
The people writing code for it are clearly retarded though. It's going nowhere.
>>
>>61324894
import argpass
import random
def get_random(file):
with open(file, "r") as _file:
lines = _file.readlines()
return random.choice(lines)
parser = argpass.ArgumentParser(description="Print out random line from inputfile")
parser.add_argument('file', metavar='FILE',type=str,nargs='+=',help='Get a random line from file FILE',action='store_const',default=get_random)

Retard.
>>
>>61325035
Seriously? I can spot at least 9 major flaws in that image. Go get your head checked you underage dumbfuck.
>>
>>61324999
it's always been about there
>>
>>61321718

kek, if you accepts Islam, forget about open source. That's haram!
>>
>>61325035
First time programming, kid?
>>
>>61325064
def get_random(file):
with open(file, "r") as _file:
lines = _file.readlines()
return __import__('random').choice(lines)
parser = __import__('argpass').ArgumentParser(\
description="Print out random line from inputfile")
parser.add_argument('file',
metavar='FILE',
type=str,
nargs='+=',
help='Get a random line from file FILE',
action='store_const',
default=get_random)
>>
Why does this throw an NullPointerException?

public class Dummy {
public Dummy() {
this.rand = Math.random();
}

double getRand() {
return this.rand;
}

private double rand;
}


Dummy[] arr = new Dummy[10];

for (int i = 0; i < arr.length; i++) System.out.println(arr[i].getRand());
>>
>>61325112
That physically hurts to look at
>>
>>61325107
>>61325086

>can't tell what's wrong with the image

kek
>>
>>61325035
>what would you change here?
Everything. Let's start with the fact that it's not a parser.
>>
what is the most christian white nationalistic programming language?
>>
>>61325123
You have created an array of Dummy, but you have not placed any Dummy objects in the array.

arr is an array of 10 null pointers.
>>
>>61325138
Rust
>>
>>61325138
x86 Assembly
>>
>>61325138
HolyC
>>
>>61321835

whne you begin using a browser made by faggots and trannies.
>>
>>61325127
A bit like you, fuckface. You belong on the bottom of my boot.
>>
>>61325146
allright, should have figured that out myself, thanks
>>
>>61325166
Excuse me?
>>
/dpt/, are there any real use cases for nested functions?
>>
>>61325166
Were you hit as a child? How on earth is that related to anything
>>
Why is /dpt/ always so hostile?
>>
>>61325185
>nested functions
explain
>>
>>61325138

D
>>
>>61324732

import std.stdio, std.algorithm, std.random, std.file, std.range;

void main(string[] args)
{
auto lines = File(args[1]).byLineCopy.array;
lines[uniform(0, lines.length)].writeln;
}
>>
>>61324732
->(file) { puts File.readlines(file).sample }.(ARGV[0].to_s)
>>
>>61325214
Dropping parens on function calls, especially those with side effects, is awful style.
>>
>>61325197
int one(void)
{
int two(void)
{
int three(void)
{
return "3";
}
return "2";
}
return "1";
}
>>
>>61325228
>side effects
>>
>>61325192
Faggot
>>61325185
>>61325197
function makeCallbackCreator(timeout) {
return function CallbackCreator(time=timeout){
return function callback(t=time) {
setRefreshCallback(t);
}
}
}
>>
>>61325257
>what is a closure
>>
>>61325257
nigga pls
fs.readdir(source, function (err, files) {
if (err) {
console.log('Error finding files: ' + err)
} else {
files.forEach(function (filename, fileIndex) {
console.log(filename)
gm(source + filename).size(function (err, values) {
if (err) {
console.log('Error identifying file size: ' + err)
} else {
console.log(filename + ' : ' + values)
aspect = (values.width / values.height)
widths.forEach(function (width, widthIndex) {
height = Math.round(width / aspect)
console.log('resizing ' + filename + 'to ' + height + 'x' + height)
this.resize(width, height).write(dest + 'w' + width + '_' + filename, function(err) {
if (err) console.log('Error writing file: ' + err)
})
}.bind(this))
}
})
})
}
})
>>
>>61325265
>what is a meme
>>
>>61325035
just an example

(html[cursor + 1] == 'h' && html[cursor + 2] == 'r') ||
(html[cursor + 1] == 'b' && html[cursor + 2] == 'r')

should be

(html[cursor + 1] == 'h' || html[cursor + 1] == 'b' ) && html[cursor + 2] == 'r')
>>
>>61325228
UFCS specifically is for making your code cleaner, fuck off pajeet.

thing.Func().Func2();


looks hideous
>>
>>61325276
That is just not okay
>>
>>61325185
Yeah. Its my preferred method of writing functions for local code. I don't like lambda syntax in C++.
But it's not portable. I use GCC.

I wish C had them.
In other languages lambdas aren't a stupid hack so you'd probably use those there and be happy with it.
>>
Newfag here. Can someone please tell me why my C code won't run?

#include<studio.h>

static main()
{
printf("Hello World");

}
>>
>>61325306
writeln isn't a variable, kill yourself
>>
>>61325323
works on my machine

what error are you getting?
>>
>>61325323
#include <stdio.h>

int main(void)
{
printf("Hello World");
}

Your meme is bad, your bait sucks, and you should fuck off back to India pajeet, but i cant stand to not correct that shit
>>
>>61325329
?
>>
>>61325329
>so stockholmed by the Sepples menace he cant conceive of the logic and power of UFCS.

wew
>>
File: puutarhakisse.jpg (56KB, 440x573px) Image search: [Google]
puutarhakisse.jpg
56KB, 440x573px
>>61325276
>
            })
}.bind(this))
}
})
})
}
})
>>
>>61325357
UFCS is fine, but paren-dropping is utterly illogical.
>>
>>61325349
the program might still not print anything to terminal because you forget "\n".
dumb faggot poster.
>>
>>61325372
>the program might still not print anything to terminal because you forget "\n".
lmao
back 2 school kid
>>
>>61325372
Im sorry, i dont work on shit-systems
>>
>>61325393
in printf it flushes the output stream.
dumb faggot.
>>
>>61325372
>Average C programmers of /g/
>>
new thread
>>61325401
>>
>>61325372
that's not how "\n" works you ape
>>
>>61325372
Anon. I'm afraid to tell you your C++ tumor may be impossible to remove.
\n isn't std::endl.
\n doesn't flush. (which is good)
>>
>>61325370
>but paren-dropping is utterly illogical.
Its really not.

Im sorry your head is so fucked by namespaces, but youre never going to mistake array invoking as variables.
>>
hey /g/
so I've been teaching myself how to program by using resources such as FreeCodeCamp and Team Treehouse online for the past month, but wanted to know if I should work on my theory of computer science or mathematics as I don't have a strong background in either of them. I'm looking to become a front or back end web developer. Are there any resources or books you could recommend for me?
>>
>>61325428
>>61323934
>>
>>61325436
Namespaces have literally nothing to do with this.
Function application should be obvious, simple as that.
>>
>>61325436
>Its really not.
>Im sorry your head is so fucked by namespaces, but youre never going to mistake array invoking as variables.

translated: Im too lazy to type () so im gonna argue with anons on the interwebz lol xd zozzle
>>
>>61322117
guys
>>
>>61325428
>. (which is good)
No, it's not good, and it's not bad. It's just something you should know and use it accordingly you fucking brainlets.
Thread posts: 322
Thread images: 41


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