Tuesday, March 15, 2016

How to Learn Any Programming Language

I'm going to teach you how to learn most of the programming languages you may want to learn in the future. The organization of this book is based on how I and many other programmers learn new languages. The process that I usually follow is:
  1. Get a book or some introductory text about the language.
  2. Go through the book and type in all of the code making all of it run.
  3. Read the book as you work on the code, taking notes.
  4. Use the language to implement a small set of programs you are familiar with in another language.
  5. Read other people's code in the language, and try to copy their patterns.
In this book, I forced you to go through this process very slowly and in small chunks. Other books aren't organized the same way and this means you have to extrapolate how I've made you do this to how their content is organized. Best way to do this is to read the book lightly and make a list of all the major code sections. Turn this list into a set of exercises based on the chapters and then simply do them in order one at a time.
The above process also works for new technologies, assuming they have books you can read. For anything without books, you do the above process but use online documentation or source code as your initial introduction.
Each new language you learn makes you a better programmer, and as you learn more they become easier to learn. By your third or fourth language you should be able to pick up similar languages in a week, with stranger languages taking longer. Now that you know Python you could potentially learn Ruby and JavaScript fairly quickly by comparison. This is simply because many languages share similar concepts and once you learn the concepts in one language they work in others.
The final thing to remember about learning a new language is: Don't be a stupid tourist. A stupid tourist is someone who goes to another country and then complains that the food isn't like the food at home. "Why can't I get a good burger in this stupid country!?" When you're learning a new language, assume that what it does isn't stupid, it's just different, and embrace it so you can learn it.
After you learn a language though, don't be a slave to that language's way of doing things. Sometimes the people who use a language actually do some very idiotic things for no other reason than "that's how we've always done it." If you like your style better and you know how everyone else does it, then feel free to break their rules if it improves things.
I really enjoy learning new programming languages. I think of myself as a "programmer anthropologist" and think of them as little insights about the group of programmers who use them. I'm learning a language they all use to talk to each other through computers and I find this fascinating. Then again I'm kind of a weird guy so just learn programming languages because you want to.
Enjoy! This is really fun stuff.

Sunday, March 13, 2016

国内有哪些好的刷题网站?

- Welcome To PKU JudgeOnline 北京大学的Online Judge。POJ上面的题目有点老了,但好处是做的人多,经典算法题多,解题报告也多,适合上手。

- ZOJ :: Home 浙江大学的Online Judge。ZOJ用的不多,但为数不多的几次体验好像都还可以,值得尝试。

- Welcome to Hangzhou Dianzi University Online Judge 杭州电子科技大学的OJ。杭电OJ在近几年取代了POJ,成为是目前国内最主流的OJ。它的题目丰富,难度梯度合理,广受全国各大高校的青睐。每年也会有大大小小的比赛挂在杭电的OJ上举办,去年的亚洲区网络赛也是在这上面做的。由此可见其在国内广大ACMer心目中的地位。也正因为如此,网上hdu的解题报告也很多,适合个人进阶训练。

- UVa Online Judge 西班牙Valladolid大学的Online Judge。是最古老也是全世界最知名的Online Judge,题库有详细的分类:如世界总决赛题目,刘汝佳的题目等等。题目目类型非常广泛。绝大部分的题目难度偏易,适合初学者磨练程序设计。

- Timus Online Judge URAL是一个俄罗斯的在线题库。里面的题目相比国内一些OJ来说颇有些难度,我们学校集训队老队员喜欢拿这里的题出给新队员做,可见有一定的进阶作用。

- Sphere Online Judge (SPOJ) SPOJ是波兰最为出色的Online Judge之一,界面和谐,题目类型也非常丰富,适合有一定基础的选手练习,对高手而言也是个提高能力的良好平台。传说君临天下的楼教主刷完了这个OJ?(更正:楼教主刷完的是SGU,感谢 @康Connor 指正)更多介绍见博客:SPOJ简介 - 海山

- USA Computing Olympiad USACO是美国中学生的官方竞赛网站、美国著名在线题库,专门为信息学竞赛选手准备;做题方式模拟正式比赛,采用标准测评机、文件输入输出、直接提交程序源文件的测评方式;网站的Training题目全面,是学习信息学不可不知的网站,每年NOINOIP 都会参考上面的题目;每道题附有详细题解,可查看测试数据和运行结果,便于调试、发现错误并改正。
采用章节递进的层次结构,由易到难,讲授知识、练习编程结合,题目必须依次完成,避免了只挑简单题做的行为;各章节犹如一本竞赛辅导书,形成了一个鲜明的知识结构,利于OI初学者和高手逐步提高水平,充分学习信息学各方面知识,避免偏颇。(来源:usaco_百度百科

- Saratov State University :: Online Contester 之前上SGU一直是404,所以不敢贴上来。现在亲测能上了就也放上来给大家看看吧。这个是货真价实的楼教主刷完的OJ。楼教主为什么要刷这个OJ而不刷这个回答里的其他OJ呢?因为这个OJ确实适合提升水平,应该跟Ural, SPOJ的难度相当。另外就不太了解了,在我心目中,SGU, Ural, SPOJ都适合区域赛冲金以及毕业想去Google等顶级公司的ACMer/Coder训练,三者区别不大。

- Codeforces Codefores是俄罗斯的一个算法竞赛网站,由 Saratov State University 创办和维护。Codeforces主要强调的是算法竞赛,每隔1个礼拜左右就会有定期的线上比赛举行,其题库也是由每场比赛的题目一场场积累下来的。相比上面几个以题库为核心的OJ,Codeforces的算法竞赛比较适合锻炼自己的临场发挥和压力下编程能力。

- HUSTOJ 华中科技大学的Online Judge。hustOJ也和主流的其他OJ一样有着丰富的题库。但它主要的用处,是它所提供的这么一个叫做vjudge的东西,全称叫做Virtual Judge。通过vjudge,你可以从各大OJ、包括但不限于上述的所有OJ中直接抽取题目,利用这些题目创建一个属于你自己的比赛。非常适合专题训练、日常集训以及小伙伴们一起比赛切题玩。

- LeetCode Online Judge 与很多OJ不同,leetcode是一个主要面向面试者的OJ (LeetCode OJ is a platform for preparing technical coding interviews)。上面的题目不多,目前只有152道,很多都是许多大公司的面试题目。题目类型偏基础,基本不会考察复杂的算法,很多都是对基础知识的应用,难度与topcoder div1 250或codeforces div1 A题难度相当。如果是希望练习编程基础或准备公司面试的话非常推荐此OJ(感谢室友/集训队大神/CMU准硕士 @yun peng 同学提供Leetcode介绍 (1/1/2015更新:室友拿了google的offer不去CMU了))。

- 大视野在线测评·欢迎您 感谢评论区 @秋长泽建议,添加BZOJ。


作者:Luau Lawrence
链接:https://www.zhihu.com/question/25574458/answer/31175374
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

Tuesday, March 8, 2016

Weisites

code school
codeacademy
https://www.datacamp.com/
www.udemy.com
Lynda.com

Friday, March 4, 2016

Top 10 Websites to Learn Coding (Interactively) Online



Gone are the days when programming languages could only be mastered programmers like Bill Gates, who later got to dominate the world by storm. Noweveryone holds the same potential, and the chance to learn and even master programming language easily. Today, we will show you 10 interactive websites that will help you do that.
interactive code learning site
That’s right, forget about complicated setups and black, cold command prompts that make you want to quit before you start, and say hi to 10 educational websites with instant and interactive lessons that teach you programming languages like HTMLCSS, PHP, Ruby and even iOS. Pick up tips, screencasts and even best practices from industry professionals.
Kickstart the beginning of your new path into programming today!

Codecademy

Codecademy is indisputably the most famous website to teach you to code interactively, thanks to its helpful interface and well-structured courses. Upon visiting the main page, you can already start tasting the programming right away, with its motivating on-screen console. Pick a course that Codecademy offers from Web Fundamentals, PHP, JavaScript, jQuery, Python, Ruby and APIs.
codecademy
Inside each lesson is a panel that explains necessary code and instruction. Another panel allows you to get your hands dirty by writing acceptable code, then checking if you are doing the right thing. Don’t worry about making mistakes, as both instruction and code panels will warn you of errorsand provide hints. It is as if there’s a kind teacher right beside you.

Code Avengers

Code Avengers is designed to make you love programming. Though it only offers HTML5, CSS3 and JavaScript course for now, each of the courses is carefully designed to truly entertain you while leveling your programming skills painlessly. At the end of each lesson you also get to play a mini game to release your cumulated stress, and keep you going for longer.
code avengers
Code Avengers has a gradual approach to interactive learning. It does not explain too much knowledge that isn’t essential for beginners, just a bit of code and playful instruction, making things very easy to digest. You also get to play with the code, then see the impact of the changes immediately. It is carefully crafted with the beginner’s comfort in mind.

Code School

After you finished courses in Codecademy or Code Avengers, and you are ready to further expand your capabilities, Code School is the next quality website you should land on. Unlike most interactive learning sites, Code School offers morein-depth courses to train and turn you into an expert with the industry’s best practices.
Overall, the courses are categorized into 4 main paths, and they are:
  • Ruby
  • JavaScript
  • HTML/CSS
  • iOS
code school
Almost all courses are aggressively polished with impressive design and informative screencasts, though the challenges after the screencast might bit a bit hard for amateurs. Luckily, there are hints and answers to refer to. Whilemost of the offered courses are free, certain ones will require you to spend$25/month to access the entire course including all screencasts and challenges, and also all other courses in Code School.

Treehouse

Treehouse courses are more project-oriented than language-oriented, so they are perfect for novice programmer with a planned purpose, such as building a website, or an application. For example, the Websites course is all about building a responsive website, interactive website or even WordPress theme – a very practical and efficient way to master related languages. Nonetheless, they have released a plethora of foundation courses with a video-then-quiz approach.
treehouse
For Treehouse, every course is divided into different stages or modules, and beyond every first stage the learner will be invited to pay a monthly subscription fee of $25 to access all courses with 650+ videos, and an exclusive Treehouse Members Forum as a bonus. If you are serious about your programming future, you could subscribe the $49 monthly plan to obtain in-depth interviews with leading industry pros and cutting-edge workshops.

LearnStreet

If you are that kind of personnel who do not fancy playful design and prefer to deal with cold hard codes, LearnStreet is probably your thing. It currently offers JavaScript, Python and Ruby courses at beginner level. With a click on the ‘Start Course’ button you will start the lesson with an exercise, a code interpreter and a glossary panel (for new programming terms).
learnstreet
LearnStreet adopts command prompt-styled code interpreters with human language to explain function and encourage you whenever possible, the kind of command prompt you want for your own local machine. However, the code interpreter could be as rude as standard command prompt, as most of the times it requires you to type in the absolute same code and content it asks for.
Other than that, it’s truly friendly and enjoyable, and most importantly, free.

Udacity

Udacity is the unification of insightful video lectures and improved quizzes to achieve the interactive feel for students, so it’s ideal for those who don’t like to read but rather get explanations from industry professionals such as Google employees.
udacity
You will be given a screencast from pros discussing the topics and instructions, then you will take either logic or programming quizzes to strengthen your understanding or forge it into a skill. The good thing about Udacity is it provides more videos than any other site, and the instructors are either real-life professors or industry veterans.
The only pitfall here is most courses are not much related to each other, so Udacity is probably not your starting point, but a virtual university to further your study.

CodeHS

At this point all websites you read here are mainly dedicated to web development and computer science, but CodeHS is one with simple and fun game programming lessons that involve problem solving, JavaScript, animation,data structures, game design and puzzle challenges.
codehs
The advantage of CodeHS is it teaches you to think, and solve a problem like a programmer with its first course, Programming with Karel. The lessons are fun as you will learn how to use the code to move the dog, Karel to complete given tasks and puzzles like picking up ball and building a towel. It plants a solid concept of programming and the way it solves the problem systematically in your mind.
Other than the course mentioned above, you must sign up first with $25 per month to continue your learning journey, but it’s a perfect site to learn basic game programming effectively.

Khan Academy

Although Khan Academy’s courses are not as structured as CodeHS, it serves as an open playground for both novice and amateurs particularly interested in learning drawing, animation and user interaction with code. It does not preach any specific programming language, but the code pattern it adopts can be applied anywhere, as a majority of languages share the similar programming pattern.
khan academy
You can first join the Programming Basics course to watch and learn basic concepts, then explore the given code after the video tutorial to validate your doubts. With Khan Academy, you can save your modification as a Spin-Off for everyone to enjoy and customize. There have been hundreds of spin-offs just from one lesson in one course, so imagine the community size, and the lesson’s effectiveness.

Scratch 2.0

Think CodeHS and Khan Academy are still too hardcore for your child, who has no comprehension beyond basic English? No worries, there is something even easier for your aspiring next-gen programmer, and it’s called Scratch. Previously an offline software that allow kids to create, upload and share their projects proudly, Scratch is now fully online with its 2.0 successor.
scratch 2.0
It’s not about programming though, but a combination of visual blocks of commands that tell assigned objects how to behave, such as telling the cat to move 10 steps, or yell ‘meow’ when it touches the owner’s leg. By using this visual programming method, the young programmers will form a habit of breaking a problem into smaller blocks, and solve them one by one logically.

SQLZOO

Structured Query Language (SQL) is just a language purely designed to store and retrieve data from a database, so imagine the boredom you will experience when programming a warehouse. Yet SQLZOO wants you to learn SQL happily with its interactive interface and smileys.
sqlzoo
Since there is really nothing too deep to explain for a straightforward language like SQL, the site will only ask you to replace the variables like city names or population number, and raise the difficulty from that level. One huge let-down will be the shortage of hints, answers and forum, so you are probably doomed if you fail to solve any one of the quizzes, just like old times.

Comparison Chart

Here’s a comparison chart for you to get a bird’s eye view of all these awesome places to learn how to code.
WebsiteCourseFeaturePricingDifficulty
CodecademyHTML, CSS, JavaScript, jQuery, PHP, Ruby, Python, APICode Interpreter, Progress Saver, Project, ForumFreeEasy – Intermediate
Code AvengersHTML5, CSS3, JavaScriptCode Interpreter, Progress Saver, Project, NoteFreeEasy
Code SchoolHTML5, CSS, CSS3, jQuery, Ruby, Ruby on Rails, iOSCode Interpreter, Screencast, Progress Saver, ForumFree, $25/monthIntermediate – Hard
TreehouseHTML, CSS, CSS3, JavaScript, jQuery, Ruby, Ruby on Rails, iOS, Android, UX, DatabaseCode Interpreter, Screencast, Progress Saver, Project, ForumFree, $25/month, $49/monthEasy – Hard
LearnStreetHTML, CSS, JavaScript, Python, RubyCode Interpreter, Progress Saver, Project, ForumFreeEasy
UdacityWeb Development, HTML5, Python, Java,Computer Science, Algorithm, AICode Interpreter, Screencast, Progress Saver, ForumFreeIntermediate – Nightmare
CodeHSProblem Solving, JavaScript, Animation, Game ProgrammingCode Interpreter, Screencast, Progress SaverFree, $25/month, $75/monthEasy – Intermediate
Khan AcademyProgramming Basics, Canvas Drawing, Animation, User InteractionCode Interpreter, Screencast, Progress Saver, Project, DiscussionFreeEasy – Intermediate
Scratch 2.0Visual ProgrammingVisual Editor, Project, ForumFreeEasy
SQLZOOSQLCode InterpreterFreeEasy – Hard
Have you studied at any website we showcased above? How’s the experience? Or have we missed certain interactive learning sites with rich assets for budding programmers? Let us share our experiences and resources to help and inspire each other then!