No.18688 [View All]
WHAT YOU'LL BE LEARNING:
C++
WHAT YOU'LL NEED:
>A computer with a text editor and compiler.IF YOU WANT TO START HACKING AT SOME CODE RIGHT AWAY:
>Navigate to http://coliru.stacked-crooked.com/>and read my second reply.BEFORE YOU GET STARTED:
>Make sure you have an editor with source highlighting and line numbers (gedit is good).>Install a compiler (gcc OR clang).WHAT IS A COMPILER?
>It converts human-readable source code (C++) into an executable (.exe, .bin, a.out)WHERE DO I GET ONE?
>Windows: http://tdm-gcc.tdragon.net/>Linux: Install the 'clang' and 'g++' packages, g++ is commonly installed>Mac Fags: I dunno, I don't use a mac, g++ should also be installedHOW DO I COMPILE STUFF?
>Make sure you have a C++ program typed out (enter 'int main() {}' and put it in a file somewhere)>Open up a terminal (CMD for you win fags)>navigate to where you stored the file with 'cd' and 'ls' ('dir' for windows fags)>type in 'g++ my_file.cpp' (or 'clang++' if you installed that)IT DIDN'T WORK!
>Make sure you either don't have spaces in your file name or you escaped the spaces with a backslash ('\'). 82 posts and 7 image replies omitted. Click [Open thread] to view. ____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.27375
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.27664
Got started with this shit, installed gedit and gcc and being a total nooblet I also had to learn how to bring up and navigate the windows terminal.
But I managed to compile and run the "hello /cyber/" program and I'll get into the meat of the matter at once.
Keep up the good work op.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.27689
>>27664
>programming c++ in a text editor
don't do that, it's insane. it might work for hello world and to show you how to use compilers from command line but beyond the first day it is just increasingly counterproductive.
install qt creator or codeblocks or some other professional IDE.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.27701
>>27689
>qt creator
>codeblocks
>professional
0/10 not even once
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.28439
Kinda related, I'm trying my hand at programming since I'm not the best. It's a random name generator and I tried making it create 7 letter roman-sounding names, but in all honesty it sounds like a russian name generator, which is pretty cool too. Sauce is here, forgive me if I don't use the code tags right.
<?php
$vowels = array("a", "e", "i", "o", "u");
$consonants = array("b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z");
function randVowel()
{
global $vowels;
return $vowels[array_rand($vowels, 1)];
}
function randConsonant()
{
global $consonants;
return $consonants[array_rand($consonants, 1)];
}
echo ucfirst("" . randConsonant() . "" . randVowel() . "" . randConsonant() . "" . randConsonant() . "" . randVowel() . "" . randConsonant() . "" . randVowel() . "" . randVowel() . "" . randConsonant() . "" );
?>
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.28444
>>28439
Sauce, though sometimes I get shit like "Heczoceox"
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.28445
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.28950
One of you shazbots start seeding that gentooman library please
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.28959
>>28950
shit user, I used to have it before my hard drive broke
>inb4 no backups
I'm poor as fuck.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.28969
>>28950
>One of you shazbots start seeding that gentooman library please
get it from retroshare or any other darknet. darknets are full of documents because you can fetch them quickly even when connections are still slow.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.28973
>>28969
I wasn't aware it was there.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.29028
>>28439
Try randomly walking a markov chain.
Initialize the markov chain with a bunch of random latin words and or names.
See what works best.
Markov chains ain't hard.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.31978
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.32013
>>25172
I found it used for 10€. Get to work, chummer!
>>18688
I've been learning C for a little bit now; I'm not doing anything too complicated yet, though. Shit like:
#include <stdio.h>
#include <stdlib.h>
void main()
{
int hor;
long conv;
char choice;
printf("Hours: ");
scanf("%d",&hor);
if (hor < 0 || hor == 0) {
printf("\nInvalid.\n");
exit(1);
}
printf("\nConvert to: \n");
printf("(A) Minutes\n");
printf("(B) Seconds\n");
printf("(C) Milliseconds\n");
printf("\n> ");
scanf(" %c",&choice);
if (choice == 'a' || choice == 'A') {
conv = hor*60L;
}
else if (choice == 'b' || choice == 'B') {
conv = hor*3600L;
}
else if (choice == 'c' || choice == 'C') {
conv = hor*3600L*10e+3L;
}
else {
printf("\nInvalid option!\n");
exit(1);
}
printf("\nResult: %ld\n",conv);
}
I'm following the book throughly; the author has yet to explain why we use int before the main function. Also, he hasn't mentioned the exit function yet either, I just did some research on that on my own (although this is from an exercise, I used some of the shit I learned from other sources).
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.32154
Iam learning java first. I need to make brouzouf. Also C, C++,java looks so similar each other.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.32167
>>18688
I'm making a simple website for my ftp server. I'm trying to learn some javascript for the website
What's the best way to calculate a random number from an array? I'm trying to make a quote list and some quotes appear twice or three times in a row when I refresh the page.Hope I get this right.
//store the quotations in arrays
quotes = [];
authors = [];
quotes[0] = "When life gives you lemons, don't make lemonade. Make life take the lemons back! Get mad! 'I don't want your damn lemons! What am I supposed to do with these?' Demand to see life's manager! Make life rue the day it thought it could give Cave Johnson lemons! Do you know who I am? I'm the man who's going to burn your house down! With the lemons! I'm going to get my engineers to invent a combustible lemon that burns your house down!";
authors[0] = "Cave Johnson, Portal";
quotes[1] = "Life is a negotiation; we all want. We all give to get what we want";
authors[1] = "Mordin Solus, Mass Effect 2";
quotes[2] = "People should be doubted. Many people misunderstand this concept. Doubting people is just a part of getting to know them. What many people call ‘trust’ is really just giving up on trying to understand others, and that very act is far worse than doubting. It is actually ‘apathy.’";
authors[2] = "Shinichi Akiyama, Liar Game";
quotes[3] = "That time was lost, yet time continued onward. ";
authors[3] = "Lightning, Final Fantasy XIII-2";
quotes[4] = "The sky above the port was the colour of television, tuned to a dead channel.";
authors[4] = "William Gibson, Neuromancer";
quotes[5] = "Now, why don't you go fuck your selfie?";
authors[5] = "Victoria Chase, Life Is Strange";
quotes[6] = "";
authors[6] = "";
quotes[7] = "Anime was a mistake.";
authors[7] = "Hayao Miyazaki";
quotes[8] = "I'm the jury,"+"<br>"+"I'm the judge,"+"<br>"+"And I committed all the crimes,"+"<br>"+"How hard I try;"+"<br>"+"It's not enough.";
authors[8] = "'Not Enough', Delain";
quotes[9] = "I learn to lose,"+"<br>"+"I learn to win,"+"<br>"+"I turn my face against the wind,"+"<br>"+"I will move fast,"+"<br>"+"I will move slow,"+"<br>"+"Take me where I have to go.";
authors[9] = "'Still Alive', Mirror's Edge";
quotes[10] = "Listen to me very carefully; people can become... whatever they want to be.";
authors[10] = "Franz Bonaparta, Monster";
quotes[11] = "Everyone is alone. Everyone is empty. People no longer have need of others. You can always find a spare for any replacement. Any relationship can be replaced. That's the world I grew tired of.";
authors[11] = "Shogo Makishima, Psycho-Pass ";
quotes[12] = "I love this game that people call life from the bottom of my heart.";
authors[12] = "Shogo Makishima, Psycho-Pass";
quotes[13] = "Friends are like books that write themselves.";
authors[13] = "Tera: Fate of Arun";
quotes[14] = "Just trust me you dumb fucks.";
authors[14] = "Mark Zuckerberg, J.E.W. of Facebook and renowned schlong-swallowing cock goblin";
quotes[15] = "It's not news anymore, it's advertising.";
authors[15] = "Faith Connors, Mirror's Edge";
//the below is to be inserted in the quotation marks for 4-lined song lyrics.
//Replace the "line" words with one line of the lyrics until done
//To add more lines, insert whats in the brackets: (+"<br>"+"your new line is here"). Lather, rinse, repeat.
"line1"+"<br>"+"line2"+"<br>"+"line3"+"<br>"+"line4";
//calculate a random index number
index = Math.floor(Math.random() * quotes.length);
//display the quotation
document.write("<DL>\n");
document.write("<DT>" + "\"" + quotes[index] + "\"</DT>\n");
document.write("<DD>" + "<br>" + "- " + authors[index] + "</DT>\n");
document.write("</DL>\n");
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.32168
>>32167
Result on jsfiddle. if you're waiting for the website to load for a while, just hit 'run' in the top left corner.
https://jsfiddle.net/Lyaj33dc/
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.32176
>>32167
Jesus, this is horrible.
Use a fucking associative array, and don't use a 'quotes' and 'authors' array.
You also have '<q>' tags for quotes in html.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.32188
>>32176
>tells me my javascript is horrible
>suggests replacing javascript with <q> tags in html
Please tell me how displaying 15 quotes at once is better than my array method.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.32189
>>32188
Don't be ridiculous, he was saying that you could use <q> instead of <dt> and <dd>
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.32190
>>32189
Oh. That works too I guess.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.32548
>>18701
>don't EVER switch away from your first language
My first language was Perl. I am become spaghetti, bane of maintenance programmers. I abuse print if like no tomorrow.
>>18788
Emacs.
>>25089
http://rms.sexy/books
You can pick and choose what you want, too, rather than wasting 35GB+ of disk space.
>>32167
>tfw no qw () in Javascript
Man that's inconvenient.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.33168
Can anyone point me to a good dictionary file or list of millions of common passwords?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.33373
Why is learning or even trying to understand code hard.
I just want to understand it so i can do stuff with it.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.33383
>>33373
depending on your meaning of "do stuff with it" that means up to 10 years of experience.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.38494
How and where do I save my codes?
I'm trying to follow these instruction and all I have to show for it is wasted time.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.38689
Suggestion: /cyber/ should team up and create a roguelike ASCII game.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.38692
>>38494
Create a GIT repository on your computer and save your code into it. Or sign up for GitHub and let them create a repository for you.
http://www.git-scm.com/book/en/v2/Getting-Started-About-Version-Control
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.42117
another thread worth bumpin
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.47535
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.47581
>>18688
Thanks a lot OP, this is just what i was looking for, keep the installments coming, i might add something myself.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.47585
>>18688
oh look, another /g/ faggo
> WHAT YOU'LL BE LEARNING:
> C++
nevermind, op is cool. bumping
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.47586
>>18701
My first language was Visual Basic 6 back in highschool nearly 15 years ago. Is Visual Basic still used anywhere?
If not Visual Basic then what about Basic?
If VB and Basic are outdated then what language is closest to them?
I want to learn a language I can use to get a job
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.47592
>>47585
>C++ without at least one year of experience in C
>cool
How much poo is there on your sidewalk?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.48084
>not teaching Common Lisp instead
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.48087
>>47586
Go for Python. Very wide range of uses - from web dev to data stuff to infrastructure.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.48096
>>18688
>editor with source highlighting
so.. this is needed… i thought i just needed to be able to write text not have a disco?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.48102
>going to uni for CS degree to become more schway
>halfway through the first semester
>already failing my discrete math 1 class with no hopes of recovery
Maybe smoking pot in high school instead of taking math classes wasn’t such a good idea
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.48103
>>48102
>failing my discrete math 1 class
How is this possible?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.48104
How would a retard like myself even begin to understand any of this code business?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.48107
>>48102
Shieeet anon, get your shit together. It's not hard. Whatever's causing you to fail is in your head. Imagine that passing this course is like getting to a 100 pushups. It just takes a few months of practice a few times a week. If you do that, there's no fucking way to fail. If you're stuck on something, go one step back until you find a place that you understand. Now go one step forward. If you really can't grok it, ask a few people for help.
If you don't have the discipline, you'll end up working a dead end job and smoking pot into your 50ties. Do I sound like somebody's parents? Maybe. You know what's the worst part of working a dead end job for years? It's fucking boring. You never have brouzouf for doing anything cool (ie. buying parts, books, etc.). You have no control over anything except your sphincter.
It's your choice.
>>48104
1. Ask questions on 8ch.net/cyber.
2. Pick something that makes sense.
3. Go at it for a month.
4. Congrats, you've learned some stuff. Now, with that new info, decide if you're going in the right direction. Ask more questions. Think about switching to eg. a different language or something.
5. Head in that direction.
6. Say no to stupid distractions.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.48110
>>48084
>common lisp
>good teaching resources
Pick one broski, there are very few beginning resources for Lisp, outside of the book land of lisp, and even then it is really not very good. Something like Scheme would have been a much better choice though than C++ for beginning programming. Almost all of the common lisp stuff is a bit too inaccessible for most beginners IMO. Paul Grahams book for instance is not something i would ever recommend to a newbie.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.48181
>>48102
Shitting dick nipples, CS students learn discrete maths? I could've picked that module but instead I went for game theory, and now I'm stuck with faggy optimisation problems you have to solve by hand because whoever designs maths courses is living in the goddamn Dark Ages.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.50625
>>18696
this guy is a complete dipshit. C++ is generally agreed to be one of the best languages except by script-kiddies who are too dumb to understand it. Also, python.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.51911
YouTube embed. Click thumbnail to play. >>18688
necromance for intredast. does /cyber/ still code?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.51929
>>51911
working on my compiler which is more like a macro assembler + linker than a true compiler It's written in C.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.51986
Is codeacademy any good for an absolute, know-nothing beginner?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.51990
>>51986
I remember not liking it, but I don't remember why exactly.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.51991
>>51986
It's probably okay if you're motivated to follow through on it. Personally I read books when I was beginning because they are easier to skip around in when you don't give a shit about a topic. The most important thing is to work on projects that interest you but are also within your ability. When you naturally find yourself needing a feature you'll be more motivated to learn it.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
No.52633
>>51991
> When you naturally find yourself needing a feature you'll be more motivated to learn it.
This is why I wrote my first hash table implementation. command_name -> function mapping in some IRC bot. Linked lists were taking too long with 100s of commands.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.