[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 319
Thread images: 40

File: dpt.jpg (202KB, 727x822px) Image search: [Google]
dpt.jpg
202KB, 727x822px
Old thread: >>61246538

What are you working on, /g/?
>>
Thanks for using anime picture.
>>
>>61252761
>>>>>>>>>>/literallyanywherebuthere/
>>
>>61252761
Is that the elusive programmer (male)?
>>
>>61252761
Fourth for white ethnostates
>>
Programming is haram, please stop doing this
>>
>>61252761
Not gonna lie this is some top tier shitposting. Honestly it's kinda funny, but it completely derails what little interesting conversation these threads have, so I wish you would stop.
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
>>61252761
Allahu akbar.
>>
>>61252761
It is haram for female to do such things
>>
>>61252874
what do you mean? Surely we're past the whole girl programmers meme.
>>
>>61253129
There are no male programmers
>>
WTF is with all these mudslime pics?
>>
>>61253193
Anime image
>>
>>61253193
>mudslime
Excuse me?
>>
>>61252761
>>>/pol/
>>
>>61253193
Allah teach us how to deal with women.
>>
>>61253214
He meant to say shitskin
>>
>>61253214
I will not excuse you.
>>
>>61253224
What the heck is your problem

>>61253229
Buzz off you bean head
>>
>>61253236
Fuck off back to rebbit/facebook/wherever you came from.
>>
more, opie, pls keep posting these
>>
>>61253250
>Even responding to low tier bait like that
>>
What is the best programming language?

>>61253236
>bean head
Please don't use anti-mexican slurs
>>
So, the tranny poster has converted to islam, I see.
>>
I'm working on getting alpha and sportive.
>>
File: 1417946933474.jpg (433KB, 852x973px) Image search: [Google]
1417946933474.jpg
433KB, 852x973px
>>61252761
C
>>
>>61253261
C
>>
File: 1406803019377.jpg (103KB, 1280x720px) Image search: [Google]
1406803019377.jpg
103KB, 1280x720px
27 posts in and it's nothing but pure shitposting.
The image affects the quality of these threads. Stop posing this stupid shit.
>>
>>61253271
>>61253281
Why?
>>
>>61253295
Buzz of you bean head
>>
>>61253295
/dpt/ is a lost cause
>>
>>61253295
>27 posts in and it's nothing but pure shitposting.
So the image had no effect?
>>
>>61253295
How about people just learn to behave?

/dpt/ has always had cute anime girls with programming books. Why is it that their religion seems to matter all of a sudden?

Is it so hard to be just a little bit tolerant?
>>
>>61253308
Exactly, /dpt/ has always been shitposting the first 100 posts in or so.
>>
C is just as much of a joke as Go.
Neither have generics.
>>
>>61253236
>What the heck is your problem
Muslims
>>
>>61253314
>>>/pol/
>>
File: 1491252657762.jpg (634KB, 1600x1200px) Image search: [Google]
1491252657762.jpg
634KB, 1600x1200px
>tfw you just discovered all the built-in unit testing features of Visual Studio

And here I was console debugging all these years. So much wasted time.
>>
>>61253327
Just put up with it, it's just a pic.

Stop sperging out over small unimportant details.
>>
>>61253331
>testing
sounds like wasted time to me
>>
>>61253329

I am not the one getting triggered by a simple image, you retard.
>>
File: Hol Horse and J Geil.jpg (185KB, 640x480px) Image search: [Google]
Hol Horse and J Geil.jpg
185KB, 640x480px
>Made the decision to get off my ass and learn programming to get a career in tech because retail simply doesn't pay enough
welp time for suicide

I'm guessing it's HTML/CSS into Javascript into something like Python/Ruby
>>
>>61253357
>Wrong cartoon Eddy
>>
>>61253314
>Why is it that their religion seems to matter all of a sudden?
I should not be able to see what their religion is, it's a distraction. Also, muslim clothes are so NOT kawaii.
>>
File: 1497921391118.jpg (55KB, 960x461px) Image search: [Google]
1497921391118.jpg
55KB, 960x461px
>>61253341
This is what the great replacement looks like

>>61253357
If you want to learn about that stuff /wdg/ will be of more help. Here you'll only get memes and language shitflinging
>>
>>61253357
html and css aren't programming languages, anon. maybe you should head over to web dev. xD
>>
>>61253377
I know, but it's something like a training step before jumping into the first level of a vidya
>>
File: chen_face.png (68KB, 289x398px) Image search: [Google]
chen_face.png
68KB, 289x398px
>>61253261
>What is the best programming language?
Mathematica.
>>
>>61253402
>first level of a vidya
If you want to make videogames, make videogames. Go hit up /vg/avgd/, use Unreal or Unity or even Love2D, and stay the fuck away from /g/. This board is hostile as fuck to anyone who wants to make applications, let alone videogames, and you'll be bombarded by memes about software ethics and language theory.
>>
>>61252761
Gotta learn how to write C so she can program microcontrollers for detonators amirite?
>>
>>61253502
Pretty sure the American and Russian arms that they purchase "just werk" out of the box. Click a few mechanical buttons and they're set.
>>
>>61253539
>purchase
that's a funny way to spell "are given by the CIA and Mossad"
>>
File: Screenshot_2017-07-06_22-12-18.png (165KB, 723x1458px) Image search: [Google]
Screenshot_2017-07-06_22-12-18.png
165KB, 723x1458px
Why does bash look so good? Why aren't you shell scripting right now?
>>
This thread is pathetic. It is not about programming. It's just a bunch of computers illiterates and first semesters memeing about whatever they just learned.

A quick search shows that most arguments used here are not original and have been copied from some trendy tech blog or other shit site.

The only real programming questions I have seen so far are from beginners(it's fine to be a beginner btw).

This entire site is shit and I don't know why anyone would regularly come here.
>>
>>61253842
I've been using it more frequently. Quite useful.
>>
>>61253849
>This entire site is shit and I don't know why anyone would regularly come here
There's plenty of worthwhile discourse to be had. Fuck off back where you came from, newfag.
>>
File: golang.png (69KB, 600x600px) Image search: [Google]
golang.png
69KB, 600x600px
Has there ever been a more vomit-inducing language?
>>
>>61253871
>newfag
>>>/r/TheDonald
>>
>>61253876
yes
>>
>>61253876
Yes.
>>
>>61253910
[kode]If userValue = "1" Then[/kode]

Tell em this is wrong please.
>>
>>61252761
Best online programming course to learn?
>>
>>61254016
What did she mean by this?
>>
>>61254010
no, that's correct. there is no == in visual basic.
>>
File: 8.webm (3MB, 1024x768px) Image search: [Google]
8.webm
3MB, 1024x768px
>>61252761

Tunnels and FOV distorts in my GLSL raymarcher
>>
>>61253261
Mat-lab
>>
File: cute-girl.jpg (44KB, 564x762px) Image search: [Google]
cute-girl.jpg
44KB, 564x762px
>>61254029
I'm upset.
>>
>>61254016
https://www.coursera.org/learn/build-a-computer/lecture/l4EGm/unit-6-1-assembly-languages-and-assemblers
>>
>>61254051
Would you be more or less upset if you were aware that "ain't" is visual basic syntax for is not?
>>
>>61253849
I know the feeling, everywhere on the net feels about ankle deep (knowledge wise) now, if you swim for the deep end you'll get dragged back with shitposting or morons LARPing at being programmers asking basic questions.
>>
>want to learn lots of useful shit this summer
>probably wont have the time because too busy procrastinating
>back to school where I only waste my time doing useless shit.
>>
File: ready_to_kill.png (176KB, 560x530px) Image search: [Google]
ready_to_kill.png
176KB, 560x530px
>>61254061
STOP
>>
>>61254097
They might have stopped before adding it actually
>>
>>61254085
That was pasta but since you replied seriously.

Yeah, internet forums have never been great but social media made it much worse.
I kinda gave up on browsing any forum looking for serious info. Now I basically use the internet to read docs and download books.
Kinda sad. I miss being able to talk to people with the same interests.
>>
File: 1499337400268.png (158KB, 724x829px) Image search: [Google]
1499337400268.png
158KB, 724x829px
>>61254061
マジがよ?
VS pajeets should just be wiped off of this earth desu.
>>
>>61254092
School isn't useless, kid. Finish high school. Until you do, please refrain from posting on 4chan.
>>
>>61254097
>>61254133
apparently it was just a joke that literally everyone believed
>>
File: (You).jpg (427KB, 1361x810px) Image search: [Google]
(You).jpg
427KB, 1361x810px
>>61254151
>>
>>61254160
no, I mean i believed it too
>>
>>61253374
this
covering up the woman as much as possible is the opposite of what most men would like to look at, retarded religion rules for a dumbfuck religion
>>
>>61252761
decentralized torrent hosting. Since all the popular torrent sites keep getting taken down
>>
>>61254151
Probably because everyone thought "Visual Basic is actually stupid enough to do something like that".
>>
>>61253326
Uhh it has generics you just have to make them yourself
>>
>>61254209
zeronet
>>
>>61254223
void* is generics
>>
>>61254257
no
>>
>>61253261
Common Lisp
>>
>>61254175
Christians do it as well
>>
>>61254310
void* isnt great but its better than templates
>>
>>61253842
Bash is useless for anything but init scripts. It's ugly and slow.
>>
>>61254366
Bash is the undisputed king of automating shit.
Really, it's just a way to glue sed, awk, grep, curl, and other shit like that together. I've written lots of handy little bash scripts which automate a lot of the stuff I do.
>>
>>61254449
No, bash is slow as shit. dash and ksh BTFO of it for general automating shit.
>>
>>61253331
D has unit testing built into the language
>>
>>61254471
Performance is not an issue for most of that sort of shit.
Most of my shell scripts are like 50 lines long and are mostly bottlenecked by network transfers.
>>
>>61254449
Most decent FP languages can do much better
>>
>>61254490
And COBOL had a new standard released in 2014.
Why the hell are you brining up irrelevant shit?
>>
>>61254471
>Benchmarking shells
Top quality autism
>>
>>61254492
>Performance is not an issue for most of that sort of shit.
By "most" you mean most of what you do. Which is not necessarily what everybody does.

>Most of my shell scripts are like 50 lines long and are mostly bottlenecked by network transfers.
bash is fine for that.
>>
>>61254503
Unit testing is not irrelevant to the post I replied to. Are you uneducated or autistic?
>>
>>61254507
>what are embedded systems?
One day you'll grow up, kid.
>>
>>61254515
D is a dead language, and is not relevant to any discussion.
Stop bringing up old, irrelevant shit.
>>
>>61254522
Why the fuck would you run shell scripts on an embedded system?
>>
>>61254525
>Stop bringing up old, irrelevant shit.
>on a Linux thread
This IS a thread about old, irrelevant shit!
>>
>>61254533
>on a Linux thread
This is /dpt/.
>>
>>61254528
Because they're flexible.
>>
>>61254525
C is irrelevant and old
>>
>>61253842
Bash is the ugliest commonly used non-esoteric language on earth.
>>
>>61254525
How can a language have lives? What kind of an autistic manchild thinks that way?
>>
>>61254539
This is /g/. All of /g/ is about GNU/Linux.
>>
>>61254554
No. Perl is uglier.
It seems like Perl's usage has dropped right off, though.
>>
main = print dpt // prints '9'

dpt :: Integer
dpt = the (first (number `besides` 1 `such_that` (it_is_odd `and` it_is_square)))


the = id
first = head
number = [1..]
such_that = flip filter
it_is_odd x = x `mod` 2 == 1
it_is_square n = sq * sq == n
where sq = floor $ sqrt $ (fromIntegral n::Double)
and f y = \x -> (f x) && (y x)
besides list x = (filter (/= x)) list

why is Haskell so perfect?
>>
>>61254503
>>61254525
>Being butthurt over a supposedly "dead" language
100 bucks say this one is C tard
>>
>>61254525
>D is a dead language
D is no deader than LISP, Haskell, Scheme, Lua, Rust and a bunch of memey shit /g/ keeps sperging about.
>>
>>61254543
If they are "flexible", why not run bash?
>>
>>61254570
All of those languages actually see some use in an established niche.
Nobody uses D.
>>
>>61254573
Because I have a deadline.
>>
>>61254565
What does it do?
>>
>>61254586
Go write x86 asm then
>>
>>61254587
it prints the first number besides 1 such that it is odd and square
>>
File: nazi-kirk-580d74b125f68.jpg (31KB, 525x469px) Image search: [Google]
nazi-kirk-580d74b125f68.jpg
31KB, 525x469px
>>61254584
Nice try, but D is more used than all of those combined.
>>
>>61254584
what is a ""niche""?
>>
>>61254602
That is flat-out wrong.
Lua alone kicks the shit out of D.
>>
>>61254599
So it basically looks for 9?
>>
>>61254609
Regarding what?
>>
>>61254609
>LOOa
Take your skid shit to /wdg/
>>
>>61254565
it_is_odd = odd
it_is_square = (==) <*> (square . floor . (sqrt :: Double -> Double) . fromIntegral)
square = ((*) >>= id)
and f y x = f x && y x
>>
>>61254622
>inb4 basic bitches ask me how i derived it_is_square and square
this is programming 101 guys
>>
>>61254620
>muh LOO ah!
>>
>>61254631
Poo(LOO) ah!
>>
reminder that VB6 is the best programming language ever created
>>
>>61254617
Being a shitty skid garbage
>>
idea guy here

right to left programming
>>
>>61254622
how did you derive it_is_square and square?
>>
File: TIOBE.png (49KB, 806x890px) Image search: [Google]
TIOBE.png
49KB, 806x890px
>>61254609
You better sit down for this...
>>
File: 1350187647300.jpg (49KB, 285x279px) Image search: [Google]
1350187647300.jpg
49KB, 285x279px
>>61254649
>2011+6
>not justifying your source code

ISHYGDDT
>>
I see that /dpt/ hasn't' changed and it's still filled with armchair computer scientists, elitist Lisp NEETS, Rust shills, the gatekeeper, and freshman college students who are too lazy / stupid to do their own work.
>>
>>61254652
programming 101
>>
>>61254657
Sir pls delet this
>>
>>61254597
Not flexible.
>>
>>61254669
Neither is "embedded systems"
>>
>>61254661
And people thought OP photos of girls in hijabs would change the threads!
>>
>>61254565
>tfw you will never reach this level of clarity in code
why even live?
>>
>>61254677
You gotta work with what you gotta work, son.
>>
File: elissa-downie.jpg (31KB, 956x500px) Image search: [Google]
elissa-downie.jpg
31KB, 956x500px
>>61254597
>x86
>on embedded systems
>>
>>61254565
you can actually do

the first (...)
rather than
the (first (...))

since the = id
>>
>>61254657
>Variable declaration is global by default, and looks exactly like assignment.
>a dereference on a non-existing key returns nil instead of an error. This, coupled with the above point makes misspellings hazardous, and mostly silent, in Lua.
>If a vararg is in the middle of a list of arguments only the first argument gets counted.
>can hold only one vararg at a time(in ... )
>can't store varargs for later.
>can't iterate over varargs. KEK
>can't mutate varargs directly.
>can pack varargs into tables to do these things, but then you have to worry about escaping the nil values, which are valid in varargs but signal the end of tables, like \0 in C strings.
>Table indexes start at one in array literals, and in the standard library. You can use 0-based indexing, but then you can't use either of those things.
>break, do while (while (something) do and repeat something until something), and goto exist, but not continue. Bizzare.
>break, do while (while (something) do and repeat something until something), and goto exist, but not continue. Bizzare.
> default string library provides only a subset of regular expressions, that is itself incompatible with the usual PCRE regexes.
>No default way to copy a table. You can write a function for that which will work till you'll want to copy a table with __index metamethod.
>No way to impose constraints on function arguments. 'Safe' Lua functions are a mess of type-checking code.
>Lack of object model leads to inconsistencies
>the string type can be treated like object, assigned a metatable and string values called with methods. The same is not true for any other type.

>2017
>Muh LOO uh!!
>>
File: OUT.png (367KB, 616x616px) Image search: [Google]
OUT.png
367KB, 616x616px
>>61254175
>encouraging thothery
Out.

>>61253374
>muslim clothes are so NOT kawaii
OUT OUT OUT!!!!
>>
>>61254725
>Pajeet tier garbage
>Literally rhymes with Poo in loo
No wonder /g/ likes it
>>
>>61254725
Absolutely disgusting
>>
>>61254751
It was literally created in a third world country.

/g/ just likes it because of muh functional meem.
>>
I'm trying to create a script to skip the comment page from MyFigureCollection and open the pic directly in a new tab. This is the code i'm using:

function openInNewTab(url) {
var a = document.createElement("a");
a.target = "_blank";
a.href = http://myfigurecollection.net/picture/;
a.click();
}

// And then
openInNewTab("http://s1.tsuki-board.net/image/");

The problem is: it's not working.
I'm a newfag in programming and i dont know too much about JS, if you guys can help me to fix this code, i'd appreciate.
Thank you.
>>
>>61254766
>LOO uh
>Functional
what do you mean functional?
>>
>>61254725
Bubububut muh LOOua jeet!
>>
>>61254771
Oh I forgot, if it's not 100% PUUUURE FUNCTIONAL!!!!111!1 you faggots consider it treyf.
>>
>>61254766
Lua is not functional, it's procedural that proceds to pure garbo, don't lump us to looa jeets
>>
>>61254777
kek, reminds me of Pajeets at work who thought they were Haskell wizards when Java 8 came out.
>>
File: 19883945.jpg (45KB, 679x567px) Image search: [Google]
19883945.jpg
45KB, 679x567px
>Bullying lua
Do you people steal candy from babies too?
>>
>>61254801
I actually tried to have a look at lua some time last month, their fucking website was down
>>
>>61252761
>Hajib
This isn't even funny
>>
>>61254840
This. A good loli is a naked loli. Who needs dress - free those boobs
>>
>>61254849
>loli
>boobs
???
>>
Do you guys listen to music while you work? I've recently taken to listening to electronic when programming. What d'y'all think?
>>
File: 1429037809603.png (160KB, 463x179px) Image search: [Google]
1429037809603.png
160KB, 463x179px
>>61254858
>>
File: wtf?.png (408KB, 558x689px) Image search: [Google]
wtf?.png
408KB, 558x689px
>>61254868
>work
>programming
>>
File: this.gif (705KB, 320x320px) Image search: [Google]
this.gif
705KB, 320x320px
>>61254858
?
>>
File: 1494915123670.png (461KB, 611x686px) Image search: [Google]
1494915123670.png
461KB, 611x686px
>>61254366
>>61254471
>It's ugly and slow
>slow as shit
In what use cases? It's faster than Python and other interpreted languages in many cases (and it's better looking than Python). CPython startup:
$ time python3 empty

real 0m0.053s
user 0m0.040s
sys 0m0.016s

Python takes 50ms just to startup!
Bash startup:
$ time bash empty

real 0m0.004s
user 0m0.000s
sys 0m0.000s

Bash is over a factor of 10 faster in that regard.
Growing an array and associative array in bash:
array=()
declare -A as_array
for ((i=0; i<1000; i++)) {
array+=($i)
as_array[$i]=$i
}
echo "${#array[@]}" "${#as_array[@]}"

$ time bash test
1000 1000

real 0m0.035s
user 0m0.028s
sys 0m0.004s

And in Python:
array = []
dict = {}
for i in range(0, 1000):
array.append(i)
dict[i] = [i]
print(len(array), len(dict))

$ time python3 test2.py
1000 1000

real 0m0.057s
user 0m0.056s
sys 0m0.000s

Bash wins again, very fast.

Now, if you want to pass arguments, verify a pathname, perform tilde expansion, and perform wildcard expansion in Python, you have to import:
>os.path
>sys
>glob
And have conditionals such as:
if os.path.exists(glob.glob(os.path.expanduser('~/python/*/trash'))) and os.path.exists(
glob.glob(os.path.expanduser('~/python/*/moretrash'))):
do something

Wheres in bash it's simply:
if [[ -d ~/python/*/trash && -d ~/python/*/moretrash ]]
then
do something
fi

At this point why even use Python? Bash is faster, less verbose, and just better, and Python is just trash, as proven in my extensive tests.
>>
>>61254945
Absolutely BTFO
>>
Why are you not programming in AS3 in __currentYear___ anon?
function Adaptive_Multiplication(x:*, y:*):*
{
switch(typeof(x)) {
case "string":
if (y is String) return (String.fromCharCode(x.charCodeAt(0) * y.charCodeAt(0)));
if (y is Number) return (String.fromCharCode(x.charCodeAt(0) * Number(y)));
break;
case "number":
if (y is String) return (Number(x) * y.charCodeAt(0));
if (y is Number) return (Number(x) * Number(y));
break;
case "object":
if (x is Vec3 && y is Vec3) return new Vec3(x.x * y.x, x.y * y.y, x.z * y.z);
break;
} throw "TypeError :: No suitable operation for types: " + String(typeof(x)) + " and " + String(typeof(y));
}
>>
Is it possible to render a webpage in the background and take a screenshot of it? Like, I could be browsing a vietnamese water puppet board and in the background I have a web scrapper which, I dunno, browses stackoverflow and takes screen shots of questions.
>>
>>61254945
>python
>bash
use haskell
>>
>>61254975
>Flash
security flaws
>>
>>61254999
>security flaws
But thats half of the fun Anon
Nothing is better than a language that can crack its own sandbox
>>
>>61254945
>comparing it to full blown programming languages
Nice way to make it look good, but it entirely misses the point. We were discussing it as a shell. Compare it to other shells, you cringey sperg.

>muh extensive tests
You did that trying to look smart and it only made you embarrass yourself.
>>
>>61252761
How do you program a bomb?
>>
>>61255027
https://en.wikipedia.org/wiki/Fork_bomb
>>
>>61255031
I'm talking about a dick shaped bomb that you can stuff inside her ass.
>>
>>61254945
>Python is getting BTFOd by _BASH_ of all languages
Kek. They should just give up by now.
Bash is still a pile of steaming shit btw.
>>
File: Ambient.jpg (3KB, 45x110px) Image search: [Google]
Ambient.jpg
3KB, 45x110px
>>61254868
ambient is good, try gas - pop
>>
>>61255093
HJAHAAHAHA what the fuck why did I save a thumbnail REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>61255093
Is this music for ants?
>>
Help,

object::object( thing *x, double w)

When I try to create an object it just tells me cannot convert double to object*, wtf am I doing wrong?

Object* obj(thing *tp, double at);
>>
>>61252761
Thank you for using an Islamic image.

Representation matters.
>>
>>61255109
Have you tried killing yourself?
>>
>>61255017
>comparing it to full blown programming languages
Bash is an extensive language, and is comparable to Python. The comparison would be valid even if bash was a toy language.

And what's wrong with comparing to "full blown" languages? When Python monkeys get compared to a "full blown" aka real language like C, Rust, etc, they cry the reverse of what you're saying, i.e.:
>b-but my modules
>fast to develop < performance
>django
And the classics such as
# A simply Twitter bot:
import twitter

and
# A simply very simple simple web
import HTTP
import webserver

Basically, you have no arguments, and cannot list a single performance deficiency pertaining to Bash and are now backpeddling.
>>61255079
>Bash is still a pile of steaming shit btw.
In what way? I think it's alright, which is enough for a shell.
>>
>>61255109
Anon...
auto obj = std::make_unique<Object>();
>>
>>61255125
>you are now backpedaling
No. You moved the goalposts by comparing bash to Python. I don't give a fuck about Python, I never automate anything in Python. I can't afford to have an entire Python environment in the small embedded systems I automate, I need to use the default shell, and I need the default shell to be something lightweight. If you look at my previous post (namely this one >>61254471), you'll see I'm not backpedaling because I explicitly mentioned examples like dash and ksh.

Now just stop shilling for bash/trolling/being dumb.
>>
>>61254945
>as_array[$i]=$i
>dict[i] = [i]
are you sure these two are equivalent?
>>
Is it possible to render a webpage in the background and take a screenshot of it? Like, I could be browsing a vietnamese water puppet board and in the background I have a web scrapper which, I dunno, browses stackoverflow and takes screen shots of questions.
>>
>>61255756
>Taking screenshots of text
Just fucking save the text.
>>
>>61255139
>explicitly mentioned examples
No, you made a blanket statement of "slow as shit", to which I asked "In what use cases?".
>I need the default shell to be something lightweight
Yes, dash is lighter than bash, then as such suits you use case. But performance wise, "slow as shit"? Is this from personal use cases, or have you just decided that that's the case?
Tests done here don't show "slow as shit", just slower than dash: https://unix.stackexchange.com/questions/148035/is-dash-or-some-other-shell-faster-than-bash
Once again, this is case-specific, not something you would notice in general shell use, and as such your claim doesn't hold; if I'm being dumb, then you're being dumber for bashing bash so baselessly.
>>61255623
declare -A
creates an associative array, aka dictionary, so yes, the arrays are more or less identical in terms of hashed key/value pairs. But the Python code should be
dict[i] = i
instead of storing the int in a list, although this is negligible.
>>
>>61255913
>although this is negligible.
i doubt that
>>
Why do people use shitty languages like Java or C# or C++?
>>
>>61256063
What shitty language do you use?
>>
>>61256063
Because they are useful.
>>
>>61256072
(((Rust))), C, and D
>>
>>61254945
>why use python
I question this myself. Why did a language made in 91 come out of nowhere 13 years later and just explode?
It doesn't have any good selling points even.
>>
>>61256063
>shitty
>java
you mean jvm
>>
>>61256097
I actually think JVM is the only good thing about Java
>>
>>61256097
No, I mean Java. JVM is excellent.
>>
Post more rare yurus
>>
>>61256100
>>61256102
What? How is the JVM supposed to be "good"?
>>
>>61256094
all shitlangs, write LISP
>>
>>61256094
>Rust
Annoying as fuck since it forces safety down your throat and fucks your ass if you do anything that is not overly complicated and "unsafe"
>C
There's no reason to use C if you're not working on things like embedded systems or kernels
>D
Pretty good but has GC, might as well use C#
>>
>>61256111
It goes fast.
>>
>>61256113
>(((LISP)))
I am more interested in Idris
>>61256117
>Pretty good but has GC, might as well use C#
Bad comparison. D is miles better and faster than Microsoft Java#
>>
>>61256120
It's significantly slower than C, and the JVM has a massive start-up penalty.
>>
>>61256129
Not really
https://benchmarksgame.alioth.debian.org/sometimes-people-just-make-up-stuff.html
>>
>>61256129
>It's significantly slower than C
That applies to just about every language, including languages which are compiled to machine code and lack a GC.
What interpreted/garbage collected language is faster than Java on JVM?
>>
>>61256138
>>61256100
>>61256094
Why was sakurano so warm?
>>
>>61256143
Swift
It uses reference counting instead of classic gc tho
>>
>>61256096
>rusts so irrelevant it's not even on the graph
>>
>>61256156
Swift is not faster than C
>>
>>61256156
Swift compiles to machine code and reference counting is not GC.
>>
>>61256163
(((Rust))) was released in 2015.
>>61256096
>I question this myself. Why did a language made in 91 come out of nowhere 13 years later and just explode?
Gradual influx of brainlets
>>
File: 1442801674517.jpg (100KB, 540x394px) Image search: [Google]
1442801674517.jpg
100KB, 540x394px
>>61256206
>Gradual influx of brainlets
Coming from an anime poster who's spamming the thread (again). Don't you ever ask yourself where it went so wrong for you?
>>
>>61256226
This, next time I'll report you
>>
I am trying to color the terrain more earth like.
My problem is, how to approach the next steps.
Do I create a new object for every height area?
OR just assign the new colors?

public RGBColor computeColor (float height, float slope, TerrainInformation info){    
float percentage = height / 100f;
RGBColor ex = new RGBColor(0,0,0);
if((height < 20f*percentage){
ex.red = 0;
ex.green = 0;
ex.blue = 255;
}
if( height<getWaterHeight() && height <getWaterHeight()+25f){
ex.red =250;
ex.green = 250;
ex.blue= 210;
}
if(height <0.65f) {
ex.red =44;
ex.green =176;
ex.blue= 55;
}
if(height <0.75f){
ex.red = 184;
ex.green = 176;
ex.blue = 155;
}
if(height < 1f){
ex.red = 238;
ex.green = 233;
ex.blue = 233;
}
else{
System.out.println("nope");
}

return ex;
}
>>
newbie here trying to learn python on codecademy

can anyone tell me why im getting a syntax error on the elif line?

def shut_down(s):
if ():
s = "yes"
return "Shutting down"

elif ():
s = "no"
return "Shutdown aborted"

else:
return "sorry"
>>
>>61256230
>Coming from an anime poster who's spamming the thread (again). Don't you ever ask yourself where it went so wrong for you?
Coming from an anime poster who's spamming the thread (again). Don't you ever ask yourself where it went so wrong for you?
>>
>>61256239
>if ()
>elif ()
What the fuck are you doing?
>>
>>61256226
>>61256233
Did I touch your unmentionable body parts in a wrong way? You sound upset.
>>
>>61256230
Oh the irony
>>
>>61256270
What did you do again?
>>
>>61256263
i have no idea, codecademy is fucking shit.

here are the instructions:
First, def a function, shut_down, that takes one argument s. Don't forget the parentheses or the colon!

Then, if the shut_down function receives an s equal to "yes", it should return "Shutting down"

Alternatively, elif s is equal to "no", then the function should return "Shutdown aborted".

Finally, if shut_down gets anything other than those inputs, the function should return "Sorry"
>>
>>61256266
>Posts the same character over and over
>They add no value to your posts, except for you trying to identify yourself.
That is textbook avatarfagging, which is against the rules.
>>
File: 15822597.jpg (5KB, 370x334px) Image search: [Google]
15822597.jpg
5KB, 370x334px
>>61256282
Can you rephrase?
>>
>>61256278
def shut_down(s):
if s == "yes":
return "Shutting down"
elif s == "no":
return "Shutdown aborted"
else:
return "Sorry"
>>
File: 1499260228053.jpg (39KB, 394x360px) Image search: [Google]
1499260228053.jpg
39KB, 394x360px
>>61256292
thanks. fuck i'm going to just buy a textbook instead. fuck codecademy.
>>
File: autism.jpg (12KB, 263x192px) Image search: [Google]
autism.jpg
12KB, 263x192px
>>61256239
>if ()
What the actual fuck?
>elif ()
Anon?
>>
>>61256280
Hello, plebbit. How is your first week in 4ch*n?
>If you are persistently attaching unrelated images of a particular character to your posts in an effort to uniquely identify yourself and roleplay as a character, then you are avataring.
>>
>>61256292
def shut_down(s):
if s == "yes":
return "Shutting down"
if s == "no":
return "Shutdown aborted"
return "Sorry"
>>
>>61256239
Automate the boring stuff with python

Download the pdf, work through that
>>
>>61256320
>>If you are persistently attaching unrelated images of a particular character to your posts in an effort to uniquely identify yourself and roleplay as a character, then you are avataring.
Yeah, that's exactly what your doing
>>
>>61256327
thank you
>>
>>61256312
>if ()
Pretty sure this evaluates to falsey:
>>> () or 1
1

So equivalent to if False
>>
>>61256328
>Yeah, that's exactly what your doing
So where did I identify and roleplay any of the "characters" I posted again?
>>
>>61256320
What the fuck are you going on about?
Are you claiming that's NOT what they're doing? Why the fuck did you censor yourself? Whoms't are you quoting?
>>
>>61256341
You don't have to identify yourself as one of the characters to be an avatarfag.

But thanks for proving yet again that literally every avatarfag is an annoying attention whore
>>
>>61256342
>>61256341
>>
>>61256353
>You don't have to avatarfag to be an avatarfag
Are you still upset?
>>
>>61253261
Perl, by far.
>>
>>61256367
Perl is for girls
>>
File: Captura.png (27KB, 589x527px) Image search: [Google]
Captura.png
27KB, 589x527px
Which one, /dpt/?

When I first learned Perl around 2001-2002 I used ActivePerl and it worked fine, but I see there's alternative distribution now.
>>
>>61256389
>Which one, /dpt/?
No one
>>
>>61256389
>Windoze
Stick to gaming
>>
File: 1476604522255.jpg (20KB, 328x396px) Image search: [Google]
1476604522255.jpg
20KB, 328x396px
any cmakefags here?
this code is ok
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")

but this isnt
set(PLUGINS_PREFIX "")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX ${PLUGINS_PREFIX})

the error is
set_target_properties called with incorrect number of arguments.

thats some bullshit, how do i fix this?
>>
>>61256403
>>61256405
Strawberry Perl looks good. I'm going to try that.
>>
>>61256447
>Year of 2017
>Using *make like it's 1972
>>
>>61256482
CMake and Make are completely different things.
Also GNU Make actually is excellent at what it does.
>>
>>61256096
libs

libs are a fucking cancer
>>
>>61256516
>his stdlib sucks
>>
>>61256447
try
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "${PLUGINS_PREFIX}")
>>
How do I iterate over an array and then paste the contents into each subsequent <td> on page ?
array[0] goes to first <td>
array[1] goes to second <td>
>>
>>61256577

$('.page').each(function(array[], td) {
}
>>
>>61256607
>muh jQuery
>>
File: Based Meme.jpg (30KB, 468x875px) Image search: [Google]
Based Meme.jpg
30KB, 468x875px
>>61256621
> M'Query
>>
>>61254868
>Do you guys listen to music while you work?
Yes
>I've recently taken to listening to electronic when programming. What d'y'all think?
Disgusting.

>>61256063
>Java or C# or C++
I have no idea why you think these three languages should be grouped together.
>>
>>61257058
C# is just Java with more shit bolted on.
C++ isn't quite as close but it is still a POOlang.
>>
>>61257073
>C# is just Java with more shit bolted on.
There's definitely some shit removed.
>C++ isn't quite as close but it is still a POOlang.
Wrong, poos can't grok C++
>>
>>61257094
what's missing in C# that Java has?
>>
>>61257118
Java has a more sane standard library imo. java.io is way better than C#'s System.IO.
>>
>>61257138
I don't know shit about Cshart, but Java's IO library is fucking terrible.
>>
>>61257176
seconded
simply reading and writing from a file is fucking retarded. Even C++ streams are better.
>>
>>61257094
>Wrong, poos can't grok C++
pfffffffffhahahaha, nice try.

C++ and C are completely dominated by Indian developers.

>>61257138
>java.io
Literally the worst of all available IO standard libraries.
>>
>>61257201
I have never heard of an Indian who could work in C, and I've only known a handful who knew C++, and to say they know C++ is a stretch.

As far as Java IO being worse, it's definitely the most verbose, but it's probably the most flexible, with the possible exception being C++ streams like >>61257182 said.
>>
>>61256239
Because the elif doesn't belong to any if
>>
>>61257223
>it's probably the most flexible
Can you give some examples, and how they compare to other equivalent features (or lack thereof) in other languages?

I'm actually trying to learn, but it sounds like you're talking out of your ass.
>>
>>61257201
I've never seen any name even resembling an Indian's in all of the open source C development I've looked at.
>>
>>61257239
While this will probably garner me accusations of being an Indian, I think the decorator pattern they use is pretty good. Basically you can combine any of the Stream classes with any other Stream classes, in any order you want, and they'll all just werk. This is really nice, if you want to perform some kind of transformation or redirection on a stream. It's certainly not the most "elegant", and functional programming advocates will point out that it's basically function composition, and it's definitely more verbose than it needs to be, but it's Java, and you're not using Java if you want short code.
>>
>>61257289
This doesn't really sound compelling; can you post an example code snippet so I can attempt to see how the behavior could be duplicated in another language?
>>
My first semester at the uni is almost ending, and I feel like the worst programmer in the class. I know I'm not a good programmer, but hell... I never thought I was this shitty.

I had a ton of assignments to do and barely made it to the deadline with the last ones. What some classmates took 6 hours to make, I took 48 hours. And my assignments weren't even good if compared to theirs.

Are these feelings normal? I always thought I had the intellect to do CS, but now I'm wondering if I really shoul be doing this. The first semester was totally outside my comfort zone.
>>
>>61257331
If you've never programmed before, this is normal.

If you've programmed before, and you're this far behind your classmates, you need to keep your eye on things and consider changing majors if you continue to be inferior.
>>
>>61257359
I did program before, but not so much. And it was Python, in my classes we are using C.
>>
>>61257308
For simple IO tasks this probably seems completely useless, but when you're managing a bunch of IO resources (files, network connections, etc), this can be quite helpful.
File file = new File("something.txt");
FileInputStream fin = new FileInputStream(file);
BufferedInputStream bfin = new BufferedInputStream(fin);
/* add some data transformation that you want to do here */

It's a compositional model, that allows a new "InputStream" class or "OutputStream" class to work on any kind of IO.

>>61257331
This is very normal.
https://softwareengineering.stackexchange.com/questions/5232/am-i-a-bad-programmer-or-does-everyone-have-this-feeling
>>
>>61257375
Going from Python to C is like going from a razer scooter to a motorcycle. Except to get hurt, but if you keep a learning mind, and you do work independently, you will be able to catch up.
Python is the mind killer.
>>
>>61257375
>And it was Python, in my classes we are using C.
Python fucks you up when trying to learn other languages, because it gives you this mentality of
>I can pretty much vomit any code into my editor and it will "work".
>>
File: 1499091344035.png (290KB, 400x600px) Image search: [Google]
1499091344035.png
290KB, 400x600px
>>61252761
Working on my first bot with python, all it does is derank you in hearthstone.
>>
>>61252761
Fuck you and your shitty goat fucking religion.

May pig shit be upon your pedophile prophet.
>>
>>61257377
Wew. The first answer is exactly what I'm feeling.

>>61257390
I prefer to work alone. The last assignment was in pairs, but I wrote the whole 1300 lines of code alone. A guy wanted to make it with me, but he's so dumb that I refused politely.
>>
>>61255110
Eat shit.
>>
>>61257377
What makes you think this is unique to Java?

var ayy = new FileStream(muhFilePath, FileMode.Open);
var lmao = new BufferedStream(ayy);
/* add some data transformation that you want to do here */
>>
File: 1440949986568.jpg (17KB, 229x255px) Image search: [Google]
1440949986568.jpg
17KB, 229x255px
>>61257421
>>
>>61257455
It's been a long time since I used C#, so I might be out of date. I recall that File IO was done through a File class, with long function names like File.ReadEntireFile and shit like that.
Java really needs type inferencing.
>>
>>61257437
In that case, then what are you worried about? You probably don't have a code problem, it sounds like you have a time management problem.
>>
>>61252761
muhammad was a false prophet
please stop following this satanic religion
thanks
>>
the OP in this link is trolling but is the whole thing just full of trolls/roleplayers?

>lets say I believe that, but.. say if you worked 8 hours per day, by just playing games and doing a bit of code, with 50/h that would be 400$ per day, that's 2800$/week, are you fucking serious? I worked 2 and a half months IN THE OFFICE and I asked the boss if I am ever going to get paid, he said yeah 184$, for a 2 and a half months of work, but he didnt pay me even that so I quit. recently I spent 3 months working for some american agency and they dont want to pay, they tried to scam me... WORKING IN TOTAL FOR ALMOST HALF A YEAR WITHOUT 1 FUCKING CENT, AND YOU ARE AT HOME EARNING ~2800/WEEK BY WANKING AND PLAYING GAMES, WHAT KIND OF A LIFE IS THIS

https://www.devrant.io/rants/696223/be-me-graduate-find-job-with-a-start-up-offer-me-1-share-as-signup-bonus-why-the
>>
>>61257484
I'm not sure... I really try to do things on time, but sometimes I get stuck in a problem for hours and hours. It slows me down.
>>
>>61254868
https://musicforprogramming.net/
>>
>>61257511
That happens to everyone, there's nothing wrong with it. What's important is A.) persisting and B.) seeking help from people who are smarter than you. You aren't expected to invent everything yourself, this is a highly collaborative field.
>>
>>61257501
Islamic anything is not and shall never be acceptable amongst any decent people.

The thread is not filled with trolls. Trolls laugh at such depravity. People are genuinely fucking pissed.
>>
>>61257475
>It's been a long time since I used C#, so I might be out of date. I recall that File IO was done through a File class, with long function names like File.ReadEntireFile and shit like that.

I know I'm being unnecessarily combative, but that's a funny way of just saying "I am wrong." What I just posted has existed since at least 15 years ago in .NET 1.0/1.1. I've just been getting more and more annoyed lately when people in /dpt/ laud "feature X", not realizing that 12 other languages have similar design.

There are static methods on File, which might be what you're thinking of, and things like
File.ReadAllLines
are often preferable for simple I/O because you can jump right into a LINQ block to transform your data into the types you're working with.

As a side note, .NET streams have a certain amount of internal buffering built-in, so you typically don't have to utilize the BufferedStream class.
>>
File: 1232211646338.gif (1MB, 1440x900px) Image search: [Google]
1232211646338.gif
1MB, 1440x900px
I wish c# had multiple inheritance or at least a way to share pieces code between classes.

>>61257491
Not having a nice Persian girlfriend/wife makes me so sad.
>>
>>61257511
>good sign

Knowing how much you don't know is a facet of wisdom.
Keep practicing and if possible learn from your classmates.
or friends. (lol)
>>
Booted into ubuntu 8.04 and played around with perl and some C GTK+ apps, its really sad what development has come to be, technology outreach was a mistake
>>
>>61257531
Okay, I was incorrect. :^*

>>61257539
Doesn't sharing code between classes defeat the purpose of OOP? If you've got a common piece of code, extract it to a static method.
>>
>>61256577
document.getElementsByName('td').forEach((element) => {
//
});
>>
>>61257539
>or at least a way to share pieces code between classes
You're going to need to elaborate on what exactly you're trying to do here.

I'm 99% certain your issue can be solved by interfaces.
>>
>>61257559
That's not what static methods are for.
>>
>>61257602
That's the only way to have a globally accessible function in C#
>>
>>61257624
static function != globally accessible function

What are you actually trying to do? If you drop in an interface that can be implemented by the classes in question, this forms a contract that they must have specific members. From there, you can create something like an extension method on that interface and work with those classes in the same way, solving the issue of what most people want multiple inheritance for.
>>
>>61257653
I'm not saying your solution isn't more correct, but in what way is a public static method not a globally accessible function?
>>
>>61257559
>>61257578
I have scraping some api with the following endpoints for example:
/persons/[:id]
/persons/:id/core
/persons/:id/pets
/persons/:id/cars
/persons/:id/houses
/persons/:id/belongings
/persons contains all of the data from those other endpoints. I just want to have my persons include all of the data from the other classes.
>>
>>61257653
>From there, you can create something like an extension method on that interface and work with those classes in the same way
that's ugly as fuck
>>
>>61252761
Thank you for giving beautiful, smart, independent muslim women a tribute.

Muslims are constantly derided and oppressed in Western nations, but we just want to devote our lives to Allah, the beneficent and merciful, and live a clean faithful life.

We can program too. In fact you should thank Islam for the many mathematical and scientific advancements we made while you were burning people at the stake and dying of the plague.
>>
>>61257660
>in what way is a public static method not a globally accessible function
Because a public static method still exists on a particular class; it's not "global" unless you squint your eyes real hard and take a few shots of vodka.

At this point, you must either do:
using MuhNamespace;
// ...
Butthole.MuhMethod();

or
using static MuhNamespace.Butthole;
// ...
MuhMethod();
>>
What kind of tests can I come up with for a game?
>>
>>61257668
You have no clue what multiple inheritance is.

You could do something as simple as have Person contain a property called Houses that is of type
List<House>
.

Your approach to this is why I have to deal with shit like
class Person : IHouseable, IPettable, ICarable, IBelongingsable { /* insert spaghetti here */ }
>>
>>61257726
play test
>>
>>61257703
A public static method is globally accessible, without being bound to an object. There's nothing wrong with squinting your eyes and taking some vodka if your language doesn't provide global functions.
>>
>>61257766
>A public static method is globally accessible, without being bound to an object.
This is simply incorrect.
>>
New thread: >>61257769
>>
File: anal beads.png (15KB, 619x401px) Image search: [Google]
anal beads.png
15KB, 619x401px
>>61257766
>A public static method is globally accessible, without being bound to an object.

"no"
>>
>>61257815
>>61257779
Just because you have to give it a qualified name doesn't mean that it doesn't have the same semantics.
>>
>>61257815
SomeOtherClass.SuckMyAssholeFaggot()
It's not bound to the object, it's bound to the namespace however.
>>
>>61257831
It isn't "globally accessible, without being bound to an object".
>>
>>61257837
>It's not bound to the object, it's bound to the namespace however.
WRONG, HOLY SHIT

I don't even know if you're trolling at this point.
>>
>>61257846
Do you know what an object is?
>>
>>61257501
Only a moron would believe you get paid working for startups.
>>
>>61254360
>void* isnt great but its better than templates
No, void* is literally the last thing you want because the compiler may not be able to assume its content and can't make optimizations according to it.
Better, template allow for optimizing specializations, e.g. check out vector<bool>

>>61254357
he didn't imply otherwise
Thread posts: 319
Thread images: 40


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