[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 320
Thread images: 27

What are you working on, /g/?

Old thread: >>60007077
>>
File: 1486780129853.jpg (280KB, 700x849px) Image search: [Google]
1486780129853.jpg
280KB, 700x849px
Daily reminder to not abuse greentext and to always ask people who abuse greentext whom they are quoting!
>>
>>60015283
Lisp is the only programming language worth programming.
>>
File: 1466969439648.png (286KB, 400x450px) Image search: [Google]
1466969439648.png
286KB, 400x450px
I like the OP image
>>
https://www.youtube.com/watch?v=NvQH8b1g3Yw any of you gonna take this job?
>>
>>60015305
>whom they are quoting!
*who
>>
>>60015320
*whom [sic] they are quoting!
>>
>>60015283
Fixed my brainfuck compiler so it works again for newer versions of macOS.

https://github.com/enfiskutensykkel/bf-compiler
>>
>>60015359
Why not a bf2c? I can not compile your soft. I am using a free (as in freedom) OS.
>>
>>60015359
Well thats pretty nice readme.md, tips for writing nice doc.
negative points for making it locked to damn OSX
>>
>>60015678
This bait is way too obvious senpai
>>
I'm having second thoughts on Clojure. I did some exercises in it, but there are some problems that really frustrate me. Most notably is the lack of a static type system. Runtime crashes because of type assertion are just stupid nowadays. Another problem I have with Clojure is that lack of proper pattern matching. Haskell really spoiled me with proper pattern matching.
So I think I'll ditch Lisp for ML. Any suggestions? F#, OCaml, Haskell? Does F# even run on the GNU operating system using Linux as its kernel? What's popular?
>>
>>60015571
>Why not a bf2c?
Because that's what literally everyone does for their first bf interpreter implementation.

>I can not compile your soft. I am using a free (as in freedom) OS.
Not my problem.

>>60015655
>Well thats pretty nice readme.md, tips for writing nice doc.
Thanks

>negative points for making it locked to damn OSX
It's not "locked to", it's implemented for it specifically. macOS doesn't understand ELF ootb and this being a toy project I don't feel like both writing it and testing it on Linux too. Too much work.
>>
>>60015742
>>I can not compile your soft. I am using a free (as in freedom) OS.
>Not my problem.
Non portable code is the mark of code monkeys.
>>
i wanna go to machine precision in C.
i implemented an iterative method and i want to evaluate my residual errors.

the error should be smt like 1e-16, but i seem to get only 0.

im using only standard double datatypes.
is there something i can do?
>>
>>60015283
Can someone post the whole pic in OP?
>>
>>60015755
>Non portable code is the mark of code monkeys.
It's a fucking compiler for a specific platform. It's not supposed to be portable.

This isn't Java byte code kiddo.
>>
>>60015779
You're using clang and you failed to understand the main idea of llvm.
>>
>>60015799
Anon, this isn't an LLVM frontend...
>>
>>60015733
Both F# and OCaml have crippled type systems which might as well be dynamic. Haskell is slightly better.
>>
>>60015814
Ye,s because you're a code monkey. A true coder would have target llvm. But that's not what you are.
>>
>>60015835
>Both F# and OCaml have crippled type systems which might as well be dynamic.
How are they crippled?
>>
>>60015733
OCaml
>>
>>60015878
No HKTs, making them a complete joke even compared to Haskell's type system. Which is saying a lot.
>>
>>60015889
Why would I choose OCaml over Haskell?
>>
>>60015837
Okay.
>>
>>60015902
I thought you were saying other than Haskell
>>
>>60015320
*whom

'Whom' is the object of the clause (i.e. they are quoting whom), thus it takes the objective case.
>>
>>60015978
People aren't required to correct sentences when quoting them.
>>
>>60015571
>Why not a bf2c?
Not him, but I assume you mean a brainfuck to C translator? That's pretty basic shit compared to actually making a running executable like anon does (even though it is for non-free pig disgusting homosex os echs). You could basically just copy paste the wikipedia article on brainfuck.

https://en.wikipedia.org/wiki/Brainfuck#Commands
>>
>>60015733
You'll never be truly satisfied with any type system.
>>
>>60016079
Weird, I would've assumed the bf2c is annoying because C is complicated. It's supposed to be an input language, not an output one. I know ppl sometimes generate C, but it strikes me that there must be a better way such as hooking into the IL or something. It's clearly portable if done correctly tho I must admit.
>>
>>60016114
Why is that?
>>
>>60016114
True, but dynamic type systems are outdated. For example, Python recently got support for some static type assertion.
>>
>>60015283
starting to work on a simple neural network based app that sorts all images on /a/ by cuteness and puts them in a queue for me to approve/decline the download. If I can get it to work somewhat reliably I will train it on different tasks as well, like finding the best memes according to my superior taste.
>>
>>60016162
>I would've assumed the bf2c is annoying because C is complicated. It's supposed to be an input language, not an output one.
Actually, C isn't complicated at all. It's extremely simple, has a very small standard library and a very small set of keywords.

It was always intended to be a portable assembly.

>I know ppl sometimes generate C
Not sometimes, virtually all modern compiled languages have a step transpiling them into C code first. Haskel/GHCl has this, Forth has this, Rust has this etc. By supplying the right flags to the compiler, you can make it stop at the C step.

Hell, even some interpreted languages have support for converting it into C (which is trivial if the language supports JIT). There are JavaScript to C translators, Python to C translators etc.

C is not a complicated language, it's really simple. The fact that C programming is hard is not because the language is complicated, but because there's so much stuff that's undefined and implementation specific.
>>
>>60016221
>Not sometimes, virtually all modern compiled languages have a step transpiling them into C code first. Haskel/GHCl has this, Forth has this, Rust has this etc. By supplying the right flags to the compiler, you can make it stop at the C step.
No anon. They can produce C, but they don't use as a standard step.
>>
>>60016211
Wrong! Python3 still is and will remain dynamically typed. The type annotations don't interest the interpreter, they aren't assertion. they are to be read and statically reasonned about by a separate tool.
>>
>>60016211
>dynamic type systems
That's impossible.
>>
>>60016241
Even when using PyPy?
>>60016248
OK, languages without a static type system.
>>
>>60016221
Actually, C isn't complicated at all.
I should define complicated, I mean that the syntax is human-oriented, so generating it is just a waste of CPU time and program complexity. Not saying it can't be done.

I'm pretty skeptical about this "everything that exists transpiles to C" claim, again, why don't they target an intermediate language?

What is the connection between a JIT and AOT compilation targeting C?
>>
>>60016267
That's impossible as well.
>>
>>60016236
>They can produce C, but they don't use as a standard step.
You are right (although some do IIRC, I'm pretty sure that GHC does this, but I may be mistaken).

However, creating C code is pretty trivial no matter if you compile to C as an intermediate step or reverse generate it from your instruction set.
>>
>>60016275
>why don't they target an intermediate language?
They usually do, I was mistaken. See >>60016236 and >>60016287

>What is the connection between a JIT and AOT compilation targeting C?
See above. Once you have byte code, recreating C is fairly trivial.
>>
Nth for C#, ASP.NET, Visual Studio, the entire .NET Framework, Bill Gates, Paul Allen and Microsoftâ„¢.
>>
>>60016267
>Even when using PyPy?
Maybe there are PyPy modules that only accept programs that are type-correct and provide some benefits in return. PyPy is said to be written in RPython, a language derived from Python that's more restrictive so types can be infered, and this allows PyPy to bootstrap itself. Maybe there are already other variants of Python in the same vein. There's also Cython....
>>
>>60016306
>reverse generate it from your instruction set.
>Once you have byte code, recreating C is fairly trivial.
Oh ok, I see now. Thank you anon for enlightening me.
>>
>>60015761
anyone, please
>>
>>60016162
>hooking into the IL
Did you confuse C with C#? If not, how do you know what IL is but don't know the difference between C and C#?
>>
File: petzold.jpg (31KB, 439x521px) Image search: [Google]
petzold.jpg
31KB, 439x521px
>>60016316
This
>>
>>60016498
Mea culpissima Anon, LLVM has an IR, IL is a term used within the context of the MS CLR. I should have typechecked before saying such horrendous bullshit. I should've taken more vaccines so as to be as autistic as you, my god-emperor.
>>
>>60016471
Google "c high precision math". It'll be the first result.
>>
What text editor do you use that was made in this decade? Atom looks fancy but the performance sucks nuts
>>
>>60016803
Emacs
>>
>>60016813
>that was made in this decade
>>
>>60016803
ed
>>
>>60016803
Visual Studio
>>
>>60016803
IntelliJ
>>
>>60016803
pen and paper
>>
>>60016824
Excuse me?
>>
If Buddhism was a language, what language would it be?
>>
>>60016803
Visual Studio, Visual Studio Code. Vim keybinds.
>>
>>60016803
Sublime Text 3.
>>
>>60016908
Haskell. That which can't do anything can't cause harm.
>>
>>60015359
Why not a bf jit?
https://corsix.github.io/dynasm-doc/tutorial.html
>>
>>60015306
It's one of the few languages that can be programmed, though.
>>
>>60015733
Typed Racket.
>>
File: shen.gif (4KB, 114x155px) Image search: [Google]
shen.gif
4KB, 114x155px
>>60016908
http://shenlanguage.org
>>
>>60015733
>Clojure
>type system
doesn't clojure have core.typed for optional type system?
>>
File: 1491284451097.png (3KB, 99x99px) Image search: [Google]
1491284451097.png
3KB, 99x99px
>>60016803
Java Enterprise Edition
>>
>>60017353
please don't say such dirty things while posting cirno
>>
File: 1491273439176.jpg (167KB, 500x500px) Image search: [Google]
1491273439176.jpg
167KB, 500x500px
>>60017373
Microsoft Visual Studio has improved my work flow!
>>
>>60017210
>>60017168
It does introduce a type system, but it feels more like a hack.
>>
>>60017418
How?
>>
>>60017440
What sort of type system? Is it at least half-decent?
>>
How do I manipulate text more efficiently
>>
What is the fastest brainfuck interpreter?
>>
>>60017542
See https://github.com/clojure/core.typed/wiki/User-Guide
It does provide a type system, but it's a complete joke nowadays.
>>
>>60016937
I second this. Whatever IDE you feel comfortable with + Vim keybindings. I use my same vimrc, without the plugins. Oh how I do miss gundo though =(
>>
>>60017607
Why isn't there an language that has both stackful coroutines and pass-by-value semantics?

Currently writing a set partitioning function in Lua. The ability to yield from within a recursive call is super nice, but fuck the whole "tables are reference types" thing. I wish it were more like python =(.
>>
>>60017700
(sorry about the quote)
>>
>>60017700
>>60017709
PSA: There is a "[Post a Reply]" link at the bottom and the top of the page!
>>
Is Idris Haskell-with-dependent-types or is there more to it?
>>
>>60017700
http://factorcode.org/
>>
>>60017663
Vim novice here, post your useful vim tricks!
>>
>>60017933
has some nice syntax customisation
>>
>>60017944
:q!
emacs -nw
>>
>>60017944
http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118
>>
>>60017700
Not sure exactly what you mean by stackful coroutines, but I bet C++ has it. Practically every language has pass-by-value too.
>>
>>60017933
It's strict.
>>
>>60017944
:E :Te :Ve :Se
>>
>>60017953
>not using spacemacs
>>
Is there any good deep learning framework that works easily on windows, preferably python3?
>>
is there a way to disable :W in vim?
>>
>>60018041
Remove the ':' and 'w' keys from your keyboard.
>>
>>60018041
You configure the key to do nothing.
>>
>>60018061
but then i can't :w
>>
>>60018067
how?
>>
>>60017997
Why should anyone use it instead of ordinary emacs?
>>
>>60018080
I don't know I use only emacs. But I hope that after years of defending vim against emacs, that you can configure such a thing on vim.
>>
File: 1491273323110.jpg (55KB, 900x900px) Image search: [Google]
1491273323110.jpg
55KB, 900x900px
>>60018095
because its literally ordinary emacs with a shitfuckasston of vim shit strapped onto it for you already
other autists are already ricing it for you! its the future!!
>>
>>60017700
But Python also passes its data structures as references
def test(d): d['asd'] = 5
d = {}
test(d) //d = {'asd' : 5}
>>
>>60018080
:command WQ wq
:command Wq wq
:command W w
:command Q q

into your .vimrc
>>
>>60017944
nnorrmap Q @q

Put that in your vimrc for quick and easy throwaway macros. Press qq to start recording then q again to stop. Then press Q to play back the recorded key sequence.
>>
File: out.png (3KB, 429x137px) Image search: [Google]
out.png
3KB, 429x137px
>>60018041
>>
File: SCARED.png (76KB, 298x312px) Image search: [Google]
SCARED.png
76KB, 298x312px
Just wrote the best program
$ George George George of the jungle watch out for that
tree!
>>
>>60018225
Hello, World!
>>
>>60018041
What does it do? I have
nnoremap ; :
in my vimrc so I've never accidentally entered that
>>
>>60015837
Don't waste your breath, anon. Anybody who posts a link to their shithub account on /g/ is already 100% certified pajeet
>>
File: rust_containers.png (121KB, 1621x895px) Image search: [Google]
rust_containers.png
121KB, 1621x895px
Thanks, google.
>>
Where do I get started with Android App development? I want to make a personal app for myself. I need to know java correct?
>>
File: me.jpg (8KB, 180x180px) Image search: [Google]
me.jpg
8KB, 180x180px
>>60018247
i learned this from koding with karli kloss please rate
#include <stdio.h>
#define eol '\n'
typedef enum cool_guys_or_guyettes {KarlMarx, GeorgeSoros, BriannaWu};
enum cool_guys_or_guyettes main(int argc, char** argv) {
char hello_world[1000] = {'h','e','l','l','o',' ','w','o','r','l','d',0xff-0xff};
printf("%s%c", hello_world, eol);
system("cd code && cd.. && cd .. && cd code");
return KarlMarx;
}

}
>>
File: paradigms-chart.png (89KB, 968x724px) Image search: [Google]
paradigms-chart.png
89KB, 968x724px
>>60018338
nice
>>
>>60017976
Stackful coroutines means that each coroutine has a stack. Python generators can't yield from within called function, they aren't stackful. Proper threads have their own stacks but are symmetric, not asymmetric.

>Practically every language has pass-by-value too
Yes, pass that struct by value in C. It's only pass-by-value for non-aggregate types.

>>60018164
Yeah, I guess you are right. I'd like proper pass-by-value for all types.

>>60017938
>stacklang
nope
>>
>>60018407
xD
>>
>>60015320
*whom'std've
>>
>>60017997
What did you mean by this?
>>
>>60017976
C++ has boost::coroutines, it's not bad although it can't be used by multiple threads.

>>60018467
>Yes, pass that struct by value in C. It's only pass-by-value for non-aggregate types.
Nope, you can have structs on as stack variables (no indirection) and also as parameters and return values. It's rarely done though.
>>
>>60018407
>C
straight to trash
>>
>>60018407
How's that fighting gender imbalance thing coming along sista? Have we found the next non-male Linus Torvalds? btw you've been non-binariphobe with that variable name, please fix
>>
>>60015283

My computer science course is taught in Java. One problem I had to do was about different types of books and how you should deal with having multiple genres of book.

The correct answer was to make a book class and then have nonfiction/fiction extend book and then have romance/mystery extend fiction and science/math extend nonfiction

Do Java tards really think this is more efficient than having a struct with an enum? you could do this in two bytes. And it would be better in every way.

Also who thought it was a good idea to include a cheep wrapper class around the types double and integer.

> oh your CPU does 1 gigaflop?
> well guess what?
> now it's gonna do .5 because we're gonna make each double twice the size.
>>
>>60018407
>system("cd code && cd.. && cd .. && cd code");
lol
>>
>>60018789
b-but the syntax sugar
>>
>>60018789
nobody would do that irl, I'm sure that was just an exercise for learning inheritance
>>
>>60018823
>the only uses of inheritance are hypothetical
>>
>>60018789
Not sure wrappers halve flops, but basically yeah. It's not a computer science course, it's an classist design course. Multiple dispatch is ok where it makes sense, but enums are fine most of the time. Note that your enum can't be dynamically extended though.

Hope they haven't been unfair to you?
>>
>>60018789
>now it's gonna do .5 because we're gonna make each double twice the size.
Wat?
>>
>>60018823
Well this is an hilariously bad exercise that's also close-minded. Anon's answer is just as good as the official one, and that's because the problem statement is utter shit. Case closed
>>
>>60015283
I am learning programming and I want to read and try some stuff when I don't havea keyboard at hand.
What do you suggest?
I need something that eases me into the world of computer science like I am a child who really wants to learn the piano but needs a loving adult who teaches him/her the way of piano and music literacy while nurturing the child's love and fascination for it.
>>
>>60018848
if the real dichotomy was that either every genre of book requires its own subclass, or that there was no inheritance at all
I would pick no inheritance at all
>>
>>60018789
>Do Java tards really think this is more efficient than having a struct with an enum? you could do this in two bytes. And it would be better in every way.

No, your lecturer is just trying to demonstrate language features.
>>
>>60018866
>close-minded
>POO class inheritance hierarchies are always open (unless they are final)
does that mean POO is going to die soon?
>>
>>60018886
Shame he can't think of a useful example
>>
>>60018886
>No, your dummass lecturer is just trying to demonstrate language features.
ftfy
>>
>>60018892
>expecting that much from lecturers
>>
>>60018866
>Well this is an hilariously bad exercise that's also close-minded
sadly almost every example you get in college when they are introducing new concepts are that bad and contrived
just gotta deal with it
>>
>>60018919
except in math.

>math is god<
>>
>>60018848
Take a look at Qt if you want real world applications.
>>
What type of graphs can Tarjan's algorithms be used on? Undirected/directed? Weighted/unweighted?
>>
What does it mean to invert a binary tree?
>>
>>60019063
recursivly go through each node backwards and end up with the first parent node.
>>
>>60019051
Yes.
>>
would saying:

 

if(newNode->data < root->data)
{
...

}



be saying if the data of the new node is less than the data of the root?

Or am I fucking up my pointers again?
>>
Whats the best source to learn about C# wihtout paying any shekels /dpt/
>>
>>60019158
Yes. stuff like member access binds even tightlier than function application, so you have a margin. in general, operator priority is tailored to the most common use, or the one that makes sense, because
node->(some boolean exception)
would not compile and make no sense at all.
>>
>>60019180
mono + google
>>
Please check the /dpt/ style guide for me, /g/.

I'm writing a C lib that's supposed to be imported by lua. I have a strong temptation to prefix my private helper functions with an underscore, in addition to making them static. Should I do that?
>>
>>60019252
Well yes, if they're not supposed to be used anywhere just make them static in the source unit where they're used.
>>
What's the longest you've ever worked on a single project? 6 months? A year? 5 years?
>>
>>60019292
>>60019292
2 semesters of making an mobile app for a bus route.
>>
>>60019292
Private MMO server, 7 years or so but the foundation had been laid out by someone else.
Currently working on my own video game, 9~ months into the project.
>>
>>60016803
e3
>>
>>60019292
40 hours per week for 2 years on a single Android app.
>>
>>60019460
what were you making, the OS?
>>
>>60017570
What do you mean?
If you want to manipulate it hands-on, by yourself, real-time, learn vim.
If you mean writing programs that manipulate text files, learn perl.
If you mean something else, learn to ask questions better.
>>
>>60019521
No, it was a Netflix clone.
>>
File: 1489242382048.jpg (44KB, 600x614px) Image search: [Google]
1489242382048.jpg
44KB, 600x614px
I want to program a browser based text rpg with lots of features.
What would be a good language/approach? I'm a good learner.

My tech friend is forcing me into using PHP frameworks.
>>
>>60019576
dont use PHP literally just do it all in javascript
>>
>>60019180
Literally write programs. And google for things which will always bring you to MSDN.

>>60019292
Like 5 days and then I get bored and throw the project out and start a new one.
>>
>>60019576
There's no reason to use PHP for it, just go with memescript.
>>
>>60019292
one week
>>
>>60015305
>Go fuck yourself
>>
>be me
>drink
>() instead of []
>hidden inside try/except
>silent
>del try/except
>cant assign function to call

>new greentext idea
>click /t/
>whys there pron?
>click/g/

>scripting's hard

oh ya, blackjack
>>
>>60019640
poop on yourself
>>
>>60019663
I feel like this would be a hard thing to do. Both on a physical and emotional level.
>>
>>60018941
>except in math
not really
>>
>>60019944
mathfags know how to formulate problems.
>>
lads I need some react/js help. I have 3 checkboxes on a page and I need a way to keep track of how many of them are checked. Only care about how many are checked, not which ones

I'm guessing when a box is checked I need to have it call some function that increments something in the state +1, and -1 if unchecked, but can't get it to work. please help
>>
>>60019536
ok, vim and perl
got that
>>
>>60020024
>please help
fuck you.

Maybe just iterate them and count them whenever you need the value? Why does it need to be done reactively? And even then, you recount them all when any box is checked or unchecked... I can't tell if you suck at ReactJS or at logic....
>>
>>60019980
it's not like math lecturers make exercises that are relevant to anything, often they won't try to explain the concepts presented at all. it's just you are such a mathfag that you ignore this. so it's no different from a programmingfag ignoring that the lecturer's inheritance example wasn't very relevant.
>>
I've always wondered:

In a 3d video game with a character that walks around a 3d map, how does it calculate player collisions with the world / movement?
>>
>>60020121
>I can't tell if you suck at ReactJS or at logic....

both, my employer hasn't discovered I can't code for shit yet
>>
>What are you working on, /g/?
found a $2/year VPS and set up openVPN and lighttpd on it
now I'm thinking up something small but useful to host
pretty neat-o
>>
>>60020139
quadtrees to narrow down checks vs moving entities
navmesh for the world and pathing
>>
>>60020024
nigga your state should hold the selected checkboxe list anyway so all you need is state.selected.length
>>
>>60020123
>it's not like math lecturers make exercises that are relevant to anything,
They are relevant to math in all its abstract purity. If you burden yourself with trying to tie concepts with unrelated real world stuff, you're either a kindergarten teacher or a POO priest. Hope you're neither.

>often they won't try to explain the concepts presented at all.
Explaining the concepts is the central goal of the lecture, was your math lecturer that bad? or do you mean 'explain' in the sense of 'illustrate' rather than 'define'? If so free your mind, that's an inferior way to think. Who needs concrete examples besides kindergarten students and POO cultists?

>it's just you are such a mathfag that you ignore this. so it's no different from a programmingfag ignoring that the lecturer's inheritance example wasn't very relevant.
That's the complete opposite.
>>
>>60019292
11 months and counting
>>
>>60020184

does that involve treating a moving entity as if it is locked down to a 2d plane?
>>
Can someone explain this c++ code to me for a Binary Search tree? I don't understand how it goes through the iteration for inserting a node. It says to loop until curr reaches 0, but what does that mean?

 
void BinarySearchTree<T>::insert(T d)
{
tree_node<T>* t = new tree_node<T>;
tree_node<T>* parent;
t->data = d;
t->left = NULL;
t->right = NULL;
parent = NULL;

if(isEmpty()) root = t;
else
{
tree_node<T>* curr;
curr = root;

while(curr)
{
parent = curr;
if(t->data > curr->data) curr = curr->right;
else curr = curr->left;
}

if(t->data < parent->data)
parent->left = t;
else
parent->right = t;
}
}


>>
File: solve (2).jpg (233KB, 1280x720px) Image search: [Google]
solve (2).jpg
233KB, 1280x720px
>>60019292
2 years. That was a QMC simulation of the renormalization group flow of a class of many-body quantum systems.
My current project has been running for 1.5 years. This is for calculating self-consistent order parameters in graphene.
>>
>>60020296
it means "loop while curr is not false" and in this case it just means that curr is a valid pointer
>>
I need help deciding what to do next as a project. All of these things interest me, so I want to start by programming the easiest one.

>basic 3d modeling
>basic 3d sculpting
>basic 2d painting

not sure about this one though
>full 2d game using an already existing engine (love2d)
>>
>>60020273
yeah some mmos do that, since for most purposes we really are trapped on a 2d plane
but even in the ones that have proper vertical collision you can still narrow it down to a square on the world with quadtrees, then check against all the entities in the possible usable volume above that square
>>
>>60020305
wtf
get away from /g/ or we may contaminate you with our stupidity
>>
>>60020310
>basic 2d painting
that one is clearly the easiest to program
make a color picker and then draw pixels à la ms-paint
>>
File: 1477910124001.jpg (871KB, 1500x878px) Image search: [Google]
1477910124001.jpg
871KB, 1500x878px
>>60019292
Since 2012.
>>
>>60020208
yes, it's possible to try "illustrating" the concept so much that you miss the point and it's shit. but often this is used as an excuse to go the other extreme and not bother at all, say the concepts are impossible to assign meaning at all then ask the student to figure everything out of class.
>That's the complete opposite.
no it's not. propping math in this context is what makes no sense. if it's impossible to make exercises in math that apply to the real world, why bring it up when the context is that some shit programming exercise didn't apply to the real world?
>>
>>60015359
>posting yer github on 4chan
why people do this?
>>
>>60020462
My point is that math exercises are never shit because solutions to problems are not subjective.

You have
>model different kinds of book as classes
>anon thinks it would be better to use an enum and he is right
You've found a correct solution to the problem, but you failed the exercise because you did not embrace the doctrin the prof has, so you fail. That's gender studies-tier bullshit.

You can't have
>prove that
fib(2n+1) == sum(fib(i) for i in range(n))

>anon proves something else
sometimes anon might come up with a better proof than what the teacher expects, but in that case anon is assured that the teacher can't arbitrarily reject the proof provided it's correct.
>>
>>60020521
Anon wants to get
touch CoC.md
and
KISS tarballs
type requests because he's a fag.

>>60020432
Lesbian lolis are GAY, although they might turn me on.
>>
>>60018979
>>
>>60016803
newest version of vim

it's got smart tabs and syntax highlighting, what more do you need?
>>
>>60018442
Wtf, are Oz and Alice omniparadigm languages?

Intriguing
>>
>>60020601
Dunno if there's a htop-type utility inside browser. Just do it by elimination with a selective JS blocker, or even by closing tabs. Don't overthink it.
>>
>>60018442
>SQL all the way on the left
>SQL all the way on the right
what?
>>
>>60020614
auto completion, refactoring, debugging, profiling, tests, static analysis, metrics, project management, advanced build options, version control integration, DB integration, REPLs, package managing, WYSIWYG editors among other things.

TL;DR: Use an IDE like a normal person. They all have vim add-ons anyway.
>>
>>60017981
Oh, just by default, I suppose?
>>
>>60020675
it's got autocompletion
>refactoring, debugging, profiling, tests, static analysis, metrics, project management, advanced build options, version control integration, DB integration, REPLs, package managing, WYSIWYG editors among other things.
use tools for those things meant for those things. programs are text, so use a text editor
>>
>>60020631
it's easy to know which tab is using a lot of CPU. if you switch tabs, the browser will stop using a lot of CPU
my question is, I want to remove/stop the script/code block that is causing the high cpu usage.
>>
>>60020697
Yeah, but you can have laziness where you need it.
>>
>>60020675
>auto completion
got it
>refactoring
Isn't it simpler to do by hand rather than learn the commands?
>debugging
got it, or using the integrated terminal like a normal person
>profiling
Why does that need support from the editor?
>tests
Not the editor's job, nor the language as discussed yesterday.
>static analysis
With a separate program, wtf?
>metrics
standalone tools, simpler to develop rather than integrate with your clusterfuck
>project management
same thing
>advanced build options
WTF advanced? not the job of the editor anyway. The only thing the editor needs is a shortcut and we have such a thing.
>version control integration
got it
>DB integration
WTF?
>REPLs
got it
>package managing
WHAT THE FUCK?
>WYSIWYG editors
are you a webfag? just use word or whatevershit, this is not the place
>other things
Neovim's not an OS, just rely on yours instead of reinventing the wheel. Emacs is said to be an OS which lacks a good editor btw.
>>
>>60020761
-> NoScript then, like i said, start blocking individual scripts until CPU usage suddenly drops. That's the easiest way.
>>
>>60020784
OK, thanks. I do use noscript already... but this page requires JS. I just want to stop the retarded page animations/effects
>>
>>60020772
>>other things
>Neovim's not an OS, just rely on yours instead of reinventing the wheel. Emacs is said to be an OS which lacks a good editor btw.
was about to double reply to him and say something like this but didn't care enough. i think the disconnect between people who use stuff like vim and people who use IDE's is that we use linux not as just as operating system, but as a tool. the command line can be your IDE. it's got everything you could possibly need and is way more flexible than any single application... it's like the ultimate IDE... plus so much more
>>
let fibs = 0 : 1 : zipWith (+) fibs (tail fibs)

Haskell is so fucking elegant - wish I could come up with similar solutions..
>>
Sublime Text or Atom?
>>
>>60018407
>0xff - 0xff
kek
>>
>>60020864
This is a pretty inefficient one though. And the efficient ones aren't as elegant.
>>
>>60019292
Longest I've worked on a project? A week maybe.
Longest I've neglected a project? Almost 5 years.
>>
>>60020838
>the command line can be your IDE. it's got everything you could possibly need and is way more flexible than any single application... it's like the ultimate IDE... plus so much more
windows users could say the same exact thing about the start menu
if you think that would be a retarded thing to say, then you should be able to realize why you sound retarded
>>
http://www.strawpoll.me/12803538
>>
>>60020889
Vim but only if I had to choose between the two.
>>
>>60020866
Sublime Text 3. You can activate with CIA Nigger's license or https://archive.fo/KpE9D license and it doesn't use javashit.
>>
>>60020432
Any progress on your sim?
>>
>>60020752
There's a text editor in my IDE. A really good one called vim. So that's hardly an argument.

>>60020772
>>refactoring
>Isn't it simpler to do by hand rather than learn the commands?
I'm not the best at vim, but i don't know of a way to refactor across files with just vim commands. For example how do you change a function in both the .c and .h files?

>>60020838
>people who use stuff like vim and people who use IDE's
I use both.
Yes the command line is more flexible, but 95% of the time you're going to want to use the same old tried and true commands. Build and run build scripts, run all tests, run the profiler, commit and push, etc. can all be done with a single click in an IDE. It's a matter of solving for the most common use case first. It's not like you can't use a command line alongside an IDE for more complex tasks.
>>
>>60018407
>
cd code && cd.. && cd .. && cd code
>>
>>60020887
windows isn't the same as linux. wallow in your ignorance if it suits you
>>
>>60018407
>return KarlMarx
Try
return TheWealthToTheWorkingClass;
>>
File: unix.jpg (63KB, 800x450px) Image search: [Google]
unix.jpg
63KB, 800x450px
>>60020838
A Unix system is the ultimate avenue for learning, it just encourages you to try stuff up and write simple programs to automate, rather than form closed clusterfucks.

I just learned something from the output of
strace cat .
, am I too deep in the rabbit's hole?
>>
>>60020889
Vim is an editor and emacs is an IDE. Stop comparing the two.
>>
>>60020921
>>>/r/abbit
>>
>>60020907
>Build and run build scripts, run all tests, run the profiler, commit and push, etc. can all be done with a single click in an IDE.
to run all the unit tests in your test folder, you just do: xunit .

that's literally it. that takes less time than mousing over to your "run unit tests" button
>>
I wish I was a Pythonista
>>
>>60020924
We can agree then, and Neovim's the best editor. That means the war is over?
>>
>>60020946
>that's literally it. that takes less time than mousing over to your "run unit tests" button
They run automatically when I build though.
>>
>>60020889
>no nano
into the trash
>>
>>60020960
then make a script to run unit tests after building. 2 lines of code
>>
File: Eternity.png (4MB, 1920x1080px) Image search: [Google]
Eternity.png
4MB, 1920x1080px
>>60015283
I made an image viewer using OpenGL, currently stuck on image scaling/resizing.
What is the best way to do this?
Is interpolation necessary to retain image quality when shrinking the image or is it only necessary when upscaling?
I could probably do it with glOrtho but does glOrtho hurt the image quality in any way (perhaps it has poor interpolation)?
>>
>>60020987
nano needed company?
>>
>implying vim and ide are the only choices
I used vim for a while and even installed autocompletion but then it hit me, what's the point of learning dozens of commands like 5daskjg or whatever to move around and delete lines at the same time and feel cool at my l33t h3ck3ring and then it wrecks my hand and I have to abandon programming due to carpal tunnel, when I could just use gedit and select the lines with the mouse? It's not worth it.
>>
>>60021002
You could keep writing scripts like that for a few years and eventually you'd have an IDE. What's your point?
>>
>>60021025
how do a bunch of throwaway 2 line scripts for different projects result in an ide
>>
>>60021011
Die ricer
>>
>>60021011
import imagemagick library
prablam salv'd
>>
>>60020907
>For example how do you change a function in both the .c and .h files?
manually AFAIK, although making a plugin for that isn't technically impossible. I don't see much gain though. Also why haven't we decided to make .h file autogenerated from the .c? I was thinking about that lately...
>ond tried and true command
make yourself a shortcut, a fully featured ide is just to heavy
>>
>>60021021
you should make a program that lets you type with your mouse through morse code if vim gives you carpal tunnel
>>
>>60021021
buy yourself a better keyboard, it's a better balance of cost/productivity.
>>
>>60020943
>>>/k/illyourself
>>
>>60021021
ok
>>
>>60020882
considering it can calculate fibs 100k in a second in the interpreter, it's pretty good
>>
>>60021053
My computer can calculate a gorillion gigafloppy dicks a second. An IDE is in no way too heavy. I frequently have 5 IDEs and a couple VMs running at the same time, as well as various other tools and utilities like DB managers, 3d game engines, browsers, chat programs, and so on.
>>
>>60021072
Neovim user with a TEK here, it's worth it trust me.
>>
>>60021076
see >>60020943
>>
File: 2dljd45.gif (485KB, 500x278px) Image search: [Google]
2dljd45.gif
485KB, 500x278px
I unironically moved from arch+xmonad+vim to win10+vs code
>>
>>60021085
Mine too, but simplicity is it's own virtue. I don't like having a big ass thunk of an IDE that does a gazillion different things behind my back that I don't understand or control, and I had the same feeling with Spacemacs, so now I use vim+dedicated command-line tools and I feel like I know what I'm doing a bit better.
>>
>>60021151
I get that to some extent, but most of the black magic in something like visual studio code and either be learned or isn't too relevant. For example I have no idea what's in a .sln file, but I can still manage pretty complex solutions with many projects and complicated build processes.
>>
>>60020921
>>Incompatible types, expecting reality got dream. ln 34
>>
File: 1491418777377.png (595KB, 871x1103px) Image search: [Google]
1491418777377.png
595KB, 871x1103px
>>60020905
I'm not the lolisim guy, I'm working on this: https://github.com/das-labor/panopticon
>>
>>60021085
>3d game engines
>>>/v/
>>
>>60021178
>complex solutions with many projects and complicated build processes.
There's no silver bullet, and maybe it's just your job and you can't change it, but what you're describing could use a good dose of KISS imho, don't you agree?
>>
>>60021235
>could use a good dose of KISS imho
yeah, just dump all the source code files into one directory and be done with it already
simple!
>>
>>60021220
What happened to the website? Also the x86 support is recent right?
>>
>>60021270
>anon doesn't understand KISS
>>
>>60021305
I don't understand this post. Did you reply to the wrong person?
>>
>>60021235
Sometimes you just need a complicated build process. UIs, different rendering modes, external libs, multiple platforms... I try to keep those things to a minimum in my personal projects of course, but clients expect you to build everything for every platform. There's also complications to working with a team, when you get to a certain size you really want things like CI to be a part of your build process too...
>>
>>60021220
Cool project. How's Rust treating your?
>>
Thinking of making a templeos-tier os, how much pain/bullshit am I in for?
Setting up a bootloader was simple enough.
>>
>>60021382
>templeos-tier os
Do you already have a Holy version of the language you're using?
>>
>>60021396
I can make a HolyForth if I really have to...
>>
>>60021052
This is C, and that would be yet another dependency which is not really necessary.

>>60021046
Oh God fuck off, it's just openbox and tint2 with window decor disabled. Learn to use a computer instead of getting triggered by other people customizing their own fucking environment.
>>
>>60015283
I'm programming a webpage.
>>
>>60021403
>if I really have to...
You have to. Assuming you want a TempleOS-tier OS.
>>
>>60021420
Is that really programming though? I feel it's more like selecting poops from the toilet and squeezing the water out of them
>>
File: dog.jpg (100KB, 1020x1366px) Image search: [Google]
dog.jpg
100KB, 1020x1366px
Can anyone give me the basic gestalt on monads? I get that is like a special kind of function composition, do I need to learn category theory to understand it?
>>
>>60021350
That's nothing that can't be handle by a standalone tool like tup afaik. Or is there? and Travis CI is configured using a shell script basically. I guess the CI doesn't have the whole IDE installed, so it's mostly an ecosystem of compatible tools using sln as a format, one of which being the builder, no? My only concerns in that case would be 1. can I use the builder standalone if I'm a vimmy team member, and 2. is everything free as in freedom?
>>
>>60021350
>like CI
like what?
>>
>>60021466
Also the JRE and CLR "ecosystems" are both unnecessary reinventions of the wheel that are deeply coupled, mutually incompatible, and huge, but that's just me.
>>
>>60021450
https://www.youtube.com/watch?v=ZhuHCtR3xq8

It's a one hour basic gestalt, but if you don't have that to spare then you should keep reading over the wikipedia definition like it'll sink in one of these days.
>>
I'm sad /dpt/
>>
>>60021327
this is a shitpost
>>
>>60021488
Continuous Integration, means you have VMs that run your whole build process and tests each time you push a commit, so the results of those available to your team in up-to-date form and such. See travis-ci.org if you want to explore the concept.
>>
>>60021526
Punishing developer is another tool to learn them to commit only building commit.
>>
>>60021090
are they backlit? i like to kode in pitch black except for the screen
>>
File: monad succinct.png (9KB, 394x116px) Image search: [Google]
monad succinct.png
9KB, 394x116px
>>60021450
>>
>>60021450
>Can anyone give me the basic gestalt on monads?
The Haskell wikibook explains it pretty well.
>do I need to learn category theory to understand it?
Depends on what you mean by understand. You can use them without knowing category theory though.
>>
>>60021517
"this" as in the post I'm replying to or "this" as in the post you're replying to?
>>
File: 1482373297003.jpg (554KB, 725x1280px) Image search: [Google]
1482373297003.jpg
554KB, 725x1280px
>>60021353
Far better than C++. A year ago I had to write lots of stuff myself but the library situation improved dramatically.

>>60021286
The website still exists https://panopticon.re. The x86 supports most of the recent instructions except 3DNow!, MPX, SGX and AVX512.
>>
File: 1492871032584.png (786KB, 1000x1300px) Image search: [Google]
1492871032584.png
786KB, 1000x1300px
Fuck it, I'm dropping Clojure in favor of Haskell.
What's a good resource to use? I didn't like LYAH. I've heard good stories about the wikibook and Haskell From First Principles.
>>
What's Tarjan's algorithm used for? Topological sorting? Strongly connected component identification? Both?
>>
>>60021506
>>60021549
>>60021556

I'll check those out, thanks
>>
Question: What the fuck do I use the Windows Powershell for? What's this I keep hearing about people automating stuff in IT?
>>
Is learning BASIC worth it as a beginner, just for fun, or should I just keep learning Javascript and HTML5 and all that crap?
>>
>>60021612
The Haskell wikibook.
>Haskell From First Principles.
I've heard it's good, but I don't think it needs to be that long.
>>
>>60021612
http://www.seas.upenn.edu/~cis194/fall16/
>>
>>60021466
I'm sure there's standalone tools that handle it just fine too, and you could probably even doctor up a good old fashioned makefile to do it. But it's far less effort to just click on a bunch of buttons and add a few dependencies, and essentially have the IDE create that make file full of wizardry and maintain it for you automatically. That's basically how I view it, very cost-efficient maintenance of project-related things like profiling, testing and building.

As for your 1 and 2 questions, that depends on which IDE we're talking about. Most of them will let you use parts of the build system as standalones, and most of them have a proprietary part to them. The engine (compilers, linkers and core language tools like debuggers) tend to be free, but the rest of the car is proprietary if you get my analogy.
>>
>>60021537
Could you please write in English?

assuming you meant
>CI is another tool to punish developers; it teaches them to only commit if the code is in a building state.
To which I answer no, it depends how you set up your CI. It's not a sin to break something, better to know it late than never, so no one punishes you if your CI is negative. CI helps with code quality but isn't meant to change how developers think. It's also perfectly compatible with the small increments commit philosophy, and what matters is that the tip of your git branches pass the test, not everything below that. You don't code any differently with CI, it just makes teams more productive, and helps with pull requests because you have a readily available indicator of whether merging will wreck your project or not. (Doesn't replace manual reviewing though, just helps.)
>>
I dont really know c++ but a bit of C and Python, i'm walking through a tutorial written in c++.

What does this mean ?
struct Foo {
bool boolean; // this i know
Foo() : boolean(true) {} // this i don't
};


I know what it's doing since it's pretty obvious, i just don't know the syntax ?

Is it the same as Tile.boolean = true; ? but declared directly in the struct ?

Also do you have recommandation of books/videos i should read/watch to get up to speed with C++ ? I probably don't wan't to dive into a big book that'll teach me C++ but rather something that'll teach me classes syntax and data management in C++.
>>
>>60021687
it sets boolean to true, but it's in the initializer list so it has different properties
>>
>>60021450
My advice is to just use them. Look at the types of bind and return and then just write some programs with it. Only this will deepen your understanding and intuition about monads.
>>
>>60021610
>Far better than C++. A year ago I had to write lots of stuff myself but the library situation improved dramatically.
Is QML still problematic with Rust? I've heard you (a bald dude) talk about it in a video on YouTube.
>pic
I saw some many girls like the pic in Taiwan. I wish I was there ;_;
>>
>>60021672
If someone publish a non building commit
I mean a commit, that prevent building
punish, I mean forcing the developer to fix using a small notepad (not notepad++) window with a broken keyboard, and writing a lot iof boring things,
PUNISHMENT
next time the developer will learn to test
>>
>>60021672
No, he ment that instead of having CI you should punish your developers when they push non-building code. Which is pretty much the most indian thing i've seen written on this website. In any case, CI is more useful for things like... Let's say you're developing a web application. You add a new feature and you want to pass it off to QA and UX. With CI all you have to do is push and it'll automatically run the tests, build it, and host it so all you have to do is send the rest of the team a link. It's not so much about just having your commits be buildable as it's a convenience for the rest of your team that don't necessarily have an up to date version of your repo with all dev branches at all times.
>>
>>60021567
the latter
>>
>>60021665
>I'm sure there's standalone tools that handle it just fine too, and you could probably even doctor up a good old fashioned makefile to do it.
agreed

>But it's far less effort to just click on a bunch of buttons and add a few dependencies, and essentially have the IDE create that make file full of wizardry and maintain it for you automatically. That's basically how I view it, very cost-efficient maintenance of project-related things like profiling, testing and building.
would be better if that build system was inputted plain text rather than clickarounds to me, but that's for the same reason that I look down upon WYSIWYG documents from my LaTeX masterrace standpoint, and upon opaque graphical installers being an ArchLinux user.

>As for your 1 and 2 questions, that depends on which IDE we're talking about. Most of them will let you use parts of the build system as standalones, and most of them have a proprietary part to them. The engine (compilers, linkers and core language tools like debuggers) tend to be free, but the rest of the car is proprietary if you get my analogy.
Seems probable. User freedom is a question we can probably agree to disagree on. As for reusing part, see my post >>60021498, to me if you have a plain unix command that can compile a file and another to link, or whatever, you can just use http://gittup.org/tup and it will be as efficient as can be, and even if it's not it's a thousand times better to improve a generic tool than whichever clusterfuck like maven or something you use to "automate" building your "app".
>>
>>60021623
SCC identification. A topological sort is done with a slightly modified DFS (i.e. a stack/array to maintain when we *finishes* processing a node), and has other uses beyond SCC ident.
>>
>>60021760
agreed
>>
>>60021815
dope, thanks
>>
>>60021687
In C++, that acts like a constructor for Foo's, i.e. when you call Foo * myFoo = new Foo, myFoo->boolean will be returned initialized to true.
>>
>>60021610
Who is this semon demon?
>>
>>60021639
I just realized that Haskell From First Principles is 1189 pages long. This makes the wikibook look much more attractive.
>>60021644
Thanks, I'll take a look at that as well.
>>
>>60021870
shittiest explanation I've seen in a while. >>60021687 don't even try to understand it
>>
I'm doing cs50 on edx, I'm having a little trouble understanding how assignment of variable really works.

int main(void)
{
do
{
printf("change:");
float change = get_float();
}
while (change < 0.0);

change = change + 2;
}



on this case the variable change it is only "on" inside of the do thingy? If, instead, I wrote like this I would have two variables change, right?

int main(void)
{
float change;
do
{
printf("change:");
float change = get_float();
}
while (change < 0.0);

change = change + 2;
}

>>
Why are constructors not static?
>>
>>60021874
You can read the first chapter if you're not already familiar with lambda calculus.
>>
>>60021919
Because inside the constructor body you're no more in a static method, you can call instance members. Constructors are hybrid.
>>
>>60019292
I'm still involved in a project that's been ongoing since 2008
>>
NEW BREAD:
>>60021954
>>60021954
>>60021954
>>60021954
>>
>>60021905
if you define a variable inside a loop for example, it will only exist inside the scope of the loop

if you try to compile the first code, the compiler will throw an error saying that "change" is undeclared
>>
>>60021905
Yes, that's why it's often considered good style to declare all variables on top of the function body. change inside the do-while body "shadows", that's the exact term, change outside, and when you exit the do-while it doesn't exist anymore and the outer variable is accessible again. IMHO that's not the most useful feature in C to say the least.
>>
>>60021979 here
>>60021971
Wait yeah I didn't notice the first example was invalid.

declaration is the key, and it's not the same as assignment. Declaration is when you create the variable with it's type, name, and scope with
float x;
.
Also note that
float x = 1;
is a shortcut for
float x; x = 1;
>>
>>60021924
Do you know where to find the book?
>>
>>60022048
search off-site /g/ archives for "functional programming thread"
>>
File: 1482373297004.jpg (601KB, 725x1280px) Image search: [Google]
1482373297004.jpg
601KB, 725x1280px
>>60021719
It got a bit better. We're migrating away from qmlrs to qml-rust which works way better and is actively maintained. If you're looking for an UI library it's worth a look. Also, relm (http://relm.ml/relm-intro) looks interesting.

> I wish I was there ;_;
We all gonna make it, brah ;_;
>>
>>60022133
>qt in the front, qt in the back
>qts everywhere
Don't tell me you know her?
>>
>>60022048
http://gen.lib.rus.ec/
>>
>>60022213
Based Russians did it again.
>>
>>60021021
Moving your hand back and forth between the keyboard and mouse will wreck your arm with cubital tunnel syndrome.

Or you could just take regular breaks to rest your hands/arms and not suffer from RSI regardless of which editor you use.
>>
>>60022176
>Don't tell me you know her?
Well, I discreetly brushed my hand against her behind as we exited the subway
And that's basically as good as knowing her.
>>
>>60021612
>dropping poop in favor of trash
Thread posts: 320
Thread images: 27


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.