[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: 339
Thread images: 49

File: 1482055600767.png (818KB, 1280x719px) Image search: [Google]
1482055600767.png
818KB, 1280x719px
What are you working on, /g/?
Old thread: >>58437759
>>
First for C11.
>>
File: 1483623719550.png (514KB, 810x698px) Image search: [Google]
1483623719550.png
514KB, 810x698px
Thank you for using an anime image!
Thank you for using a Karen image!
Thank you for using a Haskell image!
>>
what do you call anime where girls act cute?
>>
>>58443206
"anime"
>>
>>58443206
M O E
O
E
>>
What is good and fast prototyping language?
Pro tip: Python ain't fast
>>
>>58443241
Cython
>>
>>58443206
literally "cute girls doing cute things"

>>58443173
>What are you working on, /g/?
Training a co-worker on how to dev in C#, and he's completely green.

It's actually kind of fun, though.
>>
>>58443241
Haskell
>>
>>58443246

can he do FizzBuzz though
>>
>>58443261
Good question, I'll ask him to do one.

Will post results.
>>
File: reimu eating grass.jpg (212KB, 850x728px) Image search: [Google]
reimu eating grass.jpg
212KB, 850x728px
>>58443235
>it doesn't bloat up the language like C++

Standardizing VLAs are the single biggest mistake ISO has ever done.

C11 is also pretty fucking bad, so bad that nobody has bothered with Annex K, because unlike C99, it does violate "the spirit of C".
>>
>>58443231
not necessarily. But supporting those things is certainly highly desirable in just about every situation I can think of.

>>58443248
Proof of what?
>>
Thinking about memory representation of higher inductive types.
data Circle : U where
base : Circle
loop : base = base

Values of Circle need no representation. (base = base) is equivalent to the integers, so a path in (base = base) can be represented by an integer. Transitivity of paths in (base = base) is addition and symmetry is negation.
>>
>>58443280
>filename
Why?
>>
>>58443280
Why's that slut eating grass
>>
>>58443309
Because the sea weed
>>
>>58443241
>caring about performance in a prototype
>>
>>58443229
Yes, it's being a non-programmer who can;t justify the time to learn anything better.
>>
>>58443241
C#
.NET library and true OOP means you can just throw shit against the wall and stick an interface on top without any actual effort
>>
>>58443320
Every good programmer should.
>>
>>58443293
Oh, and of course refl would be 0 and loop 1.
>>
>>58443334
This. Or F#
>>
>>58443280

Annex K, like threading, is optional. Why bother implementing what nobody really wants, and other compilers also aren't implementing?
>>
>>58443280
>Annex K
Yes. Annex K is fucking garbage, but it's an optional part of the language.
The reason it sucks so hard is because it didn't take threading into account at all when it was designed.
>Standardizing VLAs are the single biggest mistake ISO has ever done.
I think they're pretty useful, although you obviously need to be mindful when using them. It's certainly better than alloca and shit that people were using before.
They made VLAs and complex numbers optional in C11, so that compilers targeting embedded platforms didn't have to add a bunch of shit they were never going to use.
>>
>>58443336
Not when performance severely limits productivity.

It would take days to do some things in C that can be done in like 4 lines of code in Python/C#/Java.
>>
>>58443361
Sure, so why use python when you can use something fast like C# and Java?
>>
>>58443334
Hilariously true.

So easy to get shit done in C# and shove it in an extension method or something and move on with your life.

It Just Werkz™
>>
>>58443354
I don't get the complex numbers in standard library meme
Is it just bandwagonning?
>>
>>58443370
No arguments here, C# is my favorite language.

Sure, you should "always care about performance", but performance comes after getting it done.

You should code sanely the first time (e.g. don't call I/O on every iteration of something), but save fine-tuning optimization for when it actually presents itself as an issue, or when there's nothing else to be done.
>>
>>58443372
They were trying to rival fortran and become more viable for numeric processing.
That's why they added restrict pointers, because that was one of the things fortran had over C.
That's why they added <tgmath.h>, to make using the math functions easier.

I've used the complex number functions before. It was helpful when I was doing some stuff with FFTs.
>>
>>58443394
>Sure, you should "always care about performance"
And that's all I stated.
>>
File: 1473006017939.jpg (99KB, 1103x639px) Image search: [Google]
1473006017939.jpg
99KB, 1103x639px
>>58443173
never tried programming before, first day today, started with c++, seems pretty fun!
>>
>>58443411
Sorry, assumed you were one of those "muh C" cucks who get absolutely nothing of value done ever.
>>
java is the best, friendos
>>
File: Screenshot_2017-01-12_00-48-19.png (12KB, 679x190px) Image search: [Google]
Screenshot_2017-01-12_00-48-19.png
12KB, 679x190px
enough green squares to get noticed by the HR subhumans?
>>
>>58443444
maybe in a world where there are no other options
>>
>>58443454
so in this?
>>
>>58443468
The only winning move is not to program
>>
File: fsdfasdfasdfasdfasdfasdfasdf.png (38KB, 1496x390px) Image search: [Google]
fsdfasdfasdfasdfasdfasdfasdf.png
38KB, 1496x390px
>>58443450

Not when there's people like me.
>>
File: cpp.jpg (107KB, 660x473px) Image search: [Google]
cpp.jpg
107KB, 660x473px
does this image represent C++ accurately?

post images for other languages
>>
>>58443280
reimoo?
>>
File: 1469367116087.jpg (75KB, 630x551px) Image search: [Google]
1469367116087.jpg
75KB, 630x551px
>>58443501
that's what everyone is doing here
>>
>>58443505
Swiss army knives are useful, safe and well designed.

No.
>>
>>58443504
>barely commiting on saturdays & sundays
It's like you actually got hobbies.
>>
>>58442456
for i=100,1,-1 do 
if(i % 5 == 0 and i % 3 == 0)
then
print("fizzbuzz")
elseif(i % 5 == 0)
then
print("buzz ")
elseif(i % 3 == 0)
then
print("fizz ")
else
print(i)
end
end


Job please. I need money.
>>
>>58443557
Runescape
>>
>look up basic react.js tutorials
>HI JUST ADD THESE 120 DEPENDENCIES
>DONT ASK WHY HELL IF I KNOW
>WE'RE GONNA NEED THIS LIBRARY TO ADD JAVASCRIPT FEATURES FROM A FUTURE VERSION AND RECOMPILE CODE INTO OLDER JAVASCRIPT
>WE NEED THIS TO PACK YOUR SCRIPT INTO A SINGLE SCRIPT
>WE NEED THIS TO ADD ALL DEPENDENCIES
>THIS DOES... UH.... STOP ASKING QUESTIONS
>THIS ADDS SOME TRIVIAL COMPONENT AND/OR FEATURE YOU COULD CODE YOURSELF IN 5 MINUTES, AS WELL AS A MOUNTAIN OF CODE THE PROGRAM WILL NEVER USE
>THIS COMES FROM A TRENDY STARTUP AND EVERYONE USES IT
>THIS IS NEEDED FOR COMPATIBILITY WITH SOME SHITTY FORGOTTEN BROWSER NOBODY USES ANYMORE

are all javascript developers mentally ill?
>>
is getting good in SQL hard?
>>
>>58443718
99% are just copy pasting pajeets in white skin
>>
>>58443729
No
>>
File: js.png (409KB, 1000x3392px) Image search: [Google]
js.png
409KB, 1000x3392px
>>58443718
:^)
>>
>>58443736
>do the needful

Triggered
>>
>>58443749
Sort of a dumb comic. As shitty as JS is, you can get it to do useful stuff without too much pain if you're not retarded.
>>
>>58443749
See, this is what I'm talking about. Why is this accepted? Why are there so many people that keep supporting this piece of shit? Why do they keep making new variations of it (coffeescript, typescript, jsx, ecmascript 2016)? This must be some kafkaesque nightmare.
>>
>>58443749
who the fuck thought JS is good outside of handling DOM?
>>
>>58443173
While writing a query generator / formatter today, I realized that Amazon's CloudSearch structured query format is thinly disguised lisp input.
>>
>>58443777
>JS
>Good at handling DOM
>>
>>58443775
Are you retarded?

JS powers the web. A lot of people use the web you know. If you want to do something interesting on the web, JS is the only option.
>>
>>58443817
>js is popular because it's popular

welcome to the tautology club
>>
>>58443804
Well, as far as I understand, it was the initial idea of JS.
>>
>>58443835
JS is popular because the WEB is popular jack ass.

Are you asking why the web only supports JS and nothing else? Because web standards suck ass and always have.
>>
>>58443749
WebAssembly will save us, r-right?
>>
>>58443627
>comparing i % 5 to 0 twice

Get out before I call security.
>>
File: 1481655942756.png (984KB, 799x452px) Image search: [Google]
1481655942756.png
984KB, 799x452px
Where can I find some good tutorials on "MySQL normalization" or "indexing", I heard it solves alot of performance problems on forums, currently my forum database has >1GB of data and the queries are taking minutes, of course it's not a populated or "real" forum but I would like to fix this, also another question, does other types of database have this problem as well or they just work™? (PostgreSQL and others)
>>
>>58443875
I think you can read a guide just on database normalization, since this problem is universal.
>>
>>58443775
>>58443749
It's just easy and intuitive to program with, a hundred million times easier than whatever "godtier" language you guys use, as long as "better" languages still are a pain in the ass to learn and program with JS won't die
>>
>>58443863

for i=100,1,-1 do
s = ""
if(i % 3 == 0)
s = s .. "fizz"
then
elseif(i % 5 == 0)
then
s = s .. "buzz"
else
s = i
end
print(s)
end
>>
Hey guys wanted to know once I'm done following the tutorials of Visual C Sharp step by step will I be able to make games?
>>
>>58443923
>It's just easy and intuitive to program with
too obvious 0/10
>>
>>58443939
Sure.
>>
>>58443952
I learned it just by trial and error in a couple weeks with basically no programming knowledge
>>
>>58443962
So it's easy and intuitive to learn compared to what?

What's the most complex thing you've written with it?
>>
File: scala.gif (16KB, 635x282px) Image search: [Google]
scala.gif
16KB, 635x282px
Does anyone know Scala well?

I want to connect to a bare SSL/TLS socket that talks XML so like a webservice but it stays connected because there are broadcast messages sometimes.

Where do I start with connecting to this in Scala?
I looked at Akka but that looks to be pure webserver.
I found spray but I'm not sure if that's the right direction.
>>
>>58443975
By godtier languages I meant C++ and C, you cannot deny those two are infinitely more complex than JS
>>
>>58443981
Scala is awful, please stop using it.
>>
>>58443938
I'm not familiar with that language but it seems you dun goofd your if statements there, bud.
>>
>>58443957
Are you being genuine? I just want something no matter how long that once finished will make me 100% capable of creating games without wasting any more time with incomplete stuff.
>>
>>58443983
What makes you think that C++ and C are "godteir"?

At least those are fast.

My point is JS is shit, and there's far better langugaes than it for doing just about anything besides web stuff. I would not go around describing it as "easy and intuitive" because it's one of the least easy and least intuitive high level langugaes in common usages, beaten only by PHP.
>>
>>58444011
Well, learn C#, and then learn a game engine that uses C#.

You can certainly make some simple games with very limited knowledge of C#.
>>
>>58443939
finish watching the tutorials because quitting makes quitting a habit and you will get better at gamedev by finishing them (you'll have more knowledge/tools to work with in your head and a greater sense of whats possible and how to find answers).

Gamedev is done using tools and game engines it's not just coding, programming is only a small part of actually making games. Enginedev is more what you think of when you think "games require c++ programmers!". This isn't even from a meme visual coding tool standpoint or a "I can make an RPG maker game I'm a gamedev!" standpoint. You'll do programming when making any significant game, but it will mostly be scripting stuff (the difference between scripting and programming is basically non existent) but whatever you do it won't be pure language stuff.

>basic programming knowledge ( boolean logic, for and while loops, basic data types, string manipulation, some sort of data structure knowledge)
>art workflow of some kind (text stuff, 3d modeling, 2d art)
>game dev tool (how are things displayed, the pipeline for using assets, using scripted game logic, outputing and packaging a game together for distribution)

Most of the game creation part is entirely done depending on what tool you're using for gamedev. Enginedeving is a completely different skillset.
>>
>>58444058
>the difference between scripting and programming is basically non existent
Scripting is just programming using a scripting langugae.
>>
File: scripting.png (98KB, 518x426px) Image search: [Google]
scripting.png
98KB, 518x426px
>>
>>58444058
>Enginedev
that's the only fun part of making a game
>>
>>58444129
Is this meant to be a joke?
>>
>>58444005
Fuck I did. I hate if, then, else statements in Lua. It like doesn't use brackets for some reason so you have to use then and end for if statements.

It should be

for i=100,1,-1 do
s = ""
if(i % 3 == 0)
then
s = s .. "fizz"
elseif(i % 5 == 0)
then
s = s .. "buzz"
else
s = i
end
print(s)
end


for(i = 100, i < 1, i-- )
{
s = "";
if(i % 3 == 0)
{
s = s + "fizz";
}
else if(i % 5 == 0)
{
s = s + "buzz";
}
else
{
s = s + i;
}
print(s);
}
}


is so much more sane.
>>
>>58444129
none of these describe a script. God help whoever wrote that garbage.
>>
>>58444157
Your intendation makes me cringe
>>
>>58444157
Messed up brackets this time.

Just fucking end me already for not reading my code before posting for the third time. The only reason the first one was syntacticly correct was because I actually ran it.
>>
>>58444157
both of those are wrong. "fizzbuzz" is never printed when i is divisible by 3 and 5.
>>
Anons who actually enjoy programming, how do you decide what projects to do next? What do you do to "practice" coding?
>>
>>58444058
Alright, thanks for the answers.
>>
>>58444210
I think of something that sounds fun to make and I make it.
>>
>>58444210
Whatever will piss off the largest number of corporations I hate, that's what I'm gonna choose for my next project.
>>
>>58444210
>how do you decide what projects to do next?
I randomly get some ideas for shit I want to do and that might be useful to me, and I do some of them.
>>
>>58444210
i mean i'm a new programmer but i just do what seems feasible giving my competency and what interests me. someone told me pick projects that seem harder then what you can do because that's the easiest way to learn. so my next project might actually be difficult.
>>
>>58444181
Yeah thats also true.

It should continue the first if check or be separated into two if checks. I didn't compile that at all but I know why it doesn't work, its exiting the if check at fizz when it needs to be fizzbuzz.

Honestly though rewriting it because I checked for i % 5 twice isn't something I'd do anyways because the first code example was so much more clear. Writing code thats as short as possible and grouping as many checks together in the smallest amount of space possible is for faggots.

I'd rather have the code do three checks for three checks separated into three clear blocks of code than be cute and do two checks for three checks using as many shorthand operators as possible because you have some sort of autistic need to write everything in as little lines of code as possible.

I'm also a shit programmer though so my opinion basically means nothing.
>>
>>58443293
What language?

>>58443775
Could be worse. Brendan Eich could have invented PHP instead of JavaScript.
>>
>>58444210
I either take something that bothers me and try to do it better than the existing solutions (if any exists), or teach myself some advanced techniques by writing toy programs that illustrate the techniques.
>>
>>58444331
A hypothetical language with homotopy type theory.
>>
>>58444323
You could just check i % 15 == 0 for FizzBuzz instead of checking i % 5 == 0 && i % 3 == 0.
>>
>>58444357
Yeah but the question is check for numbers divisible by 5 and 3. Why would I make the inference or make someone reading the code do extra math when doing a check for 5 and 3 shows exactly the logic behind the if check?
>>
Are there any good tips for coding exercises / example projects for someone who knows a little bit about programming (2 year hobbyist, in uni for 6 months now) but with very little actual experience of working on projects aside from school work.
>>
>>58443173
OpenGL/C++

I'm trying to learn shaders and VBOs and all that. I have some different colored lines I want to draw and I have a background image I want to use as a texture.

It seems I can only get one or the other to work. In my fragment shader if I comment out texture(texture1,Texcoord); then the lines are colored but my texture doesn't show (it's a quad with gradient colors instead). If i comment out vec4(pass_Color); then I get my background image to show, but the lines are just solid black.

How do I get both to show?? Multiple shaders?
>>
>>58443173
What's a good language to learn to common programming syntax's and layout
I only have experience with BASIC, so all these parenthesis is like greek to me
>>
>>58444355
Oh neat! The homotopy type theory stuff on the web I've been looking at has been kind of too circle jerky for me to go through and learn. Do you have any non Haskell circlejerk homotopy type theory resources?
>>
File: 1483160948165.png (4MB, 2560x1440px) Image search: [Google]
1483160948165.png
4MB, 2560x1440px
Dares someone explain to me, how my programm won't work?
So, this is an exercise in Think Python (11.8).
The point is to find all the word pairs which are made when you apply BASE-n rotation to a word.

I have completely forgotten about the
if x in y:

thing, so solving this would have been much easier (http://www.greenteapress.com/thinkpython/code/rotate_pairs.py)

However, I've coded this thing:
text = open('words.txt')
def rotatable(text):
by_length = {}
for line in text:
word = line.srtip()
for line in text:
guess = line.strip()
if len(word) == len(guess):
built = ''
n = ord(guess[0]) - ord(word[0])
i = 0
for letter in word:
m = ord(guess[i]) - ord(letter)
if m != n:
break
built += guess[i]
pair = word + ' ' + built
i += 1
if built == guess:
by_length.setdeafault(n,[]).append(pair)
return by_length

and it does not work.

What do? Also, does break end ALL the nested while/for cycles, or the only one, which represents the break level??
>>
>>58444423
Haskell doesn't have a type system based on Homotopy Type Theory
>>
Java will rule the world!
>>
all software sucks
>>
>>58444444
It's already the case, you getfag.
>>
>>58444423
HoTT has nothing to do with Haskell. But you're not going to find anything for beginners. HoTT will only make sense if you're already very familiar with traditional type theory, and even then it's quite undeveloped.
>>
File: 1481664473008.png (175KB, 482x436px) Image search: [Google]
1481664473008.png
175KB, 482x436px
>>58444444
KILL KILL
KILL KILL
KILL KILL
KILL KILL
KILL KILL
KILL KILL
>>
>>58444391
It doesn't matter jack shit really, but I prefer to go with the check on % 15 because only a complete tool would fail to realize anything divisible by 15 is also divisible by 5 and by 3, so it could serve as a way to weed out the retards.
>>
>>58444443
>>58444456
No. But a lot of Haskellers are interested in new and odd type theory stuff. Some of these Haskell bloggers have a tendency to circlejerk a lot. I first learned about homotopy type theory on a Haskell blog but like I was explaining there was too much type theory circlejerk.
>>
>>58444500
You mean there was too much type theory
>>
>>58444444
FUCK OFF
>>
>>58444500
>circlejerk
I don't think you know what this means. Jargon is not circlejerking.
>>
>>58444438
>>58444438
>>58444438
Peeease
Peer-review when
>>
>>58444511
No. I am not talking about jargon. The blogger was going on and on about how HOTT gives a new foundations for mathematics and seemed to think that it would be possible to a Principia Mathematica that actually formalized all of mathematics with it.
>>
>>58444444
Go home, pajeet.
>>
>>58444547
Which is pretty solid as a theory so far.

But you don't need to believe that for HoTT to be interesting.
>>
Why do people hate parenthesis?
I love them, its what makes lisp powerful.
But I'm not a Jew.
>>
File: 640.jpg (116KB, 640x360px) Image search: [Google]
640.jpg
116KB, 640x360px
>>58444444
>>
>>58443261
I'm learning programming on my own right now, I'm only two weeks in so far, but FizzBuzz was really simple to me. Surely it's a joke that people can't do it right?
>>
File: wew.png (535KB, 1638x893px) Image search: [Google]
wew.png
535KB, 1638x893px
> tfw learning Swift while making my first game
Do you think I will make lots of money if I master it /g/?
>>
File: 098162569124.png (556KB, 512x512px) Image search: [Google]
098162569124.png
556KB, 512x512px
>>58444568
>>
>>58444563
That's blatantly impossible.

It is not possible to build a computer (a type theory) that computes the truth of all propositions.
>>
>>58444466
That's shitty logic. A person can be smart and be a good problem solver and just overthink the problem or miss something obvious. Peoples brains jump logic randomly for completely reasonable reasons.

Its completely reasonable as someone reading the code to look for some reason to check for 15 elsewhere without ever assuming the 15 is even connected in any way to the 5 and 3.

Writing your code less understandable to weed out "retards" is like using Latin when writing philosophy so people that don't know Latin won't understand your philosophy. Your code should be practical and understandable just as your philosophy should be practical and understandable so as many people can benefit from it as possible.
>>
>>58444582
>Surely it's a joke that people can't do it right?
You wouldn't believe how many shitty javascript programmers would struggle with this.
>>
>>58444592
Congratulations, you've heard of Godel's incompleteness theorem. But that's irrelevant because it only says that an algorithm does not exist for deciding formulae in a theory that is both complete and interesting.
>>
>>58443309
roughage
>>
>>58444625
Either your homotopy type theory is incomplete (it cannot compute the truth of some propositions) or it is inconsistent.
>>
Trying to infer this much about a developer from such a meaningless exercise is indicative of an absolutely wretched interviewing process. If you really want to know how much they care about code brevity vs readability, why don't you just ask them?
>>
>>58444639
Did you miss the part about "an algorithm"? Type theories are not algorithms.
>>
>>58444652
A type theory is an algorithm that computes whether a type has inhabitants or not. Either it will not be possible for you to compute the inhabitants of a type or you will not be able to express certain propositions as types.
>>
>>58444678
>A type theory is an algorithm that computes whether a type has inhabitants or not.
No, it's not.
>>
So this is what he meant by type theory circlejerk
>>
>>58444438
>Also, does break end ALL the nested while/for cycles, or the only one, which represents the break level??

yeah only the loop in its scope
>>
>>58444708
He didn't mean anything because he evidently has no fucking clue what he's talking about.
>>
Must read programmer books preferably for beginners
>>
>>58444691
>>58444717
Creating a type theory that has types that have noncomputable inhabitants is hardly fucking novel or useful.
>>
>>58444741
x : f = g
>>
>>58444691
It is if it is an intensional set of of true propositions.

Set Prop = Prop -> {0,1}
>>
File: popcorn.jpg (48KB, 600x600px) Image search: [Google]
popcorn.jpg
48KB, 600x600px
>>58444741
> I AM ANGRY
> I AM ANGRY ABOUT TYPES
>>
>>58444785
this post inhabits the universe of dumb posts
>>
>>58444796
the poster is not an inhabitant of the type of people with meaningful lives
>>
>>58444741
Type theories are rules for what terms constitute types, what terms can be typed by given types, and equalities between terms. Type checking for intensional type theories (including HoTT) is always decidable.

An algorithm for determining if an arbitrary type is inhabited (by producing a witness) is a completely different thing. Type inference, unification, etc. all fall under this umbrella.
>>
File: (You).png (403KB, 521x520px) Image search: [Google]
(You).png
403KB, 521x520px
>>58444813
This poster is a STUPID FUCKING FROGPOSTER and DOESN'T HAVE A SOUL
>>
File: 1469764157477.jpg (35KB, 519x517px) Image search: [Google]
1469764157477.jpg
35KB, 519x517px
>>58444821
this poster DOESN'T HAVE A GF
>>
alright, I want in on this fucking functional meme
what language should I learn
>>
File: gun to head.jpg (7KB, 200x200px) Image search: [Google]
gun to head.jpg
7KB, 200x200px
I'm having some problems coming up with a proper logic to make a scraper, I want to scrap a forum and basically make a copy of it but I don't know how to implement it properly. My first idea is as follows:

>First function: Visit forum page and store all thread author ID's and thread ID's
>Check those ID's against the database to see if they already exist
>If they don't exist spawn a process for each(?) profile page or thread
>If it's profile page retrieve user data, no problem
But what if it's a thread? do I make it "queued" so it gets all pages in order or async? what if the thread has 2k+ pages, how would I do this then? if it's queued then will it have a problem if the forum is busy and new threads keep popping up all the time?


send help
>>
>>58444844
Haskell
>>
>>58444853
and what's the best resource to learn that language
>>
>>58444851
first thing you should do is design a logo
>>
>>58444851
just read all the pages you can and then afterwards check for new posts and update the stored threads appropriately
>>
File: 1472937160601.jpg (45KB, 640x480px) Image search: [Google]
1472937160601.jpg
45KB, 640x480px
>>58444842
>>
>>58444820
>what terms can be typed by given types

If I compute that the term (\x -> x) is typed by the type forall a. a -> a that is equivalent to computing if the type forall a. a -> a is inhabited by (\x -> x).

I stand by my definition. A type theory is a computer for computing whether or not a type is inhabited.
>>
>>58444582
No. As demonstrated in this thread, people have trouble with it all the time.
>>
>>58444860
Haskell from first principles OR the wikibook
There's a pdf link somwhere

I recommend getting Haskell Platform (includes GHC (the compiler), Cabal, Stack (package managers))
>>
>>58444876
well but do I read the pages async? with an interval? x pages at a time?

do I leave a interval checking the first forum page at all times and pushing shit to the queue?
>>
File: XDQDtjP.png (207KB, 680x285px) Image search: [Google]
XDQDtjP.png
207KB, 680x285px
>>58444444
PAJEET GO HOME
>>
>>58444860
Programming in Haskell, 2nd Edition is p. good
>>
I've been writing my code in C for the longest time, and recently, because I'm a teacher assistant for a CS C++ class, I had to learn some C++ to help my friends. C++ is a clusterfuck, but man are templates and shit nice. Makes me not want to go back to writing C...
>>
>>58444889
>>58444860
Found it

https://0x0.st/pbp.pdf
https://en.wikibooks.org/wiki/Haskell
>>
File: anim.webm (471KB, 968x581px) Image search: [Google]
anim.webm
471KB, 968x581px
i added some dynamic loading of audio urls for songs

so you can queue them and they display a spinner while the program is looking for the audio track
>>
>>58444889
>>58444919
am I reading this wrong or is the uncompressed size of the GHC a gigabyte?
>>
>>58444921
>C++ templates
Enjoy your object code bloat and incomprehensible error messages.
>>
>>58444882
Reducing the definition of a type theory to a turing machine isn't helping anyone

>>58444877
[pic]

>>58444900
Read 'em as fast as you can, async. Why not?
>>
>>58444941
It's going to run on a shit PC
>>
>>58444928
Try looking for min ghc, the regular distribution is basically GHC*4
>>
File: 1464368071633.jpg (23KB, 490x480px) Image search: [Google]
1464368071633.jpg
23KB, 490x480px
>>58444941
>mfw i forgot the pic

>>58444949
worst case you end up with software threads and it runs concurrently but not parallelized
>>
>>58444928
>>58444951
Unless you don't care, in which case get Haskell Platform (it includes a lot of libraries)
>>
File: outcomesofar.png (175KB, 1021x1622px) Image search: [Google]
outcomesofar.png
175KB, 1021x1622px
>>58443173
mmmm
function encapsulation and many nested if's.

Not actually working on it, but I wrote it as a joke a few months ago
>>
File: Screenshot_2017-01-11_19-55-13.png (272KB, 847x298px) Image search: [Google]
Screenshot_2017-01-11_19-55-13.png
272KB, 847x298px
>>58443173
Working on the fun task of writing documentation
>>
File: .lain..jpg (54KB, 546x896px) Image search: [Google]
.lain..jpg
54KB, 546x896px
>>58444964
>>
>>58444882
They are not equivalent, assuming you mean that in the first case the type is not known and in the second case the value is not known. And if so, neither is the same thing as type checking, where both the value and the type are known. Godel's incompleteness theorems only talk about an algorithm that can take a type and come up with a value of it or conclude that it is uninhabited.
>>
File: 14814642114370.jpg (71KB, 479x626px) Image search: [Google]
14814642114370.jpg
71KB, 479x626px
Fooking faggits, review my code, I want to sleep, it's 3 AM in Europe.

>>58444438
>>58444438
>>58444438
>>
>>58444625
>>58444820
If HoTT is always decidable it cannot possible serve as a foundation of all mathematics because it will not be able to express certain propositions as types.

HoTT may have many interesting characteristics but this wankery that its the ultimate foundation of everything is silly.
>>
File: dns.png (78KB, 1363x756px) Image search: [Google]
dns.png
78KB, 1363x756px
>>58444966
Also,
just for fun ive been coding a python library that implements rfc 1034
>>
want to learn c++ but i'm hesitating to start. waiting for c++ primer book to arrive.
>>
>>58444997
You are not entitled to an answer.
>does not work
People aren't going to help you if your problems are so vague.
>>
>>58444589
beautiful
>>
>>58444419
Anyone?
>>
>>58444924
noob here

can you explain that this is?

how does that search function work? (how did you implement it?
>>
>>58444998
Type checking for HoTT is decidable. Godel's incompleteness theorems are NOT about type checking. They are about satisfiability.

HoTT is consistent and interesting but it is not satisfiable. Presburger arithmetic is consistent and satisfiable but it is not interesting.
>>
>>58445002
>Dark blue text on a black background
Why didn't you pick something more legible? That shit is annoying to read like that.
>>
>>58445018
i dont think anyone is doing openGL right now,

keep playing with t till you find the answer or search the webs
>>
>>58445027
Your mom is neither satisfiable nor interesting
>>
>>58444438
It appears your loops dont work because you are using the namespace 'line' twice.

change one of the 'line' to 'lines' or something
for line in text:
word = line.srtip()
for line in text:
guess = line.strip

idiot.
>>
>>58445048
can't say the same about yours

last night she gave everything
>>
>>58445055
thanks
>>
>>58444438
change from:
>for line in text:
> word = line.srtip()
> for line in text:
> guess = line.strip()

change to:
>for line in text:
> word = line.srtip()
> for anyothervariablenameexceptline in text:
> guess = line.strip()
>>
>>58445005
If it wasn't too late in the night, I would have been offended by your post.
However, it is, so my reaction is just AYYYYYYYYYY LMAO famalam what the fuck you're talking about, it's not a linux kernel for a problem to be 'so vague'
>>
>>58445030
because when I stare at a computer screen all day, i prefer the experience to be as little like staring into a light bulb as possible.

Thus, dark blue on black = easy on the eyes.
>>
>This thread is pathetic. It is not about programming. It's just a bunch of computers illiterates and first semesters memeing about whatever they just learned.
Well I guess that explains it. Though I'd think you wouldn't hear about theories, decidability, etc. until much later in a CS degree.
>>
>>58444997
>>58444438
attention highschooler:
I already answered your quesiton, see:

>>58445064
>>58445049

you can go to bed now
>>
>>58445064
>>58445049
In Python it should be okay to use such thing.
However, I changed line in second for to line1. And still nothing.
>>
>>58445027
HoTT is a machine that computes whether an expression inhabits a type.

HoTT : (Term, Term) -> Bool

It doesn't matter how much you wank. Either some propositions cannot be encoded as HoTT (x,y) or else you will run into infinite loops with some expressions.

There is no theory of everything for mathematics.
>>
>>58442435
>>58442456
>>58443627

for i in range(1,101):print("FizzBuzz"[i*i%3*4:8--i**4%5] or i)


It aint a dpt until someone posts Fizzbuzz of the Christ
>>
>>58445025
a music player

it gets music by searching in a couple of different sources (i have only implemented youtube so far)

first I embed youtube's search function in the program, then after you add a selected song to the queue, I fetch info about it and parse it to extract a url to pure audio

then I'll implement playing sound and there we go
>>
File: namespace.png (8KB, 291x540px) Image search: [Google]
namespace.png
8KB, 291x540px
>>58445106
>its ok to resuse namespace in python
No, its not.
>>
File: index.jpg (7KB, 203x248px) Image search: [Google]
index.jpg
7KB, 203x248px
Can you guys give me some ideas for an app?

i'm the idea guy in my team, and since i earn a lot more than the programmers, i have to do a good job.

thanks
>>
>>58445100
May I ask you how did you get those dots in the begining of each line? This is IDLE, right?
I'll tweak my code tomorrow, but I want those dots.
>>
>>58445133
>first I embed youtube's search function in the program

but did you wrote it, or you got it from somewhere else (API ?
>>
>>58445151
a no-fap calendar
>>
>>58444438
Dumb Pajeet... the idea of Python is being easy to read.
>>
>>58445166
its the terminal, console

every time you press tab, it appears those dots

you can't do that in a real program, though
>>
>>58445173
i do an ajax request to the following link:

https://www.googleapis.com/youtube/v3/search?part=id,snippet&maxResults=50&q=

you add search terms after q=, and then also an api key

the api returns a json list of search results
>>
>>58445166
Checked.
Also, that was python running in a linux terminal shell.

Its different than idle (which is actually what I normally use for python devel)

But I have no idea if windows has anything like it or not. I just know its a Linux python interpreter thing
>>
File: 111.jpg (89KB, 600x699px) Image search: [Google]
111.jpg
89KB, 600x699px
>>58445207
top kek

good to know
>>
>>58443293
Does this make sense?
{-#LANGUAGE GADTs #-}
module Path where

data Equal a b where
Refl :: Equal a a
Path :: Equal p q -> Equal q z -> Equal p z

instance Show (Equal a b) where
show Refl = "Refl"
show (Path x y) = "Path (" ++ show x ++ ") (" ++ show y ++ ")"

data Circle where
Circle :: Equal a a -> Circle
instance Show Circle where
show (Circle x) = "Circle (" ++ show x ++ ")"
>>
File: GIF.gif (114KB, 491x245px) Image search: [Google]
GIF.gif
114KB, 491x245px
>>58444964
This is what happens when I try async, shit is slow
>>
Is there some place I can get free PHP hosting for a long ass time or for life? something kinda like https://www.openshift.com/, Nodejistsu, Modulus, Heroku etc

Doesn't need MySQL, just pure PHP
>>
>>58445240
No, not at all.
>>
>>58445306

Just host on your own computer.
>>
>>58445358
Can i store data on my computer?
>>
>>58445275
Oh that's cause JS doesn't have threads
Just make it so it only runs N request at a time, and then try different N until you find out which is the most effective
>>
File: 1358641580639.jpg (44KB, 500x556px) Image search: [Google]
1358641580639.jpg
44KB, 500x556px
>>58445436
>Can i store data on my computer?
>>
>>58445436
No you need a SERVER to store data.
IMost people don't know it stands for Specialized Echo Retrieval and Verification Entity Requester. Only a SERVER can store pure data.
>>
>>58445436
No, this was made illegal with the Patriot Act.
>>
>>58445436
Why is it that /g/ is the most tech illiterate of all boards?
>>
>>58445558
it's not just /g/
gen Z is old enough to post here now (as underage b&) and they're more tech illiterate than their parents
>>
Am I a meme, /dpt/?
>>
File: Screenshot_20170111-221910.jpg (194KB, 1420x651px) Image search: [Google]
Screenshot_20170111-221910.jpg
194KB, 1420x651px
bae
>>
I'm trying to populated an array of integers but this shit is not working at runtime, the value is always [0].

private uint[] framePixels;

private void randomShit(){
framePixels = new uint[_mediaPlayer.NaturalVideoWidth * _mediaPlayer.NaturalVideoHeight];
}


However, while debugging if I put a breakpoint right when the value is being assigned to framePixels and then resume the application, everything works fine and all the uints are assigned to the array correctly.
I'm probably missing obvious but I don't know.
>>
>>58445916
Am I supposed to know who this is and be impressed?
>>
>>58445812
class Meme m where
isMeme :: m -> Boolean

main = print $ isMeme you
--> True
>>
>>58445436
what is wrong with you?
>>
>>58445956
Multithreading problems?
>>
>>58445956
>the value is always [0].
what does this mean?
>>
>>58445583
Yup. The most proficient is probably gen X and one before, or more precisely, those people who were fortunate enough to get computers when they were kids back then. Technology was basically growing up with them. Similar thing with electronics and baby boomers happened before.
>>
>>58445980
That was it, thanks a lot man.
Instead a creating a proper thread, I just put the thread to sleep for 200 ms and it worked
Thread.Sleep(200);
>>
>>58443450
>>58443504
which repositories do you contribute to? Do you do minor changes for stats, or actually contribute to large, complex repositories?
>>
Traceback (most recent call last):
File "./pysdrplot.py", line 38, in <module>
ax.coords[0].set_major_formatter(mhz_fmt)
File "/usr/local/lib/python2.7/dist-packages/astropy/visualization/wcsaxes/coordinate_helpers.py", line 202, in set_major_formatter
raise NotImplementedError() # figure out how to swap out formatter
NotImplementedError

what the shit is this fuck
>>
I feel like I'm having a brain fart. I'm having a stream input into a list, and, when that list reaches 1,000 I would like to shutdown the stream.

How do I do this, without just waiting an indeterminate amount of seconds and praying I reach 1000?

 twitterStream.addListener(listener);
twitterStream.sample();
while(collection.size() < 1000)
{
//what
}
for(int i = collection.size()-1; i > 0; i--)
{
Status status = collection.get(i);
System.out.println(i + " " + status.getText());
}
return collection;
>>
>>58446180
Whoops, meant

twitterStream.sample();
while(collection.size() < 1000)
{
//what
}
twitterStream.shutdown();
for(int i = collection.size()-1; i > 0; i--)
{
Status status = collection.get(i);
System.out.println(i + " " + status.getText());
}
return collection;
>>
>>58446195
while you haven't reached size 1000, continue;
>>
>>58446180
>How do I do this, without just waiting an indeterminate amount of seconds and praying I reach 1000?

What are you asking?
Do you want it to time out if 1000 isnt reached in a certain length of time?
explain maybe I can assist
>>
>>58444924
the first actual project in this thread. Bunch of ninnies arguing about languages and beginners asking what language to get into.

That looks nice anon, thank you for posting.
>>
File: 1469205835979.png (50KB, 491x585px) Image search: [Google]
1469205835979.png
50KB, 491x585px
>>58445436
>>
>>58443938
where the fuck is 15
do you want a job or to be laughed at on the internet?

if(i % 15 == 0)
FIZZBUZZ
>>
>>58446300
not him, but all he needs to do is change the elseif to just an else that way 15 can enter both i%3 == 0 and i%5==0 if statements
>>
>>58444444
I quit programming because of this post.
>>
>>58446223
I didn't run the code until after I had posted it - it looked weird to me to have an empty while loop. However, it does functionally work (Waits til the list is at 1000, then stops stream)

Is it considered a bad practice to have empty while loops for this kind of thing?
>>
File: disgusting.png (101KB, 257x353px) Image search: [Google]
disgusting.png
101KB, 257x353px
I won't program because Visual Studio demands I restart after installing its typescript module.

Fuck that, I'm not restarting my computer so I guess I'm not programming.
>>
>>58445583
Understandable. A computer for them is basically a magic black box that works god knows how; a contraption covered by layers of impenetrable abstraction. Compare that with a C64 which was so dead simple and accessible its just silly. Not to mention your manual came with a Basic tutorial, reference and complete schematics of your computer system served on a golden plate. And you could look inside of it anytime or even mod it a little.
Sure, kids have google today, but how the heck are they supposed to know where to start and what to look for? Advice from strangers on some random boards is pretty useless, because anyone who thinks they can just come up with some sort of a teaching plan for others up from their ass has clearly no clue about teaching. Not even teachers can help them that much, because the current culture of teaching CS just barely began to mold and shape and it has to struggle with a subject changing faster than itself.
That being said, I see a bright future in results of the recent popularity of single board computers in the past few years.
>>
>>58446393
Be quiet.
>>
>>58446376
You're obviously too retarded to program anyway.

>>>/mlp/
>>
Why does Haskell have both exceptions and errors?
>>
>>58446462
Exceptions are meant to be caught and recovered from, errors are unrecoverable
>>
>>58446393
>That being said, I see a bright future in results of the recent popularity of single board computers in the past few years.
True, but most arduino stuff is just "LEARN 2 CODE C++ IN A WEEK, HERE IMPORT A BUNCH OF LIBRARIES AND MAKE SOME BULLSHIT!"
At least the boards are being made
>>
HKTs in Rust FUCKING when.
>>
>>58446578
Never
>>
>>58446462
Undefined/error are values that every type can have (as well as infinite loops). They're propagated by the reduction rules of the language normally, which means if they're never used due to laziness you won't end up with an error.

Exceptions are effectful.
>>
>>58446551
That's one side of it, but the other is that plenty of them eventually tries to design something around a bare uC by themselves.
>>
>>58446578

What do you want to do in Rust that requires Higher Kinded Types?
>>
>>58447008

HKTs are nice in general.
>>
Image segmenter. Takes a photo of written letters, numbers, etc on a piece of paper, segments into individual characters.

Using C++ BTW.
>>
Alright anons, I'm going to implement that toy VM language + VM and write a game for it, as per that programming exercise image that keeps going around. Which language should I do it in?

C:
Pros: Feels low-level, fast
Cons: Reimplementing a crapton of stuff

Java:
Pros: Quick to write, loads of features
Cons: Verbose as fuck, clunky

C++:
Pros: Lots of features, low-level enough
Cons: Bloated, less comfortable to me than C
>>
>>58447307
Do the actual VM in C. I'm doing one in D, but I'm not finding myself using anything that C can't do (with the exception of some generic functions)
>>
>>58447307

C#:
- flexible
- no bullshit
>>
>>58447326
Think that's what I'm gonna do.

>>58447344
Cons: I don't know C#.
>>
File: segg.jpg (279KB, 1733x768px) Image search: [Google]
segg.jpg
279KB, 1733x768px
>>58447299

Pic related. You can see the final "4" has been cut out of the image (along with the others if you scroll up).
>>
CS student here.

My prof completely banned for loops (we're working with python).
Is this a good practice? How should I feel about this?
>>
>>58447416
For the whole semester? Because that's retarded
>>
>>58447416
Is it a functional programming class?
>>
>>58447416
just use while loops
for loops are just a specialized version of a while loop.
if he bans those too, you can always use goto constructs.
or if you're really autistic, you could write everything as a recursive function.

programming without any iterative constructs is shooting yourself in the foot for no reason.
>>
>>58447416
>My prof completely banned for loops

That's weird. I'd say that is -- by far -- the most common way of looping.
>>
>>58447344

C# - decent language

.NET - holy shit, everythig but the kitchen sink and generally laid out terribly

WinForms - pretty much abandoned

WPF - holy shit WTF is going on, also hilarious inconsistencies (e.g. some items use "Content", others use "Text", IsVisible is read-only but IsSomethingElse is often a function).

UWP - oh my holy fucking God, what is going on.

I want to like C#, but it seems like all the stacks C# uses are horror shows.
>>
>>58447425
yes
>>58447461
its a data structures class
>>58447467
>just use while loops
yeah but for most cases for loops are more appropriate
>>
>>58447409

Anon, why are you passing a vector<vector<int>> by value?

>>58447416

It is generally considered good practice to use for loops. Unless your professor is trying to teach alternative iteration methods, there isn't much reason to avoid them.
>>
>>58447528
for (int i = 0; i < 10; i++)
can be rewritten as
int i = 0;
while (i < 10)
{
/* ~~ */
i++;
}
>>
File: Screenshot - 120117 - 17:06:44.png (20KB, 552x100px) Image search: [Google]
Screenshot - 120117 - 17:06:44.png
20KB, 552x100px
So I'm trying to get this loop to print the data with its corresponding name, but I'm sure you can all see that it doesn't work as it is. I have no idea how to make this work. Any ideas bois?
>>
File: abstract_fizzbuzzbazz.png (120KB, 947x564px) Image search: [Google]
abstract_fizzbuzzbazz.png
120KB, 947x564px
>>58444210
>>58444409

We mostly decide on projects here using this: https://matijasi.github.io/Procedural-Project-Generator/
The anon who made it is practically retarded though, so ignore most of the options you don't like.

>>58444582
FizzBuzz can be fun, check image.

>>58444730
Little schemer, Reasoned schemer and the other books of this series. If they fail to teach you style and algorithm design you are too stupid to program.

>>58447467
Recursion is a type of iteration too and it's surprisingly easy. Anyway most of the time you don't use it directly but through map, foldr, foldl, reduce, filter, ...
>>
>>58445956
Lower case for method names in C#.

Fucking kill yourself my man.
>>
File: usual_Abstract_fizzbuzz.png (114KB, 1135x581px) Image search: [Google]
usual_Abstract_fizzbuzz.png
114KB, 1135x581px
>>58447590
it can actually even pretend to be usual fizzbuzz
>>
>>58447528

>it's a data structures class
Okay. You're probably going to be using a lot of data structures that make the most sense to traverse recursively... at least if you're being intuitive about it.
>>
>>58447481
>the most common way of looping
nah, plenty of people (me included) use while loops exclusively.
>>
What's the most anime-like language?
>>
>>58447636
what kind of stupid question is this?
>>
>>58447632
>people
>me
What did he mean by this?
>>
>>58447632
[citation needed]
>>
>>58447649
It just feels more natural.
>>58447636
any language in which you can make your dreams come true
>>
File: 1426170977317.jpg (12KB, 250x250px) Image search: [Google]
1426170977317.jpg
12KB, 250x250px
>tfw no bro programmer to help me with my project
>tfw we can't discuss engineering design/decisions and colloborate
>tfw doing so much work all alone
Well, I haven't much farther to go at least.

>too paranoid someone will steal my idea anyways
>>
>>58447636

Ruby. It was made in Japan and was designed to unsurprising.

irb(main):001:0> [].methods.sort
=> [:!, :!=, :!~, :&, :*, :+, :-, :<<, :<=>, :==, :===, :=~, :[], :[]=, :__id__, :__send__, :all?, :any?, :assoc, :at, :bsearch, :bsearch_index, :chunk, :chunk_while, :class, :clear, :clone, :collect, :collect!, :collect_concat, :combination, :compact, :compact!, :concat, :count, :cycle, :define_singleton_method, :delete, :delete_at, :delete_if, :detect, :dig, :display, :drop, :drop_while, :dup, :each, :each_cons, :each_entry, :each_index, :each_slice, :each_with_index, :each_with_object, :empty?, :entries, :enum_for, :eql?, :equal?, :extend, :fetch, :fill, :find, :find_all, :find_index, :first, :flat_map, :flatten, :flatten!, :freeze, :frozen?, :grep, :grep_v, :group_by, :hash, :include?, :index, :inject, :insert, :inspect, :instance_eval, :instance_exec, :instance_of?, :instance_variable_defined?, :instance_variable_get, :instance_variable_set, :instance_variables, :is_a?, :itself, :join, :keep_if, :kind_of?, :last, :lazy, :length, :map, :map!, :max, :max_by, :member?, :method, :methods, :min, :min_by, :minmax, :minmax_by, :nil?, :none?, :object_id, :one?, :pack, :partition, :permutation, :pop, :private_methods, :product, :protected_methods, :public_method, :public_methods, :public_send, :push, :rassoc, :reduce, :reject, :reject!, :remove_instance_variable, :repeated_combination, :repeated_permutation, :replace, :respond_to?, :reverse, :reverse!, :reverse_each, :rindex, :rotate, :rotate!, :sample, :select, :select!, :send, :shift, :shuffle, :shuffle!, :singleton_class, :singleton_method, :singleton_methods, :size, :slice, :slice!, :slice_after, :slice_before, :slice_when, :sort, :sort!, :sort_by, :sort_by!, :taint, :tainted?, :take, :take_while, :tap, :to_a, :to_ary, :to_enum, :to_h, :to_s, :transpose, :trust, :uniq, :uniq!, :unshift, :untaint, :untrust, :untrusted?, :values_at, :zip, :|]
>>
>>58447636
Lisp desu
>>
>>58447642
Do you see a question mark at the end of my sentence?
>>
File: doubtful.png (90KB, 667x378px) Image search: [Google]
doubtful.png
90KB, 667x378px
>>58447528
>yeah but for most cases for loops are more appropriate
>>
>>58443173
working on putting a C library converted to javascript to work in the browser (converted via emscripten)

It doesn't happen automatically, but you can get some cool scenarios, like there is a "in memory filesystem" you can access, etc.
>>
>>58447675
Damn, haven't written in ruby for years. I really liked that language. Shame I can't find any excuse to use it more.
>>
>>58447590
>We mostly decide on projects here using this: https://matijasi.github.io/Procedural-Project-Generator/
>"Make a bootloader with human like ai in Common Lisp using imperative programming."
wat
>>
>>58447542

>Anon, why are you passing a vector<vector<int>> by value?

Should I know what you mean by this? I started using C++ only a couple of months ago.

Is there a way to "rename" vector<vector<int> > to something else? By God it takes up so much space. If I could define "vecvec" to mean vector<vector<int>>, it'd make my life so much easier.
>>
>>58447711
Just use it for scripts.

>>58447741
In C++, an argument can be passed to a function by value, whereby it is copied to the new function, or by reference, whereby it is more or less passed by a pointer under the hood. Pass by value is ideal for primitives, like int or double, which you do not want to mutate in any way. Pass by reference is ideal for anything that you want to mutate, or anything that is particularly big, and would take a while to copy. If you want to pass something by reference to avoid copying, but you also want to signify that it will not be mutated by the function, you would use a const reference.

An example of all of these, plus an answer to your question:

typedef vector<vector<int>> vecvec;

// This performs a deep copy of the original vector
// Essentially, memory is allocated for a new vector from scratch
// Then it is filled with new vectors that are also created from scratch
// Then each of those sub vectors is filled with ints that are copies of the ints in the original vectors.
// The result is two vecvecs in memory simultaneously, for only the duration of the function.
void foo(vecvec v);

// This creates a reference to the original vector
// Nothing is copied, and any changes to v are reflected back in the original vector.
void bar(vecvec& v);

// This creates a const reference to the original vector
// Nothing is copied, and any method that would mutate the vector causes a compiler error.
void baz(const vecvec& v);
>>
>>58447741
Google what it means to pass arguments to a function by:
a) value
b) pointer
c) reference

>Is there a way to "rename" vector<vector<int> > to something else?
Google "typedef"
>>
>>58447829
...or just read what Ruby wrote
>>
>>58447829
>>58447846
Beat you to the punch, Anon. ;^)
>>
why is android developer studio so fucking based?
>>
>>58447854
how so?
can i use it as a substiture for eclipse even if i don't do android projects?
>>
File: 604.jpg (17KB, 236x305px) Image search: [Google]
604.jpg
17KB, 236x305px
>>58447852
>>
>>58444333
>take something that bothers me and try to do it better than the existing solutions
Usually this.
I also hate 'bloated' apps, so I just make my own applications, and it's fun.

I just finished writing a simple program that converts PNGs to ICOs. It bothered that neither photoshop or paint natively support saving to .ico and it didn't even take me 30 minutes to make this program. There are tons of sites/programs that already do this, but I don't like to rely on them.
>>
>>58447874
its built on intelliJ so most likely

also why are you using eclipse when you can use intelliJ pajeet?
>>
>>58447906
>>58444333
>take something that bothers me and try to do it better than the existing solutions
>I just make my own applications, and it's fun.
Yeah, I can't even count the amount of web porn scrappers I wrote
>>
>>58447951
I.. I don't have the paid version ;(
>>
>>58447961
sucks to be you then

I have the student license still despite not being in school for 4 years now
>>
hi anons, i have a game server on python, im currently passing it to ctypes cause slow

but

i just figured, is linux faster than python? ( i think not cause ram) i mean, say instead of loading a bunch of classes and shit i just created temporary folders with data in it and used C programs to asses shit like "can USER move there?" "can USER attack there?" "how much DAMAGE did it make" etc?

would it be faster? like, operating in linux instead of operating withing python?

Or am i just being retarded?
>>
>>58444210
I need an idea for my first project in C++. I don't know what. Someone help me.
>>
command line tool to timebox/track my own time better
> 2017, for me, is a year I want to learn quite a few things...

API connected is in Ruby (personal app) because its easy to prototype. Probably will re-write it once its at a good point to Go.

thinking about just a bash script for the cli
>>
>>58447823

Interesting, thanks for the tip. Most of my functions only need reference to the original vector.
>>
>>58444210
i mostly just program annoying bots for social media services and have self-indulgent laughs at normies for a while, then i remember im a virgin
>>
you wouldn't program a dinosaur
>>
>>58448079
why wouldn't i?
>>
>>58444210
I program starcraft AIs.
Lots of challenges here. Architecture, AI, resource management, data structures, optimizations (need to do as much as you can for <2ms per frame)
>>
>>58448024
dragon dildo randomizer
>>
>>58448039
nice man i was trying to do the same, try using twitter for buggering you on your phone, if not you are gonna forget opening the program
>>
>>58448023
nigger what?
>>
Name my toy virtual machine language for the programming exercise.
>>
>>58448139
Virtual Memechine
>>
>>58448128
well... i do a fair bit of programming already
> web dev scrub programmer

i have a terminal open most days personally so it _should_ be ok

harder will be timeboxing things like "learn to sail"
>>
>>58448131
request comes in saying "walk left", instead of holding a world object and passing a function, i execute a c program in a temporary directory with some text files representing the world and the c program returns true or false depending if you can walk left or not

i want to know if this would be faster or is just fucking retarded

i could also use grep for finding stuff fast and shit like that

like the server is the linux distro itself instead of a program running on it
>>
>>58448128
oh and related to the phone... give me a chance to make an Android thing i guess
>>
>>58448146
I like it.
>>
File: cute anime pic 0492.jpg (39KB, 374x347px) Image search: [Google]
cute anime pic 0492.jpg
39KB, 374x347px
>>58448023
>>
>>58448147
>>58448157
i hear you, but believe me, you will procrastinate the fuck out of opening, you just need to create an account, set it private, grab the UID and imitate the HTTP request for posting while @yournormalaccount

then you can have your program interact with your phone wherever you are without needing to open up your router to external connections
>>
>>58448169
oh my zsh
>>
File: STOPMAKINGFUNOFME.jpg (98KB, 537x519px) Image search: [Google]
STOPMAKINGFUNOFME.jpg
98KB, 537x519px
>>58448170
>>
>>58448024
A turn based simulation similar to the "game of life" on a grid, but extended, where you have resources like water, plants and animals (herbivore, carnivore), reproduction and whatever comes to your mind. Maybe different species? Weather? Non-random movement? Day and night time? Height maps? Be creative, but don't take too much onto yourself. Do it in OO paradigm and then try to gradually extend your design by implementing new ideas.
Try to find such initial conditions in which your environment is balanced (e.g. so the predators won't eat all of their prays and die of hunger).
The level of difficulty of this task depends solely on you.
>>
>>58448178
You are correct. I am using oh my zsh.
>>
best programming language for deep web
>>
>>58448236
HolyC. It will serve you as a light in the darkness.
>>
>>58448236
visual basic
>>
>>58448236
D is great for penetrating deep
>>
NEW THREAD!

>>58448304
>>
>>58448023

>is linux faster than python?
Linux is a kernel for a family of operating systems.
Python is a programming language.

These do completely different things, and you can't really compare them.

>i mean, say instead of loading a bunch of classes and shit i just created temporary folders with data in it and used C programs to asses shit like "can USER move there?" "can USER attack there?" "how much DAMAGE did it make" etc?
You want to use file I/O to somehow mimic Python classes?
>>
CS dropout returning to school in a little while

I am currently a neet and have some time I could work on learning things, what online courses/websites are good? I'm already good to okay at Java, Python, Shell. Maybe I sink all my time into becoming better at C/C++? PHP?
>>
File: tumblr_inline_myylyrooGk1qmoaae.png (302KB, 500x495px) Image search: [Google]
tumblr_inline_myylyrooGk1qmoaae.png
302KB, 500x495px
>>58444444
>>
>>58448762
http://www.cplusplus.com/doc/tutorial/
for cpp

http://www.learnprolognow.org/lpnpage.php?pageid=online
if you want to pick up a logical language
>>
>>58444444
Fuck you
Thread posts: 339
Thread images: 49


[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.