/dpt/ - Daily Programming Thread

What are you working on Sup Forums?

Previous: REAL PROGRAMMERS EDITION!

Other urls found in this thread:

en.m.wikipedia.org/wiki/Yaoi
gnu.org/software/grep/manual/grep.html
gnu.org/software/sed/manual/sed.txt
linux.die.net/man/1/shar
developers.google.com/recaptcha/docs/faq
geeksforgeeks.org/detect-cycle-in-a-graph/
twitter.com/SFWRedditGifs

DISGUSTING

Not a real programmer?

What the fuck is this faggot shit.

> How to do the following.
There are several subclasses of abstract class Action: A1, A2 ...
There are several subclasses of abstract Object class: O1, O2, ..., These subclasses can perform Actions A1, A2..., but each subclass implements in its unique way.
> I want Action to have a pointer to Object, and make it possible to make this object do this action, and it should be determined by both Object's and Action's actual types.

our resident rust poster

You are looking for multiple dynamic dispatch. You will probably have to do it yourself by having one class depend on the other (likely the action depending on the object) with up to m*n subclasses.

>real programming is faggot shit
Why are you even here?

So why exactly is sizeof std::function is 40 on bindows

faggot

Delete your shitty thread

... so this is the power of 3d ...

because std::function object uses inheritance, it's a small trade off

My guess would be a function pointer (8 bytes) and 32 bytes of storage (points to captured variables if larger).

>I'm a faggot
we know, but why are you in /dpt/?

any recommended android studio books/tutorials?

see

What's wrong with the thread? It's standard /dpt/:
title - checked
link to previous - checked
What more do you want?

Thanks.

i'm okay with this, very turn on rn

sage and report

#include
unsigned long umul(unsigned a, unsigned b) {
unsigned long c = 0, bl, m;
while (a) {
bl = b;
m = 1;
while (!(m & a)) {
m

We're already at the point where the thread has scrolled down far enough that you can't see it. Stop being an autist.

Anti sage :^)

>undefined behavior

where

I love insecure boys like you, keep going

Where?

Kek
> muh C++
> end up doing hacks to make shit done

>bois
ftfy

Trying to get into live programming

Thanks sweetie

common lisp

false flag

Multiple dispatch is not trivial.

Well, I agree, tho when I thought about wither using hashtable and id, or ifs to check a type, it looked like some pajeet level programming, but wiki actually suggests it as a solution/

PRUNED
R
U
N
E
D

Do you need it to be dynamic? C++ can do multiple static dispatch fairly easily with template specialization.

Redpill me on Julia. Is it still wet af?

>In C, which the original code using inline was written in, inline is not a hint
how fucking dumb do you have to be?

It's wet and tight and goes fast when it's ready for a load.

You are not passable at all.

You're not even conventionally attractive as a man. You've got a bad case of skinnyfat and the face of a beta nerd.

I qualify it with "conventionally" because while those qualities won't get you any girls, they tend to be exactly what the faggot equivalent of a Chad looks for in his bitch. Because in the bizarro world of faggots, alphas and betas are lovers instead of competitors.

(Obviously I don't speak from experience.)

>I don't speak from experience
a little too specific tho

>(Obviously I don't speak from experience.)

upvote

What's the best technology for building GUI applications and why is it JavaFX?

it's just common knowledge bruv
en.m.wikipedia.org/wiki/Yaoi

Can you wrap ava around c++? I checked 3 years ago, and the native methods technology seemed outdated.

Does anyone know of a way to analyze a text file and to make the prgram only keep lines that conatin a certain patter, like:
>>
Anonymous 11/19/17(Sun)19:50:43 No.63451163▶
This is absically ehat I have to filter out out of a file that conatins over 4000 lines, I have about 600 occurences of this.

>claims not to be gay
>knows common yaoi tropes
hmmm

man sed

I didn't have that "common knowledge" despite being well versed in arts of theoretical manly love.
This must come from experience.

jna you mean?

swig

>Does anyone know of a way to analyze a text file and to make the prgram only keep lines that conatin a certain patter
gnu.org/software/grep/manual/grep.html
grep -E "pattern" filename > outputfile

> community-developed
But why?

Learning elisp to participate in general emacs faggotry

perl

? Man sed?
Please, I am not knowleadgeable about special slang, if this isn't a troll reponse.
For example, I have random lines, and then a line like this pops upp:
British Pakistani-poster !9Msgo4FGOs ID:+jBCLjH2 Sat 04 Nov 2017 17:57:47 No.147928111 ViewReport
And what I want to do, is to isolate all date timestamps.
(and then convert them to seconds)
Please, I would really like to figure this out/ have someone help me figure it out.

gnu.org/software/sed/manual/sed.txt

or

>gnu.org/software/grep/manual/grep.html
I am afraid, the date timestamp always vaires, so the pattern is only defined by its regular spacing of "random" letters and numbers i.e.:
>Sat 04 Nov 2017 17:57:47 No.147928111 ViewReport

> fbi data miner intern asks advice on Sup Forums

Woah, this is a fast thread, sorry, I am not quick enough to check all the answers out that fast.
Let me see (I use win10, pls no bully)

man sed is a gnu/linux shell command.

"sed" is a command line tool for serial text manipulation

"man" is a command line tool for finding and displaying available documentation on installed software

so together, "man sed" reads "computer, teach me how to use [man] my stream editor program [sed]"

Kek.

jni is not communitydev though and should be faster
idk if it's outdated

Okay, I feel stupid now.
You know what, I think I'll nuke (reset) my PC and install Linux.

So I was really wanting to work on my Java programs from the comfyness of the Netbeans IDE on my linux station

I was delighted to find out linux is supported!

I expected to download a tar archive or something. Nope. Just a simple shell script.

A 214 MEGABYTE SHELL SCRIPT!
Like holy Jesus! I'm scared to execute this thing! Can bash even handle a 214 MB script?

Probably has some embedded binary data.

basically shar file linux.die.net/man/1/shar

Modern C++ looks kinda like Javascript. I don't know how I feel about dat

and it finally has half-ass modules now.

r8 my map

template
t1 map(t1 col, t2 op)
{
std::transform(col.begin(), col.end(), col.begin(), op);
return col;
}

int main( int argc, char *argv[] )
{
std::vector arr {1, 2, 3, 4, 5};

arr = map(arr, [](int i){ return i + 1; });
}

someone give me a programming challenge i can accomplish in PHP

how do i program super douchememeio and the multiple fucknuggets of meme douche

Abysmal.

why ;_;

You guys are right. I feel like i'm on windows. They have a gui installer

I was hoping for lots of output on the terminal...

>why
Because you're using C++. In Haskell it's just map (add 1) [1,2,3,4,5].

How do I get used to the idea of modulus returning 0 being false? For situations you'd probably use === 0 for true. It just feels backwards.
Not best practice, but fun.

for(i=1;i

class ActiveRecord::Relation
def createOrUpdate(**args)
if self.exists?
args.each do |name, value|
self.first.send(name.to_s + "=", value)
end
self.first.save!
else
self.class.create(*args)
end
end
end


>he doesn't use Ruby

Can I have a (You) please ?
It's for testing purposes, I-I swear !!

Modulus is not "is divisible by".

>end
end
end
self.kill, desu

So the old V1 captcha is going to be permanently disabled in March. I imagine a lot of people will leave for other imageboards. Keeping track of all these imageboards is hard, though.

You know what would be really cool? A standard "Imageboard API" that handles posting, browsing, and searching in a standard way. Now, you could have ONE client that you can "add" imageboards to and browse all these communities from a single interface. That would be hundreds of times better than opening each fucking board in its own tab, each with their weird themes and posting requirements.

>users download an Imageboard client
>imageboard admin implements the Imageboard API on his site
>users add the imageboard to their client
>users can browse and post the same way they can on all other imageboards

Is this being actively worked on?

#include
#include

template
auto foldable(T col) {
return [col](F f, U initial) {
return std::accumulate(col.begin(), col.end(), initial, f);
};
}

int main() {
auto v = std::vector{1, 2, 3, 4};
auto c = foldable(v);
return 0;
}

>this doesn't compile even in C++14
C++ will never be a usable language.

>So the old V1 captcha is going to be permanently disabled in March
fuck off really?

fuck jewgle

here's your (you)

It's unfortunate

developers.google.com/recaptcha/docs/faq

as soon as you start

not him, but what's the problem with it? the advantage of not having to use whitespace is that you can always do something like
class ActiveRecord::Relation
define_method(:createOrUpdate) { |**args|
self.exists? \
? (args.each { |name, value| self.first.send(name.to_s + "=", value) }; self.first.save!)
: self.class.create(*args)
}
end

Fuck off ccd0, everyone knows you can't program for shit.

Right, and I get that, but I'm using the remainder it produces as a boolean. If it's 0 then it's falsey else it's truthy. It's a totally hamfisted approach, but the code works. It just feels reversed and I can't seem to get used to it.

I've started writing a client and I'm basically parsing each imageboard's browsing and posting system individually.

It would be a lot easier if imageboard authors implemented a standard API, but that's not something I can do on my own.

Huh?

I have an array with pair of numbers:
[[0,2],[0,28],[1,29],[1,32],[2,4],[3,5],[3,31],[4,30],[5,7],[6,8],[6,34],[7,8],[9,11],[9,25],[10,13],[10,26],[11,13],[12,17],[12,27],[14,16],[14,17],[15,18],[15,35],[16,18],[19,35],[19,36],[20,22],[20,25],[21,24],[21,26],[22,24],[23,27],[23,31],[28,30],[29,32],[33,36],[33,37],[34,37]]

There are 4 loops in this array, one is like: [[0,2],[2,4],[4,30],[30,28],[28,0]]

I can identify the loops by searching for the last item from the current pair to get to the next pair, eventually closing the loop.

Question is how would i do this in one step? Or in a couple of vectorised operation?

Does sepples really not have a regular fold function?

>Question is how would i do this in one step?
You mean in one pass? By keeping a list of open loops and checking for each item if it continues one of them.

pretty common problem, look at something like this geeksforgeeks.org/detect-cycle-in-a-graph/

idk if you're treating it as that, but your list is equivalent to a list of edges in a directed graph, so if you have a graph library you can probably find a method to detect all cycles

It has std::accumulate

(You)

>let's permanently disable V1 captcha on all imageboards