/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: 1506711963594.png (773x1056, 398K)

Other urls found in this thread:

en.wikipedia.org/wiki/Packing_problems#Packing_rectangles
github.com/meh/cancer
dev.aseprite.org/2016/09/01/new-source-code-license/
phonearena.com/news/20-Apple-iPhones-grabbed-from-Apple-store-as-customers-look-on_id107903
gen.lib.rus.ec/book/index.php?md5=33DC73067D7512A7D970CEC5FE8870DB
paulgraham.com/avg.html
twitter.com/SFWRedditVideos

1st for boring sundays when you're too hungover to code

Post a screenshot of your code

Attached: scrot.png (3092x1756, 432K)

Who uses a computer with their butt out like that?

Quick, give me a fun project!

Attached: 1532816093012.jpg (1280x720, 339K)

That looks like a really uncomfortable way to work.

>he doesn't unironically do this
Baka

learn the Haskell programming language

Help this user from the old thread (does this type of linking even work?)

>academic wankery
lmao

within the same board it does, if you want to do cross board you need to do >>>/board/number

Name anything more triggering than a C++ programmer claiming that C is "functional". I'll be waiting.

I see, thanks user.

What should I do if I understand some but not all programming basics, and I find myself often language-hopping and not being able to really make anything on my own? Is there some list of general programming stuff I should know and how to practice it?

bet you weren't even the one asking

Hey user what software is that?

>I find myself often language-hopping and not being able to really make anything on my own?
I'm in the same position at the moment. I think the problem is that most of the basic exercises you do are small things you do in under an hour or so, it's pretty rare that you get to practice actually building a project from ground up.
I'd say try to find the easiest possible thing you can do, and do it.
One of my first projects I did was a web server that takes xml from a different web server, does some filtering and sorting and then shows it as json.

ncurses deluge client that allows renaming files in your torrents like the gtk client does

en.wikipedia.org/wiki/Packing_problems#Packing_rectangles

Hack Jow Forums.

If some retarded Australian did it I can do it

i decided to go a lazy approach which is feh -m -W 2560 -H 1600 -E 261 -y 182 -s -X -x --no-screen-clip -z

seems to work well enough. an easy improvement would be to reject images that aren't close enough to the aspect ratio.

Hmm... Interesting, however in this case the area to be filled is fixed (say 2560x1600) but rectangles can be resized (within limits..).

the goal is less to pack the rectangles but rather to fill every pixel with a resizeable rectangle.

actually, i should take the average aspect ratio of the images and use that. I wonder if images look worse stretched horizontally or vertically.

What kind of dysfunctional abomination of a regex engine doesn't even fucking support negation? Christ on the fucking cross.

Doesn't make much sense. How would you fill it if you have only two images and cannot change the aspect ratio?

You're probably doing it wrong.

Writing unit tests
module FeedSpec (spec) where

import Prelude hiding (readFile)

import Data.Text as T
import System.IO.Unsafe
import Test.Hspec
import Text.XML

import Feed

okArticles :: [Article]
okArticles =
[ article "title1"
, article "title2"
]

spec :: Spec
spec =
describe "parseFeed" $ do
it "parses a valid Atom feed" $
okArticles `shouldBe` articles "data/atom/ok.xml"
it "parses a valid RSS feed" $
okArticles `shouldBe` articles "data/rss/ok.xml"

article :: String -> Article
article = Article . T.pack

articles :: String -> [Article]
articles path = unsafePerformIO $ parseFeed readFile def path

god i wish that were me

>Doesn't make much sense.
Use case is for many images.. at least 10, but maybe as many as 100 or more.

>How would you fill it if you have only two images and cannot change the aspect ratio?
Poorly.

unit tests are for homos

Implement a simple virtual bus in the Linux kernel and glibc so it can be used like a named pipe.

In English, doc!

you have cancer

Is it terminal?

github.com/meh/cancer

no it's adopted

leaning python
what is the simpelst way to add a new row to the end of a data frame?

google("python add a new row to the end of a data frame")

Could you post a simple example of what you want exactly?
Like put some random images of various aspect ratios on the left of an image, and on the right an expected end result that shows all kind of transformations allowed.

On a 16:10 monitor, how to place a number of (resizeable) rectangles, some of which are 4:3, some of which are 16:9, and some of which may be other aspect ratios (e.g. 2.21:1)

Basically a 16:9 monitor you can easily place 16:9 videos and cover the whole thing as long as the number of videos is a perfect square. but having other aspect ratios, or a non 16:9 monitor fucks it up.

>anime op
excellent

Attached: 1534411512477-g.png (400x457, 154K)

>unsafeperformio
keep up the good posts please

If you don't have too many images at once you could probably bruteforce it by calculating some fixed ratio scaled down resolutions for the images and finding the combination with the highest resolutions overall. Say you want to display 4 images, you could start by averaging their resolutions and rounding those results to fit the proper aspect ratios; then you just increase and decrease the resolution of the images by some arbitrary interval until you find the best combination. After doing that a couple times you'll might find some sort of pattern which you can derive a more optimized algorithm from.

my favorite way to start a day of programming is a good 8+/10 poop

how do you start your day of programming

/sip/

Attached: 1534627065683.jpg (750x749, 158K)

Added a thumbnailer to my terminal image viewer

Attached: thumbs.png (1191x745, 56K)

i'm working on collecting your data and processing it

What's something good to put on a spare 3rd monitor while I'm programming on the main and have documentation on second
Seems a waste to just leave it unused
Obviously I can put anime or movies but I don't want something undistracting

Attached: 1492911443067.jpg (839x1200, 404K)

equip socks

Videos of leaves falling

I'm getting cold feet about open sourcing a potential commercial project. The last release of the project source code was under the CC non-commercial share-alike license (and was not good enough for sell), but the upcoming release with more commercial value is making me reconsider the license. With CC-NC-SA, I might be forced to compete against a fork of my own project. At the same time, I'm comfortable with people tinkering with the source code for their personal use.
This article from when Aseprite moved away from GPL echoes my feelings dev.aseprite.org/2016/09/01/new-source-code-license/ .

What do you think /dpt/?

What is the best book to learn J2EE assuming I already know core Java

Attached: 1512423552703.jpg (250x248, 5K)

Some yoga and meditation.

lol??????????????

J2EE is outdated

neat, reminds me of sxiv

RSS feed or IRC maybe? something you can glance at to get a taste of the outside world

Music player with a visualizer.

Pretty nice, definitely relaxing

Also good idea, might have it overlay the leaves falling video

Anything more like that website that showed random webcam feeds

is this a text editor or an IDE?

You should still allow your clients to view and modify the source code for their own use, but I think you could have a license that doesn't allow them to actually sell their own versions.

hanoi tower with 1048 poles

you guys should consider adding a quality morning poop to your preparation routine

Coffee, a cigarette, and a good shit is god tier technology.

guys pls

can anyone help me get a proper PDF (ctrl+f-able) for computer systems: a programmer's perspective 3rd edition?

2nd edition has too much 32-bit stuff

Better?
module FeedSpec (spec) where

import Prelude hiding (readFile)

import Data.Text as T
import Test.Hspec
import Text.XML

import Feed

okArticles :: [Article]
okArticles =
[ article "title1" $ Just "text1"
, article "title2" $ Just "text2"
]

spec :: Spec
spec =
describe "parseFeed" $ do
it "parses a valid Atom feed" $ do
articles "data/atom/ok.xml" >>= shouldBe okArticles
it "parses a valid RSS feed" $
articles "data/rss/ok.xml" >>= shouldBe okArticles

article :: String -> Maybe String -> Article
article title = Article (T.pack title) . fmap T.pack

articles :: String -> IO [Article]
articles path = parseFeed readFile def path

I always solve problems that I've been stuck on for hours whenever I go poop
anyone here do thinking poops?

Are there any clojure wizards that are not Emacs users?
What is your setup?

Attached: oumae_kumiko___vector____hibike__euphonium_by_fremy_speeddraw-dajzxhf.jpg (1191x670, 92K)

Attached: toilet-seat-desk-chair-computer-desk-and-desk-chairs-intended-for-size-1030-x-1436.jpg (1030x1436, 528K)

Why is Javascript so fast compared to Python or Ruby?

phonearena.com/news/20-Apple-iPhones-grabbed-from-Apple-store-as-customers-look-on_id107903

This is the appropriate course of action. You should not try to interfere in these scenarios.
The police said they appeared unarmed but the other customers don't know that. Interfering with someone stealing is not worth the risk of them having a gun and shooting you.

>want to try out Java
>can't be bothered to read online or go through one of my books
>just look for a tutorial I can just hop in and out of to get the gist
>pajeets literally fucking everywhere
Is there any half decent series that is indexed so I can just lazily skim through and not somebody with a shit mic or that is Mr Rajesh or do I actually have to rack my tired brain and read

Attached: a12.jpg (1280x720, 138K)

gen.lib.rus.ec/book/index.php?md5=33DC73067D7512A7D970CEC5FE8870DB

Just warn about post
>hey Jow Forums my iPhone is blocked,please help!

mooc.fi

Go to the english version of the page and do the java courses there

Yeah I tried that but it's scanned shitty :(

Attached: 2018-08-19-203800_495x296_scrot.png (495x296, 97K)

any of you ever tear your asshole because of shitty toilet paper?

As much as I appreciate it, I just would have liked a video series to jump through instead of going to a book or website for reference because I'm lazy.
Looks half decent so I'll probably peak at it anyway though.
Thanks

You're not going to learn anything from just watching or reading.

That's why I'm doing a project.
I just need to know the general differences from what I'm used to and get going and pick up the rest.

buy the fucking book

fuck that

and then scan it for the rest of us

I want to kick her in the poon
Haha

Attached: mia_shit_post.jpg (614x640, 94K)

>buying books
I'm LMAOing at your life.

Attached: 04640995379deedc91bed5ed757b6e48.jpg (602x800, 243K)

Oh christ. Sorry about that. I just nabbed a link, didn't dl it myself or anything. If we're checking the same place, then I probably can't help. Good luck, man. Maybe some weird FTP would have it, or maybe it's on freenet or ipfs.

the epub is find you massive faggot

Attached: 2018-08-19-124657_1239x882_scrot.png (1239x882, 247K)

laugh all you want baby, at least I can hold my little book friends and show them to all the ladies I bring into my house haha

Half of Jow Forums don’t use toilet paper

spotted the poorfag

I'm heavily inebriated. Which language should I use right now?

PHP

hell yeah brother

All Lisp family langs are best used in an emacsen. Emacs and Lisp have a long history together and GNU Emacs has addons for all the major Lisps, as well as other niceties like SLIME and paredit.

200 mg caffeine, sandwich, water, speed

>tfw my current motivation to learn Haskell is an article more-or-less encouraging the use of Lisp

paulgraham.com/avg.html

Graham is a hack though.

And DPT has a long history of answering not the question that was asked.
I got your point and I don't want to go this way.

Attached: Hibike! Euphonium - 12 - Large 05.jpg (1280x720, 93K)