/dpt/ - Daily Programming Thread

/dpt/ - daily programming thread

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

Other urls found in this thread:

strawpoll.me/10508463
github.com/systemd/systemd/blob/master/src/systemctl/systemctl.c
github.com/systemd/systemd/blob/master/src/systemctl/systemctl.c#L123
github.com/systemd/systemd/blob/master/src/systemctl/systemctl.c#L6725
github.com/vim/vim/blob/master/src/edit.c
github.com/FFmpeg/FFmpeg/blob/master/ffmpeg.c
pastebin.com/1KfzyiAM
reddit.com/r/learnprogramming/comments/4oljp8/calling_out_all_seeders_ive_been_uploading_a_few/
twitter.com/SFWRedditImages

What text editor do you prefer to use Sup Forums?
strawpoll.me/10508463

>Created before the bump limit
Delete this shit and kill yourself.

Whats Sup Forums opinion on C#? I'm really loving it

shittier bloatier c++

Would it be a bad idea to write an imageboard software entirely as a single monolithic CGI script that stores posts in a SQlite database?

I figure I can just generate the page procedurally and then style it later with some CSS.

How does Sup Forums do it?

Atom, but only because power mode makes bitches panties wet.

Of course but I find it nice I think it gets the job done without being overly uglier like others

Fuck off

I literally can't respond to the strawpoll because the captcha keeps rejecting me and asking me to do more.

It works perfect for me. Have you tried the audio challenge?

>How does Sup Forums do it?

Nothing. Taking day off and watching Rocky drinking beer.

I'm the guy who did the basic Clojure database application. I can't for life of me understand why people like dynamic languages. I really missed the information I get straight from signature like

private File getFile(String path) {

Where I can see clearly visibility of method, what it returns and what works as argument. In Clojure it was just like

(defn get-file [path]

which is confusing as fuck and doesn't tell anything about what it works with or produces. Fucking sucks.

kys

Weabfags are autistic.

It depends on whether or not you want it to scale. If you don't care that this will never be able to support thousands of concurrent users, then go for it.

If you do want it to scale, then you're going to want to at least consider a database designed for this kind of use-case.

s/get-file/file-from-path/

>bloatier

who cares?
HDD space is massive these days.

>shittier

way to be vague.

What's the difference between mysql and sqlite other than requiring a separate daemon and a separate login?

mysql isn't even a great db, I'd say postgres.

The problems with sqlite:
>you're limited completely to one machine
>no user management to protect different data
>only a single write can happen at once

How does doom draw? I've tried looking through the code in the source ports, but I see very few instances of (example, let's just stick to SDL) SDL functions. Does doom draw in it's own way and SDL_CreateRGBSurfaceFrom is used to convert it?

I've looked at the struct that contains sidedefs, but i've been unable to find how those textures are stored or even drawn.

What if you have different databases for different things, like posts, images, unique user cookies, banned IPs, etc.

Why would you do that?

I'm working on training neural networks to synthesize musical pieces in the style of one input but with the "content" ie. structure, melody of another. It's similar to what people have done with images. Pic related.

You can always emulate functionality and shard the way you've described. But bear in mind that you are emulating functionality.

SQLite doesn't have network functionality or support for concurrency. It's great for its designed usages (like Firefox storing local information), but it isn't designed for web applications.

use Berkley DB.

Neat. I suspect the output will be garbage though.

Any samples yet?

>learn more C
>go through every C book
>start to feel more confident in my abilities
>open up some random project's code on Github
>constants fucking everywhere
>don't know what any of them are for
>don't know which of the 100+ headers they were defined in
>completely lost
>goto step 1

Do people in the real world just open up code and immediately know what it does? I feel like if this was my job I'd be fired the first day.

github.com/systemd/systemd/blob/master/src/systemctl/systemctl.c

I still cannot go through someone else's code

Most likely. I think it has the potential to make some interesting blends given simple enough inputs.
Soon to come. Currently I am still implementing the 'temporal' net.

When you have almost 100 lines of headers included I don't think it's expected you can tell what's happening from one file alone.


And once you start opening a project to hundreds of people it becomes a cluster fuck and what usually happens is people specialize in only one area of the program because there's literally no one that can comprehend it all.

Honestly, I'm not able to into a codebase unless I have a goal.

Try to find an open source project that has beginner hacks, and do those. It's the best way to become familiar with a codebase.

There's a difference between knowing a language and knowing a specific project. It's good enough if you know what any code does syntactically, but you can't realistically expect to understand how the whole system works instantly based on one file.

Do you mean this?

github.com/systemd/systemd/blob/master/src/systemctl/systemctl.c#L123

These are just variables for storing cli options.

github.com/systemd/systemd/blob/master/src/systemctl/systemctl.c#L6725

Ctrl-F and experience are your best friends. Also, always locate main first.

perl or ruby?

I'm coding a Sup Forums thread image scraper right now, and I'm posting a picture here to see if my script sees the update to the thread.

How do I get rid of the question mark on GET query strings?

a query string is defined by that question mark, if you don't want it in the url you'll need to use mod_rewrite

I'm trying round up an integer to the next multiple of some power of two.
I'm using (n | 0x7FFF) + 1 to round it up to the next multiple of 2^16. However this will increase it another 2^16 if the input is already a multiple of it.
How could I change this expression to not round up if it's already a multiple?

When creating a scalable mobile ui, should I use the display dimensions to position ui elements or is there a better/easier way?

Any suggestions on merging hashes in perl?

I tried using Hash::Merge but it doesn't work.

Is learning java as first language stupid?

It was an arbitrary example. I actually typed the post while reading through torvalds/linux.

I guess the moral of the story is that I don't know how anyone gets large projects done in the real world because reading someone else's code is next to impossible. I thought the whole point of the FOSS meme was that the whole world can collaborate together on something like Linux, but I would not even know where to start editing the code if I wanted to change something. I feel like Lovecraft staring into the black seas of infinity and my being unable to comprehend its vastness and complexity.

Found some more stuff that uses C as well.
github.com/vim/vim/blob/master/src/edit.c
github.com/FFmpeg/FFmpeg/blob/master/ffmpeg.c

will github get all pissy with me if I don't use their api and instead fake my headers and use a session for committing?

not at all

I've been hired for the first time ever in software, working on already in production software from a professors lab. It took me about two full days before I could actually make meaningful changes to the codebase. Finding the todos: sprinkled around and just exploring how the program control reaches those points from the beginning of execution is a good strategy to start.

>Ctrl-F and experience are your best friends.
and grep

It's probably one of the most stupid things you can do.

foreach (keys %hash1) {
$hash2{$_} = $hash1{$_};
}


I literally just learned perl today

no, Java is an ideal first language, and the most in-demand

Java made me hate programming.

Here, some more context.
use Storable;
use Data::Dumper;
use Hash::Merge qw( merge );

$hash1 = retrieve('images');
$hash2 = retrieve('images2');

print "Hash1:\n";
print Dumper $hash1;

print "Hash2:\n";
print Dumper $hash2;

%combined = %{ merge( %hash1, %hash2 ) };

print "Combined:\n";
print Dumper $combined;


Just gives me undefined.

the people insulting Java hate it because while powerful, it's also wordy as hell and has a few notable inconveniences

Javascript on the other hand is probably the easiest and comfiest to learn, but doing so is a bad idea because if you learn it first you're likely to get pissed off at every more complicated language, which is a shame because despite it's comfiness it's extremely over-specialized

It can be a bitch with larger projects. I've tried reading through the Linux source code, but it's so hard finding a good base point.

$combined = merge( $hash1, $hash2 );

learn scala

Who's the most skilled Windows programmer in the world?

Herb Sutter

Steve Ballmer

Julian Casablancas

I really want to like Atom, but its sluggishness drives me crazy.

Alright, I can get it to work there.

Why can't I get it to work here.
Line #45.
pastebin.com/1KfzyiAM

What's better /dpt/

Ruby or Perl?

It seems to me that Ruby was intended to fix Perl but it created a bunch of complications that make it less useful IMHO

I'm trying to read asynchronously the output of an NSTask. It's working, but i want to update the Controller of another view in real time.

How can I design a class that will broadcast the piped output in real time so other classes can receive it?

How do I do it?

Just close your eyes while editing text. It won't matter then.

perl is broken beyond repair, and riddled with security vulns, but if you wanna use it, i'm certainly not in a position to influence you to not do so

broken how?

I'm really wanting to get super leet at vim with cool plugins instead.

anyone willing to suggest me some practice project? i'm a CS undergraduate so I can do some shit but never tried to do something challenging. my last project was a text to music conversor which was pretty easy since I used jfugue

Use atom only if you have a good computer. Sublime is faster and has a lot more built-in functionality but it's less expandable

I'm learning C++ and I'm up to pointers.

When it's talking about memory address it's talking about it's location in RAM, right?

Yes, though those addresses aren't exactly the same as physical addresses in RAM

coursea (free) is shutting down
here is a dude who uploaded it for torrent

reddit.com/r/learnprogramming/comments/4oljp8/calling_out_all_seeders_ive_been_uploading_a_few/

it's for the algorithm courses

Best place to learn networking? Also, is it harder to get a job on networking than programming?

Sup Forums uses PHP and mysql

it's nothing fancy at all

I remember years ago when everyone was heralding the era of "free education" and "self-teaching" becoming the new paradigm.

Turns out you can't make money on shitty free online tutorials.

not just algorithms of course, but a few others as well

Is it a monolithic script tho?

it wasn't shitty at all, very good in fact

which is why people are upset it's closing down

>C#
>Windows
HARMFUL
A
R
M
F
U
L

Then why are they shutting down their free courses?

reverse an array with one million assigned elements within 10 seconds

I have a Raspberry Pi, C++ programming knowledge, and some money to blow. What can I do that is really cool? I was thinking about making a digital assistant (turning on stuff, thermostat, making coffee), which is all wired together with chromecast audio and some microphones, but I (suprisingly) want to know what Sup Forums recommends

mono

because they want to make more money, it will be the same course. But this time charged

>reddit.com/r/learnprogramming/comments/4oljp8/calling_out_all_seeders_ive_been_uploading_a_few/
uh oh, I need to finish that Calc course, is the entire website shutting down or are they just cutting back?

I guess, but why bother with using C# then? Why not just C++?

it will be a paid model

beside that person uploading the torrents, you can enroll now for a course of your choosing (check r/learnprogramming) and use a script to download all the lectures

They're converting their free courses to paid courses.

So basically the free self-taught CS education meme is over?

if I had already started the course, would I be exempt?

no idea

i almost panicked because I didn't see any progress, but I haven't logged back on since the new redesign, so everything is good

Anyone knows where or how I can make a JTable unlimited ?
Mine is set to show only 8 rows (don't even know why 8) and I want it to show everything it can (from an sql query) and just be able to scroll down in it.

Should I start making commits when my software project is in a usable v0.1 state, or should I start committing from the beginning?

Comment from the beginning, because if you fuck up at any time since the first commit, you can roll back and fix it (not to mention collaborating with other people)

Isn't C# more similar to Java than C++?

good point

I just got the urge to get a Raspberry Pi and write a kernel for it

Yes.

literally why?

No idea, the idea came to me out of nowhere

Doesn't sound like a very good idea, tbqh fampai