/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread :

Attached: HMS.jpg (1440x916, 276K)

Other urls found in this thread:

youtube.com/watch?time_continue=242&v=_2NI6t2r_Hs
pastebin.com/xR5tBhjk
pastebin.com/sLjLeVza
spring.io/projects/spring-boot
amazon.com/Programming-Phoenix-Productive-Reliable-Fast/dp/1680501453
elm-lang.org/
pragprog.com/book/jfelm/programming-elm
twitter.com/NSFWRedditGif

youtube.com/watch?time_continue=242&v=_2NI6t2r_Hs

Attached: yung_pike.png (205x226, 37K)

nth for install shen

I love ANIME!

woah dude cool
me too

How does one get into cracking pc games with denuvo?

learn assembly.
then look up basic reverse engineering examples.

>be inside virtualenv
>run django-admin
>python tries to run the django-admin that exists outside the virtualenv, but fails because django isn't installed outside the virtualenv

What's this? I though this wasn't possible in a virtualenv.

Attached: 1541104843175.png (817x1454, 331K)

Non-colorlets welcome.

>do my homework
no

Lisp is the most powerful programming language.

based

I'm working on an A.I. that will destroy the world

don't worry, global warming is already doing that

data Tree a = Leaf | Branch (Tree a) a (Tree a)

inOrder :: Tree a -> [a]
inOrder Leaf = []
inOrder (Branch l x r) = inOrder l ++ [x] ++ inOrder r

data Context a = Root | Left (Context a) a (Tree a)

inOrderTailRec :: Tree a -> [a]
inOrderTailRec t = h (Root, t)
where
h :: Context a -> Tree a -> [a]
h Root Leaf = []
h (Left z x r) Leaf = x : h z r
h z (Branch l x r) = h (Left z x r) l

class InitArray
{
template
constexpr static
void impl(std::array &arr)
{}

template
constexpr static
void impl(std::array &arr, Idx &&idx, Elem &&elem, Args &&...args)
{
arr[(Idx&&) idx] = (Elem&&) elem;
impl(arr, (Args&&) args...);
}

template
friend constexpr
std::array initArray(Args &&...args);
};

template
constexpr
std::array initArray(Args &&...args)
{
std::array arr{};
InitArray::template impl(arr, (Args&&) args...);
return arr;
}


// Initializes test with test[8] == 5 and test[2] = 7
constexpr extern
auto test = initArray(8, 5, 2, 7);

Disregard that typo.
inOrderTailRec = h Root

learning how to build useful stuff, trying to get a launcher type app going but I'm getting this which I believe relates to mixed content

thing is I don't know what I'm doing wrong nor where, the only content that's being loaded is compiled into the executable, and a few sliders uploaded into a https domain

Attached: Untitled.png (497x223, 10K)

I've been checking out the source code of this firefox extension to see if it has any malicious thing going on.
Is there any particular code block or string that I should be looking for that screams botnet?

nicified+beautified js source:
pastebin.com/xR5tBhjk
pastebin.com/sLjLeVza

Attached: googledrivedownloader.png (333x143, 15K)

also if it serves anything, loading only the "secure content" effectively loads everything correctly, so I don't know what the fuck is going on

nevermind, fixed
was loading google fonts through http instead of https, I'm a fucking dork

What's the most minimal portable way to read/write from/to stdin/stdout in C++? #include adds a bunch of assembly calls even if don't do a single thing, even with -O3

use stdio.h

Hi guys, I'm new and trying to learn Java

>What's the difference between Java SE and Java EE?
>How easy/hard is it to learn Spring?

Attached: 1541855780670.png (290x360, 58K)

why did you choose java?

In my area, that's where all the jobs are. My girlfriend has family over here and the current situation doesn't permit us moving.

Start small and work your way up. A novice fisherman does not immediately try hunt a whale.

It's not worth your time to figure out their obfuscated bullshit. Find something else.

>the ultimate status of C++
In Rust this is just:
let test = [8, 5, 2, 7];

>I can't read

Is there at least a way to monitor an extension's network activity at least?

i love you

Attached: 1508793697428.jpg (850x1250, 184K)

template
constexpr static
void impl template
constexpr static
void impl(std::array &arr, Idx &&idx, Elem &&elem, template
constexpr static
void impl template
constexpr static
void impl(std::array &arr, Idx &&idx, Elem &&elem, Args &&...args)(std::array &arr)
{}

&&...args)(std::array &arr)
{}

He can't even read this... Why do we let people who can't read use the internet, /dpt/?

this is pathetic
what's the matter rustlet, can't even read a comment?

Absolutely disgusting. In C it's just:
int test[10] = { [8] = 5, [2] = 7 };

When will C++ evolve up to at least C levels of usability?

Yeah but how do you start small?

>Yeah but how do you start small?
You just start big and work your way down, and when you reach the bottom, you start for real.

38th for removing overloaded functions from Typescript.

Only shitlangs have function overloading.

That's why I want them removed.

41st for installing and using elm

Java SE average Java.
Java EE a lot specs for webservers, Database,JSF(templates for Java made Html),JSON,security,packing,containers and distribute Java Software.

Spring Framework non-EE for webservers is just boring configure XML, use spring boot for Learning
spring.io/projects/spring-boot

42nd fo HHGTTG

Are CHM help files and the viewer the best thing created by Microsoft?

Attached: chm.png (803x621, 55K)

yes

Nt core, vstudio and c hash are some of the best humanity's achievements

And I mean it semi ironically

Which one of you fuckers writes n-gate lmao

>NT
eeeh, win32 api is a backwards compatibility mess and used to have so many vulnerabilities
>Visual Studio
used to be better, now its riddled with bugs and bloat
>C#
nice

def sum(a: int, b: int) -> int:
return a + b
How would you ensure this Python function never fails?

def sum(a: int, b: int) -> int:
try:
return a + b
except:
while True:
pass

Can anyone recommend a book that goes through web development using a functional language? I know some functional programming but I don't anything at all about web development. I'd love a book that just goes through a useful web stack while explaining the basics, how to set up a server, deploy to a cloud, interact with html, and so on.

Is this what I want? amazon.com/Programming-Phoenix-Productive-Reliable-Fast/dp/1680501453

Attached: the cat must be super high on acid to look like that.webm (1920x1080, 1.69M)

Why would it fail?

I've been revisiting an old project, where you just kill babies. Looking to add things like blending and blunt objects to the mix.

Does Jow Forums have any recommendations?

Attached: babypunch.jpg (975x507, 40K)

2edgy5me

elm-lang.org/
pragprog.com/book/jfelm/programming-elm

>/v/idya is a harmless hobby for functioning, well-adjusted adults

> ->
function annotations. neat

Not really correct since you expect a function to return at some point.
Out of memory if the bignum integers are too big. A bit length of 10737418267 uses 1.33 GiB on my machine. Python really is useless if it doesn't even bother to compress its numbers above a certain size.

Thanks, this looks promising.

>How would you ensure this Python function never fails?
Never call it.

wanting to get into android dev should I learn java or kotlin

>compress its numbers

Attached: 1527732754731.png (500x500, 60K)

>A bit length of 10737418267
>needing to count more things than exist in the entire universe
Python is for practical software engineers, not for abstract mathematicians.

call it with types that can't be added
python doesn't actually look at the types in the definition

Why does a C++ main function start with 'int'?
When I make a basic bitch hello world, at what point do integers do something?
I'm sorry if this is a stupid question, I'm coming from python and its buttery smooth syntax.

Attached: 1479519499806.jpg (1268x1485, 284K)

>python
>buttery smooth

main uses it's return value to communicate an exit status to the caller, in this case (most likely) the shell

antiquity of C.
if you want python-like, install Nim.

The type of the main function declares the main type you'll be using in your C++ program. If "int main" means you'll maybe be doing arithmetic.

Attached: ae6.jpg (224x219, 21K)

If modern Python could speak, it would beg for death. The best part is, these are still nonstandard, and completely ignored by the language.

Attached: Screenshot_2018-11-10_13-40-32.png (534x193, 27K)

It's a wart that dates back to C. C and Unix complement one another, and unix programs return an integer exit code when they finish. So C programs also return an integer argument when they exit.

Just return 0. Returning 0 indicates that the program is successful.

I, for one, salute Python in its continued fight against the static typing cancer.

Dynamic typing makes no sense in a language that is otherwise so static.

python has eval

muh units

Attached: scrot.png (675x401, 22K)

Python has crippled FP purely because Guido is a brainlet who can't understand lambdas.
The only reason to use dynamic typing is to empower programmers to express themselves in any style they like, and the rest of the language actively fights against anything that isn't PEP8 style.

That's literally how it works with bignum algorithms. You only need to operate on a certain part of the number at a time, so you can dynamically decompress and compress to do so. At least I think so.
>needing to count more things than exist in the entire universe
How can my CPU compute the number then? My disk is a factor of 90 larger in terms of bitsize, so what you say doesn't add up.

>The only reason to use dynamic typing is to empower programmers to express themselves
wrong.

The return value of main is returned to the program that executed yours, and is used to signal if your program was successful or not.
It compliments shell scripting very well.

Retards.

Justify dynamic typing.

eval()

>How can my CPU compute the number then? My disk is a factor of 90 larger in terms of bitsize, so what you say doesn't add up.

Bits are powers of 2, retard.

Why do you want eval?

SEMEN

>How can my CPU compute the number then? My disk is a factor of 90 larger in terms of bitsize, so what you say doesn't add up.
The.
Absolute.
Fucking.
State.
Truly, /dpt/'s finest.

Attached: 2018-11-01-164636_1280x800_scrot.png (826x117, 29K)

runtime evaluation, obviously. for example, in python, importing a module is done through eval().

# import foo.py at runtime
import foo

# what is bound to abc is unknown and what will returned by the call is also unknown
# this is why you need dynamic typing.
a = foo.abc()

print(a)

is this the diablo don't you guys have phones type of meme

This just shows how retarded annotations are. The sum function I posted claims to return int but takes either int or float. It's wrong, but it doesn't matter, because you can just as well write -> str or anything else and it won't complain. Not only is this unsafe (you need third-party tools to parse your Python code and verify it does what it says), it needs to be correctly updated each time you change it, but at the same time you don't have any compiler warnings to help you catch errors.

when you write 350 lines and it all just works

Attached: brainstorm.png (375x523, 252K)

Surely you mean to say "binary is base 2"? And your point? My point is, according to you, I can store more variations of data on my SSD than there are "things" that "exist" in the universe. Which doesn't make sense.

>Indentation is Nim's way of grouping statements. Indentation is done with spaces only, tabulators are not allowed

Why does every interesting new language have to shoot itself in the foot with terrible aesthetic decisions?

>importing a module is done through eval()
Does eval compiler to bytecode? Because importing a module either compiles or imports bytecode.

>Surely you mean to say "binary is base 2"?

Means the same thing.

>And your point? My point is, according to you, I can store more variations of data on my SSD than there are "things" that "exist" in the universe. Which doesn't make sense.

I can't believe there's someone who calls themselves a programmer who doesn't even understand how numbers work.

yes but that's implementation details

lisp

>I can store more variations of data on my SSD than there are "things" that "exist" in the universe
Yes, you fucktard, but you can't store 2^10737418267 of them simultaneously on your SSD, because even if each one required just one cell for storage, there are no 2^10737418267 cell on your SSD.

is the most

languageful