/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous thread:

Attached: 1484676971193.jpg (800x720, 125K)

Other urls found in this thread:

automatetheboringstuff.com/chapter0/
en.m.wikipedia.org/wiki/List_of_probability_distributions
gamedev.stackexchange.com/questions/116832/random-number-in-a-range-biased-toward-the-low-end-of-the-range
en.wikipedia.org/wiki/Beta_distribution
twitter.com/SFWRedditImages

Hi, I'm from Sup Forums

How long would it take me to learn enough python so I could code my own lewd schoolgirl train molestation visual novel? Or even just a website? I have four months to NEET it up and usually I just spend it on DOTA but this year I want to learn something

Attached: 1495474057827.jpg (827x1168, 88K)

C++ is the strongest!

learn Haskell instead

Attached: daily programming club.jpg (1280x720, 166K)

Depends on a lot of factors. How much you're willing to put into it, how naturally it comes to you, etc.

Ren'Py would be enough for a VN

Visual novels are absurdly easy to code with an engine like renpy and you could probably pajeet it up in a month
I'd wager 99% of your effort would go into assets, art, music, character design, story

>lewd schoolgirl train molestation
ah, i assume you fancy yourself the schoolgirl in this scenario?

or are you not...... ((((((sicpified)))))) enough yet

Attached: s-l1600.jpg (1001x1001, 68K)

this, you don't really have to learn much to use it.

see Don't reinvent complex wheels when you're still clueless.
If you've never coded a thing in yo life, start with
automatetheboringstuff.com/chapter0/
Then have a look at Ren'Py, and start (timeboxed) thinking and asking questions when you get stuck.

posting more best girl

I want to emulate a lot of things from old-school VNs. I also just generally feel that learning a language would be a better way to spend my time than arguing on Sup Forums and getting drunk while playing DOTA for five months
Five months, about six hours a day (I have a part-time job on the weekend)
I enjoy puzzles and when I was 13 I remember enjoying coding in C but otherwise I don't know

Attached: 1495482000093.jpg (600x720, 103K)

there's literally VNmakers on steam right now, just buy that and use those tools.

>best girl
>posts dolphin

>i assume you fancy yourself the schoolgirl in this scenario?
I'm from Sup Forums what do you think
>((((((sicpified))))))
please no outside memes "thank's"
ok, thanks
I was hoping that I could eventually pick it up as a part-time job after. Not making VNs, I'm not that deluded, but something I could use to pick up a freelance contract here and there without having to get a stressful full-time job

thighs uber alles

It's possible. Just keep an eye out on the job postings (and poke around in your social network) to get an idea of what's in demand.

Fuck off. Your taste is attrocious too.

test

test

rust i the best lnaguage proov me rong

Attached: 0e9.jpg (600x600, 27K)

rude
thanks

Attached: __midori_uchuu_patrol_luluco_drawn_by_azuki_azuki_taste__d210a26418ac5b69aa8824a3e9705a1c.png (1200x1560, 695K)

::

dumb frogposter

Is there an intuitive way to roll a number, but have it be weighted in one direction?

If you've ever played runescape, something like how you have a chance of hitting a high max hit, but you usually will hit low numbers consistently

I think they use some sort of equations

I think they use an equation to calculate

multiply it by a weight?

Got an interview tomorrow for an internship.
What questions should I expect? It'll be roughly 20 minutes long.

>I'm from Sup Forums

Attached: 1417787329572.jpg (250x272, 12K)

Curve the roll->damage function.

a day or two

en.m.wikipedia.org/wiki/List_of_probability_distributions

No, only mathy ways.

doubt.jpg

lmao i brok da compooper

Attached: j.jpg (279x181, 8K)

Why does every functional language have such fucking deranged syntax? Why can't they just have C/Pascal/Python-style syntax, but with compiler-enforced rules requiring functions to have no side effects?

making the code impossible to read keeps you employed

They're declarative as opposed to imperative. Learn one and you essentially learn them all, as far as syntax goes.

>why can't everything be C
>python
kys
No thank you. I love FP syntax for the most part.
Though i do agree, some basic things have problems, like the redundant function name typing. You just have to get used to it, and it's honestly better than imperative style.

dumb frogposter

> Why does every functional language have such fucking deranged syntax?

To keep it free of filthy C-fags

C syntax is flawless you degenerate

It's C that has deranged syntax

C syntax is for C, not a functional language.

There are some good explanations here: gamedev.stackexchange.com/questions/116832/random-number-in-a-range-biased-toward-the-low-end-of-the-range

The simplest way is to generate an unbiased number from 0-1 and then map it by raising it to the power of ~2.

>casting
>curly braces
"no"

Significant whitespace is faggotry
Programming with curly bois is how god intended it

>curly bois

>Significant whitespace is faggotry
Whitespace is good though.
It culls awful bike-shedding and forces good style.
Not every language is Python-tier shit.

Why is selection sort O(n^2)?
It doesn't seem like it does that many instructions.

Did you take a look at the wikipedia article? I usually find it quite difficult to understand time complexity but I thought it explained things quite well.

Math can be intuitive

any tips for keeping application/glue code tidy?
i feel like complicated error handling, scheduling and concurrency always fucks me over

also why is Sup Forums down? i cant get on the irc

>Why can't they just have C/Pascal/Python-style syntax, but with compiler-enforced rules requiring functions to have no side effects?
constexpr contexts in C++ are basically that

What's meant by a "full stack" developer?

one who can do both front-end and back-end work.

Shouldn't that be a deque developer?

more like a your mom developer

i mean sure, but "full-stack" was just kind of the term that stuck. Web-dev is dumb.

it's a webdev term
it means whatever pajeety soyboy to whomst'd've it applies knows every language and framework in the webdev stack they're working with and is capable of using them together to singlehandedly code a web fapplication

also it has a better buzzword-y sound than deque, and web-devs love their buzzwords.

>Vulkan 1.1 is out
>promotes a bunch of extensions to core, including multi-GPU
Niiice.

>complicated error handling
Monads
>scheduling and concurrency
Futures, i.e. monads

is "bootcamp" the biggest red flag?

We're bringing Tay back. Want to help?

Attached: activation_function.png (1920x1080, 2.32M)

one of the biggest, yes

Speaking realistically, about 10-15 years.

No language has as justified syntax as lisp. You'll hopefully realize that in due time.

Even the faggot who wrote it initially couldn't recognize the godliness of the syntax and desperately attempted to invent another syntax that would be compiled to lisp syntax.

>Lisp
>good syntax

I am trying to kill myself with Python but not luck so far

>he doesn't know macros
(define-syntax mylet
(syntax-rules ()
((_ ((x v) ...) body ...) ((lambda (x ...) body ...) v ...))))

There. There's the (((s-expression's))) existence justified in 3 lines. I demonstrate its sublimity even further if you give me only a single blank to write a metacircular evaluator on.

depending on ()s as your only means of scope is inherently flawed and heavily prone to typos.
That's why whitespace will always be superior because it's both:
1. Way easier to read
1a. program flow is much easier to discern
2. enforces one style
3. much easier to maintain/modify/expand.

Translate the above code to python then my dude. And recall that they had the technology to help you not make ( and { errors in 1985 at the latest. But you still kept using notepad anyway.

Python isn't the only language with significant whitespace. And the conversation isn't about meta-wank. Yeah, Lisp is really good at that, we get it. It was about syntax.

Since when does the conversation not include metawank? It was why functional languages don't use C syntax. Last I checked they still let lispers go to fp conferences and last I checked lisp has its syntax for metawank purposes.

Lisp is a backwards language, and most users of it get lost in all the meta-wank and forget to actually program. But Lisp isn't even special anymore now that Nim is a thing.

What I would do is roll n numbers between 0 and 1 and sort them. Select the k'th number. The k'th number's expected value is intuitively k/(n + 1).

Specifically it conforms to a beta distribution of Beta(k, n - k + 1).

en.wikipedia.org/wiki/Beta_distribution

So perhaps runescape does two rolls, takes the lowest, then multiplies that roll by the max hit and rounds.

every element is compared to every other element. the number of comparisons at the very end is number of elements squared.

how the fuck does a normal human being even read that? what a mess.

()()())))((( ......... to you too

You're lying to yourself if digesting your first dose of Java or Sepples with all the

>w-well what about THOSE OTHER LANGS
every time

Literally every language with syntax different from what you're used to is hard to read at first. And I mean every single language. Every last one. Lisp, C, Hasklel, Java, C++, Hasklel, Assembly, FORTH, English, Japanese, Latin, etc. The only languages that are easy to read are the ones close to what you're familiar with.

>Lisp is B E A U T I F U L
>the P I N N A C L E of syntax

>but you just have to get used to it
So which is it? You're saying Lisp has perfect syntax, then you're literally equating it to sepples. And telling people "you just have to get used to it". You can't have it both ways, lad.

Check out Dylan. It's essentially a Lisp (specifically based on CLOS) with ALGOL-like (C, Pascal, etc.) syntax.

But I can because I'm not autistic. My opinions are with Z E A L but not zealotry. It's obvious to anyone with a cursory understanding of biology that those neurons deep in that subconsciousness have to grow for a language to be easy to read. If you refuse to rub those neurons together occasionally and get outside your comfort zone, then you'll never grow up. You should have significant exposure to every language in that list of mine expect Japanese, and more. When you get good exposure to all of those, tell the thread which one in that list has the best syntax and why.

A non-programming example might be that people who aren't fuckups like ulillillia are picky eaters when they're kids but learn to like things like peppers, onions, steak, wine, beer, etc. To suggest that say steak diane is not god-tier food because some kid who's never had a steak before doesn't like it is retarded.

In my brief time with elm, most things were very Lispy in that:
thing(thing2 (thing3 (x y) thing4) thing5(z))

was common code. But it always felt hacky to write, and hacky to maintain.
Enter D, where that same psedo-code would be something like:
thing.thing2.thing3(x y).thing4.thing5(z)
Now tell me which one is easier to read, and change if need be.

Lisp isn't special, and it's not the end-all to syntax nor programming. It's an ancient language that somehow survived the times through hobbyist autism and Stallman. It's not steak, and you aren't "mature" for deluding yourself into thinking it's good. But the food analogy really ties it all together nicely.

>in my brief time with not lisp
>i swear its JUST LIKE lisp
>muh universal function call syntax
Incidentally Elm is a web dev language.

how do I learn design patterns fast. I'm too lazy to read the gang of four

macros won't rid you of ))))))) bloat.
Incidentally, elm is also a functional language, so i really wouldn't put it in typical webjeet-tier.

This is not exactly a programming question but I am helping a friend with a question for a comp science degree application.

The question states:
If SKU = 153 , SHIP = 156 , and STORE = 231. What is the value of UNICORN?

I've tried googling the solution, finding a pattern with the letters and numbers, different combinations for the three number sets for a UPC code or anything really but found nothing.

Currently the best answer I have is that unicorn is a term in the financial industry for a company valued at >$1b.

Another retarded solution I had was inserting the numbers given into the nine 0s in the >1b definition, resulting in $1,153,156,231.

Also this is from a university program sponsored by Shopify and they have an internal communication system called UNICORN but that still does not answer the question.

Any ideas?

>i barely know a language that's almost a spitting image of haskell
>and I'm gonna say it's just like lisp
>i am also no longer a webjeet because I know functional programming guys

technically unicorn's a startup worth >1b.

My first thought is that all the letters are variables, which would lead to S being at least 3.

This isn't exactly a programming question but I feel like you guys can help me -

I have a shit ton of flash files in one directory, Downloads. Like over 20,000. And I also have over 50,000 images in this directory as well.

This is a fucking mess and I want to clean it up. It's ridiculously large and slows down my computer when I open it.

for the flash files, I want to replace every file with a 1 byte file with the same name as that file, and move it out of that directory.

For example, if there is a flash named test.swf, I want to replace it with an empty test.swf file.

How would i go about doing this with a bash script? (on a related note, what is the difference between bash, shell, terminal, command prompt?)

Attached: 1463459532466.jpg (778x674, 101K)

>flash
enjoy your virus

how do I create an array of this

struct Chacha
{
blabla...
Chacha(blabla...):blabla...
blabla...
}

to create one I will do

Chacha myCha(blabla...);

but what if I want an array and initialize? something like this?

Chacha chaArr[32];
for(blabla...)
{
chaArr[i](blabla...);
}

why not just move the flash files out? why do you need an empty file

It's going to slow down your computer every time you open it anyway. It's not the number of bytes, it's that your computer has to make 70,000 of those little icons when you open that computer. Anyway, run these commands in your terminal:

mkdir flashes
mkdir images
mv *.flv flashes/
mv *.png images/

I really, really don't recommend making 1 byte files with the same name.

A terminal is a window for the shell, which is probably bash, which is short for (Bourne again Shell) In the olden days, terminals were extremely stupid almost computers that connected to a big ass mainframe, sent text input and received drawing commands. Windows has command prompts and Linux has terminals (they mean the same thing).

>What are you working on, Sup Forums?
Updating my color scheme to use the new ST3 JSON-based format, and be less of a mess of random overrides.

Attached: Screen Shot 2018-03-16 at 12.04.16 AM.png (3104x1968, 1.27M)

I found a odd zip file that someone some how created in my google drive with code in it. drive.google.com/file/d/12VAGKRbIHATSr_su5eLw2qbnQbzw2yXZ/view?usp=sharing any one know what it is?

shan't be clickin that, lad.

yea i wasent too sure at first but the files look 3d related but the notes looks like its more sinister.

Top coder or leetcode?

post the notes then, let us see

void FreeDirectInput()
{
// Unacquire the device one last time just in case
// the app tried to exit while the device is still acquired.
if( g_pKeyboard )
g_pKeyboard->Unacquire();
if( g_pMouse )
g_pMouse->Unacquire();
if( g_pJoystick )
g_pJoystick->Unacquire();

// Release any DirectInput objects.
SAFE_RELEASE( g_pKeyboard );
SAFE_RELEASE( g_pMouse );
SAFE_RELEASE( g_pJoystick );
SAFE_RELEASE( g_pDI );
}
BOOL CALLBACK EnumJoysticksCallback( const DIDEVICEINSTANCE* pdidInstance,
VOID* pContext )
{
HRESULT hr;

// Obtain an interface to the enumerated joystick.
hr = g_pDI->CreateDevice( pdidInstance->guidInstance, &g_pJoystick, NULL );

// If it failed, then we can't use this joystick. (Maybe the user unplugged
// it while we were in the middle of enumerating it.)
if( FAILED(hr) )
return DIENUM_CONTINUE;

// Stop enumeration. Note: we're just taking the first joystick we get. You
// could store all the enumerated joysticks and let the user pick.
return DIENUM_STOP;
}
BOOL CALLBACK EnumObjectsCallback( const DIDEVICEOBJECTINSTANCE* pdidoi,