/dpt/ - Daily Programming Thread

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

Attached: 1542189253130.jpg (3541x2507, 475K)

Other urls found in this thread:

paste.merkoba.com/1542255568-bezicu-1
docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/continue
twitter.com/NSFWRedditImage

sleeping

PARTY ROCK IS IN THE HOUSE TONIGHT

nth for how's your project coming along?

Turn down the volume you fucking zoomers I'm trying to sleep

WAKE UP GRAMPS

Attached: 1540914559815.jpg (495x362, 26K)

dumb frogposter

Attached: 1536461961307.png (990x682, 580K)

>Unfortunately, the only real C++'s competitor at this point is C#.
>Why we need a C++'s successor is that it cannot scale to the demands of modern needs.
>It's not 80s anymore, people are not looking for primitive libraries.
>They want good network processing libraries, a standard build and package system.
>C++ has none of them.

Attached: asddddddd.png (804x637, 64K)

I'm the developer for a library that actually has users, and I'm in the process of completely breaking our API.

Attached: 1485473684854.png (824x792, 408K)

based, fuck the users

good lad, strict backwards compatibility is cancer.

Attached: mpv-001.jpg (853x480, 97K)

>man fuck this shit ass API
>always breaking

what is this retard talking about?
I guess there's rust or go if you want something """modern""" (translated: s o y)

It's pre-1.0 software, and we warned them that we're very likely to break it.

I'll stabilise it once I'm happy with it. As the project grew, we found that the old APIs just didn't work that well.

I hope you've been on the cusp of a major version release for a long time now

Attached: DsAuVGTWkAEikp1.jpg (1200x675, 65K)

>wanting a standard build system and package manager is bad
the absolute state of masochists

>someone forks your library maintains the old API
>everyone starts using the fork, original gets forgotten

*takes deep breath*

Attached: euph.jpg (1280x720, 129K)

.NET Core does have those things though, and you're not limited to C#. You can use F# or any other .NET language with interop between all of them.

give (3) examples of this happening.
bonus points for the new version being objectively worse.

All of shiny new features I want to add wouldn't work with the old API.
The library is also about 60K lines of code which requires a lot of specialised knowledge. Not just anybody could maintain it.

*gives deep breath*

Attached: yinyangemoji.png (420x420, 260K)

gay

lewd

Attached: 1488846994107.jpg (249x180, 4K)

not exactly but
gnome, ffmpeg

>ffmpeg
>forgotten
everyone reverted from avconv back to ffmpeg and now avconv is dead

I said not exactly for a reason
OpenOffice, XFree86, Sodipodi

C# is not portable, very slow and inefficient, it's SDK is a well known spyware and it comes from a patent troll company.
If in a hypothetical world where there is no programming language but C#, I would write my own language and compiler and then start programming.
C# shares a lot of problems with C++ too, it has no package management and standard deployment mechanism. Every C# library is embarrassingly slow as scripting languages.

For me, its HolyC

imagine having an opinion from older than 2008 and holding it for over 10 years

Not to mention even as a language C# is mediocre at best. Every thing, including your main function is a class, half assed linq gives the Microsoft slaves a glimpse of declarative programming and they worship such slow and low quantity emulation of UFCS.
Nothing surprising from a language that was born out of Microsoft's sheer jealousy of Java's success. Sadly C# still hasn't replaced Java outside of walled garden of ms ecosystem, probably never will.

I gather you are one of those ms evangelists? How's the income? Is it worth being a disingenuous slave as you are?

i've been programing in java since it came out in 1994. about 7 years ago i worked on a project that was 100% c#. i really liked it. and visual studio is a really nice ide. blows xcode and eclipse and android studio out of the water.

>The night sky full of cries
>Hearts filled with lies
>The contract- is it worth the price?
>A soul pledged to the darkness
>Now I've lost it
>I know I can kill
>The truth exists beyond the gates

I was not talking about how ms locks you into their walled garden with a non potable, spyware ridden slow and bloated IDE but yeah that is another one of the reason why C# is out of my radar too.

>spyware ridden
i haven't used it in a few years. what do you mean by spyware?

Every single non rigged benchmark I ever saw, C# lags far behind Java as opposed to what reddit NPCs like to parrot everyday. Even in the last thread, if you look at it, C# is java's bitch.

Imagine being worse than Java.

unblockable telemetry in the SDK. No wonder big companies do not go near C#, they don't want their code stolen through a sneaky backdoor.

The true testament of how dodgy Micros**t is has been demonstrated a couple years ago when they tried embedding a telemetry injector into their inferior C++ compiler.

>weeb programmers

lul

Attached: 752x501.png (752x501, 220K)

>posting this on a weeb board

Weebs are the best programmers.

Attached: 1541243735098.jpg (800x1119, 225K)

stop responding to shitposters, baka.

What do you use as a seed for a random number generator?
I guess using the time of the system is an approach good enough, but what if the user is using a date that can't be converted to a uint64 (the seed)?
Do I say "fix your time, faggot"?

b-but muh syntax sugar!

the value from a true random number generator, dumdum

How secure does the randomness need to be? /dev/random is good if security is a concern, otherwise anything broseph. I used ship names for mine.

import std.random: uniform;
uniform(1,11).writeln;

you use the system timer which returns an integer in milliseconds or even smaller, you dont use the actual date

>I've got a date the can't be converted to a 64bit string
Does that exist? Is this quantum computing or something?

You could just add it all up. It'd be fairly predictable but it's still a seed to a chaotic process.

doubt it
wasting time watching children cartoons doesn't sound like something someone that is smart would do

Attached: 1493361618266.jpg (559x836, 70K)

The API is saying only dates between 1678 and 2262 are valid.

Lisp is the most powerful programming language.

*puts a "util" file in every single directory of the project*

Lisp is interpreted and dynamically typed so therefore is not even programming.

Are you supposed to be using Qt Quick for new Qt projects even for desktop applications?

You're supposed to be using only stdout.

"Free" sources of pseudorandomness:
The time.
CPU clock ticks since start of the program (not 100% consistent).
The processes' PID.
The location of the stack.
The location of the heap.

Preferably many of these combined. Even if one of them doesn't turn out to be random (e.g. stack location is not randomised), it's not really going to reduce the quality of your seed.

qt quick is qt's attempt to compete with react/angular based electron apps and C#'s razr
so presumably yes

>Preferably many of these combined
Combined how? Is xor combination good for this?

Yes, xor is good.

This pastebin thing paste.merkoba.com/1542255568-bezicu-1

Attached: chrome_2018-11-11_18-43-48.jpg (1920x1058, 921K)

So you only get back the current year? I see the flaws then.
Really if you're going this far you might aswell just use RDRAND. Whatever code you're using now isn't gonna be all that portable. RDRAND is on both Intel and AMD since 2015.

thoughts on golang?

Why does pic related cause an infinite loop in c# Jow Forums?

Attached: file.png (321x24, 1K)

who knows, maybe you're a stupid chucklefuck that used operator overloading to implement recursive functions.

More likely this person doesn't know how to use a debugger.

The start of the loop
So uhhh, how do I fix it?

Attached: file.png (241x38, 987)

holy fuck post more of the code, its not like your shitty broken hello world program has state secrets

in any programming language worth using, it's easy enough to pull one value from a secure random number generator to use as a seed in a PRNG.

Attached: file.png (545x209, 6K)

the line commented out also causes an infinite loop

Facial recognition systems. Using classic techniques pre-ANNs.

What is the realistic cost of arithmetic?

Say you had to add 20.4 million numbers together and compared to an algorithm that adds 1.3 million numbers together. What is the realistic cost difference?

Say the algorithms are:

O(n^3 + 20,400,000)
O(n^3 + 1,300,000)

Obviously the second is faster but n^3 is the dominating term. Is it worth optimizing code like this? Is it worth merit?

change if () {continue}
to if (!condition){
if () else }

To clarify and connect to facial recognition: I took a classic system which does 20.4m arithmetic operations (addition, subtraction, etc) on a database 100,000 strong. This is on top of an O(n^3) cost. I reduced it to 1.3m operations. Is this noteworthy?

what is rb and bb
does it actually print anything or does it just sit there stuck with no output
is lb>rb or ub>bb
why dont you give your variables proper names (very important question, superceeds the others)

Add operations on cache are really fast, better optimize n^3 on memory layout

Posting again in a different time slot. I am trying to draft a flowchart with all the recommended milestones when learning a new language. Can I have your suggestions? Here's an example to showcase what I have in mind.

e.g.
Rewriting old scripts and programs, reading the most recommended bibliography from cover to cover, reading and understanding other people's source code, programming challenges of a certain difficulty, writing something "original" yourself, etc.

Attached: peak-tism.png (920x1379, 65K)

>I think I proved P = NP
Make a private key, sign it, and post your proof.

why don't you time it before and after if you have both implementations?

Thank you so much user, it worked
right bound(rb), left bound(lb), upper bound(ub) and bottom bound(bb), I was trying to only render the part of a sprite that intersects with the viewport

A very hard part is a lot cultural references,bad words,slangs or sex jokes.

Spoke too formal or informal.

Maybe on german some people unawared use nazi references.

Classically the n^3 grows faster asymptotically with sufficiently large problem sizes, but what if the constant is the dominant term?

The cost is something like:

O(n^3 + km)

Where n is the input size (constrained to 500x500), k is some factor (millions), and m is the database size (100,000 or under).

If I can reduce it to O(n^3 + 0) which is unrealistic, it would take longer than even O(1,000,000).

It's confusing because I learned variables and their exponents dominate complexity analysis but this is a case where it's inconsequential (but still defined by input size).

That depends on how big n is. If n is the number of pixels and you're always feeding your algorithm about the same sized image then your runtime may be the same and you can just test what percentage speedup you get.

Because C# is trash.

what does operations like addition en masse have to do with recognition?

The only think I can theorize is that either rb or bb are either unsigned ints or long ints greater than INT_MAX, so i++ or j++ eventually overflows.

If so, perhaps (lb == 0 && ub == 0) is always false and optimized out by the compiler. Leaving only the statements in your else block with state changing effects. When they're commented out, the compiler sees loops with no effects and optimizes them away.

Pre-ANN era of recognition systems used n-space distance metrics to determine similarities between tuples (objects). An object can be uniquely placed in n-space and the distance between tuples is the similarity.

How are distances calculated? Using arithmetic. A shitload of arithmetic when you get into like 50-space. A single n-space distance metric requires 3n euclidean operations or 2n-1 manhattan operations. When you deal with db millions deep, you end up doing billions of arithmetic operations like this.

I'm focused on reducing the dimensionality of tuples and reducing the number of arithmetic operations necessary to object recognize.

Wait, what? Does continue do something weird in C#?

Nim v1 won't come until 2030 mark my words

continue avoid increment operation on for loops.

>continue avoids increment operation
what the fuck

What's the fucking point of using continue in a for loop if it doesn't increment?
Do people want an infinite retry on HTTP requests?

Attached: 1537127052704.jpg (488x720, 86K)

>this is a language people use unironically

No it doesn't. This sounds like a bit. Are you puttin' on the Ritz?

There's no major features left for 1.0.
It's just various bugs, crashes, minor features, and i believe they want to revisit some syntax. Personally they need to trash the @[] for seqs, considering they're just dynamic arrays. And yet static arrays are just array[len,t].

docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/continue
Nice try faggot.
Why is this stupid faggot constantly making shit up and bitching and moaning about C# in this thread?
Go hang yourself off the top of the Oracle HQ already.

Attached: Annotation 2018-11-15 001115.jpg (1042x888, 83K)

If I want to ride the machine learning bubble before it's too late, should I better get straight into tensorflow or should I use keras instead?
I remember last year or so lurking the tensorflow tutorials and it was about the MNIST and iris flowers straight in tensorflow, but now the official tutorials are all about keras or on how to be a ML codemonkey and just use google stuff without any understanding of what is happening whatsoever.