/dpt/ - Daily Programming Thread

go is ridiculously disgusting edition fuck you

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

Other urls found in this thread:

en.wikipedia.org/wiki/Modulus
round.io/chat
tour.golang.org/basics/8
tour.golang.org/basics/12
tour.golang.org/basics/14
github.com/luciotato/golang-notes/blob/master/OOP.md
github.com/noctuid/tdrop/blob/master/tdrop
tip.golang.org/src/math/big/int.go#L164
twitter.com/SFWRedditVideos

A Firefox extension to track Jews

java looks disgusting for math as well

First for Scala a shit

at least the syntax doesn't look like it was designed by a mongoloid

this

this is what im doin

what are u doin?

you what
java syntax is a lot worse

>it's a bikeshedding episode

kys

Java syntax is disgusting.

Give me a project slightly harder than fizzbuzz?

>go is ridiculously disgusting edition fuck you
indeed, uninstalling as we speak, that was the most disgusting shit I've seen in my life recently

Photoshop clone

anyways its scraping the harry potter wikia in its entirety (finished), converting to an appropriate tabulated format, converting to .opf (xml-style format), then converting to .mobi (dictionary-style format for kindles)
should take another 3 or 4 days but in the end you should have a dictionary for when you're reading on-the go (so you could click any word that says worms and get the definition in the harry potter universe)
it'll be great

can be ported easily enough to other wikis too
cool, right?

how is this:

>var facts [10001]*big.Int
facts[0] = big.NewInt(1)
big_i := new(big.Int)

not infinitely worse than:

>BigInteger[] facts = new BigInteger[10001];
facts[0] = new BigInteger(1);
BigInteger bigI;

KILL YOURSELVES

fug
Slightly less difficult?

16th for Go is faster than C+libgmp
package main

import (
"fmt"
"math/big"
)

func main() {
var facts [10001]*big.Int
facts[0] = big.NewInt(1)
tmp := new(big.Int)
for i := int64(1); i

because in java, there is no type inference system pajeet

fucks given:

>i'm too lazy and stupid to specify and care about types
kill yourself

>fmt.Printf("%s", facts[10000].Text(10))
once again, this is dumb...
fmt.Println(facts[10000].Text(10))

New to programming here. Why would something like n % 3 = 0 mean something is divisible by three when 6 % 3 = 2, etc.

oh now
what type could this be eh?
var facts [10001]*big.Int

big int since that is the value you are assigning it!

compare that to
BigInteger[] facts = new BigInteger[10001];

hmm... why do I need to write the type both times?

the java syntax is by far more consistent and readable you complete moron

see en.wikipedia.org/wiki/Modulus

y u mad pajeet
too lazy to learn a new language?

How is it more readable? I don't need to read (and write) the type twice

if something is divisible by 3, it would produce a remainder of zero.

Did you skip all of 2nd grade math or something?
That's all % is. It gives the remainder.

kill yourself lazy troll

kill yourself pathetic cunt

6 % 3 is not equal to 2, its equal to 0?

Oh! I see / would just be the division. Thanks user.

variable declaration:

Foo foo;

variable declaration with object creation and assignment:

Foo foo = new Foo();

consistent. readable.

oh pajeet

in good languages you can't declare Null variables

so you are left with this
Foo foo = new Foo();


Writing the type twice for no reason whatsoever

>in good languages you can't declare Null variables
holy fuck kill yourself smug prick

also what about this

Foo foo = new Bar();

FUCKING RETARD

could you compare it with the Builtin factorial in gmp? mpz_fac_ui

round.io/chat

it would probably be O(n^2) instead of O(n) since they're generating each one

foo_t *foo = (foo_t *) malloc(sizeof(foo_t));

don't forget

foo_init(foo);

pajeet please, there is no inheritance in good languages well

>go doesn't have inheritence
AHAHAHAHAHA that's just pathetic, what a pathetic joke of a shitlang

Go (golang)

variable declaration:

// this actually initializes foo to the "zero" (default) value:
// tour.golang.org/basics/8
// tour.golang.org/basics/12
var foo Foo


variable declaration with assignment
// Foo here is a function that returns an object of type Foo
var foo Foo = Foo()
or
// type inference: tour.golang.org/basics/14
foo := Foo()

can I just write a c++ cli and then use a gui framework so should I make my program from the ground up in the framework. In this case considering qt

>Casting malloc
What a fag.

hello pajeet,
inheritance, like java with it no type inference, is outdated

interfaces are the proper way to do object oriented code, alan kay didn't think of java with his OO definition

disgusting as shit, with the new operator it's more readable because you know that you're constructing a new object, and 'Foo' at the start of the line conveys a shit ton more information than 'var'

To the linux user from prev thread.

Is that a time command?
What params should i use to obtain similar data being printed? (not just real, user and sys time)

time prog

lol good luck with that smug hipster fag just look at which lang is #1 and which lang is irrelevant and stillborn

red black BST

>implying
golang has OOP-like features, without being OOP. google golang inheritance"" :)
github.com/luciotato/golang-notes/blob/master/OOP.md

>OOP-like features
>without being OOP
>github.com/luciotato/golang-notes/blob/master/OOP.md
>OOP
the smug in this post

how cool is this github.com/noctuid/tdrop/blob/master/tdrop

>anime in the screenshots
into the trash it goes

first f# post

well shit, after doing it in quick successions (5 calls each)
gmp was 20ms for me
go was 10ms

I wonder if someone could try it with R or julia or whatever math shit there is

>mpz_fac_ui
sorry, I hadn't seen this post.
mpz_fac_ui is much faster (at least 5x) than both versions, C+mpz_mul_ui and the Go code I posted.

mpz_fac_ui would be equivalent to facts.MulRange(1, 10000) in Go, which takes ~ 2x the time mpz_fac_ui takes (including printing):
package main

import (
"fmt"
"math/big"
)

func main() {
facts := big.NewInt(1)
fmt.Println(facts.MulRange(1, 10000).Text(10))
}

>MulRange
but I bet ^ could be optimized/simplified easily:
tip.golang.org/src/math/big/int.go#L164

Can't wait to end this semester
I have a personal project of programming a simple neural network and also learn functional programming. Any recs for the second one? Which language should I use?

>mpz_fac_ui would be equivalent to facts.MulRange(1, 10000) in Go, which takes ~ 2x the time mpz_fac_ui takes (including printing):
nevermind, for some reason, MulRange is much slower... like ~1/20x of mpz_fac_ui

>~1/20x
err, 20x

why the fuck is
temp = new
new = temp+new
different from
temp,new = new,temp+new
???? is python just retarded? is there a name for why it does this?

question : does anyone have that list of 200 od programming challenges ?

I got Ivy to zoom in/out on an image with the scrollbars adjusted for the mouse position. Took me a while to figure out how to pull that off based on how init-auto-scrollbars works, but I am pleased it's working now.

CocaCola

>le webapps are le future amirite guise xDxDxD

>tfw someone from your class asks a question on stack overflow about the assignment your stuck on.

Nigga was pretty hardcore too, even included his name, picture and what university he goes to on his profile.

link that shit nigga

Why nigga?

stuck on the problem as well

>casting a void* before an assignment
>thinking there is anything wrong with the rest of the line

how do you know what the problem is

because I go to the same university

Are you by any chance who was talking about?

No, but I am

What a small world lads, we all go to the same university!

are you sure you aren't me?

Well I posted this within 30 seconds so Sup Forums says you arent me.

Fucking liar, then why do I see two (You)s in this post?

Reminder Java is shit

OFF BY 1
CUNT

I don't know about Go in particular, but type inference is a done deal. Seriously, it's a "solved" problem. HM type inference (and derived systems) is very simple, reliable and robust.

Then again Java folk managed to fuck it up, predictably, by only half-ass-ing it.

I don't even read hp but that sounds cool

KILL YOURSELF

TypeName foo = bar();

is obviously more readable than

var foo = bar();

also

// if bar returns something other than a TypeName it's a type error
TypeName foo = bar();

// no error here no matter which type bar returns, might get hard-to-detect errors later on in the code
var foo = bar();

...

pajeet

pathetic gjewgle python-tier normie shitcunt

>gjewgle
What?

captcha is 2016

java is for normies and pajeets

Why are normies so retarded?
Why do they like Java?

"java is bad" is literally a normie meme you're fucking pathetic normies

that's what they were taught in university/high school
they don't know anything else

these are the same people who go to youtube for tutorials, can't even read online documentation

see:
anyone who isn't a stupid normie can clearly tell that type inference and go syntax is disgusting, fucking idiots

you're the ones that got taught it and you were too stupid to understand it so you're butthurt as shit over java and fox and the graping this hard

see also:

pajeet my son

that's some weak ass trolling get a life stupid shitkid

you poor poor man

pajeet go back to your kind at xda forums

you sure convinced me with those hot opinions

pajeet, telling someone to get out isn't an opinion
surely your call center boss trained you better