/dpt/ - Daily Programming Thread

Old thread: What are you working on Sup Forums?

Other urls found in this thread:

sscaitournament.com/index.php?action=tutorial
learnyouahaskell.com/
btlive.tv/
github.com/Sup
humblebundle.com/books/code-your-own-games-book-bundle
programarcadegames.com/
stackoverflow.com/questions/14672350/lua-language-how-use-something-similar-to-python-list-comprehensions
twitter.com/NSFWRedditGif

What should I code? I want something to work on but I can never find or think of anything compelling to me. The farthest I've gotten recently is simply a script that pulls all the images from a Sup Forums thread. And that was probably last year or early this year. Ideally I'd be making things all the time and getting better but it's not working out

create a starcraft AI
sscaitournament.com/index.php?action=tutorial

any wrapper for PHP?

how do I filter ports with iptables in a way that nmap cannot detect?
everything I filter shows up as "filtered" and I want it to seem "closed"

nevermind it's -j REJECT --reject-with tcp-reset

I'm just a fucking stupid code monkey. I hate myself.

You're responsible for your own learning.

I'm trying to learn and failing. That's why I hate myself.

Is bioinformatics a good field to get into if I want to solve interesting programming problems?

You can't learn if you're too busy hating yourself.

The important part is to have FUN.

Programming isn't fun anymore. I tried waiting to see whether the fun could come back on its own but it didn't. The only thing left I can do is force myself.

i wanna fuck her

Forcing yourself to do something you don't enjoy is not going to help you solve burnout. At all.

Find something else that's fun to do, related to programming or not, and then come back.

learn Haskell

Ok Sup Forums, nntpchan sucks. Let's make a real p2p imageboard

What would it look like?

is this the equivalent of "install gentoo"?
if so, is it actually as good as gentoo?

Just do something else for a while.
I "rotate" between 3 or 4 different hobbies on a regular basis, and it keeps them fresh and more interesting when you get around to doing them.

the world needs something that allows you to host static website content on ipfs and and dynamic stuff centralized
I have no idea how a truly distributed chan clone could work however because of post numbers getting reordered, people inserting posts back in time and whatnot

no its actually not a meme
haskell is really fun to learn
learnyouahaskell.com/

It IS the equivalent of gentoo
You need to be extremely autistic and capable of understanding the most esoteric of memes in order to use it

but if you do become a code autician like us, you will understand just how much nicer haskell is

Only a minor elite is able to program over a long time; Not everyone is made to be a programmer.

>What are you working on Sup Forums?

Exploring the deepest, darkest corners of Racket by doing Advent of Code 2016.

Are you telling me that was lying?

this isn't true
it just gives you a whole new way of viewing programming by the virtue of being a declarative language
it literally has no variables and all functions are merely transformations on input that produce an output

t. extreme autist fluent in esoteric memes

well it has IORefs but they're hacks

I plan on learning prolog as well
only then will I be the most autistic man alive

but this doesn't describe gentoo in any way lmao
your level of autism has to be about the same as mine to use gentoo, which is to say "bordering on neurotypical/sperg"

i don't use gentoo so i wouldn't know
what's it like being autistic?

it's got pointers too

i'm not as autistic as some other posters but sometimes i sperg out and go on 12-18 hour shitposting sprees

Pretty good.

It's also one of the few fields which values C performance autists like me because problems routinely take hundreds of thousands of CPU hours and hog terabytes of RAM

A week ago I asked for help here because biased HR department was hiring women "because yes" as backend developers. After two of my friends got finned because they complained that those women only go to smoke to the roof (which is true) I got fired today for not be able to carry the job of the new employees and teach them basic data structures and algorithms.

So, what am I working on? on migrating out of Italy.

Bitcoin solve this exact issue but at the price of lots of wasted cpu cycles.
I don't think we need to keep track of post numbers though. Just use a hash of its data

>no its actually not a meme
neither is gentoo.

Why isn't this more popular and why does it have to suck?
btlive.tv/

...

Holy shit VHDL is so fucking awful. Does anyone know how to actually use a component at a useful time? You can't have them in case statements or processes. But maybe I'm wrong because the syntax is so strict and shitty

Fug I feel ronery. It's easy to make a chatbot and feed it with Sup Forums posts?

Yeah I have done that and got my Sup Forums pass banned

>meme
>le got tired from le reddit, so I'm le here again! XD

i am working on learning python and hopefully I can transfer the knowledge into Java for next Semester's project.

Also, I have seen this humble bundle, you think it is actually useful? I want to concentrate on python and java for now.
What can I use as source in order to progress?

Because of the webscraping, or because you let the bot post like a madman?

>let the bot post like a madman
Also, you don't need a scrapper
github.com/Sup Forums/4chan-API

humblebundle.com/books/code-your-own-games-book-bundle

one of the books from the 15$ package is actually available for free

Program Arcade Games: With Python and Pygame

programarcadegames.com/

If you can make the output more englishy, have at it.

The API is bretty easy to use.

Markov Chains are kinda fun, but they're shit and I don't know where to go from here.

What does a software consultant do?


can't seem to find a good answer on this

>"Abstract base classes complement duck-typing by providing a way to define interfaces when other techniques like hasattr() would be clumsy or subtly wrong (for example with magic methods)."
>mfw ducks
>mfw magic methods
>mfw why is it "subtly wrong"

You go join a company for a couple months, shit all over their projects and tell them why everything their did is wrong, all of that at obscene hour rates.

If it wasn't subtle, you'd be able to understand. That's the point.

Sell bullshit like OOP to innocents who don't know any better

OBSESSED

>Sell bullshit like OOP

what's the best paradign then?

If your favorite language doesn't error out when you try to subtract a string from an integer, your favorite language is gay.

I'm back again because apparently I have a learning disability.
I'm the guy that was using Lua the other day.

Put straight I am trying to translate this,
[i.split('\t') for i in open('assets/lvls/test.lvl')]

into Lua.
I am currently here.
function csvEntry( str )
-- extract a table of columns
-- split into lines/rows
local tmp = 0
local dat = {}
for i in string.gfind(str, '[^\n]+') do
-- ignore comments
i = string.gsub(i, '[^%#.*\n]-', '')
table.insert(dat, {})
for j in string.gfind(i, '%d+') do
table.insert( dat[i], tonumber(j) )
end
end
return dat
end
[\code]

not OOP

Sweet mother of god.

Is Lua really so shit that you can't figure out how to replicate that simple line?

but muh pointer arithmetic, don't call C gay :(

What does that have to do with the post you're responding to?

C doesn't even have strings.

>Markov Chains are kinda fun, but they're shit and I don't know where to go from here.
word2vec and LSTM networks

stackoverflow.com/questions/14672350/lua-language-how-use-something-similar-to-python-list-comprehensions

Lua is garbage

Jesus.

C#, Java, C++, Python, etc. all have easy list comprehensions. Is Lua mostly legacy stuff, or is there new active development with it?

Assuming Python's 'open' returns something with a set of lines:
ReadAllLines("assets/lvls/test.lvl").Select(i => i.Split('\t'));

>C doesn't even have strings.
False.

The issue is that Lua is so light that they have to cut so many features and library functions from the standard that it feels like a sketch of a skilled designer sometimes.

It does the job and you can work with it but you have to think about the implementation a lot more than you would with say, Python's "batteries included" mindset.

According to the official "Programming in Lua" book the SLoC for all of the combined standard libraries comes to less than 4000. Yes. That small.

So something like this?
local f = io.open('assets/lvls/test.lvl', 'r')
local contents = f:read('*all')
f:close()

local data = {}
for chunk in contents:gmatch('([^\t]+)') do
table.insert(data, chunk)
end

Lua isn't in the same league as C#, Java, C++ and Python, it serves a completely different purpose and the standard "library" is kept very minimal intentionally.

What is the purpose of Lua?

Lua is an embedded scripting language. You can just add #include to your C source file and your program suddenly becomes scriptable with lua.

It's mostly used as embedded platform to extend existing software written in lower level languages (essentially a plugin/addon platform). You build the library yourself by creating functions in C/C++ (bindings also available in languages like D, Rust etc) and expose the functionality to the Lua VM.

>deepest darkest corners of Racket
you said this like 2-3 days ago and all you showed was a bunch of switch statements
now its just basic looping
only thing dark here is that theme

>you said this like 2-3 days ago

He's been saying that for at least two months now but it's the benchmark shitposter from last year so move along and don't argue.

>you said this like 2-3 days ago
literally every day

actually, true.
C does not have a proper string type.
C only has a pointer to a region of memory and a null-terminator.

I only check in once every couple days sometimes after a week

retard

Stop moving goalposts. You said "strings", not a "proper" (whatever that means) string type.

C definitely has strings and has string handling functions in the standard library.

Clarifying a term isn't moving a goalpost; when I said "string" initially, I was referring to what you apparently may call "proper strings".

C doesn't have strings.

C has """strings""".

actually, not true.
C does not have a proper string type.
C only has a pointer to a region of memory and a null-terminator.

What's it like using a language that can't print the character '\0'?

I wasn't the person you were responding to but you're still wrong.
C doesn't have strings despite how much you want it to be true.

Covering your ears and repeating yourself is not an argument.

>what you apparently may call "proper strings".
You used the term, I only threw your sloppy language back at you.

A string is a finite sequence of encoded characters and C has those.

>He thinks that's not possible

>C only has a pointer to a region of memory and a null-terminator.
That's an implementation detail, just one you have access to in C because it's a relatively low level language.

How do you think "proper string types" in higher-lever languages are implemented?

>he needs a workaround

>He thinks I need a workaround

>He still thinks that's not possible

>I only threw your sloppy language back at you.
autism speaks
>he thinks native string types are all represented with a null terminator

>A string is a finite sequence of encoded characters
Maybe in your world.

You're talking to two separate anons, by the way.

How long is an instance of string?

About 20 nanoseconds

len(num_of_char(string))

you can't measure string in units of time retard. That's makes no fucking sense.

A string is generally about 20 nanometers or so.

No, you're talking about lightyears, strings are measured in nanoseconds

>Maybe in your world.
In the world of computer science. I'm sorry you lack the capacity to abstract such basic concepts away from the jargon and implementation specific to your favourite programming language.

>>he thinks native string types are all represented with a null terminator
I have said no such thing. I have merely said strings in any language will have implementations specific to that language (or just implementation itself...), so you can always say that it only has "null-terminated character arrays" or "length-prefixed character arrays" or some more sophisticated construct instead of a "proper string type".

The C implementation is merely plain to see and easily available to fiddle with, but the language still defines and handles *strings* in a special way. If it didn't you wouldn't be able to use string literals, would have to handle encoding yourself, you wouldn't have string manipulation functions in the standard library and so on. Therefore, C has strings.

Time is distance

prove it

Wait 5 meters

Time is wasted neurons

Yes. Python's open can be used as an iterator over the lines of said file.

Fuck. Finally. Thanks man. I didn't realise that gmatch returned the captures to iterate over. Now it's sort of working at least. Only tweaking to go.

Lua, to me, is just a tool that writes a little like python but works at the speeds that are needed for a video game. I don't want to use C because I tend to get stuck on premature optimisation and using a language that doesn't block out with curly braces helps my mind flow.

I'll post here and in /agdg/ once I have something I'd consider worth sharing. (Early Jan)
(Damn I love art)
(I'm using LÖVE btw)

The speed of light c is just a constant that has a particular value in our current system of units. If you take a system of units such that c = 1, then the relation t * v = d becomes t = d when considering the case of the speed of light, so it appears that in this system of units (which is just as valid as ours) times are equivalent to distances.

Furthermore if you take the value ct, which is really just t with our units, (x, y, z, t) becomes a valid vector in 4 dimensional space, making time on axis of distance in that space.

And so, as you can see, time is distance.