/dpt/ - Daily Programming Thread

Old school edition.

Previous thread: What are you working on Jow Forums?

Attached: code_master.png (1164x1738, 2.17M)

Other urls found in this thread:

learnopengl.com/
opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/
suggest.aspell.net/
better-dpt-roll.github.io/
emacswiki.org/emacs/InteractiveSpell
stackoverflow.com/questions/640351/how-can-i-spellcheck-in-gvim/640362#640362
aspell.net/man-html/Writing-programs-to-use-Aspell.html#Writing-programs-to-use-Aspell
aspell.net/0.61/man-html/Writing-programs-to-use-Aspell.html
github.com/Manwholikespie/thesaurus
github.com/WojciechMula/aspell-python
github.com/frida/glib/blob/master/glib/tests/timeout.c
twitter.com/AnonBabble

First for Rust.

I just noticed that symbolic heaps in separation logic are the same thing as dual intuitionistic linear logic contexts. Makes me think.

Attached: 1524793795824.gif (360x264, 2M)

Is programming a more acceptable hobby than gaming?

if you practice programming by reimplementing solved algorithms or recommend people practice programming by reimplementing solved algorithms you suck penis and geometry is more fun than you

any good resources on separation logic or separation logic in type systems

Should I buy SICP?
Can I just use pen and pencil to solve problems?

YEAH!

Attached: C.png (867x812, 1.22M)

Fuck off.

You're going to do a lot of programming before you do anything someone hasn't already done better.

Anything by Reynolds or O'Hearn on the topic is good, especially the papers where BI, SL, and CSL are introduced (and their companion papers about semantics). Some other interesting and relevant work:
- Hoare Type Theory
- Nominal Logic
- Iris
The majority of papers on the topic seem to be about decidability results. I usually ignore those.

Doing whiteboard tier problems that have no inherent practical value whatsoever isn’t exactly going to help you get better now is it?
The very little you get out of practice like that can come from just about any other source.

For that matter, practice like that isn’t really a good motivator, it’s not productive in the slightest.

Also there's the realm of Alias Types and L3, which aren't about separation logic per se but are very similar and are type systems as opposed to program logics.

>you should solve the riemann hypothesis to learn math

I'm not going to show you fags my socks for C++ because mods are censoring socks under rule 1:no pics of anything other than technology (makes me laugh, half the board images are not related to tech).
So since there is no free speech, I'll not talk about how socks for C++ should be dark coloured and elegant.
May this post serve as a warning for all of you who also appreciate the value of socks in programming, to not to post socks or you will get banned for a day, and these bans cannot be appealed.

Based mods

Do I really need to know SQL to land a job? Every job posting I see says I must know it but is it really necessary?

no
are you retarded? programming is only for trannies and incel degenerates

What should I do to practice?

write a program that converts all command line tools into a gui by parsing --help/man pages

Attached: 1541463140696.png (651x497, 18K)

No idea, but it's easy as fuck. Basic SELECT, INSERT, UPDATE and DELETE queries, plus CREATE TABLE/INDEX, DROP TABLE/INDEX are most all that you need to know. It's not a real programming language, more just a declarative syntax for retrieving and modifying the info you want .

learn rendering
learnopengl.com/
graphics programming is fun, covers a lot of areas, is practical, and easier than it sounds

thanks for the references btw

whichever you think is easier
building game engines is a means to an end--implementing a "pure" engine is superfluous 'tism

*doesn't follow standard parameter definition syntax*

>lisps don't allow implement mapping into dotted lists

>Doing whiteboard tier problems that have no inherent practical value whatsoever isn’t exactly going to help you get better now is it?
Of course it is. Practical problems don't exist in some separate universe from known algorithms; they're the exact same problems. Filling an area with a paint can is literally Breadth-First graph search; deleting a discontiguous selection of items efficiently from a list is the half-stable partition algorithm; deciding where to hyphenate a line of text is a dynamic programming problem, etc. etc. If you think you're doing something different, that's a good sign you're actually writing a heuristic not an algorithm.

who is the target audience for this kind of program
seriously

literally all of Jow Forums

Someone said that making a simple vector graphic viewer with a camera view was relatively straightforward so I've decided I'm going to try that. In order to get there, I'm powering through a math site until I hit vector mathematics because I'm in desperate need of math revision anyway. I hope I haven't been memed.

Attached: 1526602462969.jpg (522x532, 59K)

The problem isn't if it's pure, I organized it so the bullet integration is a plugin to the engine, so I don't want too much features depending on it, unless it's expected. As in:
>what I don't have IK chains?
>oh I need the bullet plugin
>makes sense

Just note the success of WebM for Retards as a front end for ffmpeg.

trying to make a simple distributed server in elixir then DDOS it. It's for security class :/

i had the same thought when i saw that post. i was thinking more just as a quick visual representation of options so you can get an initial handle on a new tool. but really is that any better than synopsis + examples + grep? maybe slightly since we're visual creatures, but it would be a lot of work for actually functional guis.

what is ``implement mapping", friendo

You aren't memed. The topic you want is called Linear Algebra, and the specific camera transform is called a Projection Matrix.

Ctrl-F this to this site for a visual demonstration.
>Here’s another diagram so that you understand better what happens with this Projection stuff.
opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/

TRIGGERED

I want to get to the next level of C programming. I can write the code but it isn't very well structured. What are some good resources to designing large or complex libraries/frameworks?

>but it would be a lot of work for actually functional guis
and people think general ai is just around the corner

Read other's code. Pick a relatively small-scoped project so you can understand what's happening and hopefully doesn't have too much cruft.

wew lad. i spent the last few days learning rust thanks to Jow Forums shilling it. fuck this shit language. its just a bunch of shitty compile errors

Just look at already developed libraries. Even if you don't go into their source, you can tell a lot from using them. With experience using them, and a tiny bit of investigation, you'll be better at it than most pajeets.

>coach, why the hell do we gotta lift weights when there aren't any barbells allowed on the football field?

I can't spell and I'm sick of relying on speech-to-text software. How would I go about making a functional clone of this website. It's what I use when I'm not dictating through my phone.
suggest.aspell.net/
Graphics optional.

Attached: 1488225668171.png (540x301, 132K)

>its just a bunch of shitty compile errors
>can't reason about memory lifetimes
>probably uses c/c++ to write shitty code
waaaa da wust compiwer is big meanie

Is rust worth learning? I see it shilled on Jow Forums all the time.

Attached: 1533353713062.jpg (750x856, 97K)

yes i would much rather have a language like javascript that just silently ignores all my programming errors until it crashes or outputs wrong results rather than one that tells me what i'm doing wrong and how to fix my code to be correct

>get the green light to attend a category theory seminar at my local university
>most of the participants will be math/CS professors with PhDs as well as graduate students
>I'm not a student
>I have no degree
>I'll probably be the youngest one there by several years if not more
>the next one is tomorrow and on a topic that's quite relevant to what I'm working on myself
I'm in way over my head here, aren't I?

Ah, that's great then. Thank you very much user for the info.

Attached: 1525121523682.png (894x978, 568K)

Yes, its worth learning if you plan on doing systems programming. It's more reliable than C++.

mozilla shills pls leave

It's a fun language, but not currently used much by industry.

Attend anyways. Maybe you'll learn something.

>containes illegal characters
I'm not sure I would trust it.

Why would you want to develop large/complex software in C?

Because I enjoy it.

It depends on the job but usually you just have to know the basics to have an idea what is going on. You don't have to be like a full blown DBA or anything.

Are "roll for your next small programming project/challenge" images allowed in these threads?

I think I may just be overestimating how interactive it is. Hopefully I can just sit and take notes without having to speak to anyone, at least for now.

cute anime

better-dpt-roll.github.io/

Thanks, I desperately need a job and I always thought needing to know the ins and outs of databases as pointless for most jobs

any swift fags?

how to fix this wraning

Attached: Screen Shot 2018-11-05 at 9.18.06 PM.png (2224x756, 172K)

Attached: thumbs.gif (460x358, 3.16M)

Is there a quick guide out there that shows how to create a browser plugin? I need to run some JavaScript on every website I visit, I'm pretty sure this is the only way. New to webdev I guess.

Attached: THE CHAD.webm (960x540, 1.8M)

If it's just something for yourself, look into greasemonkey and userscripts

Maybe I should rephrase my question. . .

I'm fucking stupid. I was born with brain damage called "dysgraphia." It's like the reverse of Dyslexia where as opposed to having difficulty DEcoding language it's very difficult for me to ENcode language. I got interested in free software because of a anti-piracy measure in windows that locked me out of my computer with Dragon Naturally Speaking along with it. now I only use Windows for the occasional game but I'm so dependent on my smartphone to get voice dictation.

The only viable alternative is aspell but it's designed to scan documents or check individual words and my spelling is so poor that I have to correct about half of what I write. The aspell helper website can work but it's slow because I have to copy the misspelled word on to the website, look through a list of words that often look similar to me read it and then read his dictionary page to make sure it's the correct one. sometimes I get it so wrong that I have to use a thesaurus to get to the word I want. Also, spech to text makes a lot of mistakes that I can't always keep track of.

So where should I look to start if I want to program a aspell based dictionary and thesaurus?

Attached: 1500808701510-lit.png (665x574, 266K)

Programming in Scala and Erlang is so comfy. ^.^

Emacs has both built in as flyspell which uses aspell as it's backend. (Dictionary and thesaurus) You could probably script something together in elisp pretty easily.

might have to use eval() because the language i'm working in autosorts char arrays in alphabetical order once a function is applied to it

why is matlab such a pain

i've been fucking around with psyq doing psx stuff. good fun

from what i hear all the scientists hate matlab too and just use python or R

Aspell is a binary you can install locally, including dictionaries. Backpacking on it's called Interactive Spell, which suggests as you type.
emacswiki.org/emacs/InteractiveSpell

1) What if I like vim?

b) Will it speed up my shit posting?

tree) I was hoping for something I could use outside a text editor.

trying to get into android dev. java or kotlin?

1) emacs has evil-mode which emulates vim pretty much fully, registers and all
2) yes
3) you might have to make something yourself then, as said, you can use aspell however you want since it's a local binary. I'd still look into how flyspell/ispell does it since it'd make what you're doing a lot easier.

Why is Swift so comfy? I'm having a blast learning it.
func mySqrt(of x: Double, accuracy: Double) -> Double {
var guess = 1.0
while abs(guess * guess - x) > accuracy {
guess = (guess + x / guess) / 2
}
return guess
}

Attached: comfy5.jpg (2048x1367, 329K)

Why isn't * (type *) &var the same as (type) var?

You need to unwrap newValue before comparing it to index. You can just use index == newValue! if you're never going to set it to nil.

Vim's spellchecker can be invoked with :set spell in the command mode (or vimrc, if you want it always).
More info:
stackoverflow.com/questions/640351/how-can-i-spellcheck-in-gvim/640362#640362

>I was hoping for something I could use outside a text editor.
This is where life gets hard. You can talk with Aspell's API, but it's not simple:
aspell.net/man-html/Writing-programs-to-use-Aspell.html#Writing-programs-to-use-Aspell
A compromise might be to use gVim as your composer, and copy the text into the fields you want.

how the FUCK does one limit the number of iterations per second in a program? i only need 10 per second.

ANSI C btw.

Attached: The_C_Programming_Language_logo.svg.png (1200x1276, 77K)

I'm not really sure I understood but I'll probably start by looking at:
aspell.net/0.61/man-html/Writing-programs-to-use-Aspell.html
And then looking for a thesaurus api:
github.com/Manwholikespie/thesaurus
And since that is on python I would try to use an aspell wrapper for python:
github.com/WojciechMula/aspell-python

But it really depends on how you want to use it and what language you know.

keep a counter for the iterations and a counter for the frame (each second is a frame)

>being this bjarnewashed
Rust is what C++ should have always been.

the frame can probably just be a boolean here btw
the idea is when you hit 10 iterations you stop iterating until the next frame/frame is reset (and then you also reset the iterations)

github.com/frida/glib/blob/master/glib/tests/timeout.c

How would Jow Forums do it?

>- Whore Type Theory

Whoare logic is about the preconditions and postconditions of a loose woman's "activities"

return a+1;

{virgin}sex{¬virgin}

based

>you can use aspell however you want since it's a local binary.
I already knew that though, that's why I was asking. If it can be called upon as a library, I'm assuming that means I can write in any language I want?

vim's spell check is something I already knew about and it was not good enough.
also, I never had an issue cutting and pasting to and from my terminal. Maybe it's because I use Konsole.

>But it really depends on how you want to use it
You can't tell right now because I'm dictating into my phone, but I need to spell check almost everything.

>what language you know.
In the past I just dismissed the idea of me ever learning programming because I assumed I would be horribly slow and inefficient at it because of my "disability," also known as "innate brain damage."

>random

ahh warning doesnt go away

the objective here is to reduce processor usage, i should have made that clear - so there should be one iteration every 100ms.
the way he uses g_usleep seems pretty close to calling clock(), gotta check processor usage with this
clock_t interval = CLOCKS_PER_SEC / 10;
clock_t last = clock();

while(1) {
if(clock() - last >= interval) {
last = clock();
/*code*/
}
}

Remember: C++ code gets simpler each new release.

C++17:
template
auto sum(Ts ...xs) {
return (xs + ...);
}


C++14:
template
auto _sum(T x) {
return x;
}

template
auto _sum(T x, Rest ...rest) {
return x + _sum(rest...);
}

template
auto sum(Ts ...xs) {
return _sum(xs...);
}

Attached: 1515794901325.jpg (637x900, 93K)

That's meaningless. Every number has infinite coprimes, and there's no way to choose randomly from an infinite set in finite time

>I use Konsole
based KDE user
as long as you aren't using super long variable names, programming doesn't really require spelling. Fuck, I find typos in my company's codebase all the time, ie variables and stuff spelled wrong. Non-shit compilers will help you get your keywords right, just use a statically typed language so that the compiler can help you along.

Can you get words in the right order, even if they're spelled wrong? If you can, there's a good chance you'd be a fine programmer.

>If it can be called upon as a library, I'm assuming that means I can write in any language I want?
not exactly. you'll have to look it up for any given language. If it's written in C, odds are you can interface with it from any other programming language. If it isn't C, it's going to be a toss-up.

still disgusting