[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 29
File: 1456075074460.jpg (60 KB, 627x627) Image search: [Google]
1456075074460.jpg
60 KB, 627x627
https://www.youtube.com/watch?v=ayojl7Op37A

CAN'T BARRAGE THE FARAGE

Previous thread: >>55315129

What are you working on, /g/?
>>
Why do you have to force your /pol/ shit onto /dpt/?
>>
Why isn't compiling a 32 bit program as 64 bit just a straight performance win every single time?

Shouldn't the compiler be able to use all the new registers to great effect? It seems like usually the difference is only 1-2%.
>>
>>55326169
64 bit is a meme
>>
>>55326182
Fuck you. You're the reason my fucking Linux distribution requires four gigabytes of mostly redundant 32 bit libraries just so my fucking Nvidia driver can operate.
>>
>>55326123
working on this shit
https://github.com/RubenRocha/ftpscout
>>
>>55326212
>linux
lol
>>
File: 1461289400938.png (1 MB, 1366x768) Image search: [Google]
1461289400938.png
1 MB, 1366x768
>>55326123
>write up QMC simulation code in Mathematica
>let it run as I leave to spend 2 nights at a friend's house
>come back
>computer has restarted
>none of the results were saved (if the code even terminated at all)
How have you been cucked by your code today, /g/?
>>
Writing a discord bot in node.
>>
File: exploits_of_a_mom.jpg (68 KB, 345x410) Image search: [Google]
exploits_of_a_mom.jpg
68 KB, 345x410
>>55326072

Anyone?
>>
>>55326265
>>>/g/wdg
>>
>>55326239
>Training neural net while I visit family
>Come back and my computer is running Windows 10
FUCK YOU MICROSOFT
>>
I got a good answer in the previous thread, but I'll ask again in case anyone can think of more ideas.

How do I create a dictionary of synonyms that is efficient in terms of retrieving synonyms of a word?

Basically, I want to use some sorts of data storage to store groups of words, and enable an end-user to request any word and be prompted with all the other words in its group (its synonyms). Afterwards, I want to be able to add spelling corrections, suggestions, and relevancy ranking (using edit distance for example).

Also, some groups may contain the same word, so I would like to return both groups separately.

Any ideas how to get there? Any particular database, data structures, concepts, etc. that could help?
>>
File: akari3.jpg (92 KB, 912x576) Image search: [Google]
akari3.jpg
92 KB, 912x576
Rate my anonymous git hosting site!
http://tempgit.mooo.com/

Now you can make your own repos!
And you can push to any repo you want, no authentication needed!
>>
>>55326123
Remember to license your work in licenses like BSD or MIT. GPL is cuckoldry.
>>
>>55326606
>Build hash map from dictionary
>Each entry points to a struct with a vector of pointers to synonyms
Literally baby's first programming assignment
>>
>>55326636
You should lint every submission and if it's invalid, do not accept
>>
>>55326636
What's with the domain?
>>
>>55326687
it's free!
>>
>>55326637
No, fuck you. Public domain is the only non-shit option.
>>
>>55326151
Because the don is going to save america. He won't ever use beta cuck languages like GPL, he only would use alpha languages. Trump will make /g/ great again.
>>
>>55326841
Will Trump ban all the trapfags and gays? That's the only way to make /g/ great again.
>>
>>55326887
Trump will make it legal to kill them. He'll also execute communists like (((Richard Stallman)))
>>
>>55326887
But anon, you're not a real programmer if you're not into traps, everyone knows this already!
>>
>>55326841
>beta cuck languages like GPL

day1: average pol shitlord finds out about /g/
>>
>>55326887
being into traps is not gay tho
>>
>>55326841
kek
>>
Anyone here have experience working with reportlab?

I want to "group" the following together:

Paragraph
Table
Paragraph
Paragraph

so that it stays on the same page and won't split at the end of the page, instead taking the whole chunk to a new page.

KeepTogether doesn't work since it just puts each chunk on a separate page.
>>
>>55326917
stay delusional

>>55326950
stay delusional
>>
>>55326841
>>>/pol/
go home to your containment board
>>
>>55327025
>Trump will be president
stay delusional
>>
>>55326227
>>>/v/
>>
>>55327049
>Brexit won't happen
stay delusional
>>
File: 1465861778860.jpg (10 KB, 224x224) Image search: [Google]
1465861778860.jpg
10 KB, 224x224
>>55327030
Yeah, sure thing kid. Shillary or Gary will be president.
>>
>>55327049
If Brexit can happen, anything can famiglia
>>
>>55327030
Triggered SJW detected, stop being such an oversensitive retard
>>
Why are engineers and scientists so bad at explaining things in simple terms?
>>
Decided to use Kruskals algorithm as a basis for a more complicated procedural graphics generation. Gonna use spanning tree produced to control several different parameters in the generation algorithm.

Obviously try to check what the "maze" looks like from the starter code I hashed together.

>Complete shit
>Loops everywhere
>Cells not even joined to the maze
>Obviously not a spanning tree

No idea exactly how I'm being completely cucked by my own brain but it sure feels bad to fail at something so simple.
>>
>>55327449
because most things that need to be explained aren't simple
>>
>>55327449

Stems from the basis that what they find simple, you do not.

Same thing happens when you try to explain pokemon to your labrador.
>>
>>55327480
My Labrador doesn't try to learn about Pokemon. I just say shit and it listens, the words mean nothing without association. I actually really want to learn this shit but people keep going round in circles and tripping over words and throwing out new terms without ensuring I know what they mean.
>>
>>55327498
What are you trying to learn?
>>
File: 2016-06-29b-HentaiWindow.png (2 MB, 1600x870) Image search: [Google]
2016-06-29b-HentaiWindow.png
2 MB, 1600x870
getting some of the hentai webapp parts up. Creating a pseudo-window to hold interactions and images.

I'm tired though. Might call it a day for now.
or at least take a nap
>still gotta translate buttons
>still gotta create the AI-type kinda portion of the system and the RNG mood-o-meter.
>>
>>55327516
https://www.youtube.com/watch?v=Qupqu1xe7Io
This.

It started okay but I'm halfway through and he is just going around in circles and not really explaining anything.
>>
>>55327498
Essentially if you actually want to learn science and/or engineering you need to start with the basics and move upwards. There are actually specific things you should learn first before you try and get into anything actually interesting or you'll have a house with no foundations.

Don't let this dissuade you though. When you have good fundamentals, understanding the rest becomes easy.
>>
>>55327528
also, obv the buttons don't do anything. Except the red minimize button. That closes the pseudo-window.

So, I'll have to use that once I get the AI-ish interaction system up
>>
>>55327535
did you read the original paper? life ain't easy little man.
>>
>>55327535
>wants to learn something at the 3-4th year level
>gets mad that someone who's spoonfeeding him information assumes some prior knwoledge
Are you a fucking high school dropout?
>>
>>55327584
>>55327605
I don't want to learn all this shit from the ground up, I just want this one fucking algorithm so I can be done with this forever. Not everyone is a mega autist that is willing to learn math in its entirety just for one or two things.
>>
>>55326887
but trump's biggest supporter is a homo
>>
>>55327550
I'm getting a boner already
>>
>>55327633
Nope. This amount of basic geometry would only take a normal person a week to learn. The fact that you're being so adamant and stubborn about this shows how much of a brainlet you are.
>>
>>55327633
your attitude isn't very conducive to learning or production, maybe you should consider a different career.

http://vec3.ca/gjk/implementation/
>>
>>55327535
he's fucking great at explaining it you fucking retard and he's not a math/science guy he's a programmer. what is it exactly that you're struggling with?
>>
>>55326123
What's the best resources for starting out in C++ when you already know the basics of programming? (did some java and I know python)

I'm looking for something like "the C programming language" with all the bullshit left out that you'd already know from knowing programming basics and just an introduction to the language. Shouldn't be more than 300-400 pages long.
>>
>>55327662
>>55327665
I disagree with your assessment.

>>55327680
Maybe the part where he spent ten fucking minutes explaining shit and then went "so yeah that's retarded don't do that".
>>
>>55327633
if you don't know these basic things like vectors and dot products and refuse to learn them you should just kill yourself, stop being such a smug entitled prick
>>
>>55327692
>I disagree with your assessment.
Literally doesn't matter if you disagree with facts.
>>
>>55326123
schulz is so based.
it's a bit laughable that farage wants to get rid of the EU but still enjoy all the trade benefits of the EU (even if he claims that it'd hurt the EU more - he still wants to keep those deals for the UK's sake, not for the EU's sake, and if he isn't stupid then he knows that hurting the EU means hurting the UK as well, even without being in the EU).
>>
 A[I]←1+I←(0⍷A)/⍳⍴A←('FizzBuzz' 'Fizz’ 'Buzz' 0)[2⊥¨×(⊂3 5)|¨1+⍳100] 
>>
>>55327692
if you are this retarded and suck at math and programming this bad you probably shouldn't be trying to roll your own collision detection
>>
>>55327708
you CAN do trade without being a member of the EU you FUCKING RETARD
>>
>>55327708
Back to /pol/ with you.

>>55327716
I am self taught, clearly there are going to be huge fucking gaps in the things I know.
>>
>>55327744
if you were really self taught you'd be able to teach yourself these really basic math concepts without being such a whiny bitch about it
>>
>>55327760
It sounds like you don't really have a solution so you are just resorting to attacking my character in the hopes that I won't bring it up any more, thus allowing you to save face. I'm not going to do that though.
>>
File: 1464031968041.jpg (890 KB, 2272x1704) Image search: [Google]
1464031968041.jpg
890 KB, 2272x1704
>>55327782
>>
>>55327782
the solution is to either:
>learn the prerequisites
>give up

fucking mong
>>
>>55327744
You're not "self-taught". You're "monkey-see monkey-do".
>>55327782
The solution is to actually learn the concepts from scratch you stupid idiot.
>>
>>55327802
>>55327803
>>55327804
There's not need to get angry just because you can't explain it properly. Not everyone can be Carl Sagan.
>>
>>55327782
I'm not the same dude but you really need to deal with the fact that being good at maths is essential to being good at programming. If you can't be bothered then just rip someone else's code off github and enjoy your frankenstein code.
>>
>>55327835
he's explaining it fucking properly, you're the one who can't grasp it or ask questions properly
>>
was reading "Modern C" by Jens Gustedt, and in one part he says "any true C programmer can implement any library function on their own" or something like that, and then as an exercise tells the reader to implement strtod (takes a C string, converts to a double value).

I consider myself an alright C programmer, I've been doing it for years on and off through school, and I have no clue how to implement this completely and now I feel like a damn noob.
>>
>>55327835
>hurr all concepts can be reduced to bite-sized chunks of primitive information
>j-just watch Cosmos
>it's your fault that I'm a fucking retard!
This is how you sound like right now.
>>
>>55327801
Pretty sure it just blows your 480 and MOBO to smithereens.
>>
>>55327835
>Not everyone can be Carl Sagan.
you think carl sagan just watched a youtube video and then instantly knew everything? you don't think he put in the effort to actually learn things?
>>
>>55327846
He's not explaining it properly though. He's fuddling around and going round in circles.

>>55327865
All information can be reduced to bite size chunks though. That is what Mathematics was founded on.

>>55327879
What does that have to do with his ability to explain things in simple terms?
>>
>>55327901
you're just being a whiny bitch. what you are doing is not solving anything.
>>
File: image.jpg (43 KB, 615x409) Image search: [Google]
image.jpg
43 KB, 615x409
I cant even do Java in codeacademy.

I need to start really basic. Anyone got any advice? I cant understand this shit, im a creative writing major.
>>
>>55327901
>All information can be reduced to bite size chunks though. That is what Mathematics was founded on.
It isn't. You're seriously clinically retarded if you think this.
>>
>>55327919
>codeacademy
nice meme

https://docs.oracle.com/javase/tutorial/

and the daniel lang book
>>
>>55327910
Sure it is. Open dialogue is how we move forward as a species.

>>55327921
I disagree with your opinion.
>>
>>55327849
Here's an atoi I wrote once, it's the same principle.
This is trivial as fuck, you're just stupid.
int atoi(const char *nptr)
{
size_t len = strlen(nptr);
int total = 0;
int j = 0;
int i;
for (i = len - 1; i >= 0; i--)
{
if (nptr[i] >= '0' && nptr[i] <= '9')
total += (nptr[i] - '0') * pow(10, j++);
else
break;
}
if (nptr[0] == '-')
return -total;
else
return total;
}
>>
>>55327919
Do HTML5
>>
>>55327943
>I disagree with your opinion.
It literally does not matter that you disagree with facts.
>>
>>55327742
of course you can, but while in the EU you're enjoying all of these benefits simply by being in the EU, in return countries give part of their national sovereignity to a larger parlamentary democracy.
leaving the EU and wanting to keep the benefits means taking the benefits without giving national sovereignity to the EU (which, on the positive side, may even be required to properly establish said benefits).
the EU has clearly caused a lot of bullshit over the years, but i don't think we'd be better off if every country was completly independent again (why stop at the EU? why not get rid of the NATO, the OECD, the UN? why not change back to city states?).
the advantage is better communication at the organization level and arguably also better control, the disadvantage is obviously the entire thing becoming a lot more complex and harder to manage, more interdependencies resulting in quicker spread of global problems and also less control at a local level.

>>55327901
if that youtube video explained everything you'd need to know then it'd be way too long and boring for its intended target audience.
>>
>>55327943
>hurr i can't understand poo poo head's explanation
nice dialogue tard

his explanation is perfectly fine. you're just refusing to learn really simple and basic math. and you have to realize that GJK isn't the simplest thing in the world, maybe you're just not cut out to do things like that, stupid kid.
>>
>>55326169

Efficient register allocation is NP-hard, Anon.
>>
>>55327962
What we really need is city-states and for the human population to be nuked back to 500,000 people.
>>
>>55327956
An opinion isn't a fact silly. Are you in elementary school? That is one of the first things you learn.

>>55327962
It wouldn't if he explained it properly and in a structured format..

>>55327981
>If I green meemee text and reduce his comments to baby babble that will kill his credibility and I will win the internet argument!
>>
>>55328001
i would literally punch you in the face if you were in front of me.
>>
>>55327997
if we nuked the population back to 500,000 people and our technology back to the dark ages then i'd agree with you, city states would be a lot more appropriate at that level than any large state or international organization, simply because there'd be no need to discuss and solve international problems, because there are none.
>>
>>55328009
And I would let you, because that is not how I, as a civilised human being resolve things.
>>
>>55328001
Reading this reply chain reminds me that there are stupid people in the world and that makes me feel very much better about myself.

Thanks Anon, enjoy learning how to program without learning how to do maths.
>>
>>55327919
Sounds like it might be too much for you. Try something much easier, like Javascript or Ruby on Rails. I sense a web developer in the making.
>>
>>55328001
>An opinion isn't a fact silly
It wasn't an opinion though. I'm a grad student in TQFT and I've been through more mathematical training than every single one of your ancestors combined. Feel free to ask me anything about Top and geometric quantization.
Seeing as how you being a fucking complete retard is the consensus in this thread I'd say that even if it were an opinion you disagreeing with it still wouldn't matter.
>>
>>55328029
the video has 22 likes, 1 dislike on youtube. it has been widely praised and recommended in the relevant communities. i have watched the entire thing and i had no problem with understanding it.

maybe you should just sleep on it and give it another try later on. you still haven't even pointed out which specific part you're stuck on, so you seem to be the one who sucks at explaining things.
>>
>>55328022
500,000 people and current technology level would be paradise no?

>assuming moderately intact infrastructure
>assuming good distribution of skilled people saved
>>
>>55328044
And yet you can't explain this apparently high school level algorithm in simple terms. Nice degree.

>>55328031
I have been thus far. I have also done quite a lot without going incredibly in depth because as I stated, there are occasionally people that know how to explain things.

>>55328072
>22 whole likes
Score.
>>
>>55328093
KILL YOURSELF I HOPE YOU GET CANCER AND DIE A SLOW PAINFUL DEATH WHILE YOU HAVE A JUNKIE NURSE THAT STEALS ALL YOUR PAIN MEDS
>>
>>55328072
holy shit good spot anon,

it's not everyday you get to identify and mock those random retards who dislike good content on youtube
>>
>>55328093
>in simple terms
It'd be simple for normal people, which the guy in the youtube vid did, but not for complete retards like you.
Go back to your local Down's research center.
>>
>>55328073
the current level of technology may cause international problems, though.
the first example that always comes to mind are nukes, considering the OECD was basically established just to deal with this issue.
>>
>>55328097
That's pretty rude anon.

>>55328110
Now you're just being elitist.
>>
>>55328043
That is actually what I'm going into.
>>
>>55327950
Except this is not implementing atoi, it's implementing strtod. Same principle yes, but a lot more to take into consideration. I actually wrote my own atoi once for a class a long time ago.

My main concern is implementing my_strtod is parsing strings with a scientific notation form of a floating point value. I'm trying to think of a nice, clean way to do it without having some god-awful 60 line beast of a function.
>>
>>55328132
which specific part are you even struggling with? or are you just going to whine that you can't understand it and not try to resolve the issue whatsoever?
>>
>>55328158
I guess the part where he starts talking about making a tetrahedron around the origin. A few more diagrams couldn't hurt.
>>
>>55328146
Find the decimal point, multiply the current digit by pow(10, j++) when going left and divide the current digit by pow(10, j--) when going right of the decimal.
>>
>>55328184
if you go back to the start where he talks about the minkowski difference, you want to check if the contains the origin.

in two dimensions, you'd be trying to find three points (which form a triangle) such that it contains the origin. if there are no such three points, then there is no overlap/collision.

in three dimensions, you're trying to find four points (which form a tetrahedron) instead of the three points (which form a triangle).
>>
>>55328146
>I actually wrote my own atoi once for a class a long time ago

I wrote one in 2 minutes.
i bet this was your final project too, right?
you're just stupid
>>
>>55326169

You barley ever get a performance boost. You most certainly will always get a precision boost.

>>> f32, f64 = np.array(1, 'f4'), np.array(1, 'f8')
>>> f32 /= 3
>>> f64 /= 3

>>> f32
>>> array(0.3333333432674408, dtype=float32)

>>> f64, f64.dtype
>>> (array(0.3333333333333333), dtype('float64'))
>>
>>55328275
also if you're struggling with how it's implemented, maybe look up line/plane collision detection tests
>>
>>55328275
Four points where the shapes intersect or four magic points that materialise from thin air or what? All I saw at the beginning was circles overlapping. How do you use the Minkowski difference to get a triangle from overlapping circles?
>>
>>55327919
Java is geared towards Software Development and therefore is filled with all kinds of annoying shit that is really meant for making software and not for learning abstract concepts.

You should instead use a language like C or python to learn how to program.
>>
Haskell or ML?
>>
>>55328326
https://en.wikipedia.org/wiki/Minkowski_addition

if you take all points from one circle and add them to all points from the other circle, you get the big circle. if the smaller circles overlap, the big circle contains the origin. the shapes don't have to be circles, it's just an example.

you use the algorithm to quickly find out whether the "big circle" contains the origin by picking points from the "big circle" to try to form a triangle (in 2d) or a tetrahedron (in 3d) around the origin.
>>
>>55328417
>add
subtract
>>
>>55326169
because the bits just give you a higher addressable space (pointers can point to 2^64 addresses) as well as larger data types. It's not some magic bullet that automatically makes your program better.

and adding on to what >>55327987 said, if you disassemble your programs you'd notice that most of the time your programs are only using like 4 or 5 registers max within subroutines anyway.
>>
>>55328304
That's great to hear man, I'm so proud of you. and actually it was one of the daily lab assignments.
>>
Is hackerrank somewhat sufficient to keep me sharp?
I'm one of those CS majors (third year, will probably stay more than 1 year, so I neeeed an internship next summer) who doesn't really program outside of classes but I'm realizing I have to. The problems on there are interesting and it seems like a good idea to spend 1-2 hours everyday doing that
>>
>>55328481
if you can do like 80% of the hackerrank problems then you are in the top 1% of programmers
>>
>>55328481
you should look to work on some bigger projects.
>>
>>55328184
I've got to be honest with you here
I watched the first ~7.5 mins of that video and it was already clear exactly how the algo was going to work
you literally don't need to watch more than that before turning off the video and writing code
>>
File: 1461528655252.png (378 KB, 1450x1080) Image search: [Google]
1461528655252.png
378 KB, 1450x1080
>>55328481
Hackerrank is a great site. There are actually problems everywhere if you look. There's a subreddit (forget the name, too lazy to look up), for daily programming challenges. Most programming language books have exercises / programming problems at the end of every chapter. Any search engine can lead to thousands of websites with project ideas and problems to solve. Did you take an algorithms class yet? Implement some algorithms, and do it in multiple languages.
>>
>>55328529
>>55328532
Thanks. I'll work on it and also find other things to do
>>
>>55328640
i just did the contest last saturday. finished only 3/7 problems putting me in the 84% percentile.

i think the problems are good for keeping a sharp mind but they are very math based and different than a typical day of coding.
>>
>>55328716
you went in at a disadvantage
you'll do a lot better once you've done a lot of problems 'cuz you'll know a lot more algos
>>
>>55328640
Wow these are interesting too, I appreciate it. Thanks again /dpt/
>>
How hard would it be to port the Vulkan driver to a non-linux/Windows OS? Like say I wanted to write a Vulkan driver for TempleOS? Isn't the driver later for Vulkan super thin?
>>
>>55328984
going to highly doubt anyone on /dpt/ is capable of answering this, but I'm going to guess it's pretty difficult, especially if you're asking this here. there are already linux drivers out, at least intel I know released them
>>
>>55328984
probably about as hard as writing an opengl driver, if not harder since it's more of an uncharted territory
>>
>>55329077
OpenGL has a massive internal state machine while Vulkan is very explicit, as I understand it
>>
>>55329249
opengl and vulkan are fairly similar, they both have state, just that opengl is more high level, like when you use any API, you're issuing high level commands, and vulkan is more like trusting the user to go "inside" the API, like instead of serving you a big mac it lets you into the kitchen so you can make your own burger
>>
>>55328355

No java is geared towards enterprise software and is therefore filled with all kinds of annoying boilerplate bullshit that is meant to make programmers despise their everyday life.

Writing java is like filling out paperwork for the federal government. That is, overly specific, tedious, repetitive, full of boilerplate text, and verbose to the point of obfuscation.
>>
>>55328355
nice meme

>>55329461
nice meme
>>
>>55329474
POO
>>
>>55329474

Well a idea without basis doesn't tend to spread in groups with experience.. Unless of course you're a scientist in which case you do everything in your power to suppress or destroy any theory or evidence that goes against the established beliefs / methods.
>>
>>55329461
Well that's what I meant but I wanted to put it into nicer words
>>
>>55329656
C and python are shit for learning, get a grip, java and C++ are the only good languages for learning and otherwise
>>
So to calculate the Minkowski sum do I just add all points of one shape to all points of the other?
>>
>>55329692
(You)
>>
>>55329692

I'd disagree to some extent.

Python allows beginners to focus more on basic logic rather than intricate details behind what they're doing and doesn't force as much emphasis on higher level concepts like memory management, and oop.

The route I'd recommend to beginners is something like Lua / Python for a first language and then transition up into something like C# / Java to get more in depth materials. After that, I'd honestly say it's time to start looking at C++ / Rust / C.

C++ is fast and flexible but offers little protection for the inexperienced. The flexibility also comes at a cost.. There are so many different valid ways to do things in c++ that you can never fully grasp them all.


Rust has a good habit of forcing stronger designs. But, it's got a rather steep learning curve and suffers from a lack of established libraries and learning materials.

C is very outdated in methodologies and very powerful. It's a tool you have to use carefully. It's very easy for the programmer to re-implement the wheel in inefficient ways for stupid reasons. There also isn't any protection to stop you from shooting yourself in hard to notice ways. If you don't have a decent grasp of what you're doing any software developed in c will be a hellish mess.
>>
>>55329901
Sick memes
>>
is codeacademy a meme y/n
>>
>>55329901
Disagree. C is the best for learning because it doesn't hide more than is necessary. You WANT beginners to reinvent the wheel, so they know how the wheel works and what to do when it breaks. Someone who doesn't know C can't appreciate languages like Java and Python.
>>
>>55329935
codeacademy is bretty gud
>>
>>55329692
>java and C++ are the only good languages for learning and otherwise
I suggest against java and C++ as those languages have many elements that are necessary to use at all but have nothing to do with learning the concepts of programming; assignment, loops, arrays, and control flow are the basics you have to teach and constructs like
public static void main(String[] args)
just end up confusing beginners and teaches them to just ignore things and be uncreative.

After someone's done sorting algorithms or made a pyramid out of asterisk then they can move onto Java or C++ so that they can learn data structures using classes.
>>
>>55330005
>C++ as those languages have many elements that are necessary to use at all but have nothing to do with learning the concepts of programming
java and c# sure
but c++ doesn't have anything like that
>>
>>55329944

The thing is most beginners don't even have the logic to describe a wheel and how it functions. Throwing them straight into to making a wheel when they haven't learned how to describe it and the steps to make it function is adding a lot of extra difficulty upfront.

Logic and describing / developing clear steps to solve problems is far more important than intricate implementation details and optimizations when you're first starting out.
>>
>>55330005
you'd have to be straight up retarded in order to not just overlook the entry point when starting out or finding out what it is. both C and python have "stupid" entry points too.
>>
>>55330048
>most beginners don't even have the logic
>Logic and describing / developing clear steps to solve problems is far more important than intricate implementation details and optimizations when you're first starting out.
'murrica
>>
File: 1431019991378.png (100 KB, 342x298) Image search: [Google]
1431019991378.png
100 KB, 342x298
How the heck am I supposed to design a good library/API before implementation, do I just need to make and refine enough bad ones until I have the experience to know better from the start? Whenever I write some library that has common code in it I usually end up rewriting most of it halfway through the project and working things from the client code back into the library. Is this common for beginners, is there some book I should read?
>>
>>55330048
Well, I tried to learn programming starting with Python many times. It wasn't until I watched as tutorial on C where a guy opened up the debugger, showed the registers, the actual bytes in memory, then moved onto the disassembly that it clicked for me.
>>
>>55330100

>Cherry picking parts of the argument without reading the whole statements.

Let me write a shorter clear version.

Beginners don't have logic. Languages that focus more on teaching logic / establishing steps to solve problems rather than relying on low level concepts or understanding overly complex high level abstraction mechanisms are better for beginners.
>>
>>55330167
only uneducated retards can't into logic and math
>>
when you first learn a language, it's mostly just the syntax and control flow constructs and data types and such. not fucking logic/problem solving, it's common sense.
>>
>>55330146
Number 1 rule of API design: WRITE THE USAGE CODE FIRST.

Google "Casey Muratori API design" for a good talk on the practice.

You literally never want to plan out an API before you know how it's going to be used.
>>
>>55330175

Most of your entry level programmers are literally uneducated retards. It's astounding the number of people with no math background and zero logic that decide they need to pursue a hobby / job / degree in programming.
>>
>>55330166
>>55330167
>>55330175
>>55330183
I am no teacher but I do know that everyone learns differently, it's a fools errand to try and figure out a method that will work for everyone, it's not even valuable to make the claim that just because something worked well for yourself that it will work well for others.

People have different reception for teaching techniques like books, lectures, etc. before the subject is even considered, once considering the subject matter it's another uncertain mess of figuring out what the best starting point and curriculum will be for the individual(s) being taught.

Nobody can speak generally on this topic with any level of authority because learning is so personal, anecdotes are certainly helpful but don't assume that just because something worked for you it will work for everyone, you have to consider the individual themselves.
>>
File: Untitled.jpg (378 KB, 1928x1058) Image search: [Google]
Untitled.jpg
378 KB, 1928x1058
A mockup for a puzzle game
>>
>>55330237
python is literally shit though
>>
>>55330206
That's a good tip, and thanks for the reference I'm going to look into it. I've heard that name mentioned before.
>>
>>55330237
this is an absolute load of horseshit
only an american would say this
because only an american is brought up with such a strong sense of
>No, you're not stupid, you're just smart in Different Ways
>Everyone is special in their own way!
>>
>>55330254
Like everything else written in C.
>>
>>55330354
>Java is shit
>>
>>55330254
Even if that's accepted to be true it doesn't matter as it can still be a useful learning aid. You may not use training wheels still but you may have at one point to learn.

>>55330307
That's not what I mean to say at all. I'm not advocating some kind of "everyone passes!" kind of mentality I'm simply stating that everyone learns differently, this should not be a controversial thing to say.

Some people do well with lectures and mentors, others books and self experimentation, some people do well with training aids, others do better diving in head first. None of this should imply that everyone can learn anything but I wouldn't actually doubt that, it's just a matter of finding a proper plan for them (as long as they're not actually retarded).

By the way I'm Italian.
>>
>>55330237

You're right.. The problem is there is no room for so much individual attention in education. That level of 1 on 1 work is too time consuming and expensive. That is why we look for a general curriculum / method that can work for many of the students rather than all of the students.

In my experience the biggest difference between those who excelled and those who failed was instilling strong logic / reasoning from the onset.
>>
>>55330395
>The problem is there is no room for so much individual attention in education. That level of 1 on 1 work is too time consuming and expensive.
It's the unfortunate truth, if I wish for anything to be solved it is this. I might be crazy but I think the trend of pre-recorded / pre-written courses can help with this. Imagine picking a subject and being presented with a choice of lecturer and style instead of being stuck with whoever is currently employed at your campus. Actually this isn't too new since people still recommend watching the recordings of the MIT SICP course.

I hope someone figures something out.

>instilling strong logic / reasoning from the onset.
The problem is that in my experience that's had the same problems as teaching anything else, I think it may be the most crucial thing to learn but I can't imagine how you teach people logic, especially a large group of people. That kind of thing almost seems intrinsic rather than experienced. I think if we figured out some way to teach reason to big groups of children, the rest of our issues would resolve as a result, it just seems impossible to do though.
woe
>>
what's a commutative binary operation · over the non-negative integers such that a·b=z but doesn't yield z for any other elements?
>>
>>55330395
>there is no room for so much individual attention in education. That level of 1 on 1 work is too time consuming and expensive.
'murrica
>>
>>55330481
Does a, b, and z have to be distinct?

Otherwise, it could be a=b=z=0 and the operation is addition.
>>
>>55330496
Nigga do you think America is the only place on earth with a disproportionate amount of teachers to students?
>>
>>55330521
>>55330496
>>55330395
We need personal digital tutors

https://www.youtube.com/watch?v=7vsCAM17O-M
>>
>>55330241
beJEWeled?
>>
There is literally nothing wrong with Java
>>
>>55330706

Watch out you might piss off our hasidic and zionist world leaders.
>>
>>55330802
this
>>
>>55330806
There is absolutely nothing wrong with the Jewish race
>>
>>55330829
lel, I'm actually one of the devs for the coincidence detector
>>
>>55330802
(You)
>>
>>55330913
The what?
>>
>>55330913
>the coincidence detector

Lol excellent job. Kinda made it obvious who really controls things.

What sorta of algorithms did you use to implement it?
>>
>>55330472
>I think if we figured out some way to teach reason to big groups of children, the rest of our issues would resolve
this is impossible because we have massive governments actively undermining any attempts at this endeavor
the government does not benefit from an informed and reasoning populous
the government benefits from a mass of sheeple
>>
>>55330936
https://encyclopediadramatica.se/Coincidence_Detector

>>55330951
A tree search over the DOM. It's really just a simple find/replace algorithm.
>>
>>55330995
>https://encyclopediadramatica.se/Coincidence_Detector

LOL why would you make this!!
>>
>>55330995

Did you ever think of starting a database application that collects known symbols and ritual relations to the kabbalah?
>>
>>55330995
>ed
that brings me back to being 13 years old
how time flies
>>
>>55331111
Nice repeating digits.

I would have linked directly to the zeronet address but 4chan thinks it's spam. It's the first external link on the ed page.

>>55331051
no

>>55331031
for fun, and to make people think :~)
>>
File: 1460359321842.gif (33 KB, 181x222) Image search: [Google]
1460359321842.gif
33 KB, 181x222
Tell me what static analysis tools you use and what language you use them for.
>>
>>55327849
>any true C programmer can implement any library function on their own
Even shit like printf?
http://blog.hostilefork.com/where-printf-rubber-meets-road/
>>
>>55331175
jshint for js
pylint and pep8 for python
>>
>>55331175
gofmt, goimports, go vet for Golang
>>
>>55331282
This + gometalinter
>>
>>55331311
>gometalinter
Very nice.
>>
>>55331215
stdio would be one of the more annoying things in the C standard library to implement yourself, but printf itself wouldn't be that hard.
>>
>>55328481
>>55328529
Are HackerRank challenges timed? I didn't really want to create an account without knowing. I'm the kind of guy who likes to mull over things for a while and I don't want a shitty score of 0 if I don't solve everything in 15 minutes. I would be mostly doing it to learn.
>>
File: cute anime pic 0608.gif (885 KB, 459x410) Image search: [Google]
cute anime pic 0608.gif
885 KB, 459x410
I had to send and receive a POST request to implement google captcha on our website, so instead of learning to use libcurl, I simply fashioned together some system() calls to redirect the output of a curl POST to a file and then I read in the file and strstr()'d it looking for the word "SUCCESS" .
>>
>>55331401
>I don't want a shitty score of 0
>I would be mostly doing it to learn.

Don't let your ego get in the way of your learning
>>
File: everything_you_just_posted.gif (2 MB, 320x228) Image search: [Google]
everything_you_just_posted.gif
2 MB, 320x228
>>55331441
>>
File: I45pTQq.gif (195 KB, 814x814) Image search: [Google]
I45pTQq.gif
195 KB, 814x814
>>55326123

Making some weird ASCII graphics! It's a simple mandelbrot set visualisation so far!
>>
>>55331401
Just make a dummy account :^)
>>
What are the best practice programming websites you found that actually go from beginner and all way to advanced practice questions which will help you progress to get really good at programming?
>>
>>55331616
>>55331401
Incidentally I always take a really fucking long time too because I am terrible with terminology and phrasing.
>>
File: Screenshot_2016-05-20_19-06-35.png (43 KB, 894x744) Image search: [Google]
Screenshot_2016-05-20_19-06-35.png
43 KB, 894x744
>>55331613
Neat! Reminds me of this image viewer I made for the terminal (pic related)
>>
>>55331401
no the problems are not timed
the execution time of your solution is timed
and you can resubmit a solution as many times as you want to improve it with no penalty
>>
>>55331628
I'm trying not to sound like a shill, but hacker rank is a good choice for this as well
the "easy" problems in each category are trivial retard-level easy, and the hardest ones require specialized knowledge you almost certainly will not know until you see the problem
and then there are plenty of difficulty levels in between
>>
>>55331766
I was hoping to hear a few different ones which have programming practice problems going up in difficulty to get better at programming
>>
File: hr1.png (70 KB, 1212x884) Image search: [Google]
hr1.png
70 KB, 1212x884
>>55331825
there are other websites too, but really you only need one good one
and hacker rank has exactly what you're asking for
>>
c++ memory shit is so confusing coming from python
>>
>>55332369
What are you having trouble with?
>>
>>55332369
smart pointers are your friend
>>
>>55332444
>>55332369
ignore that guy
simply avoid allocating dynamic memory with new/malloc entirely
it's very easy to do with c++ and there's no excuse anymore
>>
>>55332369

is better if you have a good understading in how the memory is organized and works at low level
https://courses.engr.illinois.edu/ece390/books/artofasm/CH03/CH03-1.html#HEADING1-31

just googling found
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-172-performance-engineering-of-software-systems-fall-2010/video-lectures/lecture-7-memory-systems-and-performance-engineering

I wonder how good it's?
>>
what are some books on software engineering that aren't as comprehensive as code complete?
>>
>>55332614
Sicp
>>
>>55332676
i don't feel like proving some sequence converges to the golden ratio just so i can learn how to refactor properly
>>
>>55332684
Thinking in Java
>>
>>55332497
What's wrong with smart pointers?
>>
>>55332614
to be honest, if you don't already know everything in code complete then you're a fucking failure at life.
>>
>>55326606
each element should have the word, in its original language, as key. then each value should contain an int which signifies the group of words its synonymous wth. just increment for each new synonym group.
>>
Is there a proper way to parse POST query strings without using strtok?
>>
>>55333029
using a framework
>>
>>55332710
the problem isn't with smart pointers, it's with the concept of allocating memory in a way that requires you to later remember to free it

smart pointers are just another way to help you free your memory

the better solution is to not manually allocate memory on the heap in the first place
>>
>>55333211
I feel like that would become a larger project than the cgi script itself, but it's certainly doable.
>>
File: acomplished milf.jpg (91 KB, 736x945) Image search: [Google]
acomplished milf.jpg
91 KB, 736x945
import Data.List

-- biggest common factor beteen all nums in xs
biggd xs = foo h a
where a@(h:hs) = sort xs
foo 1 _ = 1
foo n ns = if and (map (isdiv n) ns) then n else foo (n - 1) ns
isdiv a b = b `mod` a == 0


any faster / better way?
>>
Hi guys, one question. I want to be able to make cool shit with programming (currently learning). I was told learning C would hone my programming skills, because it would make me "think" as a programmer. I installed linux on my laptop now (debian 8). So my question is: Can I learn C while learning other front end, backend languages (javascript, jquery, python). Or should I finish learning those first before I move on to C?
>>
>>55333427
You only really need the basics if you're planning to do other languages. It's worth going in depth with C though as it will get you used to manipulating memory..
>>
How do you find a fun project to work on that doesn't feel like a total waste of time?
>>
>>55333451
Think of something you wish existed and then make it happen.

If you can't think of anything, you're not living your life correctly.
>>
>>55333451
Git interested. I program because I legit have fun learning and implementing algorithms and shit.
>>
>>55333291
unless it's only one or two scripts you don't need to maintain, it's a larger project to do it yourself rather than using a framework
>>
>>55326151
>223 replies of programming related shit
>1 of butthurt redditor nerd rage

It's almost like you need to move the fuck on
>>
>>55333451
I gave up on trying to find hobby programming projects years ago
I took up other hobbies to do in my free time instead
>>
>>55333367
i don't understand your code because your variables names are shit and i don't know what language that is, but this is a very well studied problem and you probably have some cryptography library in your computer that does this faster and better
>>
>>55333563
why would you comment on code you can't read?
>>
>>55326151
Why do you have to force your fag shit onto /dpt/?
>>
File: 4thEnglish.jpg (50 KB, 591x722) Image search: [Google]
4thEnglish.jpg
50 KB, 591x722
So im learning c++. But ive been wondering, once i learn this shit, wtf am i even supposed to do/make. Ive been having fun using winforms and c# to make simple programs. But I have no clue what I can actually do with the power c++.
>>
>>55333367
https://en.wikipedia.org/wiki/Binary_GCD_algorithm
>>
File: K&R.png (107 KB, 792x1023) Image search: [Google]
K&R.png
107 KB, 792x1023
Friendly reminder that even the most poorly written C program will run orders of magnitude faster than even the most well written program in your favorite flavor of the week library language.
>>
>>55333767
stay delusional
>>
>>55333790
Why don't you prove me wrong?
>>
>>55333836
why would i and which languages are you even talking about, the fuck is a 'library language'
>>
>>55333836
>>55333767
http://benchmarksgame.alioth.debian.org/u64/performance.php?test=regexdna
>>
Does anyone have experience with contributing to Google?
I signed the CLA, but since my github mail is not a gmail (but it is added to my account), I am viewed as not having signed it.
>>
>>55333856
lolwut
http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=regexdna

also he used strings and tcl for something that not needs unicode support, what about trying it with arrays or simple dynamic allocation instead? thatcould be an improvement
>>
Can you give me a hand that what the fuck am I doing?

I started lerning C++ and I want to make a console calculator as mz first program. I do this with every language I learn.

Now I want error handling for the input. If the user puts something which is not a number into the console then I want to loop it until a number gets in.

But somehow I managed to create an endless loop. The program does not wait for the next input instead it prints out a text.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#include <iostream>

using namespace std;
double eredmeny(double,double);

int main()
{
string op ="";
double szam1=0;
double szam2=0;


cout << "THIS PROGRAM IS ON KINDERGARTEN LEVEL :( !!!!!!!!!!" << endl;

cout << "GIVE US A NUMBER!!: ";
cin >> szam1;

while((!szam1>=0) || !(szam1<=0))
{
cout << "YOU FUCKED UP ENTER A NUMBER!" <<endl;
cin>>szam1;
}


cout << "A PROGRAM ELINDULT :( !!!!!!!!!!" << endl;

cout << "A PROGRAM ELINDULT :( !!!!!!!!!!" << endl;


return 0;
}
>>
>>55334278
Fuck my English
Sorry for the grammar
>>
I always have these great ideas then when I realize how much work it takes to accomplish I'm like fuck it, I'll prob just do enough to earn my food and never do anything big in my life
>>
>>55334278
you have to take input as a string instead of a double
then you check the inputted string to make sure it's a valid text representation of a double value
then you convert it to a double and do your thing if it's good, or loop and ask for input again if it's bad
>>
>>55334278
http://stackoverflow.com/questions/257091/how-do-i-flush-the-cin-buffer
>>
File: disappointedotter.jpg (155 KB, 615x380) Image search: [Google]
disappointedotter.jpg
155 KB, 615x380
>>55331441
>>
>>55326123
Is there any software useful for planning out your programs in? It's pretty dark where I normally program at so pen and paper isn't always viable.
>tfw no Wacom
wew lad.
>>
>>55326123
>tfw Nigel Farrage will never be an American political candidate
He's like a charming, less rich, more intelligent Trump.
>>
>gradle can compile native projects
this could shape up to be pretty damn amazing, especially with the new c++ package thingy
>>
>>55335215
gradle is a shitty meme
>>
>>55335226
you're a shitty meme
its not perfect, but we really need a new build system that works for multiple languages and isn't complete ass
Thread replies: 255
Thread images: 29

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.