/dpt/ - Daily Programming Thread

Old thread: What are you working on Sup Forums?

Other urls found in this thread:

ideone.com/dr7i8E
twitter.com/SFWRedditVideos

/dpt/ anime is the best. OOP meme GTFO.

An express app. Ridiculously simple, I'm surprised I've made it this far. Deploying it using docker and a raspberry pi with resinos, which is fucking amazing.

I downloaded all banners from Sup Forums.

#include

int main(){
FILE *fp;
int i;
char FCDN_LINK[] = "wget

Delete this please

Real thread here guys:

pls delete you faggot

>not infinitely making requests to the website constantly and ripping the randomly selected image and comparing it to all previous unique images before storing it locally

>One space indent
Burn your hard drive asap

for you
#include

int main(){
FILE *fp;
int i;
char FCDN_LINK[] = "wget

why would you write a c program to create a shell script?

>all these nerds writing pages of unnecessary error handling code
Feels good being intelligent enough to know that your progrem works flawlessly.

I didn't know bash at the time of this script.
Now I still don't know it, but I have all banners downloaded.

Start over in snakescript

okay
import os

f = (wdown.c, 'w')

f.write("""#include

int main(){
FILE *fp;
int i;
char FCDN_LINK[] = "wget

Well memed user, here is a (you).

Am pleased.

>Not having your gold stars yet

Is that ASCII GTA?

How shit is Visual Studio Code on linux? I'm currently trying to migrate from Windows to Linux and I need a decent editor (just editor. Not full IDE).

Should I use VSC or something like Atom instead?

emacs

>tfw your (non-trivial) prolog program works on the first try

I honestly feel like a wizard, I could cry, this is too amazing. I am one with the computer. My legs hurt from sitting all day and my mind is broken from not being able to stop working on this project, but this moment, I lived for it.

As far as I know, VSC is no different from Atom in terms of what it uses. They are both JS-applications, so you aren't going to have a significant difference between VSC and Atom.
Emacs can be your friend, since it's easily expandable editor. As far as I know, Vim is expandable too now (but not since long ago).
Emacs script language is Emacs Lisp, Vim uses Lua. Also, with Vim you'll get experience of using a universal UNIX editor, if that matters.

It's... okay. I like it better than Atom out of the box. It's more polished and feels less janky, but it has a weaker add-on ecosystem.

They're both shit, though.

Why a C program that makes a shell script?
If you know shell scripting why not write a shell script?
If you know C why not write a C program?

vim, hands down

>his lang can't do this
(define nigger
(case-lambda
((nigger) (+ nigger 1)
((dick cuck) (+ dick cuck))))

Thanks guys. Real answers. Thats nice

lets say you have a hypothetical synchronous service, what would be the best approach to make an asynchronous middleware? what are some good examples of asynchronous code?

Nice trips.
Care to explain?

First for D

I hope he posted it just to laugh.

>))))

It would be fine if it didn't crash Xorg every once in a while. I can't even find anything about it online but after a little while of using VS code my entire system freezes to death. I have 4gb swap, 8gb ram and it certainly isn't capping it, and yet I must do a hard reset of my PC since not even sysreq or switching TTYs works. reee

thank god its not that annoying as piss web-um again

F# can. But you would never ever ever want to write code like that. Jesus fucking christ.

>If you're mocking in units tests, you didn't abstract correctly.
Not true at all.

The "abstract everything" line of thought is pajeet thinking. Automatically abstracting everything with interface boilerplate is just as dumb as not doing it at all. Contrary to the widely held belief among Java developers, you actually can't shortcut around good design with boilerplate.

>(((()()(()())))

messing around with servers.

how come when i bind a socket to a known port such as 80/http i run an nmap on my localhost it shows it being an open port - but when i bind it to just a random number or known torrent client port such ast 6881 do an nmap no open ports?

is the port still open and ready to process connections or is something wrong?

))))))))))))

port is firewalled?

>Automatically abstracting everything with interface boilerplate is just as dumb as not doing it at all.

I didn't say "abstract everything", nor did I imply it at all. If anything, I'm implicitly arguing against it, because those forced abstractions are the exact bullshit for which you have to mock. You have serious reading comprehension issues.

>I'm saying that as long as the language can enforce a single mutator and no observers
Everything in the scope of the class can "observe" the mutation of the local state. If you don't make any bugs related to local code interacting with that changing state, then yes, it will behave the same as the functional version. But that's the whole point of the functional version, it removes the possibility of those classes of bugs happening.

>solved the 1st puzzle in Lua in hours
>got both stars
>I'm not in the leaderboard

Who thought having Midnight EST as the starting point was a gr8 idea?

in F# this is just
printfn "Hello World!"

Haskell and C++ confirmed for SHIT

in Ruby it's just
p "Hello, World!"

In English this is just Hello, world!

Doesn't print out the same output. Ruby confirmed for SHIT

>Programming in an outdated language
Here, I fixed it so it runs in Python instead
#/usr/bin/env python
from subprocess import call
with open('code.c', 'w') as f:
f.write(r"""#include
int main(){FILE *fp;int i;
char FCDN_LINK[] = "wget

nope im on linux and ive not declared any rules in my iptables.

wait never mind figured it out i guess it was a os permission thing with nmap once i ran nmap with sudo it showed the port as being open.

Of course it does, you numnuts

In Australian it's just "Oi, cunt!'

That is literally the most retarded thing I've read on /dpt/ all week. Fuck me...

Certain ports require root privileges but I thought it was below, not above.

Master race F# outputs:
Hello World!


Peasant tier Ruby outputs:
Hello, World!

That's because I added in a comma, m8

In Russian it's just "Э бля"

nmap doesn't to all ports by default. If you didn't specify you get something like "All 1000 scanned ports". Notice is is MUCH lower than all the ports. Make sure you're scanning what you're intending to scan using the '-p' flag.
"-p -" will do all ports.

Got to cater to the neets.

I also should add that its easier to use
"lsof -i" if you just want to check if something is up on your local machine.

This doesn't do the same thing.
I could also have said

it chooses which function to be based on arg count

"puzzle oriented lang"
what did scheme fag mean by this

He means that it's a puzzle why anyone would use Scheme

>f#

in racket, this is just
(printf "hello world!")

lmao

In Python, this is just
(lambda _, __, ___, ____, _____, ______, _______, ________:
getattr(
__import__(True.__class__.__name__[_] + [].__class__.__name__[__]),
().__class__.__eq__.__class__.__name__[:__] +
().__iter__().__class__.__name__[_____:________]
)(
_, (lambda _, __, ___: _(_, __, ___))(
lambda _, __, ___:
chr(___ % __) + _(_, __, ___ // __) if ___ else
(lambda: _).func_code.co_lnotab,
_

It's like reading pseudo code. Beautiful.

wtf I hate haskell now

want to use dataframes in C#
what's the best package to use?

Looks like a Metroid map.

can you run this code

it would be extremely painful

its midnight and my brain isnt working, is this retarded?

i basically want to take signed and unsigned integers in bison

type : INTEGER
{
$$ = create_node($1, INTEGER, NULL, NULL, NULL);
}
| "-"INTEGER
{
$$ = create_node($1 + $2, INTEGER, NULL, NULL, NULL);
}

ideone.com/dr7i8E

What are some must read books for beginner compsci ?

>ideone
I can't stop associating it with actual Ideon. Hope I'm not alone with this.
It would be fun if some makes a picture for /dpt/ based on Ideon, though.

sedgewick - algorithms

K&R 2nd edition and SICP. the prior teaches C, the latter teaches Scheme. you will likely use neither C nor Scheme if you get a job programming

I've been programming in my spare time for over a decade and I'm fucking poor and I don't have a degree. I want to nab a programming job somehow.

What do?

what are contracts in racket

where are u from?

>you will likely use neither C
What if he's going for embedded?

Mutable state was a mistake.

The United States of America.

Maine, specifically.

(So I'm in the right country for this shit but very much the wrong state.)

upload to github, make a skills resume, include specific major projects as experience in your experience section, then apply. if you're an old fart they might discriminate against you for an entry position... they'd probably want fresh blood so you'd better be good

shart in mart

You can't talk to me that way anymore! Trump is going to cancel your H1B

i just said "likely", which is true since embedded is a minority

lol

then you don't need help

CLRS

i don't even have a H1B

seriously though, is it any good applying for one in USA?

i'm from europe, and had friend who went to work in San Francisco via H1B

good reference, awful textbook

drumpf will be sending the immigrants to a concentration camp soon so i would recommend you wait a couple years for him to be impeached first

xD

apply to jobs. don't let your lack of professional wagecuckery hold you back. If you know your shit you know your shit, if you don't you don't.
I wouldn't list projects on resume unless they were paid for by someone else, but do mention them in your cover letter
customize your cover letter, i've got a damn good reply rate for job postings and i attribute it to writing a customized cover letter for each position. Sure there will be people that tell you a cover letter is useless; ignore them 100% of the time. It's just as important as your resume. Address it to the entire company if you don't have a specific name. e.g. "Dear X Corp. Hiring Team"

I suppose you could update your resume with programming projects if you don't have any professional experience. I don't know how to best do it though. It's hard to say. It's hard to convince people you know how to program if you haven't had a job doing it for years already.

>drumpf is a fashis ecks dee he's going to be in peach!

git out

That depends -- are you actually ANY good at what you do? If so, please come and take the jobs away from the poo-in-loos.

>That depends -- are you actually ANY good at what you do? If so, please come and take the jobs away from the poo-in-loos.


even if i was, how do this things work?

you just go to their website and appy for a job even though you're from europe?

btw, what do you consider a good programmer?

>btw, what do you consider a good programmer?

Gotta be a VB6 pro.

>no one still described advantages of FP over OOP
Why is it allowed to meme around without any responsibility?

Just use a multiparadigm language. Then you get to steal some of the benefits.