/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1557650239343.jpg (689x816, 265K)

Other urls found in this thread:

cmake.org/cmake/help/latest/module/FindFreetype.html
wikileaks.org/ciav7p1/cms/page_9535650.html
eye-tuebingen.de/the-institute/news-events/news/news-article/60-why-might-reading-make-myopic/
mesonbuild.com/Builtin-options.html
twitter.com/AnonBabble

Finally. A proper thread.

why did you post a blank image?

You were so close user, that's the thread before last lol

No, it's the last thread.

Well, for the archives, since OP is a dipshit:

Fuck off

I simply posted a link to the last valid thread. What are you going on about?

Attached: 1557384757804.png (1920x1080, 1.35M)

please me good this time

Attached: __boo_and_princess_king_boo_new_super_mario_bros_u_deluxe_and_etc_drawn_by_chocolat_momoiro_piano__0 (800x800, 116K)

Imagine raping her

How do you rape a blank image

>humping air
hmm

Repostan from
So I've been trying to build my program with SFML statically linked and I can't get CMake to find the freetype library. Any ideas?
Here's my CMakeLists for reference
cmake_minimum_required(VERSION 3.0)
project(Test)
set(CMAKE_BUILD_TYPE Release)

set(src
#etc
Main.cpp
)

set(SFML_STATIC_LIBRARIES TRUE)
find_package(SFML 2.5.1 COMPONENTS graphics window system REQUIRED)

add_executable(Test ${src})
target_link_libraries(Test sfml-graphics freetype sfml-window gdi32 opengl32 sfml-system winmm)

Add:
set(CMAKE_VERBOSE_MAKEFILE ON)
message(${CMAKE_LIBRARY_PATH})

Yeah, look at cmake cmdline options.

CMake Error at CMakeLists.txt:3 (message):
message called with incorrect number of arguments
welp

desu senpai just use mxe or msys2, let the package manager take the pain away from you.

Maybe instead try:
message(STATUS ${CMAKE_LIBRARY_PATH})

how would you guys code something to solve for the longest english word from a word puzzle like countdown (UK)?


ie you have 9 random letters, longest word in the dictionary wins

just conceptually obviously dont have to write it all out

I tried MSYS2 with Meson and it had a hell of a time finding just pkg-config and OpenGL. Maybe I'll try it again with CMake and see how it goes.
I just get "--" with nothing after it.

You can just generate permutations starting from size 9 down to 2 and checking each against a dictionary.

And CMAKE_SYSTEM_LIBRARY_PATH?

>And CMAKE_SYSTEM_LIBRARY_PATH?
Same thing, just --.

anone, anone,
please don't forget to eat lemon and masturbate

Attached: 1534967821717.png (1000x1200, 1.16M)

I want to learn Elixir, what books would you recommend Jow Forums?

>You can just generate permutations starting from size 9 down to 2 and checking each against a dictionary.

That was my plan, im new and stupid though and the code is getting pretty long. i know there must be a way to make a function for this but i cant figure out how to for example iterate for length 8 through deleting each letter, for 7 each combination of 2 letters, for 6 each combination of 3 etc etc

Depends, you can just use a substring or a slice if you're storing the letters in a string, if they're an array then generate an array slice based on loop index (counting downwards).

>it's a six-hundred-and-thirty-one-line error message episode
fuck sepples

just use make and pass the -l flag to the linker for fuck's sake

inb4 it's one forgotten semicolon

it's similarly inconsequential. the very first line successfully told me what was wrong but the compiler just had to spend the next 630 odd lines ejaculating horrors like a startled sea cucumber

any haskell book will do

Attached: 1550788741590.png (1280x720, 1.12M)

I've already read that book, the languages are pretty different and it doesn't help.

Yeah, fuck that. I'm just gonna try MXE with the CMake wrapper tomorrow. Getting tired of seeing cannot find -lfreetype.

you're probably too dumb to be a programmer

you're gonna have to help me with that

The first three lines will tell you what's wrong.

>self inserting haskellfag calling others dumb
wew lad

please do not bully /dpt/ friends (unless they are paedophiles or frogposters)

JavaScript rocks!

Attached: js_rocks.png (1433x779, 473K)

usually

>cmake dependency checking is, predictably, broken
>solution is to try more cmake

if after reading that book you didn't understand elixir is shit, sorry you won't make it

bully website

Attached: 1535960383368.png (400x400, 270K)

>>cmake dependency checking is, predictably, broken
I have a feeling that part of the problem is that no build systems are designed with Windows in mind because I had a pretty similar issue with Meson. I will take your advice if I end up at the same path though.

Honestly I wouldn't bother, I love the BEAM but Elixir is kind of a meme. If you REALLY want to, then Introducing Elixir is fine. I'm not a big book person so this is the only one I read, but it was good enough.

Attached: 1538111067848.jpg (500x656, 75K)

Cheers

>Honestly I wouldn't bother, I love the BEAM but Elixir is kind of a meme

Are you saying that Elixir isn't that great compared to other BEAM languages? Just asking out of curiosity because most people on the web said you can develop faster in Elixir rather than on Erlang.

Or are you saying that reading a book for Elixir isn't that much of a requirement if I just want to learn the language itself and its syntax? I've noticed it looks similar to Ruby and Python, but I never bothered to look into these two.

>What are you working on, Jow Forums?
Working on streaming camera data from an old android device using TCP. I am currently looking at rewriting the CameraServer service. I want my process to access the camera and the current CameraServer service is overkill for what I want to do.

Attached: camera.png (1394x852, 153K)

hey, qtfags, QFileInfo::lastModified is far too slow to be used in large directories. how do i access this information without it taking 200ms per file using only your shitty beloved framework?

thanks.

A bit of both. Like you say, it's so similar to Ruby that you don't need much other than their website to get up and running with it, and then you just need to learn the ecosystem like hex and dialyzer and whatnot. I personally don't like Ruby's style or syntax, so I find writing Erlang a little easier, but it's not loads better, and it's a bit esoteric.

The great part about the BEAM is what it gives you; namely incredibly hot swapping, easy concurrency and fault tolerence, it's just the languages that utilise just don't tickle my fancy. There was a project a while ago that allowed you to write elm and transpile to elixir, but that felt like a hack. If there was an actual full language built on top of the BEAM that was built from the ground up like that though, I'd be on it in a heartbeat.

>far too slow to be used in large directories
Have you compared it to stat(2) on each file? Maybe that's just the speed of your filesystem.

pic related

Attached: elixir16.jpg (2250x2700, 1.24M)

stat is practically instantaneous. i'm guessing (i haven't read the source) that qt here is filling in a time & date structure with beautiful formatted information or some crap.

>basedbeam

>I personally don't like Ruby's style or syntax
I agree

>hot swapping, easy concurrency and fault tolerence
This is exactly why I want to get into Elixir/Erlang, sounds too good and I want to see it for myself

>There was a project a while ago that allowed you to write elm and transpile to elixir, but that felt like a hack
Still cool to see that there are people trying stuff like this. I find it to be a great indicator for a good community

Thanks for the tip, man. You were of great help.


Thanks

I prefer Erlang over Elixir, but both languages are good. Most of Elixir is not necessarily learning the language, but learning the foundations of it. Understanding OTP is a must if you want to do anything in Erlang/Elixir, and understanding the tooling is also pretty important.

|>Are you saying that Elixir isn't that great compared to other BEAM languages? Just asking out of curiosity because most people on the web said you can develop faster in Elixir rather than on Erlang.
Pretty much all BEAM languages are the same, you just need to decide which you prefer. People don't use Erlang/Elixir/LFE for the language itself, people use Erlang/Elixir/LFE for the virtual machine and what it can do. BEAM was specialized for high concurrency and fault tolerance at the expense of speed, which means that it is quite a niche language.

>Understanding OTP is a must if you want to do anything in Erlang/Elixir
Having done some quick searches, I've found some quick explanations regarding this topic. I haven't checked those books recommended earlier yet, but I believe there should be at least one chapter which covers this.

>understanding the tooling is also pretty important
Great that you mentioned, how convenient do you find the tooling in this ecosystem compared to other languages?

>dark characters on a light background are superior to light characters on a dark background (when the refresh rate is fairly high). For example, Bauer and Cavonius (1980) found that participants were 26% more accurate in reading text when they read it with dark characters on a light background
>with a bright display (white background) the iris closes a bit more, decreasing the effect of the "deformed" lens; with a dark display (black background) the iris opens to receive more light and the deformation of the lens creates a much fuzzier focus at the eye

What's /dpt/ opinion on light themes?

|>Having done some quick searches, I've found some quick explanations regarding this topic. I haven't checked those books recommended earlier yet, but I believe there should be at least one chapter which covers this.
OTP should take a few chapters in any decent tutorial. You should also get a book which explains how you should set up your program and design your superviser tree.
|>Great that you mentioned, how convenient do you find the tooling in this ecosystem compared to other languages?
Pretty good, Elixir has the advantage of being able to use tools that was built for Erlang. Dialyzer is awesome (basically allows you to annotate functions with types which can be analyzed to ensure type safety). Mix is a pretty good package manager, it is pretty similar to Ruby Gems.

Just use what you like best and find comfortable.

I don't mind them but I usually use a dark theme, the only light theme I use daily is Yotsuba B for Jow Forums.

Thank you and the others for the answers provided! It looks like I have a lot of work to do if I want to learn these technologies and they seem promising.

>expects to be able to use a package magically without finding it first
cmake.org/cmake/help/latest/module/FindFreetype.html
FIND_PACKAGE(Freetype REQUIRED COMPONENTS Freetype)
TARGET_LINK_LIBRARIES(Test PRIVATE ... Freetype::Freetype ...)
then if it reports it can't find the package, re-run cmake with -D CMAKE_PREFIX_PATH=

${VAR} expands as an array, if it's empty then you don't pass any arguments to MESSAGE(). Surround stuff in quotes to prevent this (it'll expand to an empty string, a single argument).

Works pretty fast for me.
You sure you're not copying your containers?
Try this.
#include
#include
#include
#include

int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QDir d("/home/tux/Downloads/Images/animu/tags/topless/-white_background/");
for (const auto &i : d.entryInfoList({"*"})) {
qDebug()

Rate my over-engineered Java code for checking for a win in a TicTacToe game.

Attached: TicTacRate.png (890x441, 36K)

ALGEBRAIC DATA TYPES ARE FUCKING BASED AND REDPILLED

IM A ML/HASKELL DUDE NOW

SUCK MY DICK ALGOLETS

hi /dpt/, I'd like to learn programming and change careers (currently gardener).
What anime should Iwatch first?

Ichigo Mashimaro

cool

>UNREGISTRED
wikileaks.org/ciav7p1/cms/page_9535650.html
Here you go, enjoy.
It's not limited to 10 users don't worry

/dpt/-chan, daisuki~

My roommate is a cat.

Objects are more powerful.

eye-tuebingen.de/the-institute/news-events/news/news-article/60-why-might-reading-make-myopic/

"""
Alleman, Wang and Schaeffel asked their subject to read dark text on white background or bright text on dark background. Already after 30 minutes it was found that the thickness of the choroid either decreased (when reading standard text) or increased when reading text with inverted contrast (Figure 2). One would therefore expect that dark text on bright background would stimulate myopia development and bright text on dark background would inhibit myopia. Simply inverting text contrast is therefore strategy to inhibit its development. This is easily achieved on computer screens and tablets but certainly more demanding when it comes to printed books.
"""

Why lemon?

Depth-first search on a tree where each node is either a letter or an end word mark.

for example, a tree that contains the words [hell, hello, head, heal]

// § denotes an end word mark node

H
-> E
-> L
-> L
-> § // HELL
-> O
-> § // HELLO
-> A
-> L
-> § // HEAL
-> D
-> § // HEAD


Thank you for using an anime image.

Attached: perv.webm (1280x720, 2.68M)

Lisp is the most powerful programming language.

trie

>Why lemon?
you're not the real akari-poster, are you

rip microsounds
akari bbs 2 when?

C# is the most powerful programming language.

Attached: 1556816673662.png (1406x2846, 861K)

maki is the most powerful love live

>then if it reports it can't find the package, re-run cmake with -D CMAKE_PREFIX_PATH=
The problem is even when it finds FreeType it can't link to it after building. The only thing it does after finding FreeType is say FreeType was found.

it's a longshot, but iirc freetype does something retarded if you don't have its headers organized in a very specific directory structure
is freetype's header on the base include path or in a folder?
it has to be the former

Perhaps because you're trying to just pass an arbitrary string instead of ${FREETYPE_LIBRARIES} for the linker flags?

Ok wait, I just did what you said but then explicitly set FREETYPE_LIBRARY and FREETYPE_INCLUDE_DIRS paths and now it works.

>${FREETYPE_LIBRARIES}
don't do this

>even when it finds FreeType
Is FREETYPE_FOUND true? In CMake "false" is an empty string by the way, in fact everything's a string.
If it says it actually found it, you can check the target properties to see where it thinks it found it.

congratulations

>don't do this
Why? Aren't you supposed to use the variables set by cmake find scripts instead of stuffing random shit? At that point you could just manually invoke g++ if you don't care.

Send help.

I want to change careers so fuckign much and make some real money but I'll be 30 next month, and have no college degree

>been grinding webdev the past 8 months
>learned HTML, CSS, JS, some Jquery, React, even some C++, and working on Node.js
>every fucking job listing requires a bachelor's
>working on portfolio, trying to grind stuff and retain what I've learned
>currently an industrial mechanic
>fucking hate my job with a passion
>making +/- 65k /yr but I'm pretty much topped out in my job and field
>have to start making real money
>can't take anything making less than $55k/yr starting

AHHHHHHHHHHHHH

Attached: 2dd.jpg (600x600, 40K)

In this case FREETYPE_LIBRARIES is a variable containing the absolute paths to all the freetype libraries, and it's only offered for backwards-compatibility. The Freetype::Freetype component target should be used instead; targets can have metadata like the library location and include path attached to them so you only need to pass them to TARGET_LINK_LIBRARIES.

why is cmake such a mess of hogshit?

I've not heard of components before, is this a new thing or is it just not used that much?

freetype = dependency('freetype2')
Why did CMake have to make it so hard?

Attached: 1453306116180.png (313x196, 58K)

>Freetype::Freetype
This seems like the main thing that made it work, the whole freetype and freetype2 things just won't link.

god bless meson

>every fucking job listing requires a bachelor's
Infamous requirement that often is just false.

Send your resume to those places anyway, I can guarantee many of the people working there don't have a bachelors.

I'm not gonna make it bros, I've let you down

It's okay if you don't understand monads at first, just give it time user.

It's new as of CMake 3, released in 2014. The old variable-based linking and global includes/linking is currently soft-deprecated.

Yeah because by just saying "freetype" you're telling it to literally just pass "-lfreetype" to the compiler and nothing else. If CMake doesn't recognize one of the items as a target (whether imported with FIND_XYZ or created by your project), it'll assume it's a literal library name in your system search path.

You'd think so but I started this problem off on Meson and had a similar issue since I couldn't figure out how to to link the Windows libraries on it.

Attached: Untitled.png (741x246, 21K)

hot

mesonbuild.com/Builtin-options.html
See the bit about c_winlibs/cpp_winlibs.

>I can guarantee many of the people working there don't have a bachelors
How many of them have nothing but 8 months of poor HTML experience?

I'm not HR, so I don't know how much they filter, but for junior positions I don't know a single person who cares about a degree

Yeah, I saw that, couldn't figure it out. OpenGL did had to be linked differently than all the other libraries too.

imagine living in a place where not even 65k is considered real money