/dpt/ - Daily Programming Thread

What's in the box, Sup Forums?
Old thread:

Other urls found in this thread:

github.com/Booom3/Image-Comparer
learnxinyminutes.com/docs/csharp/
twitter.com/NSFWRedditVideo

First for redblack tree, the cutest amongst selfbalancing

First for fuck FP purist whiners.

>What's in the box
pussy

Yeah I know this feeling. When nobody gives you attention unless you mention that you have a relatively good job. Its like there's only bottom of the barrel gold diggers out there for you.

Do you mean AVL?

C influenced languages get an automatic F in my book.

Why are you posting that whore?

>C influenced languages get an automatic F in my book.
Good thing nobody cares about your book, huhuhu

tfw
error: C++ style comments are not allowed in ISO C90
//

NO SHITPOSTING BELOW THIS LINE

_____________________

Good, // comments are cancerous.

>Sup Forums is a slow board you idiot

Objectively false.

I respectfully disagree. Last time I tried commenting out a section of code, the following happened:
before:
blablah somecode;
while (ttt) { /* helpful comment */
foobarspamegg
}
things;

I wanted to shut up the loop so I put comment markers around it and...
blablah somecode;
/*
while (ttt) { /* helpful comment */
foobarspamegg
}
*/
things;

MOTHERFUCKERS DON'T NEST! At least so called C++ comments do for fuck's sake!

When are you going to put up your fork on github you lazy fuck

#if 0
#endif

I don't understand why comments wouldn't nest. It's easy and very cheap to implement. And I don't see the drawbacks.

I've been working during the day, and drinking at night, mate. Someday soon, I hope.

It's mostly a caching issue at this point. I want to implement different methods for forcing fresh data or being fine with data cached with a set expiration time.

Yeah why not. I'll remember that.

Agreed, I intuitively assumed they did, but apparently they don't. Gotta check the standard, brb.

They do in ocaml.

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/!

>3DPD

By the way, is chinkm00t blocking requests without an user agent now or is it just me?

I had no issue running that code just now in the normal manner.

If your requests are brittle, you might get an exception.

Threadly reminder that you need to rethink your life.

Weird, the imgboard.php & the posting endpoints now return 403 without an user agent

feels good man.

Oh, I'm not attempting any posts at this point. My motivations are data analytics-based; I'm intending to set up a system that regularly caches post data in a way that I can analyze sentiment and other qualitative metrics of posts over time.

Would you be interested on adding a posting component though? I could help if you put it on github

I finished my one day project. I certainly enjoyed making it, although if anyone has suggestions for better C# argument parsers I would love to know because fuck both the one I used and the one I dropped.

github.com/Booom3/Image-Comparer

Should I learn android development with java or kotlin?

>Booom3

Imagine a /dpt/ without anime, autism and faggotry

>imagine Sup Forums without anime
it's called reddit

>for (
int x = bounds.x;
x < bounds.w;
x++
)

it's beautiful

>redeclaring var type every loop cycle
it's like you don't care about performace

Fuck off with your retarded tricks that don't matter

His dick

>tfw finish assignment about recursion but didn't do it on purpose

Types are overrated

Without using recursion you mean? Noice. Not very academic, but quite classy. Personally I do my Java homework with SoA and dynamic typing, to each their guilty pleasures.

Nope, read it again.

Oh yeah that's just a leftover from when those lines were significantly longer. Looks glorious now though.

: Faggot

Reposting from /wdg/.

My job is shit, I'm quitting, I have enough money to stay at home learning something on my own for a while.

Web dev or coding for landing a job and making money?

Both are pretty good afaik, depends on if you enjoy design or logic more.

dumb frogposter

Last night, I put together a PRAW bot to mass downvote submissions and comments of a given Reddit user. I even fancied it up with a Tkinter UI. However, the Stack Exchange crowd didn't care much for it. "Malicious" and "against Reddit policy" got thrown around. I thought it was "Code Review" not "Ethics Review", but whatever.

Anyway, what would be a good serious project to start up on? I've built endless amounts of web scrapers, small scale web servers, web pages, system applications like notepad, media players, etc. But I want to pour my time into something a bit larger and with a more serious goal. Any ideas for an intermediate programmer?

Write a C compiler

I actually am not a C guy. I know Python, Ruby, Java, and Javascript. Though, jumping ship to C# wouldn't be terrible. I could also write a Java compiler, no? What is the purpose of reinventing a compiler? What skills would I gain from that? Thanks for the suggestion.

>I know Python, Ruby, Java, and Javascript
You're not an intermediate programmer then
Go learn something lower level

why c#?

can c++ programs take the screen as input and then output key presses

It's the language I know best.

Oh, my apologies, I didn't know that my experience in making programs came from what language I used, instead of simply writing code. Why are you refusing to offer projects for those languages? I have taken a couple C classes in school, and have written quite a few programs in it, but chose other languages to develop in.

Maybe offer some suggestions for me to improve instead of just calling me out?

>Maybe offer some suggestions for me to improve instead of just calling me out?
That's what I did. Go learn something lower level to understand how a computer really works.

>Java compiler

You're writing it like C++ or Java, not using any of the sugar that makes C# enjoyable to use.

That's true, I have spent the last year and a half writing Node.JS and just regular JavaScript. I have forgotten a lot of the real neat shit about C#.

Anywhere I can get up to date quickly?

learnxinyminutes.com/docs/csharp/

>programming
>suddenly get a boner
wtf
how do I cope with this shit

Are you referring to the new 6 & 7 C# features? Maybe he wanted to keep compatibility with older VS versions

wear a chastity cage

No, what you did was ignore my original question and offer bullshit. My six ITS certs give me a comfy understanding of hardware and firmware. I know some assembly stuff as well.

I was asking for programming projects in some relation to my current skill-base.

Your solution read like: "Hey, I know you're an active programmer using some of the industries top-used languages, and your question was asking for projects possibly related to said languages, but instead I'm going to offer the idea that you should ditch those interests and pursue an entirely different language that you have already worked with in college, but maybe this time you should really go deep with it. Otherwise, give up on being a real programmer."

Man, I was just looking for more serious side-projects to work on. My job has me developing software for a medical information system, which is cool and all, but I wanted to see if you guys had any ideas of what I could write, at home, as a more involved project. Instead, I got shit.

Oh well, back to the Stack Exchange / Reddit. At least the levels of glorified smart-ass are a bit lower on those sites.

You'll fit right into reddit because here we don't reply to bait.

Jesus fucking christ, just fuck off to r*ddit
Nobody's gonna read your butthurt paragraphs for every shitpost you respond to

Saved

rate my haskell http server!
{-# LANGUAGE OverloadedStrings #-}

import Network.Wai.Handler.Warp (run)
import Network.Wai (Application, responseLBS)
import Network.HTTP.Types.Status (status200)

import qualified Data.ByteString as BS

main :: IO ()
main = do
putStrLn "Starting Server!"
run 8000 app

app :: Application
app req respond = do
putStrLn ("Got Request: " ++ (show req))
let response = responseLBS status200 [] "Hello World!"
putStrLn "Sending Response..."
respond response

>import

You didn't write anything.

>I've built endless amounts of web scrapers, small scale web servers, web pages,
Either you are bullshitting or aren't paying attention to your work. Project ideas pop up naturally when building "endless amounts of ..". Make a framework for yourself, I don't know. Make something your colleagues could benefit from

>String

0/10 apply yourself

>importing status 200 specifically
Jesus christ who let this language out of its crib. Shit like this needs to suffer SIDS.

I play a game with myself. If I reach a certain milestone in my program I award myself with a nice fap session. It's pretty effective

Literally not even using foreach, collections/LINQ, or even a null coalesce.

This:
if (options.OutputFilename == null)
{
outputFilename = fileName;
}
else
{
outputFilename = options.OutputFilename;
outputFilename = outputFilename.Replace("",
Path.GetFileNameWithoutExtension(path));
outputFilename = outputFilename.Replace("",
Path.GetExtension(path));
}


Can be replaced with:
outputFilename = options.OutputFilename?.Replace("").Replace("") ?? fileName;

Those bars are in those strings because apparently the XML tags in the cod is breaking Sup Forums. wtf, moot.

im a cuck

>outputFilename = options.OutputFilename?.Replace("").Replace("") ?? fileName;
replace with
var ext = Path.GetExtension(path);
outputFilename = options.OutputFilename?.Replace("", ext).Replace("", ext) ?? fileName;

>foreach

B L O A T

Once I "rewarded myself" in bathroom at work when one of our teamleads barged in since I forgot to lock the door for some reason. What's interesting is that it happened again after a year or so; I was simultaneously shitting, farting and masturbating this time.

What does he think of me I wonder

foreach is slower though

It can actually be orders of magnitude faster than a traditional for loop in some cases.

Since he didn't fire you, He must have liked what he saw.

Is worrying about bloat in a high level language like C# a bit of a moot point?

I mean, unless you're optimizing an algorithm that is clearly far too performance intensive it's a bit silly.

Cross dress and take hormones
Won't get any boners

I know right! It's so concise!
There will be gradual improvements!
Here you go!
status200 = Status 200 []

What is a ``FP" though??

>foreach
I wanted to but at some point I had to use an index so I just rolled with regular for loops. At some point this changed again but I couldn't be fucked refactoring again.

>collections/LINQ
LINQ is real neat but I don't think I need to do any querying in my code.

>null coalesce
Completely forgot about those, fuck they are good.

Still requires a definition for Status, or am I being retarded?

hi guys, im learning c++ and i want to make a music player, with a focus on design, does anyone know how i can make the interface customizable with skins?? what framework can i use? i was thinking QT...

yes use QT.

pretty sure QT would support plastering a .jpg image on their components, look in the QT documentation.

Use SDL. I know SDL is designed to be used for games but I know it really nice to use for desktop applications.

>fuck they are good
Anyone who thinks anything in that shitlang can be "good" is clearly fucking delusional.

C# is by far my favorite language, I love the hell out of it.

data Status
= Status { statusCode :: Int
, statusMessage :: B.ByteString
} deriving (Show, Typeable)

Definitely not.
You shouldn't use C* for any purpose.

>excitement
>optimism

But I just did.

and you should feel bad for being dummy

why would you say so
c hash is a bretty comfy language

I realize that being a poor programmer, you may lack the cognitive capacity to understand that.

>comfy
I'm not surprised someone such as yourself would find C h*sh a "c*mfy" language.

im tempted but sounds too much work, im going to look into it...
i've never seen a cool qt interface though, does it supports animations like menu slides and stuff??

>new IP
Masterful pasta, user.