/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

fstar-lang.org/tutorial/
youtube.com/watch?v=I94qbWBGsDs
gist.github.com/steveklabnik/7cd3267a631c4847c34d
youtube.com/watch?v=rRbY3TMUcgQ
lists.busybox.net/pipermail/busybox/2010-December/074114.html
blog.rust-lang.org/2014/12/12/Core-Team.html
twitter.com/AnonBabble

>1 post early

Complete sudoku

Reminder that mindless anti-JS shitters are as bad as pajeets.

Learning me a F*
fstar-lang.org/tutorial/

>Created before the bump limit
>Posting literal faggotry
Delete this shit and kill yourself.

Lemma: OP -> Tot Faggot

>making these posts
No, you kill yourself you autistic shitstain.

Does anyone actually understand what urbit is trying to accomplish?

youtube.com/watch?v=I94qbWBGsDs

functional OS

n.b.
functional does not imply functioning

A post-singularity computing substrate

oh damn
that's the guy who SJWs wanted to shut down

I'm getting a "free(): invalid next size (fast)" error, randomally on a multithreaded program, which I can't replicate in valgrind (most likely because valgrind zeroes all the memory it uses for what you run on it). This is in normal C by the way.
Anyone knows a way to find the culprit fast? It's a very large file with many libraries. Something like 2k lines of code.

Why does everyone here seem to value learning another language instead of learning anything useful for a language they already know?

holy shit look at the first slide he puts up

if that isn't bullshit I don't know what is

urbit is literally an open source joke, trying to get people hyped over what's actually LITERALLY fucking nothing.

Useful people are put to use

>language they already know

Because they're autists that ""know"" 10 languages but can't program anything in any of them.

>implying writing Hello World in Haskell isn't knowing the language

this is the Rust lead...
gist.github.com/steveklabnik/7cd3267a631c4847c34d

Wait, haven't we seen him somewhere before?
youtube.com/watch?v=rRbY3TMUcgQ

>I believe hate speech is violence.

Oh Klabnik, you complete fucking moron.

What a filthy SJW. I don't mind his look and views, but bashing qt Yarvin is unforgivable.

Is that aids skrillex?

d-does he take h-hormones?

any lambdaconf 2016 videos online?

what a loser

I wrote a proxy checker in python but it is complete shit, even after implementing threading.

Currently, I request a static page and if the text matches, the proxy works.

Is there a better way?
I've seen proxy checkers go though 10K proxies in 60~ seconds...

>got a high-end laptop for a graduation present
>told my dad to hold onto it until I get a job so I stay motivated
>month in without a single job prospect
>hard drive fails
>"we had a deal user!"

what

also
>kelvin versioning
>decreases by integers to absolute zero
what

get it fixed, might be under warranty or get another hard drive

I check alexa most popular pages

>what

It means that software is developed towards eternal stability. Urbit's ideal is a computing system that should remain unchanged for millenia because is works.

it's retarded, it could be made more efficient and have features added to it, it's delusional to think you've reached perfection

What are some sites other than Monster and Indeed for the job hunt? Preferably ones that have decent search algorithms (fuck Dice) and easy application features.

I'm going tomorrow but I'm also broke and he cut me off the day I graduated. I have one month's rent in the bank, plus maybe another in savings bonds

You don't need to request a page to see if a proxy is alive.

You can add features to apps that are built on urbit, but urbit's inrfastructure should be stable. Isn't it cool to have a bedrock abstraction over which everything works?

Isn't that literally what a unix is?

Sup Forums, I cheated on an exam and I feel awful about it

I desperately needed an A in this class and shit wasn't going my way and I'd have ended up with a B if I had not. I could give a thousand of excuses but that's just running away from the sin.

How do I free myself from the guilt?

Fess up and tell your professor.
You'll fail the course, and probably get kicked from the school, but at least you'll feel good about it.

something can work just fine without have to use a pretentious label like "absolute zero" in a "kelvin versioning system"

Just promise you'll never do it again, and learn to settle for Bs

how do you even cheat on an exam

anyway desperate times call for desperate measures and it's no big deal in the end if you got an A instead of B

Nah, unix is gigabytes of bloat at that point. Urbit is just 30k lines for the WHOLE SYSTEM from the turing machine to the OS.

a small peek isn't cheating
unless you literally took his paper from his desk and copied it exactly

Why did you need an A over a B? What class was it? The only way to free yourself is to apply yourself.

?

ping it

Just open the connection in a work group. If the first packet is correct drop the connection and do another proxy.

What if the proxy isn't working anymore but the host is alive?

You gotta do what you gotta do to get ahead, this is the lesson you should take away. You're going to need to do a fuckton of worse things to get ahead or choose the pussy option and get nowhere, what do you want?

If I open my job search to React, Angular and Backbone, am I just going to get a bunch of web design jobs?

of course, what do you expect to get?

to work on web applications or engines like they are made for

RUNNING TESTS: SIMPLE CALCULATOR (NO TOKENIZER)
ALL 107 TESTS PASSED @ TIME: 0.035s
RUNNING TESTS: SIMPLE CALCULATOR (USE TOKENIZER)
ALL 107 TESTS PASSED @ TIME: 0.016s
RUNNING TESTS: ADVANCED CALCULATOR (NO TOKENIZER)
ALL 107 TESTS PASSED @ TIME: 0.093s
RUNNING TESTS: ADVANCED CALCULATOR (USE TOKENIZER)
ALL 107 TESTS PASSED @ TIME: 0.039s
RUNNING TESTS: SYMBOLIC SIMPLIFICATION
ALL 56 TESTS PASSED @ TIME: 0.037s
RUNNING TESTS: SYMBOLIC DERIVATIVE
ALL 56 TESTS PASSED @ TIME: 0.063s

I would expect it would be used for javascript that does something as opposed to using it for just animations and forms

>I would expect it would be used for javascript that does something as opposed to using it for just animations and forms

Search for node.js then. Also unity has UnityScript which is derived from JS.

I know it but most jobs want angular and I'm running low on options. after this month I'm out of rent money and I'm to unsightly to be a stripper

node js is super popular, I don't see how you can't find job with it.

Everyone in new york is still using rails, django and java

go frontend then, its not bad

Is it good practice to declare unsigned types with their size like say u_int32 compared to say int?

Isn't explicit a good practice for portable code that way you don't have to deal with different compilers making their own assumptions and stuff like say the default size of int on one machine is 32 bits and 64 on another??

...

hell, unix was bloated before it was even released
lists.busybox.net/pipermail/busybox/2010-December/074114.html

alcohol and other drugs

I thought people who wrote system level programming langauges were cool

>How do I free myself from the guilt?
earn your next A

>Is it good practice to declare unsigned types with their size like say u_int32 compared to say int?
There's a header that contains macros for exactly this. stdint.h
it's good practice because it improves portability. I'm not aware of any cons.

>lead

All he is is the "developer advocate" for Mozilla w.r.t to Rust. He writes friendly documentation and shills Rust around the internet and the convention space. (would you expect anything more from a ruby/rails fag?)

Class project, need to implement AIMD over a udp connection.

Have any of you guys had experience with python sockets? I'm trying to send a file over udp (i know that it's lossy) and if a packet gets dropped i want to know so i can reduce the rate at which they are sent.

However the first packet passes but the others just fail and the conenction is terminated. Any tips? Also newfag here, not sure how to post code. Sorry if I'm being a bother I just really need help

>it's good practice because it improves portability. I'm not aware of any cons.
Actually, it reduces portability, as the (u)intN_t are optional types. Your code will no longer work in situations where those types don't exist, but it is pretty damn rare to find an implementation where they don't.
Also, the types themselves add some possibly misleading information.
If you're using "for (int32_t i = 0; i < n; ++i)" instead of something like "for (int i = 0; i < n; ++i)", you're implying that 'i' HAS to be 32 bits for some specific reason.

trying to teach myself Java before taking classes this fall. i'm trying to make a bill counter (no coins yet) but when i run the program, it asks the first question, i type my answer, and it prints the answer (in the first case times 100) but then sits there, and does not advance to the next question until i type in the number a second time.

any idea what gives? sorry i'm bad at explaining.

import java.util.Scanner;

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

int hundreds, fifties, twenties, tens, fives, ones;

System.out.println("How many hundreds?");
Scanner hundredCount = new Scanner(System.in);
System.out.println(hundredCount.nextInt() * 100);
hundreds = (hundredCount.nextInt() * 100);


System.out.println("How many fifties?");
Scanner fiftyCount = new Scanner(System.in);
System.out.println(fiftyCount.nextInt() * 50);
fifties = (fiftyCount.nextInt() * 50);


System.out.println("How many twenties?");
Scanner twentyCount = new Scanner(System.in);
System.out.println(twentyCount.nextInt() * 20);
twenties = (twentyCount.nextInt() * 20);

System.out.println("How many tens?");
Scanner tenCount = new Scanner(System.in);
System.out.println(tenCount.nextInt() * 10);
tens = (tenCount.nextInt() * 10);

System.out.println("How many fives?");
Scanner fiveCount = new Scanner(System.in);
System.out.println(fiveCount.nextInt() * 5);
fives = (fiveCount.nextInt() * 5);

System.out.println("How many ones?");
Scanner oneCount = new Scanner(System.in);
System.out.println(oneCount.nextInt());
ones = (oneCount.nextInt());

System.out.println(hundreds + fifties + twenties + tens + fives + ones);

}
}

> UDP
> The connection is terminated

You do know that UDP is connectionless, right?

still probably makes more than any of us tee bee hech

post ur code
[ code ] and [ / code ] without the spaces of course

or preferring to use size_t / std::size_t

reuse the scanner;
Scanner in = new Scanner(System.in)
println("Hundreds")
count+= in.nextInt()*100
println("50s")
count+= in.nextInt()*50
//etc

hint: why are you remaking the scanner each time?

Basically the Scanner will eat up as much input as it can, so the 2nd scanner doesn't get it because the first on ate it already, even though it did not need it for the nextInt() call.

The client meat

with open(filepath, 'rb') as f:
data = f.read(BUFFER_SIZE)
while data:
if s.sendto(data, (HOST, PORT)):
chunks += 1

try:
# wait for reply from the server, max 1024 bytes
ack, addr = s.recvfrom(BUFFER_SIZE)
if ack == 'ok':
print "accept"
wait -= 0.00001
except socket.timeout:
print "fail"
wait*=2


data = f.read(BUFFER_SIZE)
time.sleep(wait)

The server

while True:

data, addr = s.recvfrom(BUFFER_SIZE)

if data == "-1":
s.sendto("ok", addr)
else:
with open("test.txt", 'wb') as f:

while(data):
if data == "-1":
continue
else:
print "Receiving File ..."
f.write(data)

# Send ack to client
s.sendto("ok", addr)

data, addr = s.recvfrom(BUFFER_SIZE)
s.close()

>If you're using "for (int32_t i = 0; i < n; ++i)" instead of something like "for (int i = 0; i < n; ++i)", you're implying that 'i' HAS to be 32 bits for some specific reason.
And with int you're implying i HAS to be log2(INT_MAX) bits for some specific reason.

fffuuuuckk
ok cool thank you so much.

ok that makes sense. that's why when i googled, people were saying to close the scanner, but that didn't seem to be working for me.

Your implying it has to be:
a) signed
b) no decimals
c) for any positive integer n, log2(n)=2^n

You are implying nothing about the size, which is implementation defined.

Well, my compiler can now produce valid programs that assign values to variables* in memory. It can also generate procedures and if statements and such. It cannot call procedures yet, so I can't print anything to test if it's valid or not. That shall be done tomorrow.

* can't do arrays yet. Might not do arrays if I don't have the time.

>statements

>non-expression based language

You make me sick you son of a bitch.

blog.rust-lang.org/2014/12/12/Core-Team.html

still part of the core team

how do i delete only one character from my entry?
self.entry.delete(first=0, last=END)this deletes all
self.entry.delete(first=END, last=0)
this does nothing.

Err... it has expressions and statements. I can handle all expressions except function calls, and all statements except procedure calls. I don't have a choice over the language. It's actually a rather ugly sorta Pacal-like language... with a few oddities the professor added (he took most of it from another professor at another university), namely nested comments and the use of

writing documentation is important. but language design and direction is barely dictated by it or its package manager (in the case of katz). especially when cargo is literally a copy of bundler.

but Mozilla has been a SJW shitfest since the tumblerinas forced Eich out of the CEO position.

whoops. im retarded. cant into [code/]

self.entry.delete(first=0, last=END) ##this deletes all.

self.entry.delete(first=END, last=0) ##this deletes nothing

>it has statements
Exactly you twisted fucking pervert
What fucking abomination have you brought into this world?

The issue I'm having is that the first chunk of data goes though but all the other chunks are not received by the server.

I did not invent the language.

Anyways, this is the program I'm able to actually compile:

program ATest;
variable a, b : integer;
variable c : boolean;
begin
a

Why the fuck didn't you invent the language?

And I just realized I had a slight bug. Was pushing false onto the stack where I should have been pushing true. Similarly, program pushes true when it should push false. All because I forgot the ! in front of a strcmp check. Derp.

This is a class assignment. Professor hands us a spec, we build to the spec. One does not deviate from the spec.

Tell your professor that statement based languages are retarded

>end.

only Pascal-like (ones designed or influenced by Wirth) languages do this. PL/I, Ada. Fortran, Algol, Simula, etc don't use a period after the final end.

so.. what language is it? I don't recognize a)). But not one with a double hypen / emdash / whatever.

I'm going to learn Haskell... Is that a good idea?

Yes