[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
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: 24
File: 1422385664777_6.jpg (438 KB, 2500x1000) Image search: [Google]
1422385664777_6.jpg
438 KB, 2500x1000
Old /dpt/ at >>51965393

No traps (>>>/lgbt/), no anime (>>>/a/ >>>/jp/), only programming allowed.

What are you working on?
>>
>>51970377
how can I call a function every time screen size changes on ios 9? I'm using Swift btw.
>>
I can't compile my Go program because I commented out a few lines for testing and I now have an unused variable.
>>
>>51970403
look for events for that?
>>
Have you ever programmed while crossdressing, /dpt/?
>>
http://www.strawpoll.me/6285195/
>>
>>51970427
how?
>>
ideas for projects please
i know C and python, 'know' C++ a somewhat

something that may take a month or so

>>51970435
yeah

>>51970423
comment out go
>>
>>51970455
Code a compiler for Go that supports unused imports and variables
>>
I just started a roguelike using Processing today. I have dungeon generation, mobs, a player, a shopkeeper, and a movement system so far.
>>
>>51970512
>processing
>>>/v/agdg
>>
File: 1445311716435.jpg (95 KB, 724x720) Image search: [Google]
1445311716435.jpg
95 KB, 724x720
>>51970440
>People claiming they "know" C++
>>
>>51970452
you could start by googling your problem and you'd have found https://stackoverflow.com/questions/3017636/detect-when-a-mac-os-x-window-is-resized-or-moved
>>
>>51970512
>roguelike
>>>/v/agdg
>>
File: jj.png (169 KB, 363x270) Image search: [Google]
jj.png
169 KB, 363x270
>>51970377
>no anime (>>>/a/ >>>/jp/)
That's no fun.
>>
>>51970552
I'm googleing for 10 minutes already, it's a Swift app for iOS not OS X, also that solution doesn't work anyways.
>>
File: 83507023282337153.jpg (13 KB, 230x130) Image search: [Google]
83507023282337153.jpg
13 KB, 230x130
>>51970549
I have knowledge of C++. I may not be a C++ master but I can certainly write the code I need.
>>
>>51970487
unused imports: just have an on-save hook in your editor call `goimports` with the file being saved, then reload it

unused variables: use _ for placeholders
>>
File: pF5Kh.png (139 KB, 750x1050) Image search: [Google]
pF5Kh.png
139 KB, 750x1050
>>51970440
>>
>>51970549

Not enough to be a master, but more than enough to be dangerous.
>>
>>51970682
Java and Sepples fags BLOWN THE FUCK OUT
>>
Why hasn't /g/ made one true webkit browser to rule them all?
>>
>>51970682
>Cobol completely disliked

What a complete fucking blowout. That said C is popular by name alone, whether or not people have any skill with it, whatsoever.
>>
>>51970749
what language should we do it in?
>>
>>51969404

You first sperglord
>>
>>51970793
ʰᵃˢᵏᵉᶫᶫ
>>
Porn data mining
>>
I started Project Euler using Python. The file is run from the command line with an int argument corresponding to a Euler problem.

I've got a dict like so:

problem_functions = {
1: problem1(),
2: problem2(),
3: problem3(),
4: problem4()
}


At four+ entries it starts taking seconds to declare this dict. I timed it with six entries in the dict and it was taking SIX SECONDS just to get through that dict declaration. What the fuck is going on?
>>
>>51970749
Because this world doesn't need any more webkit browsers. Also /g/ can't collaborate on shit. 99.9% of
all /g/ projects turn into a logo-making thread.
Maybe if it was using Servo, it would be more interesting.
>>
>>51970820
can I contribute?
>>
>>51970836
You don't have enough ram
>>
Does anybody know where I can find a list of words that people actually use?

I've been able to find a few word lists, but they all include extremely rarely used words like
>aa
>aahed
>aahing
>aahs
>aal
>aalii
>aaliis
>aals

>aargh
>aarrgh
>aarrghh
kek

>aas
>aasvogel
>ab
>abaca
>abacas
>abaci
>>
>>51970821
Write better algorithms.
>>
Why should I learn C? What use is it to me?
>>
>>51970821
Because you're calling each fucking function.
>>
>>51970853
you could just scrape a few web pages or books and set(list)
>>
>>51970862
>What use is it to me?
http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
>>
>>51970865

If each function was called it would be taking minutes to get through the dict declaration.
>>
>>51970862
C is fun. That alone is reason enough.
>>
File: ji.jpg (87 KB, 736x748) Image search: [Google]
ji.jpg
87 KB, 736x748
I got excited when I learnt about "let" in JavaScript, but I found out there isn't much support for it yet.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let
>>
>>51970853
For every word in the list do a google search on it. throw out any words with fewer results than a cutoff you define.
>>
>>51970880
Well, they are getting called.
>>
>>51970821
are you stupid?
>>
>>51970868
>you could just scrape a few web pages or books and set(list)
this isn't a bad idea, I'll do this if nobody has one with the work already done for me
>>
>>51970880
Oh my, that sure isn't the syntax for calling functions then!
>>
>>51970895

Guess so. I fixed it. Gonna go kill myself for not realizing what I was doing.
>>
>>51970821
>strict evaluation
>>
>>51970644
if swift doesn't have some form of event listeners then you need to consider using something else lel
>>
>>51970749
I'll make the logo
>>
Scala is amazing
>>
>>51971007
I agree. How could one language be so utterly fucked up?

https://www.youtube.com/watch?v=uiJycy6dFSQ
>>
>>51970821
kek'd

I ended up giving each problem its own file

ex: Problem 1 - Multiples of 3 and 5

easy to search through them if I get another problem that kinda looks like an euler problem I've done in the past, but I can't remember which one required me to find whatever I'm looking for
>>
Open vSwitch
>>
>>51970950
nevermind, I figured it out, thanks for trying lol.
>>
>>51971025
How are Scala's collections so bad, but Clojure's collections so good?
>>
>>51971007
Except nothing compiles in your life time
>>
>>51970899
try project gutenberg for a list of books, or consider the python nltk book corpus
>>
>>51971007
C# is what Java  wanted to be
F# is what Scala wanted to be
>>
>>51971241

haskell is what noone wanted to be
>>
So I started to get a intresst in programming, and I'm currently Learning some basic in C#
Can someone tell me if it really is a good first programming language?
>>
>>51971256
C# is alright for a first programming language, yes. It'll be ezpz for you to learn java, and not too hard for you to learn C or start C++.
What's more important is your resource. How are you learning it?
>>
>>51971241
F# is what C# wanted to be
Haskell is what my dog wanted to be
>>
>>51970535
>they just did. next release (January 1) will integrate those changes
[citation needed]
>janestreet shills
Not even once!
>>
>>51971256
Depends on your perspective. If you really want to get into Computer Science (the theory behind it all), probably not.

If you just want to be able to get shit done, it is a great choice (provided you work mostly in the Microsoft ecosystem).
>>
>>51970862
Are you masochistic? If so, C is the language you absolutely want to know.
Also works if you're a C-uck.
>>
>>51971278
I got the MVS IDE, and watching Bob Tabor on Youtube... Trying to self learn it since I dont go to school and so on...
>>
>>51971256
>if it really is a good first programming language?

Yes.
>>
>>51971287
Well I don't really know what my perspective is 100% it might be a mix of mobile apps, and so on. Just want to learn new things i guess.
>>
>>51971306
Drop the youtube, the Bob Tabor.
Find a nice book, which is less common for C# since it isn't very often someone's first language.
Possible good books are Learning C# or Programming C#, both from O'Reilly.
Make sure you find a book that has exercises and is thorough in explanation.
>>
>>51971362
Really? Will try to find something about it then, thanks for the tip =)
But so far I enjoy Bob Tabor, because I tried to learn some basic a while ago, but never really understood what Everything meant. But as I'am watching Bob, he explains so atleast I understand a Little bit more. But I'll follow your tip, and try to find a good C# book
>>
>>51971256
>is it a good first programming language
No, learn C.
>>
>>51971405
You're welcome to refer back to him if you're having trouble recalling something, but books are the tried and true method to really understanding something, while people that learn solely from videos and tutorials have a harder time reaching full understanding and originality. I don't have a link to a study but I can attest to that personally and have seen it true in a lot of people.
>>
>>51971433
Well I've "Heard" some about that you basically need to know C for a lot of things. Might look it up a Little bit more.
>>51971447
Well it sounds like it makes sense, so I Believe you
>>
>>51971489
C will teach you more about what is actually going on in your programs than C# will.

Or you can watch all of the old MIT lectures on the Structure and Interpretation of Computer Programs (and download SICP by Abelson and Sussman) :^)
>>
>>51971505
>C will teach you more about what is actually going on in your programs than C# will.

Assembly will teach you considerably more about what actually happens in your programs than C will.
>>
>>51971433
>>51971489
>>51971505

While C was my first language, learning it without an IDE, telling other people to torture themselves with C to learn a first programming language isn't the greatest idea.

1) Unless they're willing to put the time in it, learning things like memory management just isn't for most people

2) C lacks a lot of basic functionality. Classes, lists, networking, UI, and threading just to name a few.

3) The language includes boilerplate code for basic things. One of the ways to get people hooked on programming is having them solve problems. If these problems require dozens of lines of code just to set up, it can be daunting to a new programmer.

Python is a great first language, but it reinforces other bad habits. C# is probably a good mix of the good and the bad for a first language.
>>
>>51971537
>learning things like memory management just isn't for most people
just isn't worth it for most people*
>>
>>51971537
>2) C lacks a lot of basic functionality. Classes, lists, networking, UI, and threading just to name a few.
I agree wholeheartedly that C is an awful first language considering the available options nowadays, but this point is just... awful and wrong
>>
>>51971505
Okay, sounds like more of a challenge than C# and a Little more intimidating for me at the moment.
haha as soon as I read MIT my brain Went "Dude... you don't have enought brain capacity for that stuff" But will look in to it, when I get the motivation! thanks for all the info and feedback guys!
>>
>>51971537
great post desu
I used to be a "C must be everyone's first language" and then I learned Python. Your last two sentences are perfect
>>
Scheme is still the best first language, and always will be.
>>
>python has lists
>python lists don't have a .length()
>instead, they have len()
>>>>>>>I make the list, then recalculate it's length
garbage lmao
>>
>>51971602
len(l) better be 'return l.length' and nothing more
>>
>>51971602
__len__
>>
>>51971554
How so?
Many people start of programming thinking "I CAN MAKE A GAME!"

Then, after learning C, realizing C has no built in:
1) graphics
2) threading
3) fucking lists, at least

Yes, there are external libraries, but as someone who's done this all before, I can tell you it really throws people off from programming when they have to go outside of their comforting first-party libraries to external libraries they don't know anything about.
>>
>>51971627
noice

I love how 'operator' overloading in python (not really operators) is just __x__, like __next__ or __iter__ etc
i guess nothing can be perfect huh
>>
>>51971633
What fucking languages come with everything that you need to make a game built-in?
>>
>>51971654
Racket has literally everything built in. I wanted to do my tax, and it turns out Racket even had my tax return pre-filled!
>>
>>51971675
the word "class" is ambigious as fuck and can be used for many similar things
>>
Do you think programming just isn't for some people? I took a course in it at my university as part of my maths degree, scraped a 40 and hated every second of it. And I'm generally pretty good at maths/language kind of stuff.
>>
>>51971654
99% of languages, really. How long have you been living under a stone?
>>
>>51971702
If you didn't have a very shitty professor with shitty course content and still "hated every second of it" then obviously it isn't for you
>>
>>51971675
function forms a closure over some parameters.
>>
>>51971715
name 5
>>
>>51971702
Completely different skill, but yeah I do.
Everyone shouldn't program, but one course isn't enough to decide.

Grab a good book and reference book for LANGUAGE and work through it on your own.
>>
>>51971725

Well I meant purely in terms of proficiency.
I had a good professor and the course was fine, I just could not get my head around it. No matter how many hours I put into it I just couldn't get good at it.
>>
>>51971737
python, racket, common lisp, opendylan, ruby.
>>
>>51970682
From now on when people ask what PL to learn, just give them the second graph and tell them to work from left to right. Tell them to work from right to left if you hate them.
>>
>>51971737
Dylan
Dylan
Dylan
Dylan
Dylan
>>
>>51971654
C#, Java, other newer languages.
Stop thinking C is the be all end all of languages.

C# can, out of the box:
>Network
>Thread
>Create UIs
>Play sound/music
etc...
>>
>>51971782
>learning C before any of the languages in the list
>ever
You must really detest people.
>>
>>51971753
>python
you know pygame isnt built in right
:^)
>>
>>51971810
Ebin post my man.
>>
>>51971675
Why did you delete your post senpai?
>>
>>51970377
>No traps (>>>/lgbt/), no anime (>>>/a/ >>>/jp/), only programming allowed.
nice

>>51970423
kek, nice meme bro
>>
>>51971795
>Network
>Thread
>Create UIs
>Play sound/music
That's not the language, it's the standard library. It's not much work to add a library to your C project with all those things and be as well off. Not that I advocate C.
>>
>>51971831
I didn't. Someone is doing it FOR FREE.
>>
>dad thinks Assembly language is involved in building a computer
>>
>>51971916
Eh? It was a programming question regarding classes in JavaScript. Why would a janny delete it?
>>
Is it ok to post my Project Euler code to Github?
>>
>>51971991
yep, just put it all in one repo lol
>>
>>51971917
tell him you're not writing an operating system, you're just putting parts together and installing one
>>
>>51971991

Read the rules on Project Euler. No.
>>
>>51971945
welcome to hiroshima's 4chan, only off-topic discussion is allowed.
>>
>>51972050
>It's getting cold, isn't it?
>>
>>51971891
But that's sort of my point. It's the STANDARD library. It's essentially part of the language.

And it isn't as easy to add a library to a C project. Especially on windows.

Back a few years ago
>Try to find a good C library for talking over USB
>found one
>"Last compiled: 1997"
>dll is 16 bit on my 64 bit machine
>That's ok, i'll recompile the source
>Load it in
>Missing half the dependencies
>"That's ok. I found it on some sketchy Russian website"
>Add the dependencies
>Some weird ass compilation error occurs
>"That's ok, I'll just google it"
>0 search results
>Post on /g/ about it
>"Stop using C. It's depreciated."
>>
>>51972083
>going through all this and getting in a cyka botnet when you could have just used C++
>>
>>51972083
But, if C is depreciated, how am I going to program for my MSP430s?
>>
>>51972083

Why use C if you aren't going to write everything you need yourself?
>>
>>51972150
Why use a computer if you aren't going to wire it up yourself?
>>51972134
C has it's uses. Just not many.
>>51972101
I ended up using C#, which does that built in. C++ doesn't have it built in.
>>
what's some neat stuff I can do with all the ezpz web stuff in python
I was thinking of doing something with Gutenberg, like calculating the flesch-kincaid ease of readability for a book, but thats kinda boring/not impressive
>>
>>51972253

I wrote a Reddit bot that scanned major subreddits for reposts using KarmaDecay and then posted a top comment from an old thread. Got about 1k comment karma per day.
>>
>>51972290
nice
>>
>>51972290
Post the code
>>
H-hey! DPT! I'm so happy! I have great news - I actually made a friend t-today..!

...

a friend class in C++ :_;
>>
>>51971831
I found the answer.
I was referring to Javascript constructor function as a class. I didn't know that, and i was doing so because on the mozilla site they also referred to a constructor function as a class. I guess i couldn't tell they weren't serious.
example: from mozilla website
Custom objects

The class

JavaScript is a prototype-based language and contains no class statement, such as is found in C++ or Java. This is sometimes confusing for programmers accustomed to languages with a class statement. Instead, JavaScript uses functions as constructors for classes. Defining a class is as easy as defining a function. In the example below we define a new class called Person with an empty constructor.

var Person = function () {};
>>
>>51972434
you made a friend in class . u .
>>
>>51972434
noice brah
>>
>>51972438
I would have thought a constructor need to return an object, not void.
>>
>>51972499
yeah it does if you fill it in i guess
>>
>>51972434
Here's my best friend represented in Haskell.
let friend = Nothing
>>
>>51972434
Good joke, but poor execution. 7/10 overall. I like how literally nobody got the joke though.
>>
>>51972618
Prelude> fmap hug friend
Nothing
Prelude> tfw
>>
>>51972723
I got it, I just didn't find it funny enough to reply. Too bad 4chan doesn't have karma, I probably would have upboated it xD
>>
>>51972723
It probably didn't help that I misread it as "A friend in C++ class"
>>
what's wrong with my syllable regex, /dpt/

'([bcdfghjklmnpqrstvwxz]*[aeiouy]+[bcdghjklnmpqrstvwxz]*e?)|([aeiouy]+)'

./test.py synchronious articulate dog work writhe daily programming thread gargantuan hypothesis
synchronious: synchr, on, ious
articulate: art, ic, ul, ate
dog: dog
work: work
writhe: writhe
daily: dail, y
programming: progr, amm, ing
thread: thread
gargantuan: garg, ant, uan
hypothesis: hyp, othe, sis
>>
>>51972434
LOL
>>
File: HWM1w2u.jpg (147 KB, 586x740) Image search: [Google]
HWM1w2u.jpg
147 KB, 586x740
how to deal with invalid pointers in C ?
>>
>>51972912

if Null, continue
>>
>>51972912
Don't create any in the first place?
>>
File: 113.gif (218 KB, 300x100) Image search: [Google]
113.gif
218 KB, 300x100
>>51970709
>>
>>51970440
Why isn't CSS on this list? :^)
>>
>>51972991
epic
>>
>>51970440
All of them. Language syntax is easy.
>>
Hello. I've been working on small projects in python for the past few months, and I've been wanting to get my hands dirty with web dev (for even faster prototyping). I spent a good week learning HTML/CSS and was wondering if I should look into learning JS, Ruby on Rails, or something entirely different for making web apps. If I go the JS route, should I look into learning Node or Angular? Friends of mine have made some pretty cool things with Node, but I have also seen quite a few companies use Angular...

Thanks :)
>>
>>51973007
>Thanks
>>
>>51973007
GET THE FUCK OUT OF HERE YOU FUCKING NEET
>>51970438
>>
>>51972766
>
hypothesis: hy poth e sis
>>
>>51970377
python a best
>>
>procrastinated studying for my exam tomorrow because there weren't very many lecture slides to review
>start reviewing
>four of the slide sets have 60-70 slides
fuck my life, good thing this shit is pass/fail
>>
>>51973007
>If I go the JS route, should I look into learning Node or Angular
Just learn JavaScript, you don't need Node or Angular.

>>51973046
He's asking a programming question, stop shitposting.
>>
test
>test >>>/trash/ test
>>
File: Vb31kvP.png (4 KB, 437x105) Image search: [Google]
Vb31kvP.png
4 KB, 437x105
>>51973135
neat
>>
>>51973007
>JS
Yes. You can't write modern websites without at least the basics of JS.
>Ruby on Rails
This is a backend web app framework.
>or something entirely different
JavaScript is the only language you can use client-side. For the backend, I'd personally recommend Go, but really anything besides RoR or Node or PHP is good.
>should I look into learning Node or Angular
Node is a JavaScript engine for servers that allows you write backend servers with JavaScript. Angular is a client-side web app framework. I would not use Node and in general avoid using JavaScript anywhere it isn't strictly necessary, because it's a really bad language. Angular is for writing single-page applications (websites that do everything via JavaScript and mimic a phone or desktop app). It might be worth learning after you know JS, but certainly don't start out with it.
>>
>>51973122
THIS FAGGOT ALREADY POSTED ON /WDG/
>>51972812

THEN CAME HERE TO SHIT OUR THREAD UP.

ALL WEB DEVELOPMENT POSTS SHOULD STAY IN THEIR CONTAMINATION THREAD.
>>
which one is better?

String match = "", input = "Hello";
String[] values = new String[10000];
values[0] = "Good day";
values[1] = "Howdy";
values[2] = "Hello";
for (int i = 0; i < 10000; i++)
if (input.equalsIgnoreCase(values[i])) {
match = values[i];
break;
} else {
match = "not found";
}
System.out.println("Match is " + match);

if (input.equalsIgnoreCase("Good Day")) {
match = "Good Day";
} else if (input.equalsIgnoreCase("Howdy")) {
match = "Howdy";
} else if (input.equalsIgnoreCase("Hello")){
//for 10000 iterations
}
System.out.println("Match is " + match);
>>
Which to learn first? SDL, SFML or Allegro?
>>
>>51973230
>first
you'll only ever use one
I liked using SDL a lot, was simple and quick
if you want to be a game dev and think you are going to need to learn all three of those, kill yourself
>>
>>51973202
Boo-hoo, faggot.

So I've started writing a lisp in c. I think I might bootstrap through Flex/Bison and use that environment to load a more complete Lisp. Any thoughts?
>>
>>51973230
I'd say SDL2 is the most worthwhile. SFML is designed to be used at a higher and more specific level, while nobody uses Allegro.
>>
>>51973258
You're so ignorant that it's kinda cute.
>>
>>51973230
vulkan said that release is imminent, you should wait and use it.
(and use sdl only for input because the windows message code gets really long)
>>
Wake up, sheeples! If your programming language doesn't support parallelism in 2016, it's already deprecated!
Is your language deprecated, /g/?
>>
>>51973224
>Java
none lmao
>>>/trash/
>>
>>51973281
Thanks! What should I do? Totally new territory to me here.
>>
>>51973290
Ocamlfags BTFO
>>
>>51973290
https://wiki.python.org/moin/ParallelProcessing
>>
>developing a programming language in C
I can see writing the VM in C, but the compiler? Awful choice.
>>
Hey /dpt/, I'm not a programmer, and I know very little about it, however my son has been learning how to code starting with Javascript. He wants to make websites currently, and eventually move into software dev etc. I've googled a bunch, but I don't really know what direction to point him in to actually start making a functional website from scratch. From my understanding he would need to learn Javascript, Html/css, and some sort of back-end language like Python, C++, Ruby etc.

Any advice /g/?
He's 11 by the way, but insists on staying away from things like scratch because he thinks it's dumb.
>>
>>51973291
>>>>/trash/
>>>/trash/
>>
>>51973244
People do learn all 3...don't really see what's wrong with that...
>>
>>51973202
No, all are welcome here, even people that want to ask a question regarding HTML and CSS.

Nobody likes your shitty /wdg/ thread so stop false flagging.
>>
File: happy.jpg (70 KB, 400x388) Image search: [Google]
happy.jpg
70 KB, 400x388
==14249== All heap blocks were freed -- no leaks are possible
>>
>>51973324
teach him HTML5, CSS3 (HTML5/CSS3 are pure shit t.b.h.) and, on the other side, HTTP (with netcat and wireshark).
>>
>>51973326
People may learn a bit of all 3 to figure out which they like best, but once they do, there's really no reason to change. Which one you pick really doesn't depend at all on what you are trying to make, it depends on your personal preferences about how much you want to do yourself.
>>
>>51973324
You missed a perfect opportunity to say "my wife's son", anon. Just think of all the (You)s you would have got.
>>
>>51973324
Tell him to stick to minecraft and let the grown-ups deal with programming.
>>
>>51973325
>>>51973291
>>>>>/trash/
>>>>/trash/
>>>/trash/
>>
File: cracking_hashes.png (10 KB, 564x86) Image search: [Google]
cracking_hashes.png
10 KB, 564x86
a proof of work scheme: https://github.com/erose1337/pride/blob/master/proofofwork.py

A simplified version of the idea is to send a hash(few_bytes + long_shared_secret) from the server to the client. The client, knowing the shared secret, brute forces the first few bytes and recovers the "encrypted" data. The amount of work and by extension, time, taken to recover the data can be increased by incrementing the number of bytes to crack per hash.

assuming I'm not missing a really obvious attack, anyways.

Managed to do it with only the python standard library in less then 200 lines, including docstrings and tests
>>
>>51973351
Is that your attempt at the "return 0" program?
>>
File: 1450591117612.png (413 KB, 2881x1620) Image search: [Google]
1450591117612.png
413 KB, 2881x1620
/g/ PLEASE HELP I NEED YOU
(baka desu senpai)
>Friend recommends Khan academy to learn Java and make simple Android Apps
>Make an account, spent last three days going through "intro to Java" seemed really childish but I dealt with it
>About 40% completion when I notice that the book "Java, a Beginners Guide 6th Edition" starts off completely differently
>Something tells me Khan Academy is a shit

/g/ please, I just want to make simple mobile games while learning game design and coding. Maybe in the future I can start diamond dogs but until I go nuclear, I want to learn Java.

Did I fuck up? Any advice? What language is best language to learn to make android or iOS games and apps? I have IntelliJ, Notepad++, and JavaSDK installed if that helps.
>>
>>51972766
> hyp, othe, sis
You have to relearn dividing by syllables
>>
>>51972997
Fag
>>
>>51973281
Seriously. I want to write a toy lisp.How should I go about this?
>>
>>51973392
No you cheeky cunt. It was for my fizzbuzz. Now I'm ready for real jobs :DD

>it was for a linked list queue
>>
>>51973421
First of all, you don't use C.
>>
>>51972766
hy
po
the
sis
>>
>>51973174
Why do you say php is bad? I've got a decent bit of experience with it and I didn't have too much trouble using it or finding resources to learn to do things I couldn't figure out.
>>
>>51973440
Then what should I use?
>>
>>51973447
my bad
hy
poth
e
sis
>>
>>51973461
Lisp
>>
File: 1450625547615.png (216 KB, 2001x2254) Image search: [Google]
1450625547615.png
216 KB, 2001x2254
>>51973415
/g/ PLS
>>
>>51973461
Something functional, like a Lisp itself, or an ML, Haskell, etc.

They tend to make both the act of parsing and manipulating the AST a lot easier, since they are good at working with trees through recursion, and generally have great parsing libraries (especially Haskell).

Trees especially are a pain in the ass in C due to manual memory management.
>>
>>51973482
That is what I'm trying to avoid for the moment. I understand certain aspects of lisp can't be done outside of lisp, but how was the first lisp programmed? Was it in pure IBM 704 assembly?
>>
>>51972766
https://www.tug.org/docs/liang/
>>
>>51973415
>>51973486
>not using eclipse
>not using android sdk which is modified eclipse
>not learning the basics of OOP independent of java so you don't go full retard with abstractfactorybeans.
>>
>>51973415
dude fuck you're a functional adult. Leave the nest, learn to google, and pave your own path.
>>
Dank Lisp memers ITT
>>
>>51973486
>What language is best language to learn to make android or iOS games and apps?

You are (practically) required to write Android apps in Java and iOS apps in Objective-C or Swift. These are 100% strict requirements but apps written in other languages are either really shitty or very time consuming to write. (This is because the native APIs are written in these languages).

If you want to write Android apps, it's very important you understand Java first; otherwise you'll find yourself in the deep-end very quickly. I learned Java with the textbook "Absolute Java"; it's not bad but not great either, but I don't know of any better intro to Java book. Start there, then pick up "Android Programming". If you want to be extra proficient in Java, "Effective Java" is non-negotiable.
>>
>>51973590
*are not 100%
>>
>>51971573
It's a first year class at MIT. If you're struggling, just take your time.
>>
>>51973121
what class :^) I'm procrastinating studying hard for my data structures exam. I've been lightly studying for 4 or 5 days now though.
>>
>>51973516
A Lisp interpreter can be written in any language. Nowadays, they are typically written in C.

Writing a Lisp interpreter boils down to writing read and eval plus whatever built-in functions you need (e.g. you aren't going to get very far without car, cdr and cons).

You need structures to represent values and symbols. You need a garbage collector for those structures. Eval needs to be able to handle built-in functions, user-defined functions and lambda terms.

The first question is: dynamic or lexical scope? For a toy Lisp, dynamic is easier, but lexical is more useful (e.g. let-over-lambda closures).
>>
>>51973827
I'm reading up on that right now. I'm leaning towards lexical scope.
>>
>>51973415
kill urself u gaylorde
>>
>>51973774
what is your favorite data structure anon
>>
>>51973415
what about https://www.thenewboston.com/ ?
>>
>>51974004
The stack
>>
>>51974004
HashTable, the dankest data structure of them all. Also practically the best.
>>
https://beej.us/guide/bgnet/
Has anyone ever used this before?
Also does anyone have any experience with socket programming?
About to embark on this in C
>>
>>51973316
>multiprocessing
>parallelism
Choose one, pytard!
>>
>>51974105
I've done plenty of socket programming. It's fun to interact with remote machines.
>>
>>51974105
Beej's guide is considered one of the best. I used it and thought it was great.
>>
>>51973415
books > websites, any day.
Yes, you fucked up.
Yes, you should read the book.
>>
>>51974004
heaps (with avl trees in second)
>>
>>51973415
>>51974140

Just because you learned something differently the first time, doesn't mean you won't understand it the second time in another aproach.

How retarded are you?

Also read books you dumb shit
>>
>>51974004
The one no one seems to understand - the vector
>>
Daily reminder that people who call programming 'coding' have no idea what the fuck they are talking about and likely never will.
>>
>>51974201
I said he fucked up just because he wasted time and maybe built some easily-erasable bad habits
I remember wasting a little over a week on learn-c.org a couple years ago

>>51974237
fucking thank you
every time I've posted this, a bunch of faggots sperg at me for being a sperg autist
if you say 'coding' you sound retarded and should go back to writing html and css
>>
>>51974214
how much like C style arrays are they?
>>
>>51974237
>tfw I know someone that calls programming as coding yet he has done more than everyone in this thread combined and right now he maintains a big FOSS project.
I do agree however, but I think it should be used to distinguish between the act of writing code and the act of designing/thinking/improving/cirklejerking to it
>>
>>51974273
they are literally just c-style arrays that realloc when they get too big lmao

inb4 anon uses me as an example for his statement 'no one seems to understand'
>>
>>51974286
are they still contiguous in memory?

did this really need to become a feature in c++?
>>
>>51974296
nvm that first question was stupid
>>
Should I get a physical copy of K&R?
>>
>>51974319
if you can find it for cheap then yes, it's a great looking book
>>
When is Vulkan coming out?
>>
>>51974353
Probably early next year.
https://www.phoronix.com/scan.php?page=news_item&px=Khronos-Confirms-No-Vulkan
>>
>>51974353
2018
>>
>>51974371
I can't understand why they don';t make it public
>>
>>51974384
Probably because there is company IP involved and they have to go through a bunch of legal shit before they make it public.
>>
>>51974384
There aren't any implementations of it ready to be used yet.

If you want to learn how to use it, study Mantle.
>>
>>51974399
>There aren't any implementations of it ready to be used yet.
And? This is a even bigger reason to make it public.

>>51974398
But the people owning whatever IP are already members of it.
Not to mention that their other projects were not as hidden and had seen public drafts.
>>
>>51974429
By implementation I mean driver.
>>
>>51974437
I know
>>
>>51973324

Why would you start him on Javascript, ugh.

If he wants to be a web dev
>Html -> CSS -> Javascript -> CSS Animations/Shapes -> PHP/SQL -> AJAX shit -> Ruby on Rails

If he wants to do anything else;
Python -> Java -> Language of choice depending on job/discipline
>>
>>51974449
What's the use in making it public if it can't be used? You'd be able to compile stuff, but never run it.
>>
>>51974286
That's true but what I meant by not understanding was that people don't understand the performance implications of linear memory access. Prefetching to avoid cache misses happens automatically and makes software run very fast.
>>
>>51974479
So you're pro-vector over list, then, right?
Anyone who his pro list over vector (for simply storing data) is clinically retarded.
>>
>>51974468
So normal people can contribute, criticise and make their own implementations. Be it drivers or something else (eg layers on top of OpenGL/Direct3D).

>You'd be able to compile stuff, but never run it.
Not really, you wouldn't be able to compile it in most systems as you still need the necessary libraries and headers to do so.
>>
>>51974496
Of course. I'm almost never use a linked list. Do I LOOK clinically retarded?
>>
>>51974479
Then you should just say you're pro arrays, really
>>
File: 1408705862106.jpg (14 KB, 251x242) Image search: [Google]
1408705862106.jpg
14 KB, 251x242
>>51974465
>Ruby on Rails
You were going so well, then you blew it
>>
>>51974498
You can't productively write a Vulkan implementation without strictly talking to the GPU. To implement it on top of OpenGL or D3D would be a categorical waste of time; it would be like writing a C interpreter in Java.

You also can't contribute to it apart from contributing to open implementations or tools. It's just a standard API. If it changes, it doesn't work for a given implementation anymore.
>>
>>51974513
A raw array doesn't have a length attached and a static array isn't flexible.
>>
File: memI0.png (28 KB, 384x128) Image search: [Google]
memI0.png
28 KB, 384x128
Just finished a chess engine project in JavaFX

>3250 lines of code

Working through fixing some bugs with the game, for some reason the spacebar event speeds/breaks the countdown timers

checkmate algorithm occasionally fucks up
haven't tested the stalemate yet

4 weeks to do it, anyone else finishing up anything interesting before xmas?
>>
File: fsm.png (123 KB, 1920x1048) Image search: [Google]
fsm.png
123 KB, 1920x1048
Working on a automation software for Wow, it's able to level from level 1-80 on its own at the moment, with fully scriptable custom classes for the FSM & combat engines.
>>
>>51974496
>not programing to interfaces
List<Integer> a = new ArrayList<Integer>(); // equivalent to a vector in c++
List<Integer> b = new LinkedList<Integer>();

now I can use a and b in the exact same way. I can profile my program and switch implementations if I find one is faster.
>>
>>51974545
Hot shit anon. How does it not get banned?
>>
>>51974517

Personally I'm learning Scala atm but I dunno is RonR still used a lot? I have a few friends who never shutup about it
>>
>>51974538
Your biggest concerns are contiguous layout in memory, which is a good concern, but not restricted specifically to dynamic arrays
The other two things is can be fixed with a variable and realloc
>>
working on trying to not get depressed once again

>>51974545
>FILE, EDIT, ... HELP
why is VS SCREAMING at you?
>>
>>51974555
That's great, good work.
>>
>>51974555
Pipe down kid, adults are talking.
>>
>>51974562
I'm looking through the codes used by bots that have been detected in the past, and try to steer away from using them. It's not much of a problem, since it's a private program.
>>
>>51974545

Is that the package that the guy used to play through NES games?

FairPlay is scary
Thread replies: 255
Thread images: 24

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.