/dpt/ - Daily Programming Thread

What have you been working on, Jow Forums?

Previous thread:

Attached: wtf.png (1790x1270, 264K)

Other urls found in this thread:

github.com/carp-lang/Carp
w3schools.com/js/default.asp
hackage.haskell.org/package/base-4.11.0.0/docs/Prelude.html#v:span
hackage.haskell.org/package/split-0.1.1/docs/Data-List-Split.html
tiswww.case.edu/php/chet/readline/rltop.html
en.wikipedia.org/wiki/Language-oriented_programming
clojure.org/community/companies
twitter.com/SFWRedditGifs

please use an anime image next time
thank you
t. concerned /dpt/ citizen

Attached: 1498866208019.png (1000x793, 717K)

I'm trying to make a program to recover my telegram account by force.
>63 days

I for one welcome our new statically typed GCless Lisp dialect overlords
github.com/carp-lang/Carp

Attached: carp_logo_300_c.png (300x242, 94K)

>impure

Attached: 91i328.jpg (740x740, 142K)

Yes but does it have classes

What's this?

I"m executing SQL queries from VBA and I was wondering if there was a way to do an inner join on one of my excel sheets and an Oracle database.

I can already pull stuff from the database purely from VBA but I'd really have to do an inner join with one column to make my code efficient. I don't have write access to the server.

Are local temp tables an option? I've also read about table valued parameters being suggested but I have no idea what they are.

plz post more like the pic here in OP

Also post some pajeet with terrible code memes.

Please they always make me laugh so hard.

No. Fuck off, redditor.

How am I a redditor? I don’t even own a reddit account, nor do I browse that cancer ass website.

>Poor writing style
>Reddit spacing
>Wants to post le ebin maymays
You absolutely reek of it. Fuck off.

best free websites for learning web development? I graduated college with an unrelated degree but its ass, I wanna learn and possibly go freelance.
I'm just using w3schools.com/js/default.asp
right now. Guess it's a start

>post on reddit to announce my software to normies
>they all ignore me, not one single comment
:(

>normies
Look who's talking, normalfag fuck.

>normie
normalfag

Aren’t redditors like super proper and punctual when they post? I’ve been linked to a thread there a few times and I can’t even read it because the posts start cascading across the screen, I don’t understand.

As far as the spacing goes, it’s just a habit I’ve picked up from reading posts that aren’t gigantic wall of texts. I don’t even know why Jow Forums even shits on “reddit spacing”. Wall of texts are hard to read.

If I wanted memes, I’d go to /b/ or Jow Forums. However, Jow Forums related programming memes come strictly from here, there’s no other place you can really find those because normies don’t understand them.

I’ve been browsing Jow Forums since like 7th grade and I’m now I’m 22. Gtfo

Any C++ here? I have a dumb question, but I cannot find the answer anywhere, so...

My code is simplified to this

string str = "some existed text";
getline(cin, str);

When getline is called, str will be deleted and the user will input a new content on their own, but I want to let the user edit/modify the "some existed text" themself. How do I do it?

*C++ expert, I mean.

do you mean that you want a console interaction to let the user edit the line, like a text editor?
It's recommendable to use a library for this. Try libedit/readline/ncurses.

>I've been on /b/ or Jow Forums for two weeks, so I'm a Jow Forums expert :^)
Stupid kid. It's extremely obvious from your entire post that you don't know how to conduct yourself here.
Lurk more.

What you're describing is actually significantly harder than you think it is.

is w3schools a good place to start learning a language

Yeah. That's what I want. Is there any "easy peasy" way to do it without any library? Google has not been giving me anything relevant by far.

>Is there any "easy peasy" way to do it
No. Controlling the console is non-trivial ways is actually quite hard.

There isn't. You have to speak in terminal protocol to do this. Sure you can do it directly, but no one does. All such things are done through terminal abstraction libraries like ncurses.

Library is the "easy peasy" way, avoiding having to implement something like ncurses yourself.

One thing you could do instead is make this program part of a larger pipeline, like:
myprogram -e | | myprogram
where first myprogram spits "some existed text" to stdout due to the -e ("edit") flag, which is fed to an existing CLI editor on stdin, which spits the edited text back out when the user finishes, and is then fed back in to the program. vipe is a wrapper for vi/vim that works like this.

That kind of interaction sounds more suited to the GUI world than CLI in my opinion, it would make it very awkward to use in a script.

>have to write a sorta-big enum of values that follow a pattern
>using vim, learn about "read !(command)" to pipe the output of a command right into your buffer
>:read !python -c "[print('\t\t{0:12s} = 0b{1:016b},'.format('Bit'+str(x),2**x)) for x in range(16)]"
>vim wins again

Attached: nice.png (601x210, 7K)

Here's sort of a working example (in C because I don't regularly use C++):
#include
#include

#define DEFAULT_TEXT "Hello world"

int main(int argc, char **argv)
{
int c;
char buffer[256];

while ((c = getopt(argc, argv, "e")) != -1) {
switch (c) {
case 'e':
puts(DEFAULT_TEXT);
return 0;
}
}

fgets(buffer, 256, stdin);
printf("Final text: %s", buffer);
return 0;
}

Attached: test.webm (400x400, 39K)

Is it me or is the python module documentation a mess to read?

:%! is excellent too, sends the current buffer to the command and replaces it with the results. Undo history is maintained so if your filter was wrong you can revert it. It makes me a little annoyed when a program doesn't use stdin/stdout as the default though (requiring a special flag or "-i -" or "-o -" to use then instead of the other way around), so for my own projects I try to make sure they play well with :%! and :r!.

FreeCodeCamp

Ok so I'm learning Haskell for the first time and I'm trying to split a string with a char, so something like splitString "hello world" 'l'
"He,o wor,d". I'm trying to use the takeWhile and dropWhile to do this, and I'm currently stuck at splitString alist x = takeWhile (/= x) alist and that just gives me "he", how do I concat or append the rest of the list? Any advice would be appreciated, here is a cute Asian girl for your time.

Attached: downloadfile.jpg (649x798, 51K)

>tfw the only way to deal with crippling loneliness is to complete immerse yourself into programming and reading about computing

Attached: sad_wojak.jpg (535x577, 61K)

You can use
dropWhile (/= x) alist
to get the rest of the list
Then you can drop the part of that that is == x

You should try using span:
hackage.haskell.org/package/base-4.11.0.0/docs/Prelude.html#v:span

If you don't need to create your own you should use split:
hackage.haskell.org/package/split-0.1.1/docs/Data-List-Split.html

I'll be lonely with you user. I'm so sad and I've been programming all night.

Attached: 1499269501420.jpg (467x700, 32K)

Should I learn golang, java spring, or something else for backend webshit?

Elixir + phoenix

Haskell

Not this user, but it's been about a year since I've touched Haskell, and decided to try myself.
Rate my solution:
splitString :: Char -> [Char] -> [[Char]]
splitString c [] = []
splitString c str = x : splitString c (dropWhile (== c) y)
where (x, y) = span (/= c) $ dropWhile (== c) str

you can use break (== c) rather than span (/= c)
then you can replace c and (== c) with a general predicate on chars

look into readline
tiswww.case.edu/php/chet/readline/rltop.html
it returns a char* string so you have to convert that to std::string

At which layer of abstraction do you stop when reinventing the wheel?

monads in the category of monads

Out of those, java spring is bretty good.

Remember your unit tests.

static inline constexpr bool all_trivial_copy = (trait::is_trivially_copyable && ...);

static inline constexpr bool all_trivial_ctor = (trait::is_trivially_constructible && ...);

static inline constexpr bool all_trivial_copy_ctor = (trait::is_trivially_copy_constructible && ...);

static inline constexpr bool all_trivial_move_ctor = (trait::is_trivially_move_constructible && ...);

static inline constexpr bool all_trivial_copy_assign = (trait::is_trivially_copy_assignable && ...);

static inline constexpr bool all_trivial_move_assign = (trait::is_trivially_move_assignable && ...);

static inline constexpr bool all_trivial_dtor = (trait::is_trivially_destructible && ...);


C++ is the best programming language on Earth.

Attached: 1467019345752.jpg (180x157, 10K)

brainlet

What's a good computer vision library for c#? I've never done computer vision before, but the project I've just started requires it.

Attached: 1479549544518.jpg (1280x853, 296K)

It is a bad idea to learn two languages at the same time?

I want to get into webdev, already went through HTML, CSS and basic JS. I want to keep improving my JS but also a friend that works as webdev always mention me that they keep hiring PHP devs where he works.

So, JS + PHP Y/N?

In c#, what is the alternative of copy pasting my code to different functions so the functions can use the values from the code.
Do I just create a .cs file and put the code in there so all the functions can get the values once they call to that code?
My coding needs some serious cleaning up because I constantly just copy/paste my code to different functions.
For example having two buttons to see from a .txt file who are twins and who are triplets, I make my code inside the twins function then copy paste most of it and paste it in the triplets button.

JS and PHP goes together like bread and butter.
Listen to your friend.

Make one function that can take an argument to determine what to do. In your twin/triplet example, you could use an int to set the number to search for.

Attached: 1479550199399.jpg (620x413, 52K)

Thank you for not using an anime image.

Thank you friendly spiky hamster guy, I will try that now.

Many people told me, just focus on one language, when you master it move to the next.

But really, I don't want to delay learning PHP too much, even more if he tells me there are jobs up for grabs and also has high hopes on me getting this shit done.

This reddit spacing bullshit needs to stop.

I write markdown and email like this, I think any adept techie who cares about readability sees the value in that.

>Many people told me, just focus on one language, when you master it move to the next.
That's understandable but when languages work well together and are often used together I think learning PHP and JS would be the exception here.
Well personally I learned a bit of JS before PHP but it makes little difference since both of them are needed to make good web applications.

Do you know how to make your shit readable?
Use paragraphs, you illiterate reddit fuck.

>I"m executing SQL queries from VBA and I was wondering if there was a way to do an inner join on one of my excel sheets and an Oracle database.

This is the most horrific thing I've ever heard.

R

E

D

D

I

T


S

P

A

C

I

N

G

FP, more like Fag Programming, amirite ?

My mate's a literal fag and he writes C++. So, no.

>mentally ill
>programs in C++
poetry
why is he still your friend

(defn draw [app rend state]
(bg rend &(rgb (/ @state 2) (/ @state 3) (/ @state 4))))

>[
>]
>@
it's even less lisp than fucking clojure and everybody knows that clojure is not lisp.

Thanks user, I'll get my ass on it.

I looked up some of the PHP basics some time ago and I actually enjoy finding similarities between languages.

We already have hundreds of languages. What could be a new reason to create a new one?

Attached: Screen Shot 2018-04-13 at 20.32.14.png (117x166, 21K)

>My mate's a literal fag
yes, your """"mate"""".
Don't worry, your secret is safe with me, fag.

Make a better language ?

C++ sucks

>muh ()s
Clojure is the only language that has even gotten Lisp back into the semi-mainstream.

we still don't have a GCless language with all the possible meme types.

>we already have millions of programs, what could be a new reason to create a new one?

BETTER C

better abstracting and utilization of processes at a language level

imagine if your code could be statically analyzed to use GPU SIMD instructions in heavy computational areas, multi threading in areas where there is no shared memory (functional languages largely do this already if im not mistaken), in the future if you have a quantum processor to properly utilize it (because its not just free performance, you have to write specifically for it), etc

the best i've ever seen this being used is c++ macros for multithreading

Ok, mr never had a job

>"My mate is"
>implying he's not trying to camouflage that is in fact him, who is the c++ programming homo

not new at all

Use a tool to generate bindings to a good python CV library.
Alternatively, find somebody who already has.

>c++ macros for multithreading
You mean pragmas, not macros.

>be emacs fag
>github crush uses nvim
What do /dpt/ ?
I know >she's the fucking one. I've been forking >her repos for a month now and am still not bored. But I don't know if I can abandon my ((()))ed config files just like that, for her or for anyone else.

I'm so confused, idk what to do with my life anymore. I just wanted to do some pair programming with a cute anime avatar image...

Attached: 1507963063416.gif (500x322, 1.97M)

san francisco hipsters is not the mainstream.

lisp being a programmable programming language, you shall not be surprised of it being extended.
also, the gc being removed, you obviously need new semantics to overcome that (@ and &)
are you no true lisper.

en.wikipedia.org/wiki/Language-oriented_programming

lol imagine being this much of a loser

try again lad
clojure.org/community/companies

plz no bulli

try again what? what i see here is sf startups

Thanks user

>.au
>.nl
>.za
>.de
>.co.uk
>.fi

Kill yourself.

irrelevant. clojure is nowhere from being mainstream.

Attached: top15.png (1102x957, 69K)

>python > java > ruby
kek
So representative of the industry.

>systems programming
Does this meme exist solely to justify the existence of horrible programming languages? I've yet to see any coherent definition of what falls under "systems programming". Protip: examples != a definition.

application = for the users
system programming = for the system

>We already have hundreds of languages. What could be a new reason to create a new one?
They're all bad.

Systems programming is a broad term for all the branches of programming that will be saved by linear types.

>application = for the users
>system programming = for the system
But then you have game engine devs claiming they are systems programmers. And why is this distinction between "for the system" and "for the user" even relevant?

I said semi-mainstream.
Also, how are more PR's indicative of quality? To me that seems like the opposite, whether i'm arguing for clojure or not.

>meme types will save meme programming
Sounds about right.

game engine devs are system programmers, they are developing libraries that enhance the system. these libraries are then used for developing tools and games for the user to use.

Do you know what a pull request is?