[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vr / w / wg] [i / ic] [r9k] [s4s] [vip] [cm / hm / lgbt / y] [3 / aco / adv / an / asp / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / qst / sci / soc / sp / tg / toy / trv / tv / vp / wsg / wsr / x] [Settings] [Home]
Board
Settings Home
/g/ - Technology



Thread archived.
You cannot reply anymore.



File: 1494219560695.jpg (420 KB, 3200x1703)
420 KB
420 KB JPG
Retarded baiting and shitposting as usual

Previous thread: >>60477250
>>
>inb4 gatekeeper
>>
>>60485029
>4chan
cringe
>>
>C++
https://www.youtube.com/watch?v=rWDNwN0h0LM

>python
https://www.youtube.com/watch?v=rkcXRBhYZHU


>C++
https://www.youtube.com/watch?v=MZIv6WtSF9I

>python
https://www.youtube.com/watch?v=qFl-Q21MzmQ


>C++
https://www.youtube.com/watch?v=1CpjRMICXNM

>python
https://www.youtube.com/watch?v=IIAWs3_Hgtc
>>
nth for rust is best memelang
>>
>>60485047
>Python
https://www.youtube.com/watch?v=PXPPKisg5-g
>C++
https://www.youtube.com/watch?v=l0Mq6rCfYtU
>>
File: 1492871032584~000.png (786 KB, 1000x1300)
786 KB
786 KB PNG
haskell a qt
>>
>>60485035
(literally use C, it's both faster than java and easier to prototype in)
>>
>>60485043
>cringe
>>>/b/

>>60485064
>meme
>>>/v/
>>
>>60485042
>>60485089
told ya so
>>
>>60485082
>C is easier to prototype in than Java
What the fuck am I reading?

C is cumbersome and slow to create anything non-trivial, in comparison to any modern high-level language.
>>
>>60485089
>giving (you)'s
>>>/s4s/
>>
>>60485150
>>>>/s4s/
>>>/s4s/
>>
>writing Java when Scala and Kotlin exist
senpai
>>
wow this thread is even shittier than normal

Anyone know a library that lets me read/write disc number id3 tags? Language doesn't matter that much. I'm trying to figure out if mutagen does, cause its docs are shit.
>>
im having trouble with the load function

this is my write function, currently adding one element at a time
void gravaSensor(Sensor* Sensor, int posicao, int novo) {  //posiçao = position
FILE *ficheiro;
ficheiro = fopen("sensores.txt", "r+t");
if (ficheiro == NULL) {
ficheiro = fopen("sensores.txt", "w+t");
}
if (novo) {
fseek(ficheiro, posicao, SEEK_END);
}
else {
fseek(ficheiro, posicao, SEEK_SET);
}
fprintf(ficheiro, "%d%d%d%30s%30s", Sensor->id, Sensor->active, Sensor->intervalo,
Sensor->local, Sensor->tipo);
fclose(ficheiro);
}


it saves something in the file so im gonna assume its working for now
i also have a function that creates a new element

now this the load one
int CarregaTodos(Sensor** l) {
Sensor* temp = *l;
Sensor sens;
FILE *ficheiro;
int i = 0;

ficheiro = fopen("sensores.txt", "r+t");

if (ficheiro == NULL) {
printf("no file\n", "sensores.txt");
return i;
}

rewind(ficheiro);

while ((fscanf(ficheiro, "%d%d%d%30s%30s", &sens.id, &sens.active, &sens.intervalo,
&sens.local, &sens.tipo) == 5)) {

novo(sens.id, sens.intervalo, sens.local, sens.tipo); //this is a function that returns a pointer to a new element

insereSensorFim(&l, novo); //this inserts the element at the end of the list

}
fclose(ficheiro);
return i;
}

i assume its the load function that is wrong, any tips on what might be wrong?
>>
File: groovy-asserts.png (99 KB, 400x267)
99 KB
99 KB PNG
>>60485491
>not Groovy
>>
>>60485491
nice meme. java is actually great, and scala and kotlin are made by amateurs with shit taste who don't understand the first thing about java or PLT in general.
>>
Is it possible to generate n pairwise independent hashng function from one single function?
I need n pairwise etc. and i would like to just add std::hash as a dependency.
>>
One question, how can i output values from ArrayList?
public class Triangle<T extends Number>  implements IMera{
private T x1,x2,x3,y1,y2,y3;

public Triangle(T x1, T y1, T x2, T y2, T x3, T y3){
this.x1=x1;
this.x2=x2;
this.x3=x3;
this.y1=y1;
this.y2=y2;
this.y3=y3;
}

...


public class Main {
public static void main(String[] args){

ArrayList<Triangle<Integer>> triangles= new ArrayList<>();
triangles.add(new Triangle<>(1,1,2,2,3,6));

System.out.println(triangles.toString());
}
}


If i run this, ill get
[Triangle@7d4991ad]
>>
>>60485640
But Java cannot be great because C is great.
>inb4 "hurrrr it bad logic to think only one thing are be great"
>>
>>60485082
Dude...
You need to reinvent the wheel with C. How is it easier to prototype compared to Java?
>>
>>60485705
You're just printing the ArrayList object type to string. Do a foreach and print each value inside the list.
>>
>>60485640
yeah, except Scala was made by a literal professor, Wirth former student, who specializes in programming languages

afaik Kotlin ruskies are actual scientists too
>>
>>60485705
>>60485760
Or I guess since there's only one triangle,
System.out.println(triangles.get(0).toString());
>>
>>60485640
>meme
>>>/v/
>>
>>60485505
>lets me read/write disc number id3 tags
I have no idea what you specifically want to do, but google shit out this as the first result
https://github.com/mono/taglib-sharp
>>
@60485796
>>>>/v/
>>>/trash/
>>
>>60485847
This looks pretty good, ta
>>
>>60485847
Google something for me too, senpai!
>>
>>60485783
>Being a science man means you make good languages
Python is the primary language of choice among data researchers and it's a heaping pile of shit.
>>
>>60485784
Nope, that is giving same output like in my first post
>>
>>60485893
>Python is the primary language of choice among data researchers
i think you mean R
>>
/dpt/ is my favorite subreddit on this website
>>
>>60485705
implement toString() in triangle
>>
>>60485906
....did you implement a toString() method in the Triangle class?

>>60485914
R is also heavily used but most data crunching is slapped into a python script and left alone for 12 hours.
I have a friend who gets gubment monies to research auditory processing in the brain and he bitches to me every day about how everybody else in the department works with Python instead of something usable
>>
File: Capture.png (28 KB, 810x464)
28 KB
28 KB PNG
>>60485892
>>
>>60485893
>and it's a heaping pile of shit.
that's because Guido himself is not a scientist

Not like it's right 100% of the time, but..
>php
>ruby
>js
>python
>made by programmers

>lisp
>c
>scala
>haskell
>made by scientists
>>
>>60485581
>you can put code blocks inside other code blocks
wew
>>
>>60485920
>>60485948
I added this
    public String toString(){
return super.toString() + " "+ x1+ " "+ y1+ " "+ x2+ " "+ y2+ " "+ x3+ " "+ y3;
}


and it is working now
>>
help i'm trying to use C to print my essay on the legitimacy of craniometry but it just keeps showing it in the console instead
>>
>>60486010
>made by scientists
Mathematicians.
C""S"" isn't a "sc*ence".
>>
File: cute.jpg (680 KB, 1920x1080)
680 KB
680 KB JPG
>>60485029
still working on the official /dpt/ tetris game :3
>>
>>60486010
>php
>ruby
>js
>python
All widely used industry standards

>lisp
>scala
>haskell
Used by hobbyists and occasionally in the industry for those hobbyists to jump and shout with glee that "SEE ITS NOT JUST A MEME LANGUAGE!"

C is a rare example of a scientist making a language correctly (i.e. with human-sane syntax)
>>
>>60486010
>lisp
>scala
>haskell
all shit
>>
>2017
>not using the most efficient and safe programming language
what are you even doing here?
>>
>>60486017
>super.toString()
for what purpose
>>
>>60486080
>MEME
>>>/v/
>>
How do you feel about lua?
>>
>>60486098
enjoy your false sense of """"safety"""" delusional fag
>>
>>60486080
>All widely used industry standards
Which almost always implies that they're absolute trash with no redeeming qualities.
>>
>>60486111
Great little scripting language, can be retardedly fast too depending on the task
>>
>>60486067
http://www.scott-a-s.com/cs-is-not-math/

>>60486080
>All widely used industry standards
I know, I know. You could say that Scala is kinda industry-ish, since Twitter and all, but yeah. Wide adoption doesn't make it less painful to write in js or php though.
>>
>>60486101
>no super
 Exception in thread "main" java.lang.StackOverflowError
at java.lang.StringBuilder.<init>(StringBuilder.java:89)
at Triangle.toString(Triangle.java:24)

>with super
Triangle@7d4991ad 1 1 2 2 3 6

>>
>>60486150
>shitty bl*g post
didn't even click the link
>>
>>60486159
does "no super" by any chance mean
    public String toString(){
return toString() + " "+ x1+ " "+ y1+ " "+ x2+ " "+ y2+ " "+ x3+ " "+ y3;
}

?
>>
ok i fucked up the code blocks above

now i changed some things, my save functions saves the values from the whole list, instead of a single element

void gravaLista(Sensor* l) {
FILE *ficheiro;
Sensor* temp = l;
ficheiro = fopen("sensores.txt", "r+t");

if (ficheiro == NULL) {
ficheiro = fopen("sensores.txt", "w+t");
}

while (temp != NULL) {
fprintf(ficheiro, "%d%d%d%30s%30s", temp->id, temp->intervalo, temp->active,
temp->local, temp->tipo);
temp = temp->proximo;
}

fclose(ficheiro);
}


everything gets saved on the file as expected

now the load function is where im lost

int CarregaTodos(Sensor** l) {
Sensor sens;
FILE *ficheiro;
int i = 0;

ficheiro = fopen("sensores.txt", "r+t");

if (ficheiro == NULL) {
printf("no file\n", "sensores.txt");
return i;
}

rewind(ficheiro);
while ((fscanf(ficheiro, "%d%d%d%30s%30s", &sens.id, &sens.intervalo, &sens.active,
&sens.local, &sens.tipo) == 5)) {

novo(sens.id, sens.intervalo, sens.local, sens.tipo); //this function returns a pointer to the new element
insereSensorFim(&l, novo); //this function inserts the new element at the end of the list
}

fclose(ficheiro);
return i;
}


when i try to print the list nothing gets printed.
the new and insertlast functions work fine.

what am i fucking up in the load function
>>
In the K&R books, some of the example code reads:

for (i=0; i<lim-1 && (c=getchar())!=EOF && c!='\n'; ++i)
s[i] = c;
if (c == '\n') {
s[i] = c;
++i;
}


Isn't that equivalent to the following?

for (i=0; i<lim-1 && (c=getchar())!=EOF; ++i)
s[i] = c;


In both cases, if c is '\n', then s[i] = c and i is incremented.
>>
>>60486200
>Exception in thread "main" java.lang.StackOverflowError
oh fuck, i just saw what i did
>>
>>60486209
*K&R book
>>
>>60486209
No, because in the first one if c == '\n' then it breaks out of the loop and moves to the if statement. Without more context I don't know what the rest of that does, but the first one will read up to either EOF or the first newline, then stop.
The second one will only stop when it reaches EOF.
>>
>>60486209
Fuck, I'm dense. I just realised that the former terminates the for loop if c is '\n'.
>>
>>60486150
>http://www.scott-a-s.com/cs-is-not-math/
>>
>>60486250
Thank you, I can't believe it took me so long to notice that.
>>
>>60486201
ok i had fucked up on the load function its

insereSensorFim(&l, novo(sens.id, sens.intervalo, sens.local, sens.tipo));


but it still doesnt print shit
>>
>>60486277
didn't read but he's right, cs is more than math.
>>
>>60486114
>false sense of safety
explain
>>
>>60486299
>cs is more than math
CS is discrete, matrix, and linear mathematics. It literally cannot be anything more.
>>
File: cs_math_venn.png (27 KB, 400x165)
27 KB
27 KB PNG
>>60486067
Step 1: Find an actual research mathematician
Step 2: Tell him that cs is math to his face
Step 3: Run

My math buds have always told me that CS has as much in common with math as chemistry or biology has. And they get considerably butthurt when people try to mix "completely different fields of study"
>>
>>60486326
you are wrong. one example: programming languages
>>
Does the c++ std library have hashing functions for primitive types?
>>
>>60486345
>I am a second year student
It's okay, you'll figure it out later.
>>
>>60486359
not an argument
>>
>>60486300
Do you get paid by Mozilla? Or are you just mentally ill?

Anyway, you have one post to sell me Rust
>>
File: 1492498365440.jpg (114 KB, 1180x1084)
114 KB
114 KB JPG
>>60486414
It is, actually, because the only people who don't understand what mathematics a computer is capable of are the ones who haven't done any complex math yet.
>>
>>60486455
design and implementation of programming languages is part of computer science. please, tell us which kind of maths would help you to design the syntax of your programming language.
>>
>>60486533
Discrete, matrix, and linear mathematics.
CS is at best a subset of mathematics, it is not "more than mathematics"
>>
>>60486555
yeah dude, matrices will help you to choose a c-like syntax over a lisp like syntax. seriously, what the fuck?
>>
>>60486533
you should stop wasting your time with this guy that clearly comes out of a math course and decided to learn for cycles and while cycles XD and he has some kind of inferiority complex, he probably has no fucking idea about the shit behind parsing and much else
>>
>>60486596
Or it may help me choose a syntax completely independent of those two, you fat retard.
>>
>>60486622
I bet you think computers are capable of continuous integrations too
>>
class character ()
{
ArrayList<Animations> animation;
}
class Animation ()
{
ArrayList<Frame> frame;
}
class Frame ()
{
ArrayList <Hitbox> hitbox;
}
class Hitbox ()
{
ArrayList <Rectangle> rectangle;
}


Is this a retarded data structure or is fine?
>>
>>60486636
define computer
>>
>>60486636
to think that cs is is strictly tied to what you can do adding or subtracting bits is the same as thinking that math is about raising and lowering your hands fingers
>>
File: 1453868884628.jpg (29 KB, 631x631)
29 KB
29 KB JPG
>>60486201
pls help
>>
File: 1473336493183.jpg (28 KB, 474x338)
28 KB
28 KB JPG
>>60486150
> http://www.scott-a-s.com/cs-is-not-math/
One megafagtronics bitches about other megafagtroics how big other megafagtronics are.
Nothing new.
>>
>>60486444
>can't elaborate
>deflects instead
kek, typical brainlet
>>
File: Irina-Shayk-ero-foto-4.jpg (153 KB, 995x1076)
153 KB
153 KB JPG
question to fellas who are working (remote freelance):
how did you find the companies you wanted to work with? i don't want to work at google or facebook, where do i find smaller companies worth working in before i move to my own venture?
>>
>>60486444
i thought mozilla ditched rust in favor of c++
>>
    
vector<vector<double>> OutputMatrix(PrimaryMatrix.size(), vector<double>(SecondaryMatrix[0].size(),0));
vector<int> PmatrixProducts(PrimaryMatrix.size(),1);

for(int i = 0; i < PrimaryMatrix.size(); i++){

std::for_each(begin(PrimaryMatrix[i]),end(PrimaryMatrix[i]),
[&](int p){
PmatrixProducts[i] *= p;
}
);

}

for(int i = 0; i < PrimaryMatrix.size();i++){
int j = 0;
int z = 0;
while(z < SecondaryMatrix[0].size())
{
if(j > SecondaryMatrix.size() - 1){
z++;
j = 0;
}
OutputMatrix[i][z] += PmatrixProducts[i] * ((double)SecondaryMatrix[j][z] /(double)(PmatrixProducts[i]/PrimaryMatrix[i][j]));
j++;
}

}
In a rating of garbage /10 how shit is this code.
>>
>>60486824
2/10
but I deducted 5 points before even starting reading it because it's in C++
>>
>>60486855
at least it isn't 0/10.
>>
>>60486533
>>60486596
mathematics is a broad subject
>>
File: haskelltan-cropped.png (589 KB, 1000x1300)
589 KB
589 KB PNG
>>60485077
I cropped her to make a wallpaper. Here you go guys.
>>
>>60486855
If I had a proof that showed it works do I get bonus points?
>>
File: problem.png (42 KB, 628x278)
42 KB
42 KB PNG
>>60485029
Hello guys,
I need to write an algorithm in log2n space complexity (not time complexity) to check if an expression of parentheses and brackets is balanced. In other words, I can only use counter variables, no stacks or any other kind of data structure. I've tried several different approaches but they all either don't work or exceed log2n space complexity. Can someone give me a hint?

Thanks
>>
Hi what is the best way to learn lisp? I would prefer to work on real stuff instead of solving some puzzles. I thought about writing elisp extensions, is this a good place to start?
>>
i rate your github/bitbucket/whatever on 10.
>>
>>60486969
no, /dpt/ doesn't care if your code does anything
>>
>>60487050
damn
>>
will i ever be writing proofs if im a code monkey?
>>
>>60486345
>>60486533
Formal language theory, which is based on theory of semigroups.
Retarded pajeet monkeys like you really should not be on this thread at all.
>>
>>60486824
>variable starting by a capital letter
0/10, you're fired
>>
File: IMG_0295.png (53 KB, 856x361)
53 KB
53 KB PNG
>>60485029
>implement a Caesar cypher in C
>seems pretty easy
>get it working in no time
>now all I need to do is make it wrap around when you go over
>I just make it check if a letter is lower or uppercase
>if it goes over 'z' or 'Z' respectively, just subtract 26
>realize this doesn't actually work
>spent like an hour+ trying to figure out the proper way to do it
>discover the formula using mod 26 or whatever
Very useful, but how do I adjust for the fact that in C, a isn't equal to 1? Am I too stupid to be into programming? I've been making good progress but this is burning me out.
>>
>>60487260
see >>60486596
>>
>>60487304
look up the ascii table. a is 65, A is 97, that's all you need to know. don't look up a formula for this
>>
>>60487304
try something like (number MOD 26) + 'a'.
>>
>>60487304
nigger when you're dealing with character you never use a number but the character itself.
And 'a' while never be equal to 1 in any (non shit) languages, look up the ascii table
>>
>>60487304
why would a = 1?
>>
File: yukari_disgust.png (29 KB, 287x201)
29 KB
29 KB PNG
>>60487331
Are you fucking retarded?
https://en.wikipedia.org/wiki/Formal_language#Programming_languages
>>
>>60487367
Irrelevant. Show me the maths that say that, for example, pascal's syntax is better or worst than C's syntax. Why, based on a mathematical model, i should favor one __style__ over the other.
>>
File: 1474229750827.png (324 KB, 498x497)
324 KB
324 KB PNG
>>60487417
>>
File: 1488133922155.jpg (111 KB, 709x290)
111 KB
111 KB JPG
>>60487417
>this fucking retarded
Holy fucking shit lmfao how much is raj paying for you to shill mathematical ignorance like this? Gotta keep the western white man down so that your own shit-in-street country could become a superpower by 2020 right? rofl
>>
>>60487417
+100 dumbass points
>>
>>60487304
>how do I adjust for the fact that in C, a isn't equal to 1?
Good question! You will need to somehow translate a character to a number between 0 and 25. (Not 1 and 26 -- the modulo technique requires 0 - 25 instead.)

Theoretically, the right way to do this is to make a table of letter/number mappings. To do your crypto you can then first translate letter to number; do your number arithmetic crypto; then translate the result back to a letter. One way to do this, for example, is to have a string `char *alphabet = "abcdefghijklmnopqrstuvwxyz";` and then look up the position of a letter in that string to find its zero-to-twentysix encoding.

In practice, there is a cleverer way. In the encoding all modern systems use for letters --ASCII-- it holds that, for example, 'b' == 'a' + 1. So you can take a lowercase letter, and subtract the character 'a'. So if `char letter = 'z';`, then `int number = letter - 'a';` will yield 25. 'a' - 'a' is 0, as expected. To translate back into letters, add 'a' to a number -- you'll get that 'd' = 'a' + 3.

>Am I too stupid to be into programming?
No, this is a legitimate nontrivial step to consider. The theoretical answer should not be really *surprising* but still takes some sharp thinking. The convenient ASCII shortcut requires knowing some particular arcana you probably had no reason to know before now.
>>
File: crying.png (104 KB, 500x280)
104 KB
104 KB PNG
>>60487279
b-but I only capitalized the containers.
>>
>>60486972
h-heelp
>>
>>60487487
>tfw KOI8
>>
>>60487504
just did your assignment, it's not that hard
>>
Time for a semi-controversial statement.

This:
class foo: 
def __init__(self, n):
self.n = n
def __call__(self, i):
self.n += i return self.n


is much easier to understand than this:
(defun foo (n) (lambda (i) (incf n i)))


the second one is "too clever", and abuses the lambda keyword for something which is not allowed in the lambda calculus. Mutable closures are messy. Mutable closures defined with just the lambda or function definition keyword is even more dangerous.
>>
Hey Rust Shill, how long do you expect it will take before we start seeing mature Rust libraries with actually decent documentation?
>>
File: libs.png (36 KB, 1146x287)
36 KB
36 KB PNG
How common is for an open source project to get bought out?
>>
>>60486814
wasn't it the other way around?
>>
>>60487533
hmm? Can i get a hint? I've been working on this for several days without success. I can do it in logn space complexity for only parentheses but no brackets, and I can do it in n space complexity for parenthesis and brackets, but I can't figure out how to do it in logn space complexity for a expression containing both brackets and parentheses.
>>
>>60486972
>remove all '()'
>remove all '[]'
>repeat until string doesn't change
>if it's empty, then it's well-formed
>>
>>60487603
Oh wait, it requires n space for the additional string. Fuck me.
>>
>>60487601
Dude you can look it up it's a basic exercise, if you can't just do a simple search on the internet drop out already
>>
>>60487601
Brainlets get the fuck off my board
>>
>>60486972
>Can someone give me a hint?
Do you know how to solve this problem when only parentheses are allowed, and no brackets? If not, solve that first.

Decompose the program into two parts. First, check that parentheses are properly nested while ignoring the shape of the parentheses -- that is, check that things are nested properly if '(' == '[' and ')' == ']'. Assuming that is the case, check for each open-paren whether the matching close-paren has the right shape -- while doing this step, you can assume that the first property holds. Remember that there are no time complexity requirements here.
>>
>>60487624
I have "looked it up". The only ways I've found people saying are the removing pairs method mentioned in >>60487603 and the stack method. Both of which are n space complexity.

There is a method in logn space complexity using a counter for depth, but that only works when there is only one type of parenthesis. ( no brackets).
>>
>>60487645
Hmm yeah I know how to do the one with only parenthesis allowed. i'll give that a try. Thanks, I appreciate the help.
>>
>>60487573
from what i understand, the Libs and Docs teams are working on this as we speak. Hopefully by the end of the year a lot of improvements are made.
>>
>>60487781
meant for >>60487565
>>
i fixed my stupid load function.

fuck c

you have to be a fucking autist to enjoy this piece of shit language
>>
>>60487617
On the other hand, you can do it n/2 times, since each iteration removes 2 or 0 elements. If it's still not empty, it's not well formed. No additional string required.
>>
>>60487954
Yeah this was the first approach I tried. Unfortunately, it is incorrect since I'm not allowed to modify the input string, and n/2 is still considered n time.
>>
>>60487980
I know, I'm just messing around. Just do what >>60487645 proposed, it's reasonable and not hard to implement.
>>
>two string types
I love Rust but why this?
>>
Trying to write an algorithm which will prove that pascal's syntax is either better or worse than C's syntax.
>>
>>60488038
Ada has 4 standard string types
>>
>>60488052
Fuck Ada then
>>
>>60488038
Because the normal string is UTF-8 and the vastly superiour OsString isn't.
>>
>Hipster Pack
>mac air with Linux installed
>Atom with in Vim mode
>Ruby on rails

Any advice?
>>
File: 1493246822485.png (1.14 MB, 992x1048)
1.14 MB
1.14 MB PNG
Does a language really need if statements?
>>
Is Ocaml really THE language to use?
>>
>>60488145
It's the basic building block on which all other loops in classical computing are made so yeah.
>>
>VMware falling for the Rust meme
>>
>>60488145
not the lazy one
>>
I've been thinking about sometime making a video series on YouTube to teach programming through C, and through demonstrating as many mistakes as possible (and their corrections). I want to put an emphasis on the basics of computer architecture, such as how your program interacts with the OS and with the hardware. I also want to place an emphasis on some security basics. What causes a program to be insecure, and how do we defend against this? How do other languages abstract away from some of these problems, and how do those abstractions map to our basic primitives? I want to de-mystify all of these things, in hopes that I might be able to produce a better generation of programmers.

>>60487781
>>60487801

Sounds pretty good then. Rust is a language I'd like to keep more of an eye on, as it is one of the few languages that can actually duplicate the functionality of C for new projects.

There are some convenience features I wish it had though, like bitfields, or an Index/IndexMut trait that can return values instead of just references (you can't implement a bitvector in Rust that has a [] operator, since there is no way to make it return bool). Maybe a future standard of Rust will support them.
>>
>>60488272
>I've been thinking about sometime making a video series on YouTube to teach programming through C
this topic is cursed. be careful so you end up like that reddit guy who did a C tutorial for beginners
http://www.al.com/news/huntsville/index.ssf/2014/11/carl_philip_herold_kills_himse.html
>>
>>60488145
No.
>>
>>60488145
Not if you just want to print how many dicks you suck per day
>>
why are you fuckers so eager to hop on the next meme language, there still aren't any compelling reasons to switch from C++ to rust, rust could improve in the future but so could C++
>>
>>60488052
Are you counting utf-8? I only can think of 3 without that.
>>
>>60488202
>>60488441
>meme
>>>/v/
>>
>>60488441
Just for this actually:
if condition {}
instead of if (condition) {}
>>
>>60488441
>why are you fuckers so eager to hop on the next meme language, there still aren't any compelling reasons to switch from C++ to rust, rust could improve in the future but so could C++
this post is such an elaborate joke

>why are you fuckers so eager to hop on the next meme language, there still aren't any compelling reasons to switch from C to C++, C++ could improve in the future but so could C
>>
>>60488458
still no clue what memes have to do with video game consumption
>>
>>60488441
Maybe C++Twenty-fucking-god-knows-what will implement Rust itself, making it more "feature richl"
>>
>>60488485
>just for a more unsafe way to implement a loop
>yfw Rustbabbies can't handle conditionals that are longer than 1 line
>>
>>60488441
Nah, nobody's actually hopping anywhere
It's just the easiest subject to argue and shitpost about by a large margin, arguing about tech or algorithms requires solid background
>>
>>60488485
that's really, really gay. you have shit taste.
>>
>>60488511
Are you feeling too salty?
Rust allows you to do if in the latter way too, but I'm interested why would you actually ever need () in if condition
>>
>>60488489
nigger C and C++ have completely different paradigms
>>
>>60488521
if (!(gay)) {}
>>
>>60488511
>C++ tards talking about safety
LOL
>>
>>60488543
>Rust allows you to do if in the latter way too
'CAUSE MY SEX JUNK

IS SO OH-OH-OH

MUCH MORE THAN

EITHER OR-OR-OR
>>
>>60488571
>autistic meltdown
>>
>>60488445
String
Wide_String
Wide_Wide_String

Ada.Strings.Unbounded
Ada.Strings.Bounded
Ada.Strings.Fixed

Interfaces.C.Strings

Ada is over-engineered garbage that shall be avoided at any cost.
>>
>>60488583
>he doesn't know
https://www.youtube.com/watch?v=Wllc5gSc-N8
>>
>>60488145
not if its lazily evaluated
>>
>>60488590
oh god what that fuck is that shit
I never bothered actually watching the video
we're all fucking doomed
goddam it 'murica
>>
>>60488588
how many different types of strings does haskell have?
>>
>>60488588
The wide variants are for encodings using larger character sizes than 8 bits. Fixed is the same thing as Fixed, and C.Strings is only useful for interfacing. So 3.
>>
>>60488145
No, it is against the OOP way. Just define a true class and a false class which inherit from the boolean class. Then you can just implement an ifTrue method on it which takes in a block as an extra argument, and executes it only if it is called on True.
>>
File: stargazer.gif (924 KB, 500x281)
924 KB
924 KB GIF
tfw quantum computing comes out and invalidates all you know
>>
>>60488763
t. Smalltalk programmer
fun language desu
>>
>>60488590
jesus christ

>>60488763
>a true class and a false class
didn't you forget something?
>>
File: 14921321102545.jpg (31 KB, 439x521)
31 KB
31 KB JPG
So, memes aside, I've read https://github.com/ksimka/go-is-not-good and it feels like it's mainly "scripting language code artisans" complains. If anything it made me actually want to try it, lol.

Is Go a perfect shite for a c/c++ programmer to make some web back-end? Anyone here unironically wrote something non-trivial in it? Or should I just pajeet up and get me some Java?
>>
File: 1441648599925.jpg (606 KB, 1395x858)
606 KB
606 KB JPG
>>60488793
>tfw heading to a PhD position to do research in condensed matter to ensure that future
Dumb frogposting pajeet codemonkeys BTFO
>>
>>60488793
quantum computing is overhyped and non-pajeets will have a head start in exploring and making use of quantum algorithms
>>
>>60488793
>"gee how do i reduce the time complexity of this O(n^4) operation"
>put in thread
>runs in alternate universe whose time dimension is orthogonal to ours
>casually pluck the return value out of farther along in that universe's timeline
>time complexity is now O(1)
>mfw
>>
>CS is Math
Objectively wrong. csTheory might be said to be math, but OS, PLT, AI, etc are not math.
>inb4 only csTheory is CS
No, what is, and is not a part of a subject is a matter of convention. Everyone counts non-theory cs as also being a proper part of CS, and thus it is.
>inb4 b-but math is a heavy part of those subjects
Perhaps, but that doesn't make them math. Pure Math is about proving theorems, applied maths is about applying it. If something is neither of these, but merely uses math because it's necessary or convenient, it is not a part of math.
>>
@
>PLT
>not math
>>>/g/wdg/
>>
>>60487260
>Based on/application of math != being math
Physics is not math even though it uses it. CS is not math even though it uses it. They are separate subjects.
>>
>refactor all yesterday
>realize what I'm doing is a bad idea and revert everything
>refactor all day today
>realize I need to update hundreds of test cases
>considering everything everything again
life is suffering
>>
>>60488860
>math
>not CS
>>>/sci/
>>
File: 1464282034833.jpg (155 KB, 500x492)
155 KB
155 KB JPG
>>60488793
>>
>>60488878
>>realize I need to update hundreds of test cases
>he fell for the TDD meme
>>
>>60488860
Not an argument. I'm not passing anykind of judgement, I'm just stating an objective fact, which is that the subject CS is not a sub-field of the subject Mathematics.
You however sound like you have a major inferiority complex and need CS to literally be math.
>>
>>60488740
no, it's a pain in practice. Ada is probably the most painful programming language i ever programmed with.
>>
>>60488912
its a good idea but only once your design has solidified
doesnt work with this agile bullshit most shops are pulling nowadays
>>
>>60488912
>he fell for the he fell for the meme meme
>>
@
>need CS to literally be math
PLT is quite literally math. I don't care about "CS" (which I don't recognize to be a valid word since it is a very distinct field).
>>
File: images.png (5 KB, 226x223)
5 KB
5 KB PNG
>>60488948
>mfw
>>
>>60488912
>mfw the tests are more complicated than the code itself
>>
>>60488927
And you used it so much to not know Fixed doesn't define a string type, but is just a package for manipulation.
>>
>>60488793
It's not like it can be applied to any problem. Plus it's intrinsic stochastic nature wouldn't let you use it in many systems.
>>
>>60488835
Are you me?
>>
File: g2tSfA.gif (172 KB, 650x650)
172 KB
172 KB GIF
/dpt/, what is the best language for creating finite state automata like the one pictured?
>>
>>60488948
Except it's not. The people who research it tend to be CS people, articles are published in CS journals, courses are offered by CS departments etc.
How many mathematicians work directly on PLT as mathematicians in maths departments?
>>
>>60488590
What the fuck Bill Nye. You had one job. Make people love science and not make a fool of yourself so that we can point people to you. Now look what you did.
>>
>>60488997
never i have said it was a type. Just showing how Ada is a mess by having separate packages for each types.

Text_IO.Bounded_IO
Text_IO.Unbounded_IO
Wide_Text_IO.Bounded_IO
Wide_Text_IO.Unbounded_IO
Wide_Wide_Text_IO.Bounded_IO
Wide_Wide_Text_IO.Unbounded_IO

seriously, this is insane. Ada died for reasons.
>>
It feels good to shitpost, listen to good music, and order pizza. All from the comfort of my bed
>>
>>60489122
>wide_wide_text
That's just goofy
>>
File: test (2).png (716 KB, 811x599)
716 KB
716 KB PNG
>>60489080
Don't think so anon. What do you study?
>>
@
>CS
That's a meaningless word. You might as well replace it with any random sequence of characters.
>>
>>60488145

A language should have some sort of mechanism for conditional executions. The construct of if/else/else if is not entirely necessary, and could be replaced with pattern matching, switch statements, or just a simple while loop with a break. If you do not have conditional execution, however, the type of functionality that can be implemented is severely limited. You could not really call such a tool a programming language.

>>60488948

>It's a distinct field, so it doesn't exist
>>
>>60489154
you're so fucking pretentious ruby
>>
>>60489125
Hmm.

No. I don't think it does.

Are you okay?
Do you need to talk to someone?
>>
>>60489122
Ada isn't dead, it's just missing in action
>>
I want to make a 4chan bot that utilizes OCR for legacy captcha and proxies to evade bans. Is this possible to do?
>>
Why is some subhuman replying to my post?
>>
>>60489145
Then every word is meaningless. Math because it refers to several subfields, physics, chemistry etc.
>inb4 not about computers, not a science
True, that makes it a bad name, not a meaningless name for the purposes of classification.
>>
>>60489154
Conditional executions are built into the idea of a programming language, at the very least in the sense that what some text does depends on what the text is. Without that, not only would you not have a programming language, I'd argue you wouldn't have a language of any kind
>>
>>60489170
Nah i may be lonely but at least im comertable
>>
>>60489122
You definitely did by replying to my questing on what the 4 string types are with it. As for separating the few string types into different packages, is so that it's easier to read. Imagine reading a package with all of those functions in them. Additionally, I have never needed to use the wide variants, ever. You can easily ignore them.
>>
>>60489154
>If you do not have conditional execution, however, the type of functionality that can be implemented is severely limited.
>what is lambda calculus
>>
File: 1493435745139.gif (1023 KB, 500x514)
1023 KB
1023 KB GIF
Writing a non-Turing-complete dialect of most popular languages.
>>
>>60489162
It's alright. He's close to get his degree iirc, it's an extremely pretentious timeframe. It's fun to crush their attitudes at the interviews. My boss is always "So what can you do? Hmm.. Ah! Fresh out of uni I see, so literally nothing."
>>
File: 1486169738292.png (229 KB, 495x495)
229 KB
229 KB PNG
>>60489213
good luck akarin!
>>
>>60489199
Not a language specification that doesn't have conditional execution

see: >>60489195
>>
>>60489195
>at the very least in the sense that what some text does depends on what the text is
Nope. You could have a programming language which has no valid programs.
>>
If you use a Turing complete language you simply have no right to call yourself a "programmer".
>>
>>60489227
>My boss is always "So what can you do? Hmm.. Ah! Fresh out of uni I see, so literally nothing."
What an asshole. Hope someone runs him over. You must be a true cock-sucker sucking up to some asshole like that.
>>
>>60489249
who a hell would to give an shit aboutregardingof such lang
>>
>>60489195

You would have a language, but it would not be a language that could be feasibly used to describe an abstract machine/program. You could have a markup language, however.

>>60489199

You can have conditional execution in lambda calculus, as well as general recursion.
>>
>>60489234
show me where lambda calculus has conditional execution (execution is not even a thing when talking about lambda calculus)
>>
>>60489292
If you use a language that's not Turing complete you simply have no right to call yourself a programmer, excluding if the language is capable of anything a Turing machine can't do, in which case you actually STILL have no right to call yourself a programmer because clearly whatever you program on is not a computer
>>
>>60489227
So you give your boss rimjobs then?
>>
>>60489325
>because clearly whatever you program on is not a computer
>not a programmer
>program on
What did she mean by this?
>>
I'm developing an asp.NET webpage using vb.NET in the backend. My webform has an UpdatePanel with a Table inside this:
        <asp:ScriptManager ID="Scm_Default" runat="server" EnablePartialRendering="true">
</asp:ScriptManager>

<asp:UpdatePanel ID="Upl_Table" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Btn_Search" />
<asp:AsyncPostBackTrigger ControlID="TxtDate_01" />
<asp:AsyncPostBackTrigger ControlID="TxtDate_02" />
<asp:AsyncPostBackTrigger ControlID="DdlPrevision" />
</Triggers>

<ContentTemplate>
<div id="Div_Error" runat="server" style="margin: 0 auto; width: calc(100% - 5px);">
<p>Sin Resultados</p>
</div>

<div id="Div_Table" class="div_main table_data" runat="server">
<p>Valoralización de Atenciones por Previsión</p>
<div>
<div style="width: 100%;">
<asp:Table ID="Table_Aspx" runat="server" class="display" width="100%" cellspacing="0">
</asp:Table>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>


With JS, I transform my Table(Table_Aspx) whit this Script:
    <script type="text/javascript">
window.addEventListener("load", TablaDatos, false)
function TablaDatos() {
$('#<%= Table_Aspx.ClientID%>').DataTable();
}
</script>


Out of this UpdatePanel I have a Button that fills the Table (It does an AsyncPostBack). my Problem that's the JS Script doesn't Work. Why I can't execute this Script after the AsyncPostBack?
>>
@60489308
>>60489311
>lambda calculus
Which one of them? You do realize that "lambda calculus" doesn't actually refer to anything, right?
>>
>>60489325
>If you use a language that's not Turing complete you simply have no right to call yourself a programmer
That is actually one of the main conditions for calling yourself a programmer.
>>
>>60489195
>>60489234
>>60489311
>>60489361


type Bool = Ɐa. a → a → a
true, false : Bool

true = λx. λy. x
false = λx. λy. y

ifThenElse :Ɐa. Bool → a → a → a
ifThenElse b = b


obviously untyped can represent the same
>>
>>60489311
This:
\a.(\b.a)
Is different from this:
\a.a
That's a very trivial kind of conditional execution: the meaning of symbols in the language is conditional on their sequence.
>>
Where the conditional execution in

({ () => print("a"), () => print("b" }[foo > bar])()
>>
>>60489373
wrong
>>
 LUA_API void lua_sethook (lua_State *L, lua_Hook func, int mask, int count) {
//stuff
}

What significance is "LUA_API"? Its not the function return type, because in this case its void. I see this in some C code but I dont get it.
>>
>>60489385
Why did you reply to me if you didn't answer my question? I'm talking about post >>60489361
>>
>>60489414
If it were written differently it would mean something different. Its meaning is conditional on how it's written
>>
>>60489415
>wrong
Wrong.
>>
>>60489418
lambda calculus does refer to something very specific, though you may use "a lambda calculus" to refer to an extension of the core lambda calculus
>>
File: 1494995805430.png (1.68 MB, 1044x1044)
1.68 MB
1.68 MB PNG
>>60489429
>Wrong.
rong
>>
Daily reminder that Rust is taking it's first few steps towards dependent typing:
https://github.com/rust-lang/rfcs/pull/1931
https://internals.rust-lang.org/t/lang-team-minutes-const-generics/5090
>>
>>60489426
No. You could have a language in which every program is a loop. That isn't conditional on how it's written.
>>60489433
It doesn't refer to any single language.
>core lambda calculus
What do you mean by this? A core of what lambda calculus?
>>
>>60489451
daily reminder that rust is a meme and mozilla is a walking corpse
>>
>>60489451
Aren't Rust generics compile-time?
>>
>>60489426
there is no condition in this code

there is a comparison
an fetch
an evaluation
>>
>>60489451
dependent typing a shit

suppose i have a type Nat
it start at 1

i have Int
it 0

i add 1 to Int

my Int is now also Nat
but it was not before

it is very UN-Nat for variable to change type at runtime
>>
>>60489488
what?
>>
>use mingw via codeblocks for years, happy
>need to use headers that aren't included
>download sdk from ms website
>link
>all sorts of errors and discrepancies
>windows sdk is designed to only work with visual studio
>at least 6gb to download
I feel like killing the next person I see
>>
>>60489488
I don't know if this is a shitpost or retardation desu
>>
>>60489488
excellent
>>
>>60489503
>use mingw via codeblocks
Found the problem senpai
>>
>>60489488
So you prove at compile time that your nat is nonzero. If it reaches zero during the execution of the program, it's not a nat.
>>
>>60489528
Can you translate his post?
>>
>>60489488
Dependent typing is a scam.
>>
>>60489528
That's not the problem. No need to check at compile-time, it's easy enough to just throw a runtime error if a value tries to go out of its type. The problem is, if a value goes into another type without going out of its original type, which type is it?
>>
>>60489578
>if a value goes into another type without going out of its original type
What did he mean by this?
>>
>>60489503
>mixing comfy mingw and pig disgusting MS
You either go full MS visual studio cancer or full mingw. Btw I hope you're using mingw-w64 from win-builds.
>>
>>60489590
i have Int
it 0
i add 1
Int is 1 now
1 is Nat
so is my Int a Nat or is it an Int?
>>
>>60489541
I think what he means is that natural numbers are the subset of integers which are >=1.

I.e. I think that he's suggesting that expressing this as a type is bad because whether or not an integer is a natural number can change during runtime as you mutate it, while in a statically typed language, types are defined at compile time.
>>
>>60489590
Nat is 1 to infinite
Int is 0 to infinite

A = 0

type of A is Int

B = A + 1

now, the type of B is Int or Nat ?
>>
>>60489605
It's still an int, unless it is cast as a nat using a proof that it is positive.
>>
File: smug_ran.jpg (632 KB, 709x1063)
632 KB
632 KB JPG
>0 isn't in N in his language
Brainlet af desu
>>
>>60489605
You can't turn 1 : Nat into 1 : Int without casting it.
>>60489621
>Nat is 1 to infinite
No.
Nat is
Z : Nat
Succ : Nat -> Nat
There are no numbers involved, except for convenience. Why would (Succ Z) : Nat somehow become an Int?
Integers aren't usually even defined as a type in this way as far as I'm aware.
>>
>types, dependencies, casting, ...
kek, all this has been resolved by dynamic typing, you fags.
>>
>>60489694
>dynamic typing
That's a contradiction in terms. No such thing can possibly exist.
>>
>>60489605
>>60489621
Is this some joke I'm not getting?
>>
>>60489708
k tard
>>
>>60489694
>kek
>you fags
>dynamic typing
This thread is for above 80 IQ users only.
>>
>>60489621
You're complaining about subtyping, not dependent typing
>>
TDD > static typing
>>
>>60489730
Haskell Curry was a proponent of dynamic typing.
>>
PDD > everything else > T*D
>>
>ever writing tests
lol
>>
>>60489773
How can someone be a "proponent" of something which is impossible by definition?
And why do you think him being a "proponent" of it would somehow change anything?
>>
>>60489605
>what is strong typing
>>
>>60489798
>something which is impossible by definition
what?
>>
>>60489796
this

most things besides trivial school exercises you can't just "test" with a simple harness, you would have to engineer a really complicated test for some programmer to solve like a puzzle, just write the program itself you don't need some fucking test
>>
How are you guys liking Idris? Have any of you read the book by Edwin Brady?
>>
>>60489821
You are genuinely fucking retarded.
>>
>>60489837
have fun writing a compiler without any tests. how would you know that your last modification has not introduced a bug?
>>
>>60489864
how would you know that your tests don't have bugs?
>>
>>60489849
how python is a thing if dynamic typing is impossible?
>>
>>60489864
It would be a type error.
>>
File: 1495051259074.png (694 KB, 816x816)
694 KB
694 KB PNG
>>60489847
>How are you guys liking Idris?
It's pretty bad since it has general recursion.
>>
>>60489885
Python is unityped.
>>
>>60489882
because logic? it's easier to manually check a test one time than your program every time
>>
>>60489864
I mostly use proofs instead of tests.
>>
>>60489907
>what is loose coupling
>>
>>60489885
Python's existence is only possible if it's not "dynamically typed".
>>
>>60489905
wrong, python has types.
>>
Python is strongly typed.
>>
if your development process REQUIRES tests you're writing some fucking sloppy code
>>
>>60489837
>>60489956
t. never worked on a real project
>>
>Some are descended from angels
Agda

>Others are descended from apes
Python

>Some are the result of romantic love
Idris

>Others the result of rapes
C++
>>
>>60489971
t. pajeet
t. doesn't know how to separate code into modules
t. doesn't have a grasp of his software architecture, just duct tapes it together and hoping that the tests will catch all the bugs
>>
>>60490000
>0000
C++ looks like a magnificent rape child. Two strange men Simula/Smalltalk raped an innocent working lady C.
>>
File: 1481144220145.jpg (50 KB, 720x720)
50 KB
50 KB JPG
Is there a programming language which is anime-complete?
>>
File: dlang_chan.jpg (139 KB, 470x545)
139 KB
139 KB JPG
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); and she's super duper cute and easy to prototype in! Say something nice about her, /dpt/!
>>
>>60490242
Lisp
>>
>>60490254
Rust > D
>>
>>60490260
Where can I find a proof of its anime-completeness?
>>
>>60490275
It's a proof by construction.
>>
>>60490254
>she

>>60490275
Lain
>>
>>60490254
stop posting this
>>
>>60490268
I think you can generalise that a bit more:
* > D
>>
>>60490268
I'd make a tread between Rust and D. I prefer more productivity. That's the only think that'll kill rust
>>
File: 13479061011671.gif (127 KB, 480x270)
127 KB
127 KB GIF
>>60490260
>gayest language is anime-complete
You can't make this shit up lmao
>>
New thread:

>>60490315
>>60490315
>>60490315
>>
>>60490279
Is Lisp a construction which proves its own anime-completeness?




Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

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.