/dpt/ - Daily Programming Thread

Old thread: What are you working on Sup Forums?

Attached: 1495725498283.jpg (700x671, 206K)

Other urls found in this thread:

en.wikipedia.org/wiki/Lottery_mathematics
techempower.com/benchmarks/#section=data-r15&hw=ph&test=db
benchmarksgame.alioth.debian.org/u64q/python.html
raw.githubusercontent.com/gambit/gambit/master/lib/_io.c
twitter.com/NSFWRedditVideo

ur moms
uh
erm
backdoor
thats right, backdoor

Dart will save mobile programming

skimming casync code

New to programming.

I've seen some programming languages described as being more suitable for mobile applications. Why would whether an application is meant for a smartphone vs a computer have any influence on what language you use?

>why would whether
Say no more, raj. Use Jaba.

Reposting from old thread:

Why are we acting like Dart and Fuscia are some maybe and don't exist? It's like NEETs being so lodged in their chair they're debating about whether the sky's blue instead of going outside. Flutter's their effort in this space and the devs want it to run on Fuscia. Whether that will happen ever is up to lawyers and a bunch of politics/market forces. But the effort is already here, money already being spent, and deserves no speculation

They want it to run Dart with Flutter

A lot of influence comes from the body of libraries and how "native" your language is to a mobile platform, which affects ease of deployment and debuggability.

The OS you're running the program on has to be able to understand it.
Just use java, it can be used on all platforms

Dude, did you know 3 billion devices run Java?

>What are you working on Sup Forums?
Pic related

Attached: IMG_0501.jpg (2101x1962, 1.27M)

>my coffeepot runs java

Mobile applications need to be as efficient as possible because of battery life, so ideally you would use assembly, but C is fine too.

>mobile applications need to be efficient as possible
tell that to the facebook app

Facebook is probably extremely efficient, considering how much data they mine about you every second.

Am I a brainlet or is this addition fucked up?

Attached: JmcaaLg.png (173x189, 13K)

looks fucked to me

fourth bit on first sum should be 1, fifth should be 0 with carry

His result is right though, so what the fuck am I missing?

Attached: pPBinVZ.png (1286x379, 70K)

Reminder that if you don't have a PhD, you're a code-monkeying dead-ender, soon to be rendered obsolete by AI written by programmers with PhDs.

Attached: 729.gif (340x340, 137K)

tfw masters student brainlet

Attached: 1483601820443.png (720x720, 357K)

Working on a PhD right now.

Teach me how to draw, /dpt/.

Is this what Americans tell themselves to feel better about getting hundreds of thousands of dollars into a debt?

is this right? i dont remember when i wrote this

// Get a random number in the inclusive range 0,n using rand().
int random(int n)
{
assert(n >= 0);
assert(n (n ? RAND_MAX - RAND_MAX % n : RAND_MAX));
return n == INT_MAX ? res : res % (n + 1);
}

>rand
no, it's not

but its .,~:portable:~,.

What the motherfuck...
int random(int n) {
double r = (double)rand();
return (int)(r / RAND_MAX * (n + 1));
}

You realize you don't pay to get a PhD right? They pay you

And how are you going to get your bachelor's first?

I'm trying to use tkinter to make a small GUI for a little python script that generates an image and it's killing me inside
Is there an easy way out?

And if you're going to introduce branches into it for runtime error-checking, you might as well just make it produce useful output for n

Scholarships and grants is how I got it. I'm not a retard

Should I learn perl6??
Is community as bad as rust

source

>Is community as bad as rust
No community is as bad as Rust.

Why is she so sweaty? Programming while smelling like ass is nigger tier

>she

Attached: 2d6ee8077d8977ac8b913e99d8a42672.jpg (600x800, 97K)

i really want it too

Calculating the zeta function in J.

zeta
4 : 0
if. 0 < 9&o. y do.
(%:) - -&y % ^&y)"0 >:i.x
else.
(2^y)*((o.1)^(

Attached: plot.png (480x360, 82K)

idk, maybe he he made a mistake elsewhere that cancelled out. or did it with a calculator and pasted his answer at the end.

I don't really know what notation he's using (is that the sign in the midde?)

Okay, so taking a second look honestly the whole thing looks fucked up. I'm gonna assume those 2 bits are the exponent. So it's 00, which is denormal, sure. Why the fuck does he take 0.001 and multiply it by 2^4, a huge exponent, then? That's far too large of an exponent to represent with 2 bits.

You should have
00 2^0 denormalized
01 2^0 normalized
10 2^1
11 infinity

Beyond generic containers, is template metaprog just academic circlejerking?

Attached: 1522227661607.png (1000x700, 147K)

Template metaprogramming is just a retarded version of type level programming, which is useful for any kind of code generation (not limited to generics) and formal verification.

n += n < 0 ? -1 : 1;
what does this mean?

>GOOD LORD, WHAT IS HAPPENING IN THERE?

its mumbo jumbo

Is there a reason for using win api defined functions for files or can I just use standard io?

if (n < 0)
n += -1;
else
n += 1;

im thinking he meant *= but thats UB in case of 2s representation.

c++ templates offer polymophism in the static environment. generic types like in java are still done in the dynamic environment if i recall correctly.

trying to figure out how linux works
feels like im just wasting time

yes im not that retarded, only slightly

Probably look up the definition in the header files and see if it's anything more than typedef

In Java it's basically just a compiletime macro to automatically insert statically proven downcasts. Java bytecode is completely unaware of generics.

It eats 3 arguments stating that I want to read a file.

I am shuffffling bits after encrypting data
so I know if the data has been modified while in encryped mode
I want to calculate how hard it is to break the shuffling thing
but I am a math brainlet
the math problem just comes to this:
having "t" balls in a bag how many different ways can you pick "n" balls from it?
any math savy help me with this?

/dpt/-chan, daisuki~

Yes, winapi abstracts the system calls allowing microsoft to mess with them without bothering the users.

Attached: shot0033.jpg (1920x1080, 310K)

en.wikipedia.org/wiki/Lottery_mathematics

java is comfier to use in general than let's say C++. C++ is used for things like 3d games which need the best possible performance but java isn't all that much slower compared to python for example. but java doesn't run directly on iOS so for native iOS apps it makes more sense to use swift or objective-C/-C++. but then there are cross-platform frameworks that run javascript and other very high-level (easy to use but slow) languages which cater to web developers who aren't very into programming and just want a simple app for ordering pizza or whatever.

>C++ is used for things like 3d games which need the best possible performance but java isn't all that much slower compared to python for example.
clarification: java is a bit slower than C++ but not as slow as python

Joukowski air foils

are shit

lik u

>pyhton is slow
WEE WOO WEE WOO
RETARD ALERT
WOO WEE WOO WEE

In what universe isn't Python slow?

Haskell gurus, show me your workflow.

Attached: haskell-logo.png (355x165, 17K)

>academics everywhere use and teach pyhton because it's the best language in the modern world
>hurr it's slow
>hurr muh sepples
>hurr muh java

Attached: 1522253388514.jpg (961x1140, 106K)

How do I decide which programming language to learn out of a list

>python isnt slow because I can call libraries written in c++ that I didn't write in it
>python isn't slow because it is easy to teach to brainlet noobs

Shut the fuck up python cucks. You can come back when you are anywhere near the top on: techempower.com/benchmarks/#section=data-r15&hw=ph&test=db

or aren't performing so poorly in
benchmarksgame.alioth.debian.org/u64q/python.html

Attached: 1512326212205.png (645x729, 69K)

They use it because it's simple, has libs, and has a good FFI. Whenever you aren't using a lib that doles out all the heavy lifting to C code it's painfully slow.

If there is a program that you want to contribute to, learn that language
Otherwise, choose Scheme or C or Python (you should learn these 3 first, do in any order)

What do you mean?

just found out that the hardness is
2^48 combinations
if some russian man was trying to hack me how hard would that be?
how hard is current RSA used by browsers compared to my 2^48 number?

Python CPython: 77.788729238 seconds time elapsed
Python PyPy: 46.487679095 seconds time elapsed

Scheme Gambit: 1.932229635 seconds time elapsed
Racket: 3.618877176 seconds time elapsed

Java OpenJDK: 1.189619693 seconds time elapsed

C clang: 9.971914301 seconds time elapsed
C++ clang++: 5.518077517 seconds time elapsed
C++ G++: 4.659448453 seconds time elapsed

Javascript node.js: 10.406505448 seconds time elapsed
Javascript SpiderMonkey: 10.216595020 seconds time elapsed

Crystal: 3.034363672 seconds time elapsed

Nim: 6.083644424 seconds time elapsed

Attached: IBUPIhC.webm (720x404, 2.55M)

it's really easy if it's client side. you would need to do it server side with rate limiting (for example 5 tries every 15 minutes) for it to be secure

clangfags btfo

isn't proving cryptography being secure the same as proving P ≠ NP?

I know those 3 but I'm curious of replacing tools in my admittedly hobbyist/ non corporate tool kit.

Common Lisp vs. Haskell vs. Scala vs. Perl 6

Curious about them all for different reasons

Attached: 53738_romancing_saga_snes_front_cover.jpg (800x444, 65K)

more like C fags btfo
everyone should clearly be using java

Gambit scheme compiles to C so that makes no god damn sense unless you are writing fucking retarded C.

Do you have a link for the benchmark suite or do you just pull the numbers out of your ass?

Just grab one and see how it works.

P ≠ NP is the assumption.

>people comparing interpreters and compiled languages and virtual machines made for platform independence like they even compete for the same use cases in the real world by throwing retarded anecdotes at each other

Does this board consist of any one actually programming or is it just NEETs that have written hello world once and college freshman that fanboy the first language ever taught to them?

speed doesn't matter when you're doing web programming uwu

Attached: Screen Shot 2018-03-28 at 2.54.06 AM.png (764x1388, 222K)

>Gambit scheme compiles to C
are you sure about that?

>raw.githubusercontent.com/gambit/gambit/master/lib/_io.c
holy fuck what

I'm dying user

I'd like to make a simple menu-based user interface for my program (pic related). So far I've made a "disp_management" module for writing text strings at given row & column locations and drawing horizontal or vertical lines on the screen.
How should I structure the program for creating the menu system? Should each menu be a separate function, each with calls to appropriate display management functions?

Attached: scr.png (509x399, 186K)

>triple underscores
we're reaching new levels of C here

>>people comparing interpreters and compiled languages and virtual machines made for platform independence like they even compete for the same use cases
running time is running time, whatever the implementation.

>speed doesn't matter when you're doing web programming uwu

Attached: 1512326637002.png (300x300, 9K)

>perl6
>perl 6

"One of the goals behind the lively and colorful design of the logo was to discourage misogyny in the community and for it to be an opportunity for those of "masculine persuasion" to show their sensitive side"

worse than rust

in that case, assembler is clearly the best language of all.

they teach it in beginner classes because it's easy, not because it's good

programming languages like c++ have computation in the static environment and inline expansion.

thanks for taking the time to engage with my bait
lick ya later homos

>how do we get more women in tech?
>replace our programming language's logo with a Down syndrome butterfly
>perfect

Attached: db0.jpg (349x642, 40K)

I posted it and honestly no clue, also interested

Can someone tell me about linq?
Still new to programming and this is the first time I heard about it, is it a 1:1 alternative to sql or a .net specific query language or how can I see it?
Got a new book that uses linqpad for its tutorials, read about linq on the startpage there and then googled it, cant really understand it so far that's why Im asking here. Asked in the stupid questions thread earlier but didnt get a reply