/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: squid.jpg (1280x720, 188K)

Other urls found in this thread:

big-o.io/algorithms/comparison/quicksort/
downloads.haskell.org/~ghc/7.4.2/docs/html/libraries/ghc-prim-0.2.0.0/src/GHC-Tuple.html
lmgtfy.com/?q=C++ Metaclasses
twitter.com/SFWRedditImages

>What are you working on, Jow Forums?
literally nothing

Attached: 1539821370334.png (497x480, 217K)

based shinryaku ika musume (aqua from konosuba) poster

Im contributing to open source C# projects!

what project, fellow csharper?

If I have the big O of some function, and how much time it would take to run an input of size k, and then it asks me how much time it would take to run a input of size m, how would I go about calculating that?

>principle of least surprise
then use a for loop. if you want it to behave like other languages then write your code like you would in other languages.

You can't determine that.

you can't, big Oh is an upper-bound

Jesus fucking christ, do you think map is a JS invention?

not him, but I do, unironically

no

Ok then this question is dumb?

Attached: 2019-06-25-124725_1040x71_scrot.png (1040x71, 14K)

ASP.NET Core is the biggest one im working on right now

It's a trick question ya dingus.

an upper-bound on the growth rate of the function
good enough for the aspie?

Proff actually expects us to solve that though. He did an in-class example, and he hasn't uploaded the slides but the assignment is due in 1 hr.
Can you at least explain why its wrong?

Alright, user! Time to work on that JavaScript project!

Attached: f51044ba05b4d3e69be8860bd798402d.jpg (1365x2048, 241K)

big-o.io/algorithms/comparison/quicksort/
big o of quicksort would be O(n^2) then which only happens in rare cases.

your prof has no idea what he's talking about, nice

>what's worst-case analysis

also you can modify it slightly so it doesn't have this pathological case

Then you're attending a shit school.
The issue is that O(n^3) could include functions like n^3, n^3+ n^2, 5 n^3 + n, n^3 + 50000 etc. Even an algorithm that takes constant time (i.e. always 54 seconds) is included in that.

How to "solve" it:
They probably want you to just pick c * n ^3 and solve the equation c * n^3 = 54 for c and then insert it into c * 5^3.

*should be c * 3^3 = 54 for the equation you have to solve

>no one in these threads is ever working on machine learning
Is machine learning a meme?

this thread is about language and editor wars, not personal projects.

lurk more summerfag.

Go on, share the ML project you're working on

well, their retarded version that behaves unlike any other certainly is

yesn't? It's way too hyped up and is definitely gonna crash sooner or later, but it also has lots of useful applications.

Java WebDev is hell on earth.

How does JSP inclusion work?

I have included the nav header with my login/logout with spring security jstl tags, in a separate file, as follows:

Login


Logout


And I import it in the main page via either one of the following:


or

My page renders both goddamn text elements. Why is this?

Followup question:
What happens to the variables in 'header.jsp'? Are they accesible in the scope of 'index.jsp' (the importer) and do they retain values?

Oh. Yeah he's a new prof, not white.

finally getting back into programming after dropping out one semester from finishing my program after about a year. I'm so disgustingly rusty at the moment. I'm doing some quick webdev stuff at the moment since that was the most fleeting imo, but I'm shocked at how much I've forgot even basic syntax. Pretty sad desu. Good news is I've been really motivated recently to improve and start building stuff again, and this time try to branch into some freelancing work for easy bonus cash

Attached: 1543203776499.jpg (430x396, 18K)

I still want to use Perl despite you guys telling me it was a bad language.

It looks fine for regexp shit and I struggle at this, so maybe it'll be helpful. Thoughts?

bunny cunny

it's still O(n log n) in best-case analysis
retard

How to write function that takes symbolic arguments like picrel?

Attached: 1542937302961.png (366x39, 4K)

I'm not working on an ML project, but I have the opportunity to go get my Master's for free. I'm trying to decide if I should go machine learning, cryptography, compsci, or just straight mathematics.

it's not, it's a good language
just very old, and you'll feel it.

perl regexes tend to have more features than other language's, and they sometimes behave differently.

New profs almost always just take the course material from their predecessor. Still bad that they're not correcting it, but could just be lazyness.
Also, if you bring up the question being at the very least worded poorly, don't be smartass about it. Even if your prof is a total dullard, don't get on their shitlist.
what the hell are you talking about

x < y && y < z && z < w
(< x y z w)
how can c derivatives even compete?

i always write this as
if (x < y)
if (y < z)
if (z < w)
do_thing();

It's really sad how proud liserps are of variadic operators

How would you express this as elegantly without lisp syntax?

What would your ML curriculum look like? Having done few masters courses on ML myself, I would pretty much do anything else. The courses I did were somewhat introductory and got fairly boring and all the programming assignments were so easy a monkey could have done them. That being said, I know there are uni's out there offering some interesting courses on ML, but if I had an option to take pretty much anything (compsci, maths, DSP, hell even finance) I would have.

>function
you can't, that's a macro.

>elegantly
They just don't care about this.

Stop being a code monkey.

(x < y < z < w) or define a function ascends?.
Variadic operators aren't bad, but they're just way over hyped, especially because most of the time you'll have to use apply with them anyway and at that point you could just define a function like sum.

int printf(const char *s,...);

#define LOOP(start, end) \
for (int i = (start); i < (end); i++) { \
printf("%d\n", i); \
}

int main()
{
LOOP(1,10);
return 10-10;
}

Are there any languages that make x < y < d < w do what it does in arithmetic and not just evaluate it the obvious way?

Thanks user

You can write a macro.

the power of python
if 10 < a < 20:
print ('between')

python

yuck

of those 3, math may be the hardest to study on your own

or 4. see what I mean?

if (x < y) &&
(y < z) &&
(z < w)
do_thing();

it's the same fucking thing
chained logic is interpreted left to right, except in implementations that do it all at once
don't use impure functions to determine truth in chained AND expressions.

cool

Attached: GyaruKaho.jpg (1920x2856, 1024K)

>JavaScript project

Attached: SudokuBeam.png (270x360, 66K)

See if your machine learning program is heavy on statistics. If not, definitely skip it.
Not sure on crypto degree, would probably just go for math instead if that's your field of interest.
Unless your school is bad, cs vs math generally just comes down to your interests. If your eventual goal is something in the cs area, I'd just go for it.
There are a lot of subjects that are hard to study on your own, but that doesn't mean they're 'worth more'

Lisp is the most powerful programming language.

I have a bunch of somewhat similar images. I want to generate more of them. Generated images don't have to be very accurate, they are also allowed to have weird effects.
Can anyone point me in the right direction? I suspect I have to use some machine learning or something, but I'm not very familiar with the field. I know Python tho and I've heard it is often used in such things.

Attached: doge.jpg (913x571, 362K)

If by Lisp you mean Racket then yes.

make it general
increasing = and . map (uncurry (

This isn't elegant it's baroque.

That's cool. I'm gonna start doing it this way. Hopefully no one will sperg at my coding style.

I don't care much about old, I only care about getting things done and learning new ways to think!

I like baroque, but also pipe-style
increasing xs = zip xs (tail xs)
& map (uncurry (

can someone please explain to me what's going on here? I'm completely lost.

Attached: makefile.png (482x140, 4K)

well, by old I mean there won't be anything new to learn. Or rather you'll have to think about solving problems yourself that have since long been solved.
Also subroutines are shit.

alright, I'll take it back, variadic operators are a thing of true beauty

a lot of effort to go to to achieve something that should just be builtin

>and . map
use all

just wait till you see GHC's tuple implementation
downloads.haskell.org/~ghc/7.4.2/docs/html/libraries/ghc-prim-0.2.0.0/src/GHC-Tuple.html

What's the fastest language for read/write NTFS volumes

oof, I'm retarded

assembly

Give me one good reason tuples shouldn't just be nested pairs.

so I can't have 1 million ary tuples?

God I want to FUCK this gyaru!

This is why languages without metaprogramming are a bad idea.

why? i don't care.

C++ Metaclasses
>what are they
>how do they work
>why the fuck do we need another overcomplicated feature

cringe

compile time reflection
who knows yet that's c++23 at the earliest
moar metaprogramming

lmgtfy.com/?q=C++ Metaclasses

>be year 2098
>C++ is releasing another version
>can't use C++98

>compile time reflection
ooh boy

you need GANs

they might have their reasons

they have lists for that

>compile time reflection
It uses reflection, but that's not what it is.

>>what are they
look up cppcon metaclasses
>>how do they work
How they work right now, is the class definition is passed to a constexpr function, the function reflects on the class and outputs a new class definition, which replaces the old one.
template
constexpr void foo(T the_class) {
// reflect on the_class and generate new "class fragments"
}

struct(foo) Niggers {};
// Niggers definition gets replaced by definition generated by foo(Niggers)


>>why the fuck do we need another overcomplicated feature
There's many uses for metaclasses, check the cppcon videos.
Some uses include: interfaces, better tuples, better variants, "regular" value types.
They can be used to generate a lot of boilerplate that you'd usually have to write yourself without metaclasses.

But lists are of homogeneous type, IIRC.
The reason for tuples then would be to support heterogeneous types.

>But lists are of homogeneous type
That's pretty gay

You can use algebraic data types if you need more variety in your list. I'm not a Haskeller but there is a method to their madness.

My first finished mini-game.
Based. I always try finding some good first issue but all the open issues I find are either so fucking hard or I am too much of a brainlet to understand the large project structure.

Attached: tictac.jpg (1579x863, 339K)

if you want unchecked heterogeneous type then simply have a type for that (or better a type that captures the possibilities and little else) and have a list of that. then you guarantee it is a valid list but don't make assurances about the elements

is there a better way to do this:

BYTE firstrunmask = (1

Attached: da1dd40384eaf0c0d86bd2c51d0bf171.jpg (736x919, 114K)

Attached: congratulations.jpg (1569x564, 726K)