/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g2d/BitmapFont.html#setUseIntegerPositions-boolean-
pastebin.com/9KbUQt8M
twitter.com/NSFWRedditVideo

First for C++

Very nice, how much?

16

Program me a gf

>you will never buy a mail order bride from ukraine and murder her
>you will never develop a file system

web application for managing events (laravel)

Thank you for not using anime

...

rate my stupid game
import System.Random

main :: IO ()
main = do
putStr "guess a number between 1-1000: "
fst randomR (1,1000) newStdGen >>= loop 0

loop :: Int -> Int -> IO ()
loop c n = do
i > loop (c+1) n

reiserfs?

Neat-o. Now make a Hangman game.

thanks for no anime shit

Is this regarded as good form in coding? I'm not if this more readable or not.

String str_Query1 = "INSERT INTO perguntas ("+
"area,"+
"question,"+
"r1,"+
"r2,"+
"r3,"+
"r4,"+
"difficulty,"+
"correct) SELECT"+
"'math',"+
"'2+2',"+
"'1',"+
"'2',"+
"'3',"+
"'4',"+
"1,"+
"4"+
"WHERE NOT EXISTS (SELECT * FROM quizz);";

*I'm not sure

...

working on my first serious project using a gui toolkit

is it supposed to be this frustrating?

Probably. What toolkit?

I know, right? My teacher taught my class something like this, but never a query of this size. It was mostly bite sized queries. It didn't looked like this abomination.

What language is that? It looks like it's just going to generate a static string to me.

It really depends on the language and the toolkit. You're going to have a harder time programming Gtk in Perl than, say, using the built-in GUI libraries in Java or Racket.

That being said, GUI programming is hairy no matter what. You're going to have a whole lot of ugly programs before you really get the knack of things. If you're just starting out, I wouldn't worry too much because no matter how hard you work on it it's going to be shitty.

Java. My teacher is an old fart that isn't really coherent with his programming style. I'm just wondering if this is actually good form that I will find on other people's code regularly, because this looks awful.

you have any experience in gui programming with haskell??

using qt, Im trying to code it manually using c++ and avoid using the designer

if + just concatenates strings, there is no reason to split them up like that
just do "r1,r2" etc etc

>I'm just wondering if this is actually good form
It isn't. At most I would split that whole thing in maybe two.

>that I will find on other people's code regularly
You definitely will. Of course, I've seen a lot of really, really bad Java code.

...

Why isn't this anime?

Thanks, mates.

Negative

>manually using c++ and avoid using the designer
Godspeed. Qt isn't the worst, but you can lose yourself pretty easily. It just takes practice, user, I believe in you!

not really, but then again its fucking DB shit so it's gonna look like shit either way

kill yourself

Only if you go out with me.

Good morning. I see the assassins have failed.

Anime is harmful.

>Disgusting 3D females

Get the fuck off my website normalfags

maybe something like this

String str_Query1 =
"INSERT INTO perguntas (area, question, r1, r2, r3, r4, difficulty, correct) " +
"SELECT 'math', '2+2', '1', '2', '3', '4', 1, 4 " +
"WHERE NOT EXISTS (SELECT * FROM quizz);";

you fucking weeboo

ez b8

Not programming.

>>>/reddit/

Not bait. This is an anime website and Sup Forums has always been techloli/g/y.

you're clearly picking out the most ridiculous smug anime pics to annoy people

>something completely new works on the first try

The problem is people who complain about anime on an anime website. Anime is not the problem, you are.

you're the problem, you're shitting up a fucking programming thread just because it doesn't have anime in the OP, kill yourself

>"works"

These two fags were attacking anime on an anime website and I was telling them to fuck off.

...

...

>
>>Disgusting 3D females
KILL YOURSELF

>I've only been here for a month herp derp

Thanks user, I was just about to upload that image.

>Sup Forums
>forum

a stupid game

I really like your work, kid. You got talent. Talent like that is hard to come by these days.

I want you to work for my firm. 148k per annum. We're based in New York. We'll fly you in here - first class and free of charge. You start tomorrow.

moot is gone you retard, you need to fuck off back to Sup Forums

How can I make this code more performant?

time node if.js


real 0m4.405s


const exec = require('child_process').exec
const fs = require('fs');

checkEquality = (this_variable, do_something_if_true, do_something_if_false) =>
{
fs.writeFile('do_something_if_true.js',`eval('(${do_something_if_true.toString().replace(/\\/g,"\\\\").replace(/\"/g,"\\\"").replace(/\'/g,"\\\'")})()')`,(err) => 1)

fs.writeFile('do_something_if_false.js',`eval('(${do_something_if_false.toString().replace(/\\/g,"\\\\").replace(/\"/g,"\\\"").replace(/\'/g,"\\\'")})()')`,(err) => 1)

exec(`echo \'exec(\"python -c \'\"\'\"\'from subprocess import Popen,PIPE;Popen([\\\"\'\"node\\\\\"\'\",\\\"\'\"-e\\\\\"\'\",Popen([\\\"\'\"cat\\\\\"\'\",\\\"\'\"do_something_if_true.js\\\\\"\'\"],stdout=PIPE).stdout.read()]) if \\\"\'\"true\\\\\"\'\"==\\\"\'\"${Math.ceil(Math.sqrt(Math.sin(((!(this_variable&&!this_variable)-1)||!(this_variable

>js

Ya did it!

Moot stepping down and selling the site doesn't change a thing. This is an anime website and always will be. Just because you came here post fappening doesn't mean that you belong here.

>python

same grills x^&

Is not the language that sets the speed but the algorithm. All languages can run O(n).

#define 0 int
#define 1 const
Point a(0 * 1);
dob geg
>sepples
>not even once

>#define 0
>#define 1
You can't do that.

A mobile app that's going to make me a billionaire.

exactly

time ./hs
"It's damn true"

real 0m0.002s


do_something_if_true = print "It's damn true"
do_something_if_false = print "Hillary Clinton"
main = if 3>2 then do_something_if_true else do_something_if_false

just do some legally questionable shit like uber did and you'll be rich af

That only works if you have the nose for it.

Learning python as my first language
Good choice? Which one should be next?

it's trash

learn java and C++

C, then Kashell

I'm using Libgdx to create android games.

When I draw onto the screen using BitmapFont, the text jitters when I move the Orthographic camera.
I want to be able to keep the text coordinates stationary, but have the text remain on the screen, as the camera moves.

How do I do this? I've been told not to make another SpriteBatch, but I don't see any ways around this.

You'll never learn how to program if you learn Python. Learn Haskell first then Scheme then nose dive into 6502 Assembly.

libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g2d/BitmapFont.html#setUseIntegerPositions-boolean-

...

has anyone use openstreetmaps here? is it possible to render all tiles in a map, and store the images? also, how much space would that take?

Haha that's very funny picture friend. How feels it having no job NEET?

Thank you so much user

What language should I learn for first time, also sysadmin stuff

Don't listen to these people. I'm not even going to give you advice because you shouldn't listen to me either.

python is literally shit though, almost any other language would be better for him to learn

Not him but here's my Haskell hangman
pastebin.com/9KbUQt8M

what are they like 16
what is this pedo shit

Why?
Python is made to be easy to use and it succeeds at it. Java and C are a pain to learn because they're a pain to use. And nobody wants to learn Lisp (the best option) anyways so it's no use trying to get people to learn it.

Whatever your opinion of C being used in the current year is, or how much you think C++ is a fucking ass backwards mess, or how much of a babby language you may think C# is, we can all agree that each of them is vastly superior to Python.

Yeah, but how much?

>Pedo shit
>Fully clothed girls who are of legal age in most of the civilised world

Get your head out of your arse.

if you want to be a racing driver you don't just sit around and play with toy cars. if you want to learn something and be good at it you don't just take the easy route

Oh

Okay thanks you got me

Don't listen to this faggot, it's a good language but a terrible first language.

>fully clothed
>their face completely visible
>their arms completely visible
>neck visible
>upper torso slightly visible
You're lucky I live in the UK amerifat

Most Lisps are a pain to use too though

Inshallah Brother

I've tried learning C++ multiple times over the past 5 years, but I've always gotten stuck and given up as it's so hard.

I started Javascript, and was making games in canvas within a few days, and it felt so rewarding.

I've moved onto Java, and the transition was so easy.

I'd say start with Javascript, if your motivation comes from seeing results on the screen.

>And nobody wants to learn Lisp (the best option) anyways
Thank G-d for that.

Who /cultured coder/ here?

...

>coder
>html
k

also, stop eating so much sugar, fattie

>Animeshit