/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

codereview.stackexchange.com/questions/159056/find-all-distinct-8x8-chessboards-where-5-queens-attack-occupy-every-square
python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/)
mitpress.mit.edu/decision-making-under-uncertainty
gitgud.io/hackierendebernds/BBS-Simulator
pastebin.com/Yj0qmBTb
github.com/bibanon/BASC-py4chan.
basc-py4chan.readthedocs.io/en/latest/index.html
cmake.org/cmake/help/latest/command/add_library.html
cmake.org/cmake/help/latest/command/target_link_libraries.html
lmgtfy.com/?q=compiler benchmarks
soundcloud.com/recordsyourcomments/48-1
github.com/ethereum/wiki/wiki/JSON-RPC#hex-value-encoding
pastebin.com/F2V852x7
twitter.com/NSFWRedditImage

I made this:
codereview.stackexchange.com/questions/159056/find-all-distinct-8x8-chessboards-where-5-queens-attack-occupy-every-square

I was inspired by this:
(Cross-thread)

Please help to improve

...

i'm learning lisp :3

you could concentrate better on the lap of a cute boy tho user

Finishing touches on Google Summer of Code application. Nobody else (other than the maintainers) has submitted a PR to the project I'm submitting an application to in the past year, so I think I'm gonna make it.

p-pls you're making me blush >.

ditched C for Elixir
muh concurrency

i'll turn your cheeks red indeed user

You need portable threading? Use musl.

threads are more costly than elixir processes (which arent processes)

Are there any good reads on how to port Python 2.7 scripts to Python 3? Is that even a good idea, or should I start webmrelated from scratch for Sup Forums?

Fun fact:

Did you know that the creator of Lua is a Brazilian Jew?

What compatibility issues are you having specifically working in 2.7? Just keep developing in 2.7 if you like, set up a virtualenv (python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/) to make it easy for people to contribute and use.

oo stap

As always.

I'm reading this book now
mitpress.mit.edu/decision-making-under-uncertainty

What the fuck am I looking at?
Anywhere there are modules that port 2.7 to 3 but it might result in your script being buggy. So why not just work in 2.7?

im afraid i cant hold myself back with you user

Uh, ok, I guess.

No issues really, just want to have a fork ready for people who prefer Python 3.

A BBS simulator for the temporarily dead german imageboard Krautchan. It currently supports browsing all boards, viewing page 1 and the catalog as well as opening threads and downloading every attachment in a thread into a directory specified by the user. Was working on posting functionality but then KC got the Polizei treatment.
As for the porting: see above. Some people just prefer Python 3 so I want to please both Versionistas.

I don't really care much about this meme, but if there really is any crossdressing programmer. I would really like to give them a hug.

Anyhow. Guys I got a minor question, I haven't found any proper answer to it. The question is, what benefits are there in writing in a webservice in "java-ee" compared to "js/php".

Anyone who uses python 3 should also have virtualenv. The changes in syntax aren't hard to pick up on the fly if you want to change something but are annoying enough to change in the program itself that it's probably not worth updating.

Just google a guide on updating legacy code to 3, it might not be that hard for your use case. But if you have a library that depends on 2.7 you're probably fucked.

Do you have a git for that. I am interested? I amuse you are using basc_py4chan as your wrapper for Sup Forums API?

Thanks, will keep that in mind.

Yeah I have: gitgud.io/hackierendebernds/BBS-Simulator (you need to request group invitation first though).
Source can also be viewed here: pastebin.com/Yj0qmBTb (expires in a week; the 'heinrich' import is just a file that displays ASCII art at random)
As KC doesn't feature any API that I'm aware of, I used BeautifulSoup to scrape the website and print the content I needed. It's very crude as I just hacked this thing together rather quickly. For the Sup Forums version I'll probably rewrite everything from scratch anyway.

Have you seen this before? github.com/bibanon/BASC-py4chan. I use this to make a script to scrape Sup Forums to mass save images off /h/. It is pretty decently documented as well.

basc-py4chan.readthedocs.io/en/latest/index.html

Oh, this also allows for posting? Now that is something I'll definitely use. Thanks.

No it doesn't allow you to post it just makes scraping Sup Forums a lot more easier than using BS

>"js/php"
What do you mean by JS/PHP? Do you mean JS on backend or PHP on backend, or do you mean JS front-end/PHP backend?

A lot of services begin with PHP then later switch to compiled languages in order to make their service faster, more optimized. I don't know about writing web services in Java, but I assume the positive side is that you're not using PHP, ho ho ho!

If you mean JS on backend as well, then you don't really want that if your service needs any sort of heavier processing and/or I/O to files. JS is single threaded as well so that's not nice. I guess you could use workers to split it into processes, but I haven't really looked into that.

Oh that's a shame then. I'll take a look at it anyway during the weekend. But if posting is not possible, I'll probably stick to BS.

I meant in both way. Just wanted to know if anyone have concrete information about the question I had. Want to learn a bit about it, since I never know if I must work with it in the future(even the java-ee is old)

No the beauty of the wrapper is the simplification of lines in your code. Looking at the source here is an example.

Instead of
ThreadName = soup. Select ( 'div.thread_body div.postheader span.postsubject' ))


You use
ThreadName = thread.topic


Off topic but just curious how are you going to deal with captcha when posting?

i've worked with all 3. java webservices are great for performance (JVM) and making things very exact (strict typing) and structured (OOP). this makes it ideal for enteprise

I'm unemployed

My friend who has a job writing ENTERPRISE QUALITY C# code told me the other day "You know, I never really *got* recursion"

But I'm the one who's unemployed

Anybody who says markets allocate talent efficiently is full of shit

Fine then, the difference is that PHP is interpreted language and Java compiles to bytecode, so in theory, Java should be faster.

Just learn all you can.

>he thinks employers only care about how much you know
laughing_girls.webm

I've heard that the creator of php was a novice programmer, but are these things he's actually said?

That's because you're too autismal to get hired and you smell weird. People feel uncomfortable around you.

It's hard to get a job that way.

Check his twitter.

I don't
because they clearly don't

the idea that capitalism spurs individuals to better themselves is a big fat lie. We are only incentivized to grovel before those who hold the resources

I think half of it is made up. He may have said some those things. Or maybe none of them.

Still funny though, I really really like that image.

How easy/well is it to do test deployments with the java webservices?
Thanks I know that bit, just wanted to know the core benefits of using x instead of y and then a comparison of why use y than x. I am still googling about the matter and doing some readings but I am having my eye open here too, incase someone drops by and lends their knowledge

Yeah sure, the simplification is thanks to the library I have to import. To me it doesn't make any difference other than having to distribute less files. And the user will not notice any different either. I'll have a look, but seeing as I'd have to read through additional docs or at least read and understand the library I'll most likely stick to BS unless the library totally blows my mind.

Captcha is something I am currently struggling with. Which is why posting on Sup Forums will probably be a long stretch.
Downloading the images will probably not work. Thought about using the audio captcha.

His twitter seems pretty normal desu, nothing crazy in the past year of history at least.

tru

Cute, but also degeneracy

Well I look forward to your project and wish you the best of luck. Hit me up with your git so I can keep up to date with it.

Let's have a consensus that as long as it's cute, degeneracy is allowed, yeah?

Will drop a link in a future dpt once I get to it. Cheers for helping so far.

I'll concede that so long as it doesn't turn lewd

Is it normal after 3 months of learning to still not know what you're doing?

nah, Sup Forums stands for gay roleplay
i'll lewd anyone i want user

if it's C or Rust, yea

Is anyone here good with cmake?
I have a .so I need to link to my project using cmake.

I have included it in a dir local to the project (src/LIB) relative to the CMakeLists.txt

SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
INCLUDE_DIRECTORIES(src/LIB/include/)
LINK_DIRECTORIES(src/LIB/lib/x64/)
ADD_LIBRARY(${PROJECT_NAME} -lLIB


This worked well on one computer, but didn't work on the other computer I am testing on.
They both have the same library files.
Is there something else I can do?

No. Fuck you.
"Le trap meme XDDD" is not funny, cute, or endearing in any possibly way.
It's literally just a stupid forced meme.

the error is:
/usr/bin/ld: cannot find -lLIB

we aren't going to take your fetish seriously, sissy

You should put on a trip so that Anons who do not want to see your lewd roleplaying can filter it.

They can always start their own if they need a safe space from some gender dysphoric dudes roleplaying lol

>we
Who the hell is "we"?
Also, did you even comprehend my post in the slightest? What you said doesn't even make sense.

In CMake, add_library is used for building a new library. To tell your project to link against a library, you need to use target_link_libraries.

It's not about needing a safe space, it's about not wanting to be bothered by a bunch of off-topic cybersex when one is trying to discuss programming.

We is me and But that little chat between those two anons at the beginning of the thread was cute, so we allow that degeneracy. It was already conceded. You're late.

By we I meant the board, and you came across as some tranny who is butthurt someone's not taking them seriously by complaining about the meme.

I feel bad that I had to explain this to you, hope you get better soon my man

But the cybersex is to stimulate the dopamine release to aid concentration and brain performance user, you want us to underperform?

>Calling traps a stupid fucking meme means that you're a trap
Are you fucking serious? Your logic baffles me.
>By we I meant the board
>I speak for Sup Forums

I use these functions in Android native builds.

What, are you replying to the right person? You go right ahead, I'm well happy to let you go on with your cybersex.

>>Calling traps a stupid fucking meme means that you're a trap
>Are you fucking serious? Your logic baffles me.
So you aren't a tranny and still give so much shit about what people meme about? Get a hobby my man

fuck wanted to reply to ruby lmao, thanks for the permission daddy

You're welcome cutie ;)

;*

>In CMake, add_library is used for building a new library. To tell your project to link against a library, you need to use target_link_libraries.
my mistake, I wanted to cut out the irrelevant information, so it was easier to ask my question, I did a add_library, on the line above so I mixed them up when I wrote the question, I do use target_link_libraries{${PROJECT_NAME} -lLIB}
It works on one machine, but ld cannot find the library.
as I have phrased it, the relative path is "src/LI B/lib/x64/libLIB.so"
There must be a way to get cmake to look for the file.

There are MANY ways to get the dopamine rush you need to perform better. Even if you do feel that the best way to do so is through cybersex, consider that you do not need to do so in the discussion thread, and that your continued actions may distract others trying to have any reasonable discussion, causing them to underperform.

I would like to repeat my suggestion that you adopt a trip, as not only would it allow others to filter you, it would allow you to identify each other so you can more easily fuck off to some private IRC channel somewhere, rather than grabbing a random user.

Right. And the same commands on desktop Linux, on Windows, and on Mac OS X, apply equally the same on Android.

add_library:
cmake.org/cmake/help/latest/command/add_library.html
>Adds a library target called to be built from the source files listed in the command invocation. The corresponds to the logical target name and must be globally unique within a project.

target_link_libraries:
cmake.org/cmake/help/latest/command/target_link_libraries.html
>Specify libraries or flags to use when linking a given target and/or its dependents

What this user said x2

>There are MANY ways to get the dopamine rush you need to perform better. Even if you do feel that the best way to do so is through cybersex, consider that you do not need to do so in the discussion thread, and that your continued actions may distract others trying to have any reasonable discussion, causing them to underperform.
>I would like to repeat my suggestion that you adopt a trip, as not only would it allow others to filter you, it would allow you to identify each other so you can more easily fuck off to some private IRC channel somewhere, rather than grabbing a random user.

no
*teleports behind u and molests ur third chin erotically while u can do nothing about it*

i wanted to know if there was a way to "benchmark" a compiler so i came in here, but now i have a whyboner goddamnit

I just wrote it wrong here, it is correct in my CMakeLists.txt
I was more concerned with the LINK_DIRECTORIES path being correct.
I could set a environment variable on all systems, then load it with cmake so I write the full path, is this a better way?

Alright, I'm going to sleep after this post. Night, all!

Your syntax on target_link_libraries is also wrong. Don't think of it like what you'd pass to the compiler. You don't throw in any -l nonsense. You just put in the name of the library. CMake will then generate whatever flag is necessary for your linker to use that library.

lmgtfy.com/?q=compiler benchmarks

>come to dpt
>get told to google it

>listening to tripfags
Just hide them.

>What are you working on, Sup Forums?
Working on my NVMe driver for CUDA.

Attempting to do some multiple reads and writes and benchmark the performance of stuff. Right now I'm busy trying to weed out bugs though.

Some stuff I need to do is to set up MSI-X interrupts and in addition create and delete namespaces, in order to set block size to equal page size.

Btw, trying to come up with an idea to a workload to showcase when it makes sense, if anyone has an idea where it would make sense to control one or more disks from the GPU, let me know. From my perspective, the BAR size of the Quadro I have is really limiting, and the latency of the disk is too high to show any real performance improvement. I might choose to focus on the persistence aspect of the SSD.

private String newID() {
ArrayList ids = new ArrayList();

for( int i = 0; i < nodes.size(); i++ ) {
ids.add( nodes.get( i ).getID() );
}

String id;
int idNum = 1;
id = "BH" + idNum;

for( int i = 1; i < ids.size() + 2; i++ ) {
if( ids.contains( id ) ) {
idNum = i;
id = "BH" + idNum;
}
}

return id;
}

is this retarded enough that i should redo it?

Rewriting GNU coreutils in D. Dunno how is thr Rustfag doing. I finished ls, cat and wc. I found out writing manpages take a lot of time.
I also discovered freeBSD's cat and GNU cat are vastly different.
I got a question. How should I work with man-db? Amd how do I package manpages?

This is literally as memetacular as the "Rewriting x in Haskell" shit usually posted at the start of these threads.

Except im actually doing it, its a nice project to "git gud"

>Writing anything with some shitty deadlang
You may as well write it in Delphi or some shit.

Languages have no lives

D's not dead

Neither do you

>D's not dead
That deserves a smug anime face.

It's not though

For some reason, my IDE was hiding the warnings, adding cmake_policy(SET CMP0015 NEW) helped, now it works for some reason....

Worst vivid.

Where can I learn C macroexpanding techniques, so I could write object-oriented C?

>object-oriented C
Don't bother. This is a terrible idea.

>soundcloud.com/recordsyourcomments/48-1

Holy fuck I'm dying.

read the docs and code on Gobject

(define (sums-even? field)
(let ((bit-len (calc-bit-len (calc-field-width field)))
(height (calc-field-height field)))
(if (=
(length
(filter
even?
(accumulate-n
+ 0
(map
convert-binary
field
(generate height bit-len)))))
bit-len)
#t
#f)))


Diving into Scheme.

I'm using Python and have to decode this string
0x55ba4283
Into
2015-07-30T15:28:03.000Z
But I can't manage to figure out how to do it

Documentation on the data is github.com/ethereum/wiki/wiki/JSON-RPC#hex-value-encoding

I tried with decode("utf-8") and ("hex") without success

pastebin.com/F2V852x7

>that one faggot who forces trap shit is still starting /dpt/'s
>node
>rust
This is the state of /dpt/ today.

0x55ba4283 == 1438270083
That's a Unix timestamp.

in 2008 it was
>traps
>RoR
>Visual Basic
lurk more