{"id":556,"date":"2010-01-22T10:55:32","date_gmt":"2010-01-22T10:55:32","guid":{"rendered":"http:\/\/www.codingfriends.com\/?page_id=556"},"modified":"2010-03-17T12:26:17","modified_gmt":"2010-03-17T12:26:17","slug":"lessons-on-programming","status":"publish","type":"page","link":"https:\/\/www.codingfriends.com\/index.php\/projects\/lessons-on-programming\/","title":{"rendered":"Lessons on programming"},"content":{"rendered":"<p>Here is going be some links to posts that I have done regarding different aspects of programming in different languages so that it brings it all together as such.  For example, what is a class and how does it work etc.  anyway here are some basic tutorials and links to different languages and kinder to show how they are kinder all linked :).  The different headings will have different languages links underneath ;)..<\/p>\n<h2>Introduction to<\/h2>\n<h2>Hello world<\/h2>\n<p>The classic hello world program examples for some programming languages.<\/p>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/02\/01\/hello-world-8\/\">Flex &#8211; Hello world<\/a> (flash swf)<\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/27\/hello-world-3\/\">Javascript &#8211; Hello world<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/27\/hello-world-4\/\">PHP &#8211; Hello world.<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/28\/hello-world-ruby-style\/\">Ruby &#8211; hello world.<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/18\/hello-world\/\">C++ &#8211; Hello world<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/24\/hello-world-2\/\">C# &#8211; hello world.<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/27\/hello-world-classic\/\">Java &#8211; hello world.<\/a><\/li>\n<\/ol>\n<h2>Variable types<\/h2>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/27\/local-variables-3\/\">Java &#8211; local variables<\/a><\/li>\n<\/ol>\n<h2>Casting of variables<\/h2>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/02\/03\/reinterpret_cast-cpp\/\">Reinterpret_cast &#8211; c++<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/02\/03\/const_cast-cpp\/\">const_cast &#8211; c++<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/02\/08\/dynamic_cast-cpp\/\">dynamic_cast &#8211; c++<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/02\/08\/static_cast-cpp\/\">static_cast &#8211; c++<\/a><\/li>\n<\/ol>\n<h2>Flow control (loops) &#8211; while \/ for \/ foreach etc.<\/h2>\n<h2>Arrays<\/h2>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/27\/arrays-2\/\">Java<\/a><\/li>\n<\/ol>\n<h2>Methods<\/h2>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/27\/method-add-two-numbers-2\/\">Java &#8211; add two numbers<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/28\/method-add-two-numbers-4\/\">Ruby &#8211; add two numbers<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/27\/method-add-two-numbers-3\/\">PHP &#8211; add two numbers<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/24\/method-add-two-numbers\/\">C# &#8211; add two numbers<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/27\/add-two-numbers-3\/\">Javascript &#8211; add two numbers<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/02\/12\/method-adding-two-numbers\/\">C++ &#8211; add two numbers<\/a><\/li>\n<\/ol>\n<h2>Classes<\/h2>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/27\/class-structure-2\/\">Java<\/a><\/li>\n<\/ol>\n<h2>Comparison of classes<\/h2>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/02\/19\/equals-why-and-why-not-2\/\">Java &#8211; Equals \/ Compare<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/02\/16\/equals-why-and-why-not\/\">C# &#8211; Equals<\/a><\/li>\n<\/ol>\n<h2>Delegates \/ Events<\/h2>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/01\/18\/delegates-csharp\/\">C# &#8211; Delegates<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/02\/19\/events-fire-that-event\/\">C# &#8211; Events<\/a><\/li>\n<\/ol>\n<h2>Interfaces<\/h2>\n<ol\n\t\n\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/27\/interfaces\/\">Java<\/a><\/li>\n<\/ol>\n<h2>Overloading<\/h2>\n<p>Overloading is when you overload a methods\/functions within a class, when you overload a method you can define a function with the same function name but have either different return values and passing parameters.<\/p>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/01\/14\/overloading-methods-c\">C#<\/a><\/li>\n<\/ol>\n<h2>Overriding<\/h2>\n<p>Overriding functions allow for derived classes to override virtual functions from the base class.<\/p>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/01\/15\/polymorphism-override-csharp\/\">C#<\/a><\/li>\n<\/ol>\n<h2>Polymorphism<\/h2>\n<p>Polymorphism allows for a base class to be inherited to create a new class that implements\/add&#8217;s new functions.  Here are some examples in different languages <\/p>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/02\/02\/polymorphism\/\">C++<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/02\/02\/polymorphism-2\/\">PHP<\/a><\/li>\n<\/ol>\n<h2>Templates and Generics<\/h2>\n<p>Templates and Generics allow for the same class to be initialized with different data types. Here are some examples in different langauges<\/p>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/24\/templates\/\">C++ (Templates)<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/24\/generics\/\">C# (Generics)<\/a><\/li>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/27\/generics-2\/\">Java (Generics)<\/a><\/li>\n<\/ol>\n<h2>Constants, properties, fields, methods.<\/h2>\n<p>const in c++ ( and also within functions definitions) can be found <a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/01\/29\/const-constants-in-functions\/\">here<\/a><\/p>\n<p>Shall add more when doing the tutorials links<\/p>\n<h2>Files<\/h2>\n<ol>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/07\/27\/readwrite-files\/\">Java &#8211; read\/write<\/a>\n<\/ol>\n<h2>Exercises<\/h2>\n<p>During a interview I was asked to do some &#8220;home work&#8221; coding to show my style of coding and if I was able to do the tasks.<\/p>\n<ol>\n<li>Exercise 1. (Simple)<br \/>\nAccept form input for a user registration form, and store results in a MySQL table, using PHP. Applicant should demonstrate a knowledge of input validation, and using server-side code to avoid sql injection exploits. The user data should include first name, last name, email, and phone number. <\/p>\n<p>Usage of Javascript pre-validation would be a plus, as would forward planning, i.e. adding a unique code to the user details that could be used to validate their email address. Suitable MySQL table schema should be demonstrated.<\/p>\n<ul>\n<li>Part 1 of the exercise &#8211; <a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/03\/16\/web-page-inputs-and-insert-into-database\/\">web page and the javascript<\/a><\/li>\n<li>Part 2 of the exercise &#8211; <a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/03\/16\/web-page-inputs-and-insert-into-database-part-2\/\">php and database<\/a><\/li>\n<\/ul>\n<li>Exercise 2. (Medium) &#8211; <br \/>Write a class containing 2 functions. One function to merge 2 or more images into a single binary file. Write a counterpart function to this,which can extract the original files from the single binary, and write them out as single images, using their original filenames. Compression is not necessary, as the exercise is only designed to show an understanding of using binary files with PHP, filesystem error handling, and planning a simple file format.\n<ul>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/03\/11\/join-files-together-into-a-single-file-and-expand-out\/\">Code for joining files together and expanding them again<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Exercise 3. (Moderately difficult) <br \/>Create a simple stack-based calculator. This should be capable of performing addition, subtraction, multiplication and division. Example input would be: &#8220;2*(3+1)&#8221;. The result should be expressed as a numeric value, so the example should return 8. Usage of the eval() function, although amusing, is not allowed! This test is designed to show general programming skills, rather than an understanding of the programming platform; however the solution should be demonstrated using php as the language.\n<ul>\n<li><a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/03\/11\/simple-calculator\/\">Code of the simple calculator<\/a><\/a><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Here is going be some links to posts that I have done regarding different aspects of programming in different languages so that it brings it all together as such. For example, what is a class and how does it work etc. anyway here are some basic tutorials and links to different languages and kinder to &hellip; <a href=\"https:\/\/www.codingfriends.com\/index.php\/projects\/lessons-on-programming\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Lessons on programming<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":34,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-556","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/pages\/556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/comments?post=556"}],"version-history":[{"count":29,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/pages\/556\/revisions"}],"predecessor-version":[{"id":818,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/pages\/556\/revisions\/818"}],"up":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/pages\/34"}],"wp:attachment":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/media?parent=556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}