/dpt/

What are you working on Sup Forums?

Previous thread:

Other urls found in this thread:

youtube.com/playlist?list=PLhMnuBfGeCDNgVzLPxF9o5UNKG1b-LFY9
youtube.com/watch?v=2Op3QLzMgSY&list=PL8FE88AA54363BC46
0.30000000000000004.com/
perl6.org
{0.1 0.2}.com/'
{0.1 0.2}.com/
blogs.perl.org/users/vstemen/2017/10/perl6-should-be-renamed-perlplusplus.html
composingprograms.com/
twitter.com/SFWRedditImages

It's just not spaced out like most languages these days. If you put that on 10 lines and indented, it'd be perfectly readable.

>lispfags will actually defend this

print this statement in your favorite language:

.1 + .2 - .3

did you get zero?

$ perl6 -e 'say .1 + .2 - .3'
0


With Perl 6 you do. Consider switching today

C did it just fine

...

0.1 + 0.2 - 0.3
2.77556e_17

i guess turing forgot to account for that when he designed his test

c++ is the greatest language of all time

guy in the other thread posted these SICP lectures from barkeley youtube.com/playlist?list=PLhMnuBfGeCDNgVzLPxF9o5UNKG1b-LFY9

the lectures I knew were the one from MIT youtube.com/watch?v=2Op3QLzMgSY&list=PL8FE88AA54363BC46

read great things about both. Preferred one?

pi = 3

I can't shitpost to this :-\

(label subst
(lambda (x y z)
(cond
((null z) nil)
((atom z) (cond
((eq y z) x)
(1 z)))
(1 (combine (subst x y (first z))
(subst x y (rest z)))))))

let subst = lambda(x, y, z) {
if(null(z)) {
return null;
}
else if(atom(z)) {
if(eq(y, z)) {
return x;
}else {
return z;
}
}else {
return combine(subs(x, y, first(z)), subst(x, y, rest(z))));
}
};

Wow, so much better.

oh wait, how could I forget
>reddit spacing
gb2 plebbit etc etc

conveniently forgetting non-shit languages that *do* provide pattern matching is setting the bar embarrassingly low

Why should I learn programming when it's incredibly boring?

Python3
>>> .1 + .2 - .3 5.551115123125783e-17

No it didn't.
#include
int main() {
printf("%16.16f\n", 0.1 + 0.2 - 0.3);
}

$ ./floats
0.0000000000000001


It doesn't help that he's using commas too. As if anyone but a smug lisp weenie would read the original lisp paper.

>programming is boring
>why should I learn it
who says you should?

With it being all the rage these days, I just don't see the point

>conveniently forgetting that most mainstream languages look like the second snippet
>conveniently forgetting that this is from a 60s paper defining a bare minimum Lisp before HLLs even existed
Pretty much what I've come to expect from "people" like you.

0.30000000000000004.com/

Who says you must see the point?

I don't see a reason to learn it

nigga how are you gonna tell someone to open that site?
>alright, it's zero point three zero zero zero zero
>uhh

That's perfectly fine.

Can anyone help me solve this error?
OpenGL ES3 on Android Studio.

who says you need to learn it?

>Nim
>echo(0.1 + 0.2)
>0.3
yeah baby

Check out Perl 6 today

perl6.org

It's a very nice language with a very nice community!

excuses, excuses
no wonder lisp isn't going anywhere

print '{0.1 0.2}.com/'

try with a longer precision format (eg: %.17f in C)

>shilling for a stillbirth language
stop trying to make fetch happen

>Go
>0.299999999999999988897769753748434595763683319091796875

Looks like your global variable initializer was not a constant expression. Post shader.

>can't accept simple and objective facts
Please tell me more about your burning asspain, kiddo. I see you just can't get enough of it today. ;^)

I'm writing a class in c++ that requires a function that simply returns the value of a private string. I have verified through debugging another function that the data is being input properly into said string. Why is this not returning the string when I invoke it through cout?

std::string mycl::get_mystring() const
{
std::cout mystring;
}

$ python -c "print '{0.1 0.2}.com/'"
{0.1 0.2}.com/
$

>%16.16f
I just did %f and I got zero so it works

#version 300 es
in vec4 VertexPosition;
in vec4 VertexColor;
uniform float RadianAngle;
out vec4 TriangleColor;
mat2 rotation = mat2(cos(RadianAngle),sin(RadianAngle), -sin(RadianAngle),cos(RadianAngle));
void main() {
gl_Position = mat4(rotation)*VertexPosition;
TriangleColor = VertexColor;
}
#version 300 es
precision mediump float;
in vec4 TriangleColor;
out vec4 FragColor;
void main() {
FragColor = TriangleColor;
}

The second snippet is unironically more readable.
And I like Lisp.

again with the projection
not doing your pet language any favors by representing it like this, you know

I'm not shilling, I'm simply letting people know that Perl 6 a very fun language. If you like other scripting languages like Python, Ruby, and Perl 5, you will be pleasantly surprised at how nice Perl 6 is!

seconded
can be even more readable in a better language, of course

GL and GLES drivers are very gay.
What it is saying is either that you are using some non-const thing to initialize a constant (1) or that the compiler is retarded and can't notice the constness of the value you used (2).

// (1)
float foo = bar();

// (2)
float foo = 1+2;

>The second snippet is unironically more readable.
Cool opinion, I guess? Roughly the same number of brackets, but the second has a bunch of extra visual noise.

in python, try f"{0.1 0.2}.com" (the 'f' as prefix is important!)

long time lisper here. first is much more readable to me.

might wanna put a disclaimer that they'll be learning a very niche language that was too late to have a chance
>Perl 6 makes all of Lisp's mistakes, then sets itself on fire. by
lmao

im just learning android; why do i get a null object reference for btn_temp?

this button is inside the tab_settings xml layout

>makes some retarded remark about pattern matching
>conveniently forgets that most mainstream languages look like the second snippet
>conveniently forgets that this is from a 60s paper defining a bare minimum Lisp before HLLs even existed
Please tell me more about your visceral asshurt.

yeah just like i said in uniform float RadianAngle;
...
mat2 rotation = mat2(cos(RadianAngle),sin(RadianAngle), -sin(RadianAngle),cos(RadianAngle));

rotation depends on the return value of those functions, which in turn depend on the value of RadianAngle which is a runtime constant (will remain constant through the execution of the shader) not a compile time constant (will remain constant forever).

std::cout

>long time weeb here. muh waifu is obviously much more attractive than 3dpd to me.

t. broken record

Learning HTML and CSS
New to code besides maybe 5 hours of learning C
What is a good text editor to use?
Would be cool if there was one that would also test and show what I had written.
I realize that people hate html.
Thanks

I disagree. The fact that it has explicit words like "if", "else" and "return" makes it much clearer, at least to me.
But to each one his own, I guess. In terms of pure readability, however, nothing can beat Python.
def subst(x, y, z):
if null(z):
return null
elif atomz(z):
if eq(y, z):
return x
else:
return z
else:
return combine(subst(x, y, first(z)), subst(x, y, rest(z)))

Jesus, who'd have thought just setting up an openGLES environment would be such a pain in the bootyhole.

(lambda (x y z)
(cond
[(null z) nil]
[(atom z) (if (eq y z) x z)]
[else (combine (subst x y (first z))
(subst x y (rest z)))])))

This isn't what I need. I need to be able to run
std::cout

Just because it's not the most popular right now does not mean it's a bad language. Maybe one day it will be the new standard and replace Python.

>Perl 6 makes all of Lisp's mistakes, then sets itself on fire. by
Sounds like misinformed hyperbole to me

>In terms of pure readability, however, nothing can beat Python.
that's not a lambda expression, buddy.

Weird this doesn't work.
#include
int main() {
double x = 0.0;
double y = 0.1 + 0.2 - 0.3;

printf("%lld\n",*((long long int*)&x));
printf("%lld\n",*((long long int*)&y));
}

$ ./doubles
0
4363988038922010624


Put rotation in your main(). Also this is a little thing but you're going to be doing that matrix calculation every vertex every frame so you should compute it client side and upload the whole matrix as a uniform. I just let my linear algebra library make the 4d rotation matrix and upload it as a uniform.

use my_view.findViewById

>hyperbole
>gee
as is tradition

a = 1 + 2 - 3
print "." + a

The equivalent to your snippet would actually be this:
(defun subst (x y z)
(cond
((null z) nil)
((atom z) (if (eq y z) x z))
(t (combine (subst x y (first z))
(subst x y (rest z))))))

But I agree that the Python code is easier to read.

>Maybe one day it will be the new standard
I wish it was likely that it'd at least gain enough market share to be a viable choice when doing professional dev work
but given its trajectory, smart money wouldn't bet on it
have a look at its history

Visual Atom Text
>Thanks
this is a shitposter safe zone, don't try and guilt trip us you meanie

Currently working on a webassembly optimizer.

You must be doing something wrong somewhere else then.

>Maybe one day it will be the new standard and replace Python.
saddens me to say it, having looked at what it promises, but I don't think so
a recent discussion:
blogs.perl.org/users/vstemen/2017/10/perl6-should-be-renamed-perlplusplus.html

Shit you're right, I mistook it for a simple function definition, being the syntax almost exactly the same in Common Lisp.

Now that I think about it, a true equivalent lambda expression could still be done in Python, but how would you properly nest the ternary operator? It has a different order than other C-like languages. In C, it's
? exp1 : exp2

Which can be easily nested to produce a similar code to the Lisp example as
[](auto x, auto y, auto z)
{
return null(z) ? null :
atom(z) ? eq(y, z) ? x :
z :
combine(subst(x, y, first(x)), subst(x, y, rest(z)));
}

In C++. But since Python's ternary operator has a different ordering:
exp1 if condition else exp2

I'm having trouble writing an equivalent expression that isn't ambiguous, how would you do it (without of course checking the condition twice by using an end)?

s-expressions are filtering the mediocre out of the lisp community.

>wrong tool for the job is filtering pragmatists out of the autism community
no argument there

>what are parenthesis

(exp1) if (cond) else (exp2)

yeah whatever, keep hating on lisp all you want. i couldn't care less. i am too busy programming stuff.

>m-m-muh opinions are arguments
>yours aren't, though

Goddamn I must stop smoking pot.

I'm trying to learn some sepples and I've run into a problem.

Say I have a generic class:

template
class Foo {
T member;
// other shit
}


Then I want a class which I can have a single instance of that can hold any type of Foo. Take for example:

template
class Bar {
Foo variable;
// other shit
}


However obviously this is not what that does. If I have a Bar, it can only hold a Foo. What I want is a single Bar that can hold a Foo, and maybe next a Foo, then a Foo. Is this possible at all without using void pointers or am I retarded and need to redesign?

Thanks for any help.

>smoking pot.

Perlanon, tell me more of the advantages. Why should I learn Perl 6 over Perl 5, or even some other language like Python?

honestly happy for ya m8, not worth it to take shitposting on a chinese cartoon board seriously

can someone tell me why java is bad again?

>Which can be easily nested to produce a similar code to the Lisp example
Except nobody does this because it's a horrible idea in curlybrace languages due to how error-prone it is.

InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState

shit might be bad for your memory, including working memory size
felt like driving a car with a periscope during that period, especially things that required more working memory (planning, scheduling, programming)
though plenty claim it has different effects on different people, which is not impossible

niche lang with some neat ideas
got nothing to do with perl5 except the creator, who's a pretty neat dude
don't invest time assuming you're guaranteed to get any ROI tho
in other words, if you don't know python, learn that first

>perl over python
please, don't.

get this man a job at the nsa

Alright, thanks anons. I already know some Python so I guess I'll stick with that.

>the thanks was for just being in the thread.
thanks for your reply

Fuck fioc this picture is on point.

CL-USER> (- (+ .1 .2) .3)
0.0

You're retarded and need to redesign
How other languages solve this is to abstract away primitives. But doing that is costly and not the C++ way. If you're looking for a language that does this, any interpreted languages does this, but I dunno if any compiled has it

Yeah I figured. It's not a big deal, I've wrapped the data types I need to store under a bunch of subclasses of another wrapper class, need to do that anyway.

Tried posting for help in the last thread but it got pruned. I'm trying to build a username scraper for twitter in python, but I'm getting a unicode error. what do


import bs4, requests, os, sys

print('Please enter Twitter url')
twitterUrl = input()

twitterAcc = requests.get(twitterUrl)

twitterAcc.raise_for_status()

twitterFile = open('twitterFile.html', 'wb')

for chunk in twitterAcc.iter_content(100000):
twitterFile.write(chunk)

#twitterFile.close()

twitterFile = open('twitterFile.html')
twitterSoup = bs4.BeautifulSoup(twitterFile.read())
twitterElems = twitterSoup.select('p')

open your HTML file with UTF8 encoding

...
twitterFile = open('twitterFile.html',encoding="utf8")
...

Thanks man this worked

unfortunately, berkeley has switched to composingprograms.com/

rubyist@Overmind:~$ irb
irb(main):001:0> .1 + .2 - .3
SyntaxError: (irb):1: no . floating literal anymore; put 0 before dot
.1 + .2 - .3
^
(irb):1: syntax error, unexpected '.'
.1 + .2 - .3
^
(irb):1: no . floating literal anymore; put 0 before dot
.1 + .2 - .3
^
(irb):1: no . floating literal anymore; put 0 before dot
.1 + .2 - .3
^
from /usr/bin/irb:11:in `'