/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous thread:

Other urls found in this thread:

github.com/rust-lang/rust/commit/34c0de2067b132c8d68689501604d4fffbe9fba8
docs.python.org/3.3/library/functions.html#zip
docs.python.org/3.6/library/itertools.html#itertools.product
red-lang.org/2017/12/leaping-into-future-red-goes-blockchain.html
pastebin.com/3Td8hP4D
pubs.opengroup.org/onlinepubs/007904975/utilities/make.html
pinterest.fr/animemotivate/motivational-anime-quotes/
honeysanime.com/top-10-inspirational-anime-quotes-best-recommendations/
animequotes.net/inspirational-anime-quotes
startpage.com/do/search?cat=pics&query=motivational anime quotes
en.wikipedia.org/wiki/Address_space_layout_randomization
github.com/JadeMatrix/SHOW
show-cpp.readthedocs.io/en/v0.7.3/
twitter.com/NSFWRedditVideo

C is a shitlang

>rewriting my GUIs by hand after using Qt Designer

i am become cute, the destroyer of desktop applications.
they even look better now, which surprised me.

cucks the lot of them

>soyboy sjw cuck
Fuck off pjw

I'm trying to get all permutations of a group of lists in Python 3 and I don't really know where to begin.

item1 = ["foo", "bar", "baz", "baq"]
item2 = ["123-456-789", "123456789", "123 456 789", "123/456/789"]
item3 = ["01/15/1995", "01-15-1995", "1-15-1995", "1/15/1995", "01151995", "1151995", "01/15/95", "01-15-95"]
item4 = ["123456789012, "1234-5678-9012", "1234/5678/9012", "1234 5678 9012"]


As you see I don't have an even number of items in each list. I know about itertools but I don't know how to get a list of all possible non repeating permutations of these items. Anyone here have a clue as to what I could do?

github.com/rust-lang/rust/commit/34c0de2067b132c8d68689501604d4fffbe9fba8
check em soyboy

Could you post a few lines of the desired output?

Something like this. I can process the results out of list format later.

["foo", "123/456/789", "1/15/1995", "123456789012"
["baq", "123456789", "1151995", "1234 5678 9012"]

>having a code of conduct at all
language discarded

docs.python.org/3.3/library/functions.html#zip

If you want every single thing in the first list with every single thing in the second list and so on, you want a cartesian product. I'm sure there's something in python's itertools which does that.

4 nested for-loops my man.

What are the "meme books" every computer scientist should have, dpt?

I already have 4 in mind that I want to buy, but I just want to make sure I'm not forgetting any interesting ones.

lots of ways to do it, but like said itertools.product is probably easiest here

forgot the link like an idiot
docs.python.org/3.6/library/itertools.html#itertools.product

Can someone point me to a guide for makefiles and softwares for generating them?
I'm very confused.

Is red worth looking into or is it trash?

Is absolute positioning not a good practice when constructing GUI?

red-lang.org/2017/12/leaping-into-future-red-goes-blockchain.html

What if you rescale the window, senpai?

hearing a lot about blockchain

other than memecoins and maybe banking/voting, is it the future? is there any reason we'll be expected to implement it in our programming on a regular basis?

wish to hear all opinions, but only if you have logic to back it up.

Oh, fucking Christ that answers that.

Why do fuckers try to put blockchains in everything?

no

But what if I lock the window?

your logic behind that 'answer'?

Is it possible to make some sort of program that scans posts on Sup Forums?
I'm fairly new to programming and only know some C and little Java

it is

Little more direction? I only know how to FizzBuzz in C. Would this type of program be called script? Is that what I should look in to?

Writing an RSS downloader in Rust. Any tips on organizing my imports?
pastebin.com/3Td8hP4D

parser, web crawler
look up these

hello anons!

I'm a beginner web programming student and i'm learning js with php.
I does have an idea to make a website that lists the Sup Forums threads from WSG board where i can just play the videos or download then.

First i tried uses only php with Simple HTML DOM Parser and worked fine. But I didn't like the code(completely mess code) and so i starded to use js ajax to get the results from the parser, that makes my code more cleaner but here the problem begins.

I cannot more receive the thumbnails (image cover) from the webm's, because it's returning 403 forbidden error;
Doing some google research i find that maybe this is a security config on the Sup Forums's server, CORS maybe, and i tried to change the headers using CURL but it's not worked.
After that i tried to reverse the code to uses only php and now it's not working anymore (403 error too), which leads me to believe that i cannot do this type of request on the server and my IP did get blocked.

It's really a unauthorized access (why?) or i forgetting something in the code? Also i using the Sup Forums API to list the threads, it's possible to use to get these datas that i want?

Sorry about my english, i'm from 3rd world country. Plz don't judge me.

there is an api

...

1st rule of programming:
don't write programs that already exist.

shit

Unless yours does it 1000x times better.
Otherwise we would be stuck with C languages because they exist and most programmers use them.

I'm doing this only for study purposes, also can you please pass me the source?

i hope nobody actually believes this

thank you :)

...

yes, I'm still learning web design too :p

Locking the window size because you're too incompetent to build a GUI that scales properly is cancer. There are many different displays, with wildly different form factors. Locking the window dimensions is the temporary retard solution that, in the end, causes more problems than it solves.

consider accessibility, too

Pjw = Pajeet Justice Warior

pubs.opengroup.org/onlinepubs/007904975/utilities/make.html
you don't generate them, you write them by hand

Working on a wordmap of /dpt/ right now. I'll have to purge the stupid words like "the" and "that" though.

This. Start by writing a small simple makefile that works and expand it as the project grows. Automatically generated makefiles are a bloated mess.

Assuming that I have prior Haskell experience, would you guys suggest Scala or Kotlin?

/dpt/ Word Cloud v2

Scala is more functional than Kotlin, so Scala. Also, check out clojure.

Kotlin, if higher potential chance of employability as an Android dev is something you feel is worth pursuing.
Scala otherwise, I guess.

At first glance, I sort of like Scala better, but I'm afraid that I won't feel the same way six months in. And it's large enough that learning it properly will be a signficiant time sink.

Kotlin feels much more "boring", but at the same time reasonably practical and the tooling is great.

For context, I'm in physics grad school atm, and I'm thinking about future employability. I might commit to learning machine learning properly in the future, and in that case Scala could be better since it has a few hyped frameworks for that, but I'm not sure if that's the kind of stuff I'd end up working on with my background (as opposed to mainly doing math/prototyping and guiding others), and those things can change in the long term.

The logistical problem with Scala is that it just sometimes breaks Java libraries. It's a neat language but the litany of interopability issues makes it hard to use as a production language. The companies that have used Scala are starting to move away from it (and I'm thinking many will move to Kotlin or Java).

you forgot some words. Please add them on v3
>Pajeet
>Rajesh
>Brainlet
>t.
>Hurr Durr my is better than your

desu this sample size is just two threads. I have to pull the rest of the threads (I think I'll use 25 as a good sample).

what are the good scala ml libraries?
i don't like python but it's been fine for this purpose so far

Should I write my next program in GHC bytecode or CLR Assembly?

I think Ive read enough about databases and how they work now.
Is there any tutorial or something to create an actual database with real world applications just so I can replicate it?
also which dbms for small-medium businesses mysql or postgres? just want something simple without too many gimmicks

is G-code a real programming language?
are CNC machine coders, real programmers?

I've been working on a temporary email service (like 10minutemail) using phoenix+elixir+react.

I haven't used react before and it's feeling a lot like visual basic. Any good pointers for it? I thought components should only contain render logic, but it seems like anything that modifies a components state must be encapsulated in the component

Why every time I launch program it behaves differently?
I have two JTextFields and I want them deselected so that when user clicks on them text inside disappears.
I did requestFocusInWindow() in JFrame.

If I launch program 10 times, 4 out of 10 JTextField will be deselected other six first one is selected without text.

variations in clock speed?
can you add some slowdown to your program?

multithreading?

Use CMake instead. I've always preferred Makefiles but I've started converting recently.

>What are you working on, Sup Forums?

completed advent of code 2017.

...

Was it worth it? Or was it just pointless busywork?

>Was it worth it?
no

is leaving a fstream open and not closing it will causing disk access even if there is no read or write?

I was working on AoC until I got food poisoning and got sick for a week. Feels bad senpai.

Sometimes, I lose my motivation.
So, I'm creating a program that displays a motivational anime randomly with a music corresponding with the anime.

This program will be run at startup on my computer.

There is a couple of good ones, but most was pretty bad, I was disappointed and gave up.
Day 3 was fun, because implementing it was easy, the hard part was thinking.
But most were pretty obvious and straight up busywork.

where'd you get the quotes user?

back to old thread
comment in pic rel

Define what you mean by disk access. If you mean any read or write, then yes, since it will cause inode/whatever filesystem data structure your os uses, reads to locate the correct sector where your file metadata is located. Other than this, there should be none. Of course, your os could load the first couple of blocks of that file into its buffer cache since you'll probably read from/write to that file. In short, it's very platform dependent.

>In mentioning both "gender" and "gender identity and expression" the
code of conduct attempts to draw a distinction which doesn't exist;
i.e. that there is "True Gender" and "gender identity" (a distinction
which is often drawn to marginalize trans/nb folks).

No CMake is disgusting and serves no purpose. If you can't write your makefiles yourself you're making it too complicated.

LLIR

Some links:
> pinterest.fr/animemotivate/motivational-anime-quotes/
> honeysanime.com/top-10-inspirational-anime-quotes-best-recommendations/
> animequotes.net/inspirational-anime-quotes
> startpage.com/do/search?cat=pics&query=motivational anime quotes

this output* is other

With make I have to either note all dependencies or write .PHONY recipes to use the compiler dependency detection & use them if they exist. Either way it's a lot of boilerplate that CMake handles automatically. On the other hand CMake makes some things very frustrating, but that's either because I'm still learning or just in the name of portability.

I'm in need of some busywork. Any ideas for a project? I mostly know C/C++ and Java. Alternatively, how do you guys come up with ideas for projects (excluding employment)?

Want to do some C++ web programming? I need people to try out my HTTP framework.

Sure. I'd have to take the time to learn stuff but why not. Contact or something?

The address isn't guarunteed to be the same every time you run the program.

en.wikipedia.org/wiki/Address_space_layout_randomization

Also, gdb runs your program in a different way so the addresses may be different.

>What are you working on, Sup Forums?
Rando 4Me clone - android app and backend both written in Kotlin

shit.
both addresses are always the same when i start the program and dbg in their own way. and adress printed in program had 00000000 value in gdb so i though i miss something. thx

have a warm (You) for writing a native application.

I was just about to push v0.8 today, it's mostly minor API changes and internal fixes, I just need to merge it. Be warned it's pretty low-level since it's meant for people interested in working specifically with HTTP not just general "web apps."
code: github.com/JadeMatrix/SHOW
docs: show-cpp.readthedocs.io/en/v0.7.3/

Cute Karen

i have 3 python script in the version of themselves, need to make a new req analysis file of all of them in one. I dont know how to do req analysis, is there a good guide for it ?

Post more karen

I have only this one.

-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Python 15 464 121 2007
-------------------------------------------------------------------------------
SUM: 15 464 121 2007
-------------------------------------------------------------------------------

>tfw just passed 2k lines on the project
aren't you guys proud of me for making it this far without giving up?

>python
fuck off

>only one karen

just got my fpga to blink some LEDs. I was surprised how easy it was to get the icestorm flow up and running.

>muh language wars
nobody cares, don't (You) me

Gj user. First time you cross 10k is pretty satisfying as well.

10k lines of code... that's CUTE ;)