{"appState":{"pageLoadApiCallsStatus":true},"categoryState":{"relatedCategories":{"headers":{"timestamp":"2023-02-02T08:01:03+00:00"},"categoryId":33592,"data":{"title":"Programming & Web Design","slug":"programming-web-design","image":{"src":null,"width":0,"height":0},"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592}],"parentCategory":{"categoryId":33512,"title":"Technology","slug":"technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"}},"childCategories":[{"categoryId":34511,"title":"Go Programming Language","slug":"go-programming-language","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34511"},"image":{"src":"/img/background-image-2.fabfbd5c.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":1,"bookCount":1},{"categoryId":33593,"title":"3D Printing","slug":"3d-printing","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33593"},"image":{"src":"/img/background-image-1.daf74cf0.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":33,"bookCount":1},{"categoryId":33594,"title":"App Development","slug":"app-development","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33594"},"image":{"src":"/img/background-image-2.fabfbd5c.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":85,"bookCount":6},{"categoryId":33595,"title":"C","slug":"c","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33595"},"image":{"src":"/img/background-image-1.daf74cf0.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":17,"bookCount":3},{"categoryId":33596,"title":"C#","slug":"csharp","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33596"},"image":{"src":"/img/background-image-2.fabfbd5c.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":29,"bookCount":4},{"categoryId":33597,"title":"C++","slug":"cplusplus","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33597"},"image":{"src":"/img/background-image-1.daf74cf0.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":63,"bookCount":2},{"categoryId":33598,"title":"Cisco Programming","slug":"cisco-programming","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33598"},"image":{"src":"/img/background-image-2.fabfbd5c.png","width":0,"height":0},"hasArticle":true,"hasBook":false,"articleCount":1,"bookCount":0},{"categoryId":33599,"title":"Coding","slug":"coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"image":{"src":"/img/background-image-1.daf74cf0.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":106,"bookCount":5},{"categoryId":33600,"title":"HTML","slug":"html","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33600"},"image":{"src":"/img/background-image-2.fabfbd5c.png","width":0,"height":0},"hasArticle":true,"hasBook":false,"articleCount":8,"bookCount":0},{"categoryId":33601,"title":"HTML5","slug":"html5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"image":{"src":"/img/background-image-1.daf74cf0.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":265,"bookCount":2},{"categoryId":33602,"title":"Java","slug":"java","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33602"},"image":{"src":"/img/background-image-2.fabfbd5c.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":122,"bookCount":6},{"categoryId":33603,"title":"JavaScript","slug":"javascript","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33603"},"image":{"src":"/img/background-image-1.daf74cf0.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":86,"bookCount":3},{"categoryId":33604,"title":"MATLAB","slug":"matlab","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33604"},"image":{"src":"/img/background-image-2.fabfbd5c.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":83,"bookCount":1},{"categoryId":33606,"title":"Python","slug":"python","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33606"},"image":{"src":"/img/background-image-1.daf74cf0.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":83,"bookCount":5},{"categoryId":33607,"title":"R","slug":"r","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33607"},"image":{"src":"/img/background-image-2.fabfbd5c.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":99,"bookCount":4},{"categoryId":33608,"title":"SQL","slug":"sql","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33608"},"image":{"src":"/img/background-image-1.daf74cf0.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":26,"bookCount":3},{"categoryId":33610,"title":"General Programming & Web Design","slug":"general-programming-web-design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33610"},"image":{"src":"/img/background-image-2.fabfbd5c.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":206,"bookCount":35},{"categoryId":34324,"title":"CSS3","slug":"css3","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34324"},"image":{"src":"/img/background-image-1.daf74cf0.png","width":0,"height":0},"hasArticle":true,"hasBook":false,"articleCount":4,"bookCount":0},{"categoryId":34338,"title":"Web Hosting","slug":"web-hosting","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34338"},"image":{"src":"/img/background-image-2.fabfbd5c.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":6,"bookCount":1},{"categoryId":34376,"title":"Blogging & Website Platforms","slug":"blogging-website-platforms","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34376"},"image":{"src":"/img/background-image-1.daf74cf0.png","width":0,"height":0},"hasArticle":true,"hasBook":true,"articleCount":65,"bookCount":9}],"description":"Ever wonder what makes the software, websites, and blogs you use every day function properly (or improperly)? It's programming. Our articles reveal the ins and outs of programming and web design.","relatedArticles":{"self":"https://dummies-api.dummies.com/v2/articles?category=33592&offset=0&size=5"},"hasArticle":true,"hasBook":true,"articleCount":1390,"bookCount":94},"_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"}},"relatedCategoriesLoadedStatus":"success"},"listState":{"list":{"count":10,"total":1392,"items":[{"headers":{"creationTime":"2016-03-27T16:48:10+00:00","modifiedTime":"2023-01-11T15:40:51+00:00","timestamp":"2023-01-11T18:01:03+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Java","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33602"},"slug":"java","categoryId":33602}],"title":"Java All-in-One For Dummies Cheat Sheet","strippedTitle":"java all-in-one for dummies cheat sheet","slug":"java-all-in-one-for-dummies-cheat-sheet","canonicalUrl":"","seo":{"metaDescription":"Learn about writing Java statements and classes, the different kinds of Java data types, and the operations for operands.","noIndex":0,"noFollow":0},"content":"Writing Java statements (like <code>for </code>and <code>if</code>) and classes (like <code>Math</code> and <code>NumberFormat</code>) help you start and build strong programs. Variables hold different kinds of <a href=\"https://www.dummies.com/programming/java/the-eight-data-types-of-java/\" target=\"_blank\" rel=\"noopener\">Java data types</a>: numbers, characters, and true/false numbers. You designate Java operations that can be performed on operands, including arithmetic operators, relational operators (or binary) and logical operators (or Boolean).\r\n\r\n[caption id=\"attachment_272791\" align=\"alignnone\" width=\"556\"]<img class=\"size-full wp-image-272791\" src=\"https://www.dummies.com/wp-content/uploads/Java-concept.jpg\" alt=\"Java concept image\" width=\"556\" height=\"489\" /> © DeymosHR/Shutterstock.com[/caption]","description":"Writing Java statements (like <code>for </code>and <code>if</code>) and classes (like <code>Math</code> and <code>NumberFormat</code>) help you start and build strong programs. Variables hold different kinds of <a href=\"https://www.dummies.com/programming/java/the-eight-data-types-of-java/\" target=\"_blank\" rel=\"noopener\">Java data types</a>: numbers, characters, and true/false numbers. You designate Java operations that can be performed on operands, including arithmetic operators, relational operators (or binary) and logical operators (or Boolean).\r\n\r\n[caption id=\"attachment_272791\" align=\"alignnone\" width=\"556\"]<img class=\"size-full wp-image-272791\" src=\"https://www.dummies.com/wp-content/uploads/Java-concept.jpg\" alt=\"Java concept image\" width=\"556\" height=\"489\" /> © DeymosHR/Shutterstock.com[/caption]","blurb":"","authors":[{"authorId":8946,"name":"Doug Lowe","slug":"doug-lowe","description":" <p><b>Doug Lowe </b>is the information technology director at Blair, Church & Flynn Consulting Engineers, a civil engineering firm. He has written more than 50 <i>For Dummies</i> books on topics ranging from Java to electronics to PowerPoint.</p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/8946"}}],"primaryCategoryTaxonomy":{"categoryId":33602,"title":"Java","slug":"java","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33602"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[],"fromCategory":[{"articleId":275099,"title":"How to Download and Install TextPad","slug":"how-to-download-and-install-textpad","categoryList":["technology","programming-web-design","java"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/275099"}},{"articleId":275089,"title":"Important Features of the Java Language","slug":"important-features-of-the-java-language","categoryList":["technology","programming-web-design","java"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/275089"}},{"articleId":245151,"title":"How to Install JavaFX and Scene Builder","slug":"install-javafx-scene-builder","categoryList":["technology","programming-web-design","java"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/245151"}},{"articleId":245148,"title":"A Few Things about Java GUIs","slug":"things-java-guis","categoryList":["technology","programming-web-design","java"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/245148"}},{"articleId":245141,"title":"Getting a Value from a Method in Java","slug":"getting-value-method-java","categoryList":["technology","programming-web-design","java"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/245141"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281747,"slug":"java-all-in-one-for-dummies-6th-edition","isbn":"9781119986645","categoryList":["technology","programming-web-design","java"],"amazon":{"default":"https://www.amazon.com/gp/product/1119986648/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119986648/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119986648-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119986648/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119986648/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/java-all-in-one-for-dummies-7th-edition-cover-9781119986645-203x255.jpg","width":203,"height":255},"title":"Java All-in-One For Dummies, 7th Edition","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"<p><b><b data-author-id=\"8946\">Doug Lowe</b> </b>is the information technology director at Blair, Church & Flynn Consulting Engineers, a civil engineering firm. He has written more than 50 <i>For Dummies</i> books on topics ranging from Java to electronics to PowerPoint.</p>","authors":[{"authorId":8946,"name":"Doug Lowe","slug":"doug-lowe","description":" <p><b>Doug Lowe </b>is the information technology director at Blair, Church & Flynn Consulting Engineers, a civil engineering firm. He has written more than 50 <i>For Dummies</i> books on topics ranging from Java to electronics to PowerPoint.</p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/8946"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;java&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119986645&quot;]}]\" id=\"du-slot-63bef95f2b3be\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;java&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119986645&quot;]}]\" id=\"du-slot-63bef95f2bc1c\"></div></div>"},"articleType":{"articleType":"Cheat Sheet","articleList":[{"articleId":154428,"title":"Common Java Statements","slug":"common-java-statements","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/154428"}},{"articleId":154427,"title":"Primitive Data Types","slug":"primitive-data-types","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/154427"}},{"articleId":154429,"title":"Math and NumberFormat Classes","slug":"math-and-numberformat-classes","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/154429"}},{"articleId":154426,"title":"Java Operators","slug":"java-operators","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/154426"}}],"content":[{"title":"Common Java statements","thumb":null,"image":null,"content":"<p>Java statements build programs. Every Java class must have a body, which is made up of one or more statements. You can write different kinds of statements, including declaration and expression.</p>\n<h3>The <i>break</i> statement</h3>\n<pre class=\"code\">break;</pre>\n<h3>The <i>continue</i> statement</h3>\n<pre class=\"code\">continue;</pre>\n<h3>The <i>do</i> statement</h3>\n<pre class=\"code\">do\r\n {<i>statements</i>...}\r\nwhile (<i>expression</i>);</pre>\n<h3>The <i>for</i> statement</h3>\n<pre class=\"code\">for (<i>init</i>; <i>test</i>; count)\r\n {<i>statements</i>...}</pre>\n<h3>The enhanced <i>for</i> statement</h3>\n<pre class=\"code\">for (type variable : array-or-\r\n collection)\r\n {statements...}</pre>\n<h3>The <i>if</i> statement</h3>\n<pre class=\"code\">if (<i>expression</i>)\r\n {<i>statements</i>...}\r\nelse\r\n {<i>statements</i>...}</pre>\n<h3>The <i>throw</i> statement</h3>\n<pre class=\"code\">throw (<i>exception</i>)</pre>\n<h3>The <i>switch</i> statement</h3>\n<pre class=\"code\"><i>switch (expression)</i>\r\n{\r\n case <i>constant</i>:\r\n <i>statements</i>;\r\n break;\r\n default:\r\n <i>statements</i>;\r\n break; \r\n}</pre>\n<h3>The <i>while</i> statement</h3>\n<pre class=\"code\">while (<i>expression</i>)\r\n {<i>statements</i>...}</pre>\n<h3>The <i>try</i> statement</h3>\n<pre class=\"code\">try\r\n {<i>statements</i>...}\r\ncatch (<i>exception</i><i>-class</i> e)\r\n {<i>statements</i>...}...\r\nfinally\r\n {<i>statements</i>...}\r\ntry\r\n {<i>statements</i>...}\r\nfinally\r\n {<i>statements</i>...}</pre>\n"},{"title":"Primitive data types","thumb":null,"image":null,"content":"<p><i>Java data types </i>are the kind of data you can store in a variable. <i>Primitive data types</i> are defined by the language itself. Java defines a total of eight primitive types. Of the eight primitive data types, six are for numbers, one is for characters, and one is for true/false values. Of the six number types, four are types of integers, and two are types of floating-point numbers.</p>\n<table>\n<tbody>\n<tr>\n<th>Type</th>\n<th>Wrapper Class</th>\n<th>Parse Method of Wrapper Class</th>\n</tr>\n<tr>\n<td><span class=\"code\"><code>int</code></span></td>\n<td><span class=\"code\"><code>Integer</code></span></td>\n<td><span class=\"code\"><code>int parseInt(String s)</code></span></td>\n</tr>\n<tr>\n<td><span class=\"code\"><code>short</code></span></td>\n<td><span class=\"code\"><code>Short</code></span></td>\n<td><span class=\"code\"><code>short parseShort(String s)</code></span></td>\n</tr>\n<tr>\n<td><span class=\"code\"><code>long</code></span></td>\n<td><span class=\"code\"><code>Long&lt;</code>/span&gt;</span></td>\n<td><span class=\"code\"><code>long parseLong(String s)</code></span></td>\n</tr>\n<tr>\n<td><span class=\"code\"><code>byte</code></span></td>\n<td><span class=\"code\"><code>Byte</code></span></td>\n<td><span class=\"code\"><code>byte parseByte(String s)</code></span></td>\n</tr>\n<tr>\n<td><span class=\"code\"><code>float</code></span></td>\n<td><span class=\"code\"><code>Float</code></span></td>\n<td><span class=\"code\"><code>float parseFloat(String s)</code></span></td>\n</tr>\n<tr>\n<td><span class=\"code\"><code>double</code></span></td>\n<td><span class=\"code\"><code>Double</code></span></td>\n<td><span class=\"code\"><code>double parseDouble(String s)</code></span></td>\n</tr>\n<tr>\n<td><span class=\"code\"><code>char</code></span></td>\n<td><span class=\"code\"><code>Character</code></span></td>\n<td>(none)</td>\n</tr>\n<tr>\n<td><span class=\"code\"><code>boolean</code></span></td>\n<td><span class=\"code\"><code>Boolean</code></span></td>\n<td><span class=\"code\"><code>boolean parseBoolean(String s)</code></span></td>\n</tr>\n</tbody>\n</table>\n"},{"title":"Math and NumberFormat classes","thumb":null,"image":null,"content":"<p>Java classes lay the foundation for your programs. The Java <span class=\"code\"><code>Math</code></span> and <span class=\"code\"><code>NumberFormat</code></span> classes let you program number values, as well as format numbers and currencies.</p>\n<table>\n<caption><strong>The <i>Math</i> Class</strong></caption>\n<tbody>\n<tr>\n<th>Method</th>\n<th>Description</th>\n</tr>\n<tr>\n<td><span class=\"code\"><code>num abs(num y);</code></span></td>\n<td>Absolute value of <em><span class=\"code\">y</span></em> (<span class=\"code\">num</span> can be any numeric data type)</td>\n</tr>\n<tr>\n<td><span class=\"code\"><code>num max(num y, num z);</code></span></td>\n<td>Maximum of <em><span class=\"code\">y</span></em> and <em><span class=\"code\">z</span></em></td>\n</tr>\n<tr>\n<td><span class=\"code\"><code>num min(num y, num z);</code></span></td>\n<td>Minimum of <em><span class=\"code\">y</span></em> and <em><span class=\"code\">z</span></em></td>\n</tr>\n<tr>\n<td><span class=\"code\"><code>double = Math. random();</code></span></td>\n<td>Random number, such that 0.0 &lt; <em>x</em> &lt;= 1.0</td>\n</tr>\n</tbody>\n</table>\n<table>\n<caption><strong>The <em>NumberFormat</em> Class</strong></caption>\n<tbody>\n<tr>\n<th>Method</th>\n<th>Description</th>\n</tr>\n<tr>\n<td><span class=\"code\"><code>NumberFormat<br />\ngetNumberInstance();</code></span></td>\n<td>Gets an instance that formats numbers.</td>\n</tr>\n<tr>\n<td><span class=\"code\"><code>NumberFormat</code></span></td>\n<td>Gets an instance that formats currency.</td>\n</tr>\n<tr>\n<td><span class=\"code\"><code>String format(x);</code></span></td>\n<td>Formats the specified number.</td>\n</tr>\n</tbody>\n</table>\n"},{"title":"Java operators","thumb":null,"image":null,"content":"<p>An <i>operator </i>designates a mathematical operation or some other type of operation that can be performed on <i>operands.</i> Java has <i>arithmetic operators, relational operators </i>(also known as <i>binary operators</i>) and <i>logical operators </i>(also known as <i>B</i><i>oolean</i><i> operators)</i>.</p>\n<table>\n<caption><strong>Arithmetic</strong></caption>\n<tbody>\n<tr>\n<th>Operator</th>\n<th>Description</th>\n</tr>\n<tr>\n<td><span class=\"code\">+</span></td>\n<td>Addition</td>\n</tr>\n<tr>\n<td><span class=\"code\">&#8211;</span></td>\n<td>Subtraction</td>\n</tr>\n<tr>\n<td><span class=\"code\">*</span></td>\n<td>Multiplication</td>\n</tr>\n<tr>\n<td><span class=\"code\">/</span></td>\n<td>Division</td>\n</tr>\n<tr>\n<td><span class=\"code\">%</span></td>\n<td>Remainder</td>\n</tr>\n<tr>\n<td><span class=\"code\">++</span></td>\n<td>Increment</td>\n</tr>\n<tr>\n<td><span class=\"code\">—</span></td>\n<td>Decrement</td>\n</tr>\n<tr>\n<td><span class=\"code\">+=</span></td>\n<td>Addition and assignment</td>\n</tr>\n<tr>\n<td><span class=\"code\">-=</span></td>\n<td>Subtraction and assignment</td>\n</tr>\n<tr>\n<td><span class=\"code\">*=</span></td>\n<td>Multiplication and assignment</td>\n</tr>\n<tr>\n<td><span class=\"code\">/=</span></td>\n<td>Division and assignment</td>\n</tr>\n<tr>\n<td><span class=\"code\">%=</span></td>\n<td>Remainder and assignment</td>\n</tr>\n</tbody>\n</table>\n<p>&nbsp;</p>\n<table>\n<caption><strong>Relational</strong></caption>\n<tbody>\n<tr>\n<th>Operator</th>\n<th>Description</th>\n</tr>\n<tr>\n<td><span class=\"code\">==</span></td>\n<td>Equal</td>\n</tr>\n<tr>\n<td><span class=\"code\">!=</span></td>\n<td>Not equal</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;</span></td>\n<td>Less than</td>\n</tr>\n<tr>\n<td><span class=\"code\">&lt;=</span></td>\n<td>Less than or equal to</td>\n</tr>\n<tr>\n<td><span class=\"code\">&gt;</span></td>\n<td>Greater than</td>\n</tr>\n<tr>\n<td><span class=\"code\">&gt;=</span></td>\n<td>Greater than or equal to</td>\n</tr>\n</tbody>\n</table>\n<p>&nbsp;</p>\n<table>\n<caption><strong>Logical</strong></caption>\n<tbody>\n<tr>\n<th>Operator</th>\n<th>Description</th>\n</tr>\n<tr>\n<td><span class=\"code\">!</span></td>\n<td>Not</td>\n</tr>\n<tr>\n<td><span class=\"code\">&amp;</span></td>\n<td>And</td>\n</tr>\n<tr>\n<td><span class=\"code\">&amp;&amp;</span></td>\n<td>Conditional and</td>\n</tr>\n<tr>\n<td><span class=\"code\">|</span></td>\n<td>Or</td>\n</tr>\n<tr>\n<td><span class=\"code\">||</span></td>\n<td>Conditional or</td>\n</tr>\n<tr>\n<td><span class=\"code\">^</span></td>\n<td>xor</td>\n</tr>\n</tbody>\n</table>\n"}],"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"One year","lifeExpectancySetFrom":"2023-01-11T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":207712},{"headers":{"creationTime":"2023-01-10T19:24:24+00:00","modifiedTime":"2023-01-11T14:37:48+00:00","timestamp":"2023-01-11T15:01:03+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"R","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33607"},"slug":"r","categoryId":33607}],"title":"R All-in-One For Dummies Cheat Sheet","strippedTitle":"r all-in-one for dummies cheat sheet","slug":"r-all-in-one-for-dummies","canonicalUrl":"","seo":{"metaDescription":"R provides a wide array of functions to help you with your work — from simple statistics to complex analyses.This Cheat Sheet is a handy reference for Base R st","noIndex":0,"noFollow":0},"content":"R provides a wide array of functions to help you with your work — from simple statistics to complex analyses.\r\n\r\nThis Cheat Sheet is a handy reference for Base R statistical functions, interactive applications, machine learning, databases, and images.","description":"R provides a wide array of functions to help you with your work — from simple statistics to complex analyses.\r\n\r\nThis Cheat Sheet is a handy reference for Base R statistical functions, interactive applications, machine learning, databases, and images.","blurb":"","authors":[{"authorId":9759,"name":"Joseph Schmuller","slug":"joseph-schmuller","description":" <p><b>Joseph Schmuller</b> works on the Digital & Enterprise Architecture Team at Availity. He has taught statistics at the undergraduate and graduate levels. He has created and delivered courses for LinkedIn Learning, and he is the author of all previous editions of <i>Statistical Analysis with Excel For Dummies.</i></p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9759"}}],"primaryCategoryTaxonomy":{"categoryId":33607,"title":"R","slug":"r","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33607"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[],"fromCategory":[{"articleId":262959,"title":"Statistical Analysis with R For Dummies Cheat Sheet","slug":"statistical-analysis-with-r-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","r"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/262959"}},{"articleId":251666,"title":"R Project: Combining an Image with an Animated Image","slug":"r-project-combining-image-animated-image","categoryList":["technology","programming-web-design","r"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/251666"}},{"articleId":251663,"title":"11 Useful Resources for R Programmers","slug":"11-useful-resources-r-programmers","categoryList":["technology","programming-web-design","r"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/251663"}},{"articleId":251660,"title":"R Project: Delay and Weather","slug":"r-project-delay-weather","categoryList":["technology","programming-web-design","r"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/251660"}},{"articleId":251657,"title":"R Project for RFM Analysis: Another Data Set","slug":"r-project-rfm-analysis-another-data-set","categoryList":["technology","programming-web-design","r"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/251657"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":296576,"slug":"r-all-in-one-for-dummies","isbn":"9781119983699","categoryList":["technology","programming-web-design","r"],"amazon":{"default":"https://www.amazon.com/gp/product/111998369X/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/111998369X/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/111998369X-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/111998369X/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/111998369X/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/r-all-in-one-for-dummies-cover-9781119983699-203x255.jpg","width":203,"height":255},"title":"R All-in-One For Dummies","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"<p><b><b data-author-id=\"9759\">Joseph Schmuller</b></b> works on the Digital & Enterprise Architecture Team at Availity. He has taught statistics at the undergraduate and graduate levels. He has created and delivered courses for LinkedIn Learning, and he is the author of all previous editions of <i>Statistical Analysis with Excel For Dummies.</i></p>","authors":[{"authorId":9759,"name":"Joseph Schmuller","slug":"joseph-schmuller","description":" <p><b>Joseph Schmuller</b> works on the Digital & Enterprise Architecture Team at Availity. He has taught statistics at the undergraduate and graduate levels. He has created and delivered courses for LinkedIn Learning, and he is the author of all previous editions of <i>Statistical Analysis with Excel For Dummies.</i></p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9759"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;r&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119983699&quot;]}]\" id=\"du-slot-63becf2f29be4\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;r&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119983699&quot;]}]\" id=\"du-slot-63becf2f2a839\"></div></div>"},"articleType":{"articleType":"Cheat Sheet","articleList":[{"articleId":0,"title":"","slug":null,"categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/"}}],"content":[{"title":"Base R statistical functions","thumb":null,"image":null,"content":"<p>Here&#8217;s a selection of statistical functions that come with the standard R installation. You’ll find many others in R packages.</p>\n<p><strong>Central Tendency and Variability</strong></p>\n<table>\n<tbody>\n<tr>\n<td width=\"139\"><strong>Function</strong></td>\n<td width=\"436\"><strong>What it calculates</strong></td>\n</tr>\n<tr>\n<td width=\"139\">mean(x)</td>\n<td width=\"436\">Mean of the numbers in vector x</td>\n</tr>\n<tr>\n<td width=\"139\">median(x)</td>\n<td width=\"436\">Median of the numbers in vector x</td>\n</tr>\n<tr>\n<td width=\"139\">var(x)</td>\n<td width=\"436\">Estimated variance of the population from which the numbers in vector x are sampled</td>\n</tr>\n<tr>\n<td width=\"139\">sd(x)</td>\n<td width=\"436\">Estimated standard deviation of the population from which the numbers in vector x are sampled</td>\n</tr>\n<tr>\n<td width=\"139\">scale(x)</td>\n<td width=\"436\">Standard scores (<em>z-</em>scores) for the numbers in vector x</td>\n</tr>\n</tbody>\n</table>\n<p>&nbsp;</p>\n<p><strong>Relative Standing</strong></p>\n<table width=\"576\">\n<tbody>\n<tr>\n<td colspan=\"2\" width=\"576\"></td>\n</tr>\n<tr>\n<td width=\"277\"><strong>Function</strong></td>\n<td width=\"298\"><strong>What it calculates</strong></td>\n</tr>\n<tr>\n<td width=\"277\">sort(x)</td>\n<td width=\"298\">The numbers in vector x in increasing order</td>\n</tr>\n<tr>\n<td width=\"277\">sort(x)[n]</td>\n<td width=\"298\">The <em>n</em>th smallest number in vector x</td>\n</tr>\n<tr>\n<td width=\"277\">rank(x)</td>\n<td width=\"298\">Ranks of the numbers (in increasing order) in vector x</td>\n</tr>\n<tr>\n<td width=\"277\">rank(-x)</td>\n<td width=\"298\">Ranks of the numbers (in decreasing order) in vector x</td>\n</tr>\n<tr>\n<td width=\"277\">rank(x, ties.method= “average”)</td>\n<td width=\"298\">Ranks of the numbers (in increasing order) in vector x, with tied numbers given the average of the ranks that the ties would have attained</td>\n</tr>\n<tr>\n<td width=\"277\">rank(x, ties.method=  “min”)</td>\n<td width=\"298\">Ranks of the numbers (in increasing order) in vector x, with tied numbers given the minimum of the ranks that the ties would have attained</td>\n</tr>\n<tr>\n<td width=\"277\">rank(x, ties.method = “max”)</td>\n<td width=\"298\">Ranks of the numbers (in increasing order) in vector x, with tied numbers given the maximum of the ranks that the ties would have attained</td>\n</tr>\n<tr>\n<td width=\"277\">quantile(x)</td>\n<td width=\"298\">The 0th, 25th, 50th, 75th, and 100th percentiles (the <em>quartiles, </em>in other words) of the numbers in vector x. (That’s not a misprint: quantile(x) returns the quartiles of x.)</td>\n</tr>\n</tbody>\n</table>\n<p>&nbsp;</p>\n<p><strong><em>t-</em>tests</strong></p>\n<table width=\"576\">\n<tbody>\n<tr>\n<td></td>\n<td width=\"386\"></td>\n</tr>\n<tr>\n<td width=\"190\"><strong>Function</strong></td>\n<td width=\"386\"><strong>What it calculates</strong></td>\n</tr>\n<tr>\n<td width=\"190\">t.test(x,mu=n, alternative = “two.sided”)</td>\n<td width=\"386\">Two-tailed <em>t-</em>test that the mean of the numbers in vector <em>x </em>is different from <em>n</em>.</td>\n</tr>\n<tr>\n<td width=\"190\">t.test(x,mu=n, alternative = “greater”)</td>\n<td width=\"386\">One-tailed <em>t-</em>test that the mean of the numbers in vector <em>x</em> is greater than <em>n</em>.</td>\n</tr>\n<tr>\n<td width=\"190\">t.test(x,mu=n, alternative = “less”)</td>\n<td width=\"386\">One-tailed <em>t-</em>test that the mean of the numbers in vector <em>x</em> is less than <em>n</em>.</td>\n</tr>\n<tr>\n<td width=\"190\">t.test(x,y,mu=0, var.equal  = TRUE, alternative = “two.sided”)</td>\n<td width=\"386\">Two-tailed <em>t-</em>test that the mean of the numbers in vector <em>x</em> is different from the mean of the numbers in vector <em>y</em>. The variances in the two vectors are assumed to be equal.</td>\n</tr>\n<tr>\n<td width=\"190\">t.test(x,y,mu=0, alternative = “two.sided”, paired  = TRUE)</td>\n<td width=\"386\">Two-tailed <em>t-</em>test that the mean of the numbers in vector <em>x</em> is different from the mean of the numbers in vector <em>y</em>. The vectors represent matched samples.</td>\n</tr>\n</tbody>\n</table>\n<p>&nbsp;</p>\n<p><strong>Analysis of Variance (ANOVA)</strong></p>\n<table>\n<tbody>\n<tr>\n<td width=\"104\"><strong>Function</strong></td>\n<td width=\"468\"><strong>What it calculates</strong></td>\n</tr>\n<tr>\n<td width=\"104\">aov(y~x, data = d)</td>\n<td width=\"468\">Single-factor ANOVA, with the numbers in vector <em>y</em> as the dependent variable and the elements of vector <em>x </em>as the levels of the independent variable. The data are in data frame <em>d</em>.</td>\n</tr>\n<tr>\n<td width=\"104\">aov(y~x + Error(w/x), data = d)</td>\n<td width=\"468\">Repeated Measures ANOVA, with the numbers in vector <em>y </em>as the dependent variable and the elements in vector <em>x </em>as the levels of an independent variable. Error(w/x) indicates that each element in vector <em>w</em> experiences all the levels of <em>x</em>. (In other words, <em>x</em> is a repeated measure.) The data are in data frame <em>d</em>.</td>\n</tr>\n<tr>\n<td width=\"104\">aov(y~x*z, data = d)</td>\n<td width=\"468\">Two-factor ANOVA, with the numbers in vector<em> y</em> as the dependent variable and the elements of vectors <em>x </em>and <em>z</em> as the levels of the two independent variables. The data are in data frame <em>d</em>.</td>\n</tr>\n<tr>\n<td width=\"104\">aov(y~x*z + Error(w/z), data = d)</td>\n<td width=\"468\">Mixed ANOVA, with the numbers in vector <em>z</em> as the dependent variable and the elements of vectors <em>x</em> and <em>y</em> as the levels of the two independent variables. Error(w/z) indicates that each element in vector <em>w</em> experiences all the levels of <em>z</em>. (In other words, <em>z</em> is a repeated measure.) The data are in data frame <em>d</em>.</td>\n</tr>\n</tbody>\n</table>\n<p>&nbsp;</p>\n<p><strong>Correlation and regression</strong></p>\n<table>\n<tbody>\n<tr>\n<td width=\"106\"><strong>Function</strong></td>\n<td width=\"466\"><strong>What it calculates</strong></td>\n</tr>\n<tr>\n<td width=\"106\">cor(x,y)</td>\n<td width=\"466\">Correlation coefficient between the numbers in vector <em>x</em> and the numbers in vector <em>y</em></td>\n</tr>\n<tr>\n<td width=\"106\">cor.test(x,y)</td>\n<td width=\"466\">Correlation coefficient between the numbers in vector <em>x </em>and the numbers in vector <em>y</em>, along with a <em>t-</em>test of the significance of the correlation coefficient.</td>\n</tr>\n<tr>\n<td width=\"106\">lm(y~x, data = d)</td>\n<td width=\"466\">Linear regression analysis with the numbers in vector <em>y</em> as the dependent variable and the numbers in vector <em>x </em>as the independent variable. Data are in data frame <em>d</em>.</td>\n</tr>\n<tr>\n<td width=\"106\">coefficients(a)</td>\n<td width=\"466\">Slope and intercept of linear regression model <em>a.</em></td>\n</tr>\n<tr>\n<td width=\"106\">confint(a)</td>\n<td width=\"466\">Confidence intervals of the slope and intercept of linear regression model <em>a</em>.</td>\n</tr>\n<tr>\n<td width=\"106\">lm(y~x+z, data = d)</td>\n<td width=\"466\">Multiple regression analysis with the numbers in vector <em>y </em>as the dependent variable and the numbers in vectors<em> x</em> and<em> z</em> as the independent variables. Data are in data frame <em>d</em>.</td>\n</tr>\n</tbody>\n</table>\n<p class=\"article-tips tip\">When you carry out an ANOVA or a regression analysis, store the analysis in a list — for example: a &lt;- lm(y~x, data = d). Then, to see the tabled results, use the summary() function: summary(a)</p>\n"},{"title":"Interacting with a user","thumb":null,"image":null,"content":"<p>R provides the shiny package and the shinydashboard package for developing interactive applications. Here are selected functions from these packages.</p>\n<p>&nbsp;</p>\n<p><strong>Functions from the shiny package</strong></p>\n<table>\n<tbody>\n<tr>\n<td width=\"112\"><strong>Function</strong></td>\n<td width=\"463\"><strong>What it does</strong></td>\n</tr>\n<tr>\n<td width=\"112\">shinyApp()</td>\n<td width=\"463\">Ties a user interface and a server into a shiny application</td>\n</tr>\n<tr>\n<td width=\"112\">fluidPage()</td>\n<td width=\"463\">Creates a browser page that changes with the width of the browser</td>\n</tr>\n<tr>\n<td width=\"112\">sliderInput()</td>\n<td width=\"463\">Defines a slider and its input for a shiny user interface</td>\n</tr>\n<tr>\n<td width=\"112\">plotOutput()</td>\n<td width=\"463\">Reserves a shiny user interface area for a plot</td>\n</tr>\n<tr>\n<td width=\"112\">renderPlot()</td>\n<td width=\"463\">Draws the plot on a shiny user interface</td>\n</tr>\n<tr>\n<td width=\"112\">textOutput()</td>\n<td width=\"463\">Reserves a shiny user interface area for text</td>\n</tr>\n<tr>\n<td width=\"112\">renderText()</td>\n<td width=\"463\">Adds text to a shiny user interface</td>\n</tr>\n<tr>\n<td width=\"112\">selectInput()</td>\n<td width=\"463\">Creates a drop-down menu on a shiny user interface</td>\n</tr>\n</tbody>\n</table>\n<p>&nbsp;</p>\n<p><strong>Functions from the shinydashboard package</strong></p>\n<table>\n<tbody>\n<tr>\n<td width=\"147\"><strong>Function</strong></td>\n<td width=\"426\"><strong>What it creates for a shinydashboard page</strong></td>\n</tr>\n<tr>\n<td width=\"147\">dashboardPage()</td>\n<td width=\"426\">The page</td>\n</tr>\n<tr>\n<td width=\"147\">dashboardHeader()</td>\n<td width=\"426\">Page header</td>\n</tr>\n<tr>\n<td width=\"147\">dashboardSidebar()</td>\n<td width=\"426\">Page sidebar</td>\n</tr>\n<tr>\n<td width=\"147\">sidebarMenu()</td>\n<td width=\"426\">A menu for a sidebar</td>\n</tr>\n<tr>\n<td width=\"147\">menuItem()</td>\n<td width=\"426\">An item for a menu</td>\n</tr>\n<tr>\n<td width=\"147\">dashboardBody()</td>\n<td width=\"426\">Page body</td>\n</tr>\n<tr>\n<td width=\"147\">fluidRow()</td>\n<td width=\"426\">A variable-width row inside the dashboard body</td>\n</tr>\n<tr>\n<td width=\"147\">box()</td>\n<td width=\"426\">A box inside a row</td>\n</tr>\n<tr>\n<td width=\"147\">valueBoxOutput()</td>\n<td width=\"426\">A reserved space for a value box</td>\n</tr>\n<tr>\n<td width=\"147\">renderValueBox</td>\n<td width=\"426\">Reactive context for a value box</td>\n</tr>\n<tr>\n<td width=\"147\">valueBox</td>\n<td width=\"426\">A value box</td>\n</tr>\n<tr>\n<td width=\"147\">column()</td>\n<td width=\"426\">A column within a fluid row</td>\n</tr>\n<tr>\n<td width=\"147\">tabBox()</td>\n<td width=\"426\">A tab for a tabbed page</td>\n</tr>\n</tbody>\n</table>\n"},{"title":"Machine learning","thumb":null,"image":null,"content":"<p>R provides a number of packages and functions for machine learning. Here are some of them.</p>\n<p><strong>Machine learning packages and functions</strong></p>\n<table>\n<tbody>\n<tr>\n<td width=\"88\"><strong>Package</strong></td>\n<td width=\"140\"><strong>Function</strong></td>\n<td width=\"347\"><strong>What it does</strong></td>\n</tr>\n<tr>\n<td width=\"88\">rattle</td>\n<td width=\"140\">rattle()</td>\n<td width=\"347\">Opens the Rattle graphical user interface</td>\n</tr>\n<tr>\n<td width=\"88\">rpart</td>\n<td width=\"140\">rpart()</td>\n<td width=\"347\">Creates a decision tree</td>\n</tr>\n<tr>\n<td width=\"88\">rpart.plot</td>\n<td width=\"140\">prp()</td>\n<td width=\"347\">Draws a decision tree</td>\n</tr>\n<tr>\n<td width=\"88\">randomForest</td>\n<td width=\"140\">randomForest()</td>\n<td width=\"347\">Creates a random forest of decision trees</td>\n</tr>\n<tr>\n<td width=\"88\">rattle</td>\n<td width=\"140\">printRandomForests()</td>\n<td width=\"347\">Prints the rules of a forest’s individual decision trees</td>\n</tr>\n<tr>\n<td width=\"88\">e1071</td>\n<td width=\"140\">svm()</td>\n<td width=\"347\">Trains a support vector machine</td>\n</tr>\n<tr>\n<td width=\"88\">e1071</td>\n<td width=\"140\">predict()</td>\n<td width=\"347\">Creates a vector of predicted classifications based on a support vector machine</td>\n</tr>\n<tr>\n<td width=\"88\">kernlab</td>\n<td width=\"140\">ksvm()</td>\n<td width=\"347\">Trains a support vector machine</td>\n</tr>\n<tr>\n<td width=\"88\">base R</td>\n<td width=\"140\">kmeans()</td>\n<td width=\"347\">Creates a k-means clustering analysis</td>\n</tr>\n<tr>\n<td width=\"88\">nnet</td>\n<td width=\"140\">nnet()</td>\n<td width=\"347\">Creates a neural network with one hidden layer</td>\n</tr>\n<tr>\n<td width=\"88\">NeuralNetTools</td>\n<td width=\"140\">plotnet()</td>\n<td width=\"347\">Draws a neural network</td>\n</tr>\n<tr>\n<td width=\"88\">nnet</td>\n<td width=\"140\">predict()</td>\n<td width=\"347\">Creates a vector of predictions based on a neural network</td>\n</tr>\n</tbody>\n</table>\n"},{"title":"Databases","thumb":null,"image":null,"content":"<p>Created for statistical analysis, R has wide array of packages and functions for dealing with large amounts of data. This selection is the tip of the iceberg’s tip.</p>\n<p><strong>Packages and functions for exploring databases</strong></p>\n<table>\n<tbody>\n<tr>\n<td width=\"88\"><strong>Package</strong></td>\n<td width=\"140\"><strong>Function</strong></td>\n<td width=\"347\"><strong>What it does</strong></td>\n</tr>\n<tr>\n<td width=\"88\">didrooRFM</td>\n<td width=\"140\">findRFM()</td>\n<td width=\"347\">Performs a recency, frequency, money analysis on a database of retail transactions</td>\n</tr>\n<tr>\n<td width=\"88\">vcd</td>\n<td width=\"140\">assocstats()</td>\n<td width=\"347\">Calculates statistics for tables of categorical data</td>\n</tr>\n<tr>\n<td width=\"88\">vcd</td>\n<td width=\"140\">assoc()</td>\n<td width=\"347\">Creates a graphic that shows deviations from independence in a table of categorical data</td>\n</tr>\n<tr>\n<td width=\"88\">tidyverse</td>\n<td width=\"140\">glimpse()</td>\n<td width=\"347\">Provides a partial view of a data frame with the columns appearing onscreen as rows</td>\n</tr>\n<tr>\n<td width=\"88\">plotrix</td>\n<td width=\"140\">std.error()</td>\n<td width=\"347\">Calculates the standard error of the mean</td>\n</tr>\n<tr>\n<td width=\"88\">plyr</td>\n<td width=\"140\">inner_join()</td>\n<td width=\"347\">Joins data frames</td>\n</tr>\n<tr>\n<td width=\"88\">lubridate</td>\n<td width=\"140\">wday()</td>\n<td width=\"347\">Returns day of the week of a calendar date</td>\n</tr>\n<tr>\n<td width=\"88\">lubridate</td>\n<td width=\"140\">ymd()</td>\n<td width=\"347\">Returns a date in R date-format</td>\n</tr>\n</tbody>\n</table>\n"},{"title":"Images","thumb":null,"image":null,"content":"<p>Here are some functions to help you get started using R to process images. They all live in the magick package.</p>\n<p><strong>Functions from the magick package</strong></p>\n<table>\n<tbody>\n<tr>\n<td width=\"137\"><strong>Function</strong></td>\n<td width=\"439\"><strong>What it does</strong></td>\n</tr>\n<tr>\n<td width=\"137\">image_read()</td>\n<td width=\"439\">Reads an image into R and turns it into a magick object</td>\n</tr>\n<tr>\n<td width=\"137\">image_resize()</td>\n<td width=\"439\">Resizes an image</td>\n</tr>\n<tr>\n<td width=\"137\">image_rotate()</td>\n<td width=\"439\">Rotates an image</td>\n</tr>\n<tr>\n<td width=\"137\">image_flip()</td>\n<td width=\"439\">Rotates an image on a horizontal axis</td>\n</tr>\n<tr>\n<td width=\"137\">image_flop()</td>\n<td width=\"439\">Rotates an image on a vertical axis</td>\n</tr>\n<tr>\n<td width=\"137\">image_annotate()</td>\n<td width=\"439\">Adds text to an image</td>\n</tr>\n<tr>\n<td width=\"137\">image_background()</td>\n<td width=\"439\">Sets the background for an image</td>\n</tr>\n<tr>\n<td width=\"137\">image_composite()</td>\n<td width=\"439\">Combines images</td>\n</tr>\n<tr>\n<td width=\"137\">image_morph()</td>\n<td width=\"439\">Makes one image appear to gradually become (morph into) another</td>\n</tr>\n<tr>\n<td width=\"137\">image_animate()</td>\n<td width=\"439\">Puts an animation into the RStudio Viewer window</td>\n</tr>\n<tr>\n<td width=\"137\">image_apply()</td>\n<td width=\"439\">Applies a function to every frame in an animated GIF</td>\n</tr>\n<tr>\n<td width=\"137\">image_write()</td>\n<td width=\"439\">Saves an animation as a reusable GIF</td>\n</tr>\n</tbody>\n</table>\n<p>&nbsp;</p>\n"}],"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Two years","lifeExpectancySetFrom":"2023-01-10T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":296643},{"headers":{"creationTime":"2016-03-27T16:51:53+00:00","modifiedTime":"2022-11-21T22:34:55+00:00","timestamp":"2022-11-22T00:01:02+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Blogging & Website Platforms","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34376"},"slug":"blogging-website-platforms","categoryId":34376},{"name":"General Blogging & Website Platforms","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34378"},"slug":"general-blogging-website-platforms","categoryId":34378}],"title":"Blogging All-in-One For Dummies Cheat Sheet","strippedTitle":"blogging all-in-one for dummies cheat sheet","slug":"blogging-all-in-one-for-dummies-cheat-sheet","canonicalUrl":"","seo":{"metaDescription":"This Cheat Sheet is a great reference if you're starting a blog. Learn about popular applications, resources, and much more.","noIndex":0,"noFollow":0},"content":"All blogs start in the same way: A person picks a blogging application, creates a blog, and publishes a post online. What happens then depends on each individual blogger.\r\n\r\nThis Cheat Sheet supplements the information provided in <i>Blogging All-in-One For Dummies</i> and helps you find resources and tools to make your blog a unique place that allows you to reach your goals.","description":"All blogs start in the same way: A person picks a blogging application, creates a blog, and publishes a post online. What happens then depends on each individual blogger.\r\n\r\nThis Cheat Sheet supplements the information provided in <i>Blogging All-in-One For Dummies</i> and helps you find resources and tools to make your blog a unique place that allows you to reach your goals.","blurb":"","authors":[{"authorId":9938,"name":"Susan Gunelius","slug":"susan-gunelius","description":" <b>Susan Gunelius</b> is a 20-year marketing veteran and President and CEOof KeySplash Creative, Inc. Her marketing-related content appears onForbes.com, MSNBC.com, and other business-oriented sites. She is the author of <i>Blogging All-in-One For Dummies</i> and <i>Google Blogger For Dummies</i>. Susan speaks about these topics at events around the world.","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9938"}}],"primaryCategoryTaxonomy":{"categoryId":34378,"title":"General Blogging & Website Platforms","slug":"general-blogging-website-platforms","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34378"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[],"fromCategory":[{"articleId":226241,"title":"How to Screen Your Blog for Spam","slug":"screen-blog-spam","categoryList":["technology","programming-web-design","blogging-website-platforms","general-blogging-website-platforms"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/226241"}},{"articleId":226233,"title":"Writing Well and Frequently for a Successful Blog","slug":"writing-well-frequently-successful-blog","categoryList":["technology","programming-web-design","blogging-website-platforms","general-blogging-website-platforms"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/226233"}},{"articleId":207790,"title":"Blogging For Dummies Cheat Sheet","slug":"blogging-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","blogging-website-platforms","general-blogging-website-platforms"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207790"}},{"articleId":205810,"title":"Adding a Blog to Your Website","slug":"adding-a-blog-to-your-website","categoryList":["technology","programming-web-design","blogging-website-platforms","general-blogging-website-platforms"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/205810"}},{"articleId":205787,"title":"How to Create an Etsy Widget for Your Website","slug":"how-to-create-an-etsy-widget-for-your-website","categoryList":["technology","programming-web-design","blogging-website-platforms","general-blogging-website-platforms"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/205787"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":0,"slug":null,"isbn":null,"categoryList":null,"amazon":null,"image":null,"title":null,"testBankPinActivationLink":null,"bookOutOfPrint":false,"authorsInfo":null,"authors":null,"_links":null},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;blogging-website-platforms&quot;,&quot;general-blogging-website-platforms&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[null]}]\" id=\"du-slot-637c113f08763\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;blogging-website-platforms&quot;,&quot;general-blogging-website-platforms&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[null]}]\" id=\"du-slot-637c113f091f1\"></div></div>"},"articleType":{"articleType":"Cheat Sheet","articleList":[{"articleId":174999,"title":"Popular Blogging Applications","slug":"popular-blogging-applications","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/174999"}},{"articleId":175010,"title":"Finding Blog Help and Resources Online","slug":"finding-blog-help-and-resources-online","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/175010"}},{"articleId":175012,"title":"Getting Traffic to Your Blog","slug":"getting-traffic-to-your-blog","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/175012"}},{"articleId":175011,"title":"Blog Money Makers","slug":"blog-money-makers","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/175011"}}],"content":[{"title":"Popular blogging applications","thumb":null,"image":null,"content":"<p>Many online tools and applications allow you to create a blog, but not all these tools are equal. Some offer far more customization and functionality than others. Following are some of the most popular and feature-rich blogging applications:</p>\n<ul class=\"level-one\">\n<li>\n<p class=\"first-para\"><a href=\"http://www.wordpress.com\"><b>WordPress.com</b></a><b>:</b> An easy-to-use, free blogging application with limited functionality and additional features available for a fee.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://www.wordpress.org\"><b>WordPress.org</b></a><b>:</b> The most feature-rich and customizable blogging application. It&#8217;s free but does require an investment in a separate web host and more technical knowledge than other blogging applications require.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://www.blogger.com\"><b>Blogger</b></a><b>:</b> An easy-to-use and fairly feature-rich blogging application that is completely free.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://www.typepad.com/\"><b>TypePad</b></a><b>:</b> A fairly feature-rich blogging application, but users must pay a monthly fee to use it.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://www.tumblr.com\"><b>Tumblr</b></a><b>: </b>A simple blogging tool for publishing text, video, images, audio, and quotes without all of the features of more comprehensive blogging applications.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://www.movabletype.com\"><b>Movable Type</b></a><b>:</b> This blogging application is popular among blogging networks and offers a variety of features for a fee.</p>\n</li>\n</ul>\n"},{"title":"Finding blog help and resources online","thumb":null,"image":null,"content":"<p>Even the most seasoned bloggers have questions and need help sometimes. Following are some of the best websites and blogs to find blogging tips, help, and resources:</p>\n<ul class=\"level-one\">\n<li>\n<p class=\"first-para\"><a href=\"http://www.problogger.net\"><b>ProBlogger</b></a><b>:</b> Darren Rowse is one of the most popular bloggers around, and he shares his experiences on his blog about blogging.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://en.support.wordpress.com\"><b>WordPress support site</b></a><b>:</b> The official support site created by the people behind WordPress.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://codex.wordpress.org/Main_Page\"><b>WordPress.org Codex site</b></a><b>:</b> The official site offering documentation for all WordPress.org features and tools.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://help.blogger.com\"><b>Blogger help site</b></a><b>:</b> The official help site owned by the people behind Blogger.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"https://help.typepad.com/\" target=\"_blank\" rel=\"noopener\"><b>TypePad Knowledge Base</b></a><b>:</b> The official support site maintained by the people behind TypePad.</p>\n</li>\n</ul>\n"},{"title":"Getting traffic to your blog","thumb":null,"image":null,"content":"<p>To grow your blog&#8217;s readership and (dare we say?) fan base, check out these tools and start promoting your blog and content across the social web:</p>\n<ul class=\"level-one\">\n<li>\n<p class=\"first-para\"><a href=\"http://twitter.com\"><b>Twitter</b></a>: The most popular microblogging site.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://www.facebook.com\"><b>Facebook</b></a>: The most popular social networking site.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://www.linkedin.com\"><b>LinkedIn</b></a>: A popular social networking site for businesspeople around the world.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://pinterest.com\"><b>Pinterest</b></a>: A rapidly growing visual social bookmarking site.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://digg.com\"><b>Digg</b></a>: A highly trafficked social bookmarking site.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://www.stumbleupon.com\"><b>StumbleUpon</b></a><b>:</b> A popular social bookmarking site.</p>\n</li>\n</ul>\n"},{"title":"Blog money makers","thumb":null,"image":null,"content":"<p>Blogs can be just for fun, but they can also turn a profit. If you want to earn money from your blog, check out these popular monetization opportunities:</p>\n<ul class=\"level-one\">\n<li>\n<p class=\"first-para\"><a href=\"http://www.google.com/adsense/login/en_us/index.html\"><b>Google AdSense</b></a><b>:</b> A popular contextual advertising program that any blogger can join and easily integrate into a blog.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"https://affiliate-program.amazon.com\"><b>Amazon Associates</b></a><b>:</b> A popular affiliate advertising program that any blogger can join.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://socialspark.com\"><b>SocialSpark</b></a><b>:</b> A popular pay-per-post monetization program that requires full disclosure.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://buysellads.com\"><b>BuySellAds</b></a><b>:</b> An online advertising marketplace where bloggers can sell ad space and advertisers can purchase that ad space.</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://sponsoredtweets.com\"><b>SponsoredTweets</b></a><b>:</b> A pay-per-post program that pays people for publishing sponsored updates on Twitter.</p>\n</li>\n</ul>\n"}],"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Explore","lifeExpectancy":"Two years","lifeExpectancySetFrom":"2022-11-21T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":208275},{"headers":{"creationTime":"2016-03-27T16:47:47+00:00","modifiedTime":"2022-11-14T14:41:42+00:00","timestamp":"2022-11-14T15:01:03+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"slug":"coding","categoryId":33599}],"title":"Coding For Kids For Dummies Cheat Sheet","strippedTitle":"coding for kids for dummies cheat sheet","slug":"coding-for-kids-for-dummies-cheat-sheet","canonicalUrl":"","seo":{"metaDescription":"Learn how to create programs in Scratch, code apps in App Lab, and write code in MakeCode to operate the micro:bit electronics board.","noIndex":0,"noFollow":0},"content":"Coding, or computer programming, is your way of communicating with technology. It’s the new literacy you need to master to be successful in the coming decades. Like any form of communication, coding takes place through language. Just as there are many human languages (English, French, Mandarin, Spanish, and so on), there are many coding languages! Two examples of coding languages are Scratch and JavaScript. Scratch is perfect as a coding language for kids because it’s easy and fun to use, Scratch coding for kids allows you to build programs by snapping together commands in the same way you assemble a puzzle.\r\n\r\nJavaScript is a step up in difficulty because it’s an authentic programming language, used by real coders. JavaScript powers many technologies, and you can use it to make both apps for your phone and control code for operating electronics gadgets. You can ease into JavaScript by using blocks to build programs (just like Scratch) and then switching to text-based coding when you’re ready. Here, discover tips for creating programs in Scratch, coding JavaScript apps in App Lab, and writing JavaScript code in MakeCode to operate the micro:bit electronics board.\r\n\r\n[caption id=\"attachment_261750\" align=\"alignnone\" width=\"535\"]<img class=\"size-full wp-image-261750\" src=\"https://www.dummies.com/wp-content/uploads/coding-kids.jpg\" alt=\"Kids coding on laptops\" width=\"535\" height=\"357\" /> ©By Photographee.eu/Shutterstock[/caption]","description":"Coding, or computer programming, is your way of communicating with technology. It’s the new literacy you need to master to be successful in the coming decades. Like any form of communication, coding takes place through language. Just as there are many human languages (English, French, Mandarin, Spanish, and so on), there are many coding languages! Two examples of coding languages are Scratch and JavaScript. Scratch is perfect as a coding language for kids because it’s easy and fun to use, Scratch coding for kids allows you to build programs by snapping together commands in the same way you assemble a puzzle.\r\n\r\nJavaScript is a step up in difficulty because it’s an authentic programming language, used by real coders. JavaScript powers many technologies, and you can use it to make both apps for your phone and control code for operating electronics gadgets. You can ease into JavaScript by using blocks to build programs (just like Scratch) and then switching to text-based coding when you’re ready. Here, discover tips for creating programs in Scratch, coding JavaScript apps in App Lab, and writing JavaScript code in MakeCode to operate the micro:bit electronics board.\r\n\r\n[caption id=\"attachment_261750\" align=\"alignnone\" width=\"535\"]<img class=\"size-full wp-image-261750\" src=\"https://www.dummies.com/wp-content/uploads/coding-kids.jpg\" alt=\"Kids coding on laptops\" width=\"535\" height=\"357\" /> ©By Photographee.eu/Shutterstock[/caption]","blurb":"","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":" <p><b>Camille McCue, PhD</b> is a STEM educator and leader who has worked for IBM, NASA, PBS, and numerous independent schools. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science. Camille is co&#45;author of <i>Helping Kids with Coding For Dummies</i> and author of <i>Getting Started with Coding</i> and <i>Getting Started with Engineering.</i> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}}],"primaryCategoryTaxonomy":{"categoryId":33599,"title":"Coding","slug":"coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[],"fromCategory":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281668,"slug":"coding-for-kids-for-dummies-2nd-edition","isbn":"9781119555162","categoryList":["technology","programming-web-design","coding"],"amazon":{"default":"https://www.amazon.com/gp/product/1119555167/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119555167/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119555167-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119555167/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119555167/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/coding-for-kids-for-dummies-2nd-edition-cover-9781119555162-203x255.jpg","width":203,"height":255},"title":"Coding For Kids For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9324\">Camille McCue, PhD</b> is a STEM educator and leader who has worked for IBM, NASA, PBS, and numerous independent schools. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science. Camille is co-author of <i>Helping Kids with Coding For Dummies</i> and author of <i>Getting Started with Coding</i> and <i>Getting Started with Engineering.</i> </p>","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":" <p><b>Camille McCue, PhD</b> is a STEM educator and leader who has worked for IBM, NASA, PBS, and numerous independent schools. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science. Camille is co&#45;author of <i>Helping Kids with Coding For Dummies</i> and author of <i>Getting Started with Coding</i> and <i>Getting Started with Engineering.</i> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;For Kids&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119555162&quot;]}]\" id=\"du-slot-6372582f28a99\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;For Kids&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119555162&quot;]}]\" id=\"du-slot-6372582f29309\"></div></div>"},"articleType":{"articleType":"Cheat Sheet","articleList":[{"articleId":261740,"title":"How to Create Programs in Scratch","slug":"","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/261740"}},{"articleId":261743,"title":"How to Build Apps in App Lab","slug":"","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/261743"}},{"articleId":261747,"title":"How to Write Control Code for Electronics","slug":"","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/261747"}}],"content":[{"title":"How to create programs in Scratch","thumb":null,"image":null,"content":"<p>Scratch is a coding language, but it is also an all-in-one integrated development environment (IDE) in which kids can design, code, test, and share their programs. Here are some tips for getting started with Scratch coding:</p>\n<ul>\n<li>Open <a href=\"https://scratch.mit.edu/\" target=\"_blank\" rel=\"noopener\">Scratch</a>. Select Create or File→to start a project.</li>\n<li>For project starter ideas, click the Tutorials button in the menu bar.</li>\n<li>Every new project starts with Backdrop1 — which is blank. You can add a new backdrop by clicking the Choose a Backdrop icon and then selecting a backdrop from the Choose a Backdrop library.</li>\n<li>Every new project starts with Sprite1 — which is Scratch Cat. You can keep Scratch Cat and write code for him to run, or you can cut him by clicking the X in his icon. You can add a new sprite by clicking the Choose a Sprite icon and then selecting a sprite from the Choose a Sprite Library.</li>\n<li>Change sprite attributes by typing new numbers for the x position, y position, size, and direction.</li>\n<li>Start a new program with an event, such as <code>when green flag clicked</code>. At the Code tab, select the Events category and then drag the event to the code workspace. Add one or more commands to the event, attaching each new command to the previous event, to build a code block. Run the code block by clicking the green flag (or whatever event handler you chose). Stop the code block by clicking the stop sign icon.</li>\n<li>Add additional sprites to your project, and build whatever code you want on each sprite.</li>\n<li>You can add new sounds. First, click the Sounds tab and then click the Choose a Sound icon. Click a sound from the Choose a Sound library to add it to your program. Then add the new sound to your code by clicking the Code tab and then clicking the Sound icon to display the sound commands. Drag a sound command such as <code>play sound</code> to the workspace, and attach it to a code block. Press the arrow in the <code>play sound</code> command and select the sound you added. Then test your code block to hear the sound.</li>\n<li>Name your project and, if you want, click the Share button to make it publicly visible.</li>\n</ul>\n"},{"title":"How to build apps in App Lab","thumb":null,"image":null,"content":"<p>App Lab is an IDE for building apps using JavaScript. You can design and code your apps in App Lab. Then you can test them in an online simulator and — when they’re working just the way you want — you can share them, even sending them to your phone. Here are some tips for getting started working in App Lab:</p>\n<ul>\n<li>Open <a href=\"https://code.org/educate/applab\" target=\"_blank\" rel=\"noopener\">App Lab</a>. Set up a new account, or log in to your existing account. Click Try It Out to start a project.</li>\n<li>Click the Design button to switch to Design mode, where you lay out the appearance of your app. The Design toolbox opens, showing elements that you can drag to screen1 of the simulator.</li>\n<li>To add a background to your app, work in Design mode. Click the simulator screen, and then click the Color tab in the Properties area to choose a new background color. Or click the Choose link to upload a background image. The color or image appears as the background in the simulator.</li>\n<li>To create elements on your screen, work in Design mode. Click the icon for an element in the Design toolbox and then drag it to the screen. Commonly used elements are Button, Label, Text Input, Image, and Screen. For example, create a button for a user to click. In Design mode, drag the Button icon to the screen and place it anywhere you want. In the Properties area, change some attributes of the button you want, such as size and color. Note that the button ID is <code>button1</code>. Type <strong>CLICK ME</strong> in the text field of the button properties.</li>\n<li>To code your app, click the Code button to switch your interface to Code mode. In App Lab, you create all code in a single program, which is displayed in the Code workspace. You can work in block mode or text mode, toggling between the two modes by selecting the Show Blocks/Show Text button. Each command is listed on a separate line.</li>\n<li>Commands are displayed in Code mode in the toolbox, grouped by function, such as UI (user interface) controls. To build your program, drag a command from the toolbox to the workspace. Attach new commands to previously added commands, snapping them together.</li>\n<li>Start a new program with an event, such as <code>onEvent</code>. At the Code tab, select the UI category and then drag <code>onEvent</code> to the Code workspace. Continuing with the button example, press the ID tab in the command and select <code>button1</code> from the drop-down list. Leave the other items in the command as-is. Now make something happen when you click the button. From the UI category, drag a <code>setProperty</code> command to the Code workspace, placing it inside <code>onEvent</code>. Set the command to read <code>setProperty(\"screen1\", \"background-color\", \"red\");</code>.</li>\n<li>Test code in the simulator by clicking the Run button. In the button example, clicking the Run button and the clicking the Click Me button triggers the event to turn the screen red.</li>\n<li>Add additional elements to your project, and build whatever code you want on each element.</li>\n<li>Name your app and, if you want, click the Share button, sending it to a phone for mobile operation.</li>\n</ul>\n"},{"title":"How to write control code for electronics","thumb":null,"image":null,"content":"<p>MakeCode is an easy-to-use IDE for writing and testing programs for controlling a kid-friendly electronics board called the <a href=\"https://makecode.microbit.org/\" target=\"_blank\" rel=\"noopener\">micro:bit</a>. You write JavaScript in MakeCode, testing your programs in an online simulator.</p>\n<p>If you want, you can upload a completed program to a micro:bit board to create a real, working gadget! Here are some tips for getting started with MakeCode for micro:bit:</p>\n<ul>\n<li>Open App Lab. Click New Project to start a project.</li>\n<li>In MakeCode, you build code blocks, with each code block associated with an event. All the code blocks are displayed in the code workspace. You can work in Blocks mode or JavaScript (text) mode, and you can move between the two modes by using the toggle button at the top of the workspace. In JavaScript (text) mode, each command is listed on a separate line.</li>\n<li>Commands are grouped by function, such as Basic, Input, Music, LED , Radio, Loops, Logic, Variables, and Math. You can click the Advanced tab for many additional, useful commands, including Pins. To build your program, drag a command from the code categories into the workspace. Attach new commands to previously added commands, snapping them together.</li>\n<li>Commands from the Input category allow you to capture data from micro:bit sensors, including button clicks, accelerometer shakes, compass headings, temperature, light levels, and pin presses.</li>\n<li>Start a new program with an event, such as <code>on button A pressed</code>. Drag this command from the Input category into the workspace. (You can drag the starter commands, <code>on start</code> and <code>forever</code>, which are already in the workspace at the start of a new project, back into the command categories to remove them from your program.) Then drag a command from the Basic category, such as <code>show string “Hello!” </code>to the code workspace, placing it inside the <code>on button A pressed</code> command.</li>\n<li>Test code in the simulator by activating the sensors you have programmed. In the example, when you click button A in the simulator, <em>HELLO!</em> should scroll across the screen of the micro:bit.</li>\n<li>Add additional code blocks to your project, and build whatever code you want on each code block.</li>\n<li>Name your app and, if you want, transfer your code to a real micro:bit. Just attach a micro:bit to your computer using a microUSB-to-USB cable. Click the Download button in the MakeCode IDE to download your code to your computer. Then drag the downloaded file (which is in .hex format) to the icon representing your micro:bit on your computer. The micro:bit blinks orange for a few seconds to tell you that the transfer is taking place.</li>\n<li>Disconnect a micro:bit (with its program onboard) from the computer, and then attach a portable battery pack to the board. You can now run the program on the micro:bit, away from the computer!</li>\n</ul>\n"}],"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Explore","lifeExpectancy":"One year","lifeExpectancySetFrom":"2022-02-23T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"\"For Kids\"","adPairKey":[]},"status":"publish","visibility":"public","articleId":207624},{"headers":{"creationTime":"2016-03-26T07:16:02+00:00","modifiedTime":"2022-10-19T14:16:44+00:00","timestamp":"2022-10-19T15:01:03+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Python","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33606"},"slug":"python","categoryId":33606}],"title":"How to Install Python on Your Computer","strippedTitle":"how to install python on your computer","slug":"how-to-install-python-on-your-computer","canonicalUrl":"","seo":{"metaDescription":"Whether you use a Mac, Windows, or Linux OS (operating system), you can find and install Python on your computer. The following sections give you instructions f","noIndex":0,"noFollow":0},"content":"Whether you use a Mac, Windows, or Linux OS (operating system), you can find and install <a href=\"https://www.dummies.com/article/technology/programming-web-design/python/write-a-simple-program-in-python-139547/\">Python </a>on your computer. The following sections give you instructions for each OS.\r\n<h2 id=\"tab1\" >How to install Python on Mac OSX</h2>\r\nTo find and start Python on Mac OSX computers, follow these steps:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Press Cmd+spacebar to open Spotlight.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Type the word <span class=\"code\">terminal</span>.</p>\r\n<p class=\"child-para\">Or, from the Finder, select Finder→Go→Utilities→Terminal.</p>\r\n<p class=\"child-para\">The Terminal window opens.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">In the terminal, type <span class=\"code\">python</span>.</p>\r\n<p class=\"child-para\">The Python interpreter that's built in to Mac OSX opens.</p>\r\n</li>\r\n</ol>\r\n<h2 id=\"tab2\" >How to install Python on Windows</h2>\r\nUnfortunately, Python doesn't come on Windows. If you're running Windows, then you need to download and install Python by following the instructions here. Installing Python on Windows isn't difficult. If you can download a file from a website, you have the skills to install Python.\r\n\r\nFortunately, the Python Foundation (the peeps who guide the development of Python) makes installable files available from its website.\r\n<p class=\"Tip\">Firefox and Internet Explorer responded differently to the Python download website, so the instructions are based on which of these browsers you use. If you use a whole other browser altogether, try the Internet Explorer instructions.</p>\r\n\r\n<h3>Installing with Firefox</h3>\r\nTo install Python on a Windows machine with Firefox, follow these steps:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Visit <a href=\"http://www.python.org/downloads\" target=\"_blank\" rel=\"noopener\">www.python.org/downloads</a>.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Click the button that says Download Python 2.7.9.</p>\r\n<p class=\"child-para\">Or, if it's there, click a more recent version number that starts with 2.7.</p>\r\n<p class=\"child-para\">Clicking this button automatically downloads and saves an <span class=\"code\">msi</span> file for you. If not, try the instructions for Internet Explorer. See Figure 1.</p>\r\n\r\n<div class=\"imageBlock\" style=\"width: 535px;\">\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/497374.image0.png\" alt=\"<b>Figure 1</b><b>:</b> Download Python with Firefox.\" width=\"535\" height=\"448\" />\r\n<div class=\"imageCaption\"><b>Figure 1</b><b>:</b> Download Python with Firefox.</div>\r\n</div></li>\r\n \t<li>\r\n<p class=\"first-para\">When the download's complete, click the icon for Firefox's download tool.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Click the file called <span class=\"code\">python-2.7.9.msi</span> (or the more recent version, if you downloaded one).</p>\r\n<p class=\"child-para\">Python 2.7.9 installs on your computer.</p>\r\n</li>\r\n</ol>\r\n<h3>Installing with Internet Explorer</h3>\r\nTo install Python on a Windows machine with Internet Explorer, follow these steps:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Visit <a href=\"http://www.python.org/downloads\" target=\"_blank\" rel=\"noopener\">www.python.org/downloads</a>.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">From the menu bar, select Downloads→Windows.</p>\r\n<p class=\"child-para\">You can see the menu options in Figure 2.</p>\r\n\r\n<div class=\"imageBlock\" style=\"width: 535px;\">\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/497375.image1.png\" alt=\"<b>Figure </b><b>2:</b> Download Python with Internet Explorer.\" width=\"535\" height=\"304\" />\r\n<div class=\"imageCaption\"><b>Figure </b><b>2:</b> Download Python with Internet Explorer.</div>\r\n</div></li>\r\n \t<li>\r\n<p class=\"first-para\">Scroll down to the heading Python 2.7.9-2014-12-10.</p>\r\n<p class=\"child-para\">Or scroll to a more recent version, which starts with Python 2.7, if one is available.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Under this heading, click the link titled <span class=\"code\">Download Windows x86 MSI Installer</span>.</p>\r\n<p class=\"child-para\">See Figure 3. This is a link for a 32-bit installation, which makes things work better with third-party libraries. Use the 32-bit installer even if you have a 64-bit machine and even if you have no idea what this paragraph is talking about.</p>\r\n\r\n<div class=\"imageBlock\" style=\"width: 535px;\">\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/497376.image2.png\" alt=\"<b>Figure </b><b>3:</b> Python x86 MSI Installer.\" width=\"535\" height=\"464\" />\r\n<div class=\"imageCaption\"><b>Figure </b><b>3:</b> Python x86 MSI Installer.</div>\r\n</div></li>\r\n</ol>\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">If you're asked to choose whether to run or save the file, choose Run.</p>\r\n<p class=\"child-para\">This downloads <span class=\"code\">python2.7.9.msi</span> and starts running the installer.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">If you get a security warning when the installer begins (or at random times during the installation), choose Run.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Accept the default installation options that the installer provides.</p>\r\n</li>\r\n</ol>\r\n<h2 id=\"tab3\" >How to install Python for Linux</h2>\r\n<p class=\"Warning\">If you're running Linux, confirm that you have version 2.7.9 of Python installed, rather than version 3. This shouldn't be a problem because Python 2.7 is installed by default in recent versions of OpenSuSE, Ubuntu, and Red Hat Fedora.</p>\r\nIn the nutty odd case when someone has Python 3 but not Python 2.7, read your distribution's documentation for how to use the package manager and get Python 2.7 and IDLE.","description":"Whether you use a Mac, Windows, or Linux OS (operating system), you can find and install <a href=\"https://www.dummies.com/article/technology/programming-web-design/python/write-a-simple-program-in-python-139547/\">Python </a>on your computer. The following sections give you instructions for each OS.\r\n<h2 id=\"tab1\" >How to install Python on Mac OSX</h2>\r\nTo find and start Python on Mac OSX computers, follow these steps:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Press Cmd+spacebar to open Spotlight.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Type the word <span class=\"code\">terminal</span>.</p>\r\n<p class=\"child-para\">Or, from the Finder, select Finder→Go→Utilities→Terminal.</p>\r\n<p class=\"child-para\">The Terminal window opens.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">In the terminal, type <span class=\"code\">python</span>.</p>\r\n<p class=\"child-para\">The Python interpreter that's built in to Mac OSX opens.</p>\r\n</li>\r\n</ol>\r\n<h2 id=\"tab2\" >How to install Python on Windows</h2>\r\nUnfortunately, Python doesn't come on Windows. If you're running Windows, then you need to download and install Python by following the instructions here. Installing Python on Windows isn't difficult. If you can download a file from a website, you have the skills to install Python.\r\n\r\nFortunately, the Python Foundation (the peeps who guide the development of Python) makes installable files available from its website.\r\n<p class=\"Tip\">Firefox and Internet Explorer responded differently to the Python download website, so the instructions are based on which of these browsers you use. If you use a whole other browser altogether, try the Internet Explorer instructions.</p>\r\n\r\n<h3>Installing with Firefox</h3>\r\nTo install Python on a Windows machine with Firefox, follow these steps:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Visit <a href=\"http://www.python.org/downloads\" target=\"_blank\" rel=\"noopener\">www.python.org/downloads</a>.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Click the button that says Download Python 2.7.9.</p>\r\n<p class=\"child-para\">Or, if it's there, click a more recent version number that starts with 2.7.</p>\r\n<p class=\"child-para\">Clicking this button automatically downloads and saves an <span class=\"code\">msi</span> file for you. If not, try the instructions for Internet Explorer. See Figure 1.</p>\r\n\r\n<div class=\"imageBlock\" style=\"width: 535px;\">\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/497374.image0.png\" alt=\"<b>Figure 1</b><b>:</b> Download Python with Firefox.\" width=\"535\" height=\"448\" />\r\n<div class=\"imageCaption\"><b>Figure 1</b><b>:</b> Download Python with Firefox.</div>\r\n</div></li>\r\n \t<li>\r\n<p class=\"first-para\">When the download's complete, click the icon for Firefox's download tool.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Click the file called <span class=\"code\">python-2.7.9.msi</span> (or the more recent version, if you downloaded one).</p>\r\n<p class=\"child-para\">Python 2.7.9 installs on your computer.</p>\r\n</li>\r\n</ol>\r\n<h3>Installing with Internet Explorer</h3>\r\nTo install Python on a Windows machine with Internet Explorer, follow these steps:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Visit <a href=\"http://www.python.org/downloads\" target=\"_blank\" rel=\"noopener\">www.python.org/downloads</a>.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">From the menu bar, select Downloads→Windows.</p>\r\n<p class=\"child-para\">You can see the menu options in Figure 2.</p>\r\n\r\n<div class=\"imageBlock\" style=\"width: 535px;\">\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/497375.image1.png\" alt=\"<b>Figure </b><b>2:</b> Download Python with Internet Explorer.\" width=\"535\" height=\"304\" />\r\n<div class=\"imageCaption\"><b>Figure </b><b>2:</b> Download Python with Internet Explorer.</div>\r\n</div></li>\r\n \t<li>\r\n<p class=\"first-para\">Scroll down to the heading Python 2.7.9-2014-12-10.</p>\r\n<p class=\"child-para\">Or scroll to a more recent version, which starts with Python 2.7, if one is available.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Under this heading, click the link titled <span class=\"code\">Download Windows x86 MSI Installer</span>.</p>\r\n<p class=\"child-para\">See Figure 3. This is a link for a 32-bit installation, which makes things work better with third-party libraries. Use the 32-bit installer even if you have a 64-bit machine and even if you have no idea what this paragraph is talking about.</p>\r\n\r\n<div class=\"imageBlock\" style=\"width: 535px;\">\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/497376.image2.png\" alt=\"<b>Figure </b><b>3:</b> Python x86 MSI Installer.\" width=\"535\" height=\"464\" />\r\n<div class=\"imageCaption\"><b>Figure </b><b>3:</b> Python x86 MSI Installer.</div>\r\n</div></li>\r\n</ol>\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">If you're asked to choose whether to run or save the file, choose Run.</p>\r\n<p class=\"child-para\">This downloads <span class=\"code\">python2.7.9.msi</span> and starts running the installer.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">If you get a security warning when the installer begins (or at random times during the installation), choose Run.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Accept the default installation options that the installer provides.</p>\r\n</li>\r\n</ol>\r\n<h2 id=\"tab3\" >How to install Python for Linux</h2>\r\n<p class=\"Warning\">If you're running Linux, confirm that you have version 2.7.9 of Python installed, rather than version 3. This shouldn't be a problem because Python 2.7 is installed by default in recent versions of OpenSuSE, Ubuntu, and Red Hat Fedora.</p>\r\nIn the nutty odd case when someone has Python 3 but not Python 2.7, read your distribution's documentation for how to use the package manager and get Python 2.7 and IDLE.","blurb":"","authors":[{"authorId":9026,"name":"Brendan Scott","slug":"brendan-scott","description":" <p>Brendan Scott is a dad who loves Python and wants kids to get some of its magic too. He started pythonforkids.brendanscott.com to help teach his oldest child to code. He maintains it to help other young people learn Python.</p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9026"}}],"primaryCategoryTaxonomy":{"categoryId":33606,"title":"Python","slug":"python","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33606"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[{"label":"How to install Python on Mac OSX","target":"#tab1"},{"label":"How to install Python on Windows","target":"#tab2"},{"label":"How to install Python for Linux","target":"#tab3"}],"relatedArticles":{"fromBook":[{"articleId":207407,"title":"Python For Kids For Dummies Cheat Sheet","slug":"python-for-kids-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207407"}},{"articleId":141581,"title":"Use Python to Help with Your Math Homework","slug":"use-python-to-help-with-your-math-homework","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/141581"}},{"articleId":141474,"title":"Python 2.7 Keyword Subset and Examples","slug":"python-2-7-keyword-subset-and-examples","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/141474"}},{"articleId":141443,"title":"Using Tkinter Widgets in Python","slug":"using-tkinter-widgets-in-python","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/141443"}},{"articleId":139551,"title":"How to Interrupt a Program in Python","slug":"how-to-interrupt-a-program-in-python","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/139551"}}],"fromCategory":[{"articleId":264919,"title":"How to Define and Use Python Lists","slug":"how-to-define-and-use-python-lists","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264919"}},{"articleId":264911,"title":"How to Use Lambda Functions in Python","slug":"how-to-use-lambda-functions-in-python","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264911"}},{"articleId":264906,"title":"Your Guide to the Python Standard Library","slug":"your-guide-to-the-python-standard-library","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264906"}},{"articleId":264894,"title":"A Beginner’s Guide to Python Versions","slug":"a-beginners-guide-to-python-versions","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264894"}},{"articleId":264888,"title":"How to Build a Simple Neural Network in Python","slug":"how-to-build-a-simple-neural-network-in-python","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264888"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281835,"slug":"python-for-kids-for-dummies","isbn":"9781119093107","categoryList":["technology","programming-web-design","python"],"amazon":{"default":"https://www.amazon.com/gp/product/1119093104/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119093104/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119093104-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119093104/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119093104/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/python-for-kids-for-dummies-cover-9781119093107-203x255.jpg","width":203,"height":255},"title":"Python For Kids For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p>Brendan Scott is a dad who loves Python and wants kids to get some of its magic too. He started pythonforkids.brendanscott.com to help teach his oldest child to code. He maintains it to help other young people learn Python.</p>","authors":[{"authorId":9026,"name":"Brendan Scott","slug":"brendan-scott","description":" <p>Brendan Scott is a dad who loves Python and wants kids to get some of its magic too. He started pythonforkids.brendanscott.com to help teach his oldest child to code. He maintains it to help other young people learn Python.</p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9026"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;python&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119093107&quot;]}]\" id=\"du-slot-6350112fa2eea\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;python&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119093107&quot;]}]\" id=\"du-slot-6350112fa36e5\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Explore","lifeExpectancy":"Two years","lifeExpectancySetFrom":"2022-01-25T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":139548},{"headers":{"creationTime":"2016-03-26T07:16:01+00:00","modifiedTime":"2022-10-19T14:15:04+00:00","timestamp":"2022-10-19T15:01:03+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Python","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33606"},"slug":"python","categoryId":33606}],"title":"Write a Simple Program in Python","strippedTitle":"write a simple program in python","slug":"write-a-simple-program-in-python","canonicalUrl":"","seo":{"metaDescription":"Just getting started with Python? Learn how to write your first program and follow in the footsteps of many great programmers.","noIndex":0,"noFollow":0},"content":"Tradition dictates that Hello World! be the first program that you write when you're learning a <a href=\"https://www.dummies.com/article/technology/programming-web-design/python/10-major-uses-of-python-148755/\" target=\"_blank\" rel=\"noopener\">new programming language like Python</a>. You're following in the footsteps of many great programmers when you create this project.\r\n\r\nTo create your Hello World! program, follow these steps:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Open your Start menu and choose Python (command line).</p>\r\n<p class=\"child-para\">You should get a prompt that looks like <span class=\"code\">>>></span>.</p>\r\n<p class=\"child-para\">At the moment, you're doing everything in interactive mode in the Python interpreter. That's where the <span class=\"code\">>>></span> comes in. Python shows you <span class=\"code\">>>></span> when you're supposed to type something.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">At the prompt, type the following. Use a single quote at the start and the end — it's beside the Enter key:</p>\r\n\r\n<pre class=\"code\">print('Hello World!')</pre>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Press the Enter key.</p>\r\n<p class=\"child-para\">Python runs the code you typed.</p>\r\n</li>\r\n</ol>\r\nYou see the output shown in Figure 1. Congratulations — you've written your first program. Welcome to the <a href=\"https://www.dummies.com/article/technology/programming-web-design/python/how-to-install-python-on-your-computer-139548/\" target=\"_blank\" rel=\"noopener\">Python</a>-programmers-in-training club.\r\n<div class=\"imageBlock\" style=\"width: 535px;\">\r\n\r\n[caption id=\"\" align=\"alignnone\" width=\"535\"]<img src=\"https://www.dummies.com/wp-content/uploads/497387.image0.png\" alt=\"<b>Figure </b><b>1:</b> Your Hello World! program is ready for more instructions.\" width=\"535\" height=\"267\" /> Figure 1: Your Hello World! program is ready for more instructions.[/caption]\r\n\r\n<div></div>\r\n<div class=\"imageCaption\">If you don't see what's in Figure 1, check that you typed in the text from Step 2 exactly as it's written:</div>\r\n</div>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Check that the parentheses and single quotes are in the right places.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Check that for each opening parenthesis there is a closing parenthesis. (Otherwise, you're left hanging.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Check that for each opening quote there's a closing quote.</p>\r\n</li>\r\n</ul>\r\n<p class=\"Remember\">Programming languages have their own grammar and punctuation rules. These rules are the language's <i>syntax</i>. Humans, can work most stuff out even if perfect not you're is grammar (See? You figured out what that sentence was trying to say), but Python pretty much freaks out if you get the syntax wrong.</p>","description":"Tradition dictates that Hello World! be the first program that you write when you're learning a <a href=\"https://www.dummies.com/article/technology/programming-web-design/python/10-major-uses-of-python-148755/\" target=\"_blank\" rel=\"noopener\">new programming language like Python</a>. You're following in the footsteps of many great programmers when you create this project.\r\n\r\nTo create your Hello World! program, follow these steps:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Open your Start menu and choose Python (command line).</p>\r\n<p class=\"child-para\">You should get a prompt that looks like <span class=\"code\">>>></span>.</p>\r\n<p class=\"child-para\">At the moment, you're doing everything in interactive mode in the Python interpreter. That's where the <span class=\"code\">>>></span> comes in. Python shows you <span class=\"code\">>>></span> when you're supposed to type something.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">At the prompt, type the following. Use a single quote at the start and the end — it's beside the Enter key:</p>\r\n\r\n<pre class=\"code\">print('Hello World!')</pre>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Press the Enter key.</p>\r\n<p class=\"child-para\">Python runs the code you typed.</p>\r\n</li>\r\n</ol>\r\nYou see the output shown in Figure 1. Congratulations — you've written your first program. Welcome to the <a href=\"https://www.dummies.com/article/technology/programming-web-design/python/how-to-install-python-on-your-computer-139548/\" target=\"_blank\" rel=\"noopener\">Python</a>-programmers-in-training club.\r\n<div class=\"imageBlock\" style=\"width: 535px;\">\r\n\r\n[caption id=\"\" align=\"alignnone\" width=\"535\"]<img src=\"https://www.dummies.com/wp-content/uploads/497387.image0.png\" alt=\"<b>Figure </b><b>1:</b> Your Hello World! program is ready for more instructions.\" width=\"535\" height=\"267\" /> Figure 1: Your Hello World! program is ready for more instructions.[/caption]\r\n\r\n<div></div>\r\n<div class=\"imageCaption\">If you don't see what's in Figure 1, check that you typed in the text from Step 2 exactly as it's written:</div>\r\n</div>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Check that the parentheses and single quotes are in the right places.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Check that for each opening parenthesis there is a closing parenthesis. (Otherwise, you're left hanging.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Check that for each opening quote there's a closing quote.</p>\r\n</li>\r\n</ul>\r\n<p class=\"Remember\">Programming languages have their own grammar and punctuation rules. These rules are the language's <i>syntax</i>. Humans, can work most stuff out even if perfect not you're is grammar (See? You figured out what that sentence was trying to say), but Python pretty much freaks out if you get the syntax wrong.</p>","blurb":"","authors":[{"authorId":9026,"name":"Brendan Scott","slug":"brendan-scott","description":" <p>Brendan Scott is a dad who loves Python and wants kids to get some of its magic too. He started pythonforkids.brendanscott.com to help teach his oldest child to code. He maintains it to help other young people learn Python.</p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9026"}}],"primaryCategoryTaxonomy":{"categoryId":33606,"title":"Python","slug":"python","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33606"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":207407,"title":"Python For Kids For Dummies Cheat Sheet","slug":"python-for-kids-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207407"}},{"articleId":141581,"title":"Use Python to Help with Your Math Homework","slug":"use-python-to-help-with-your-math-homework","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/141581"}},{"articleId":141474,"title":"Python 2.7 Keyword Subset and Examples","slug":"python-2-7-keyword-subset-and-examples","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/141474"}},{"articleId":141443,"title":"Using Tkinter Widgets in Python","slug":"using-tkinter-widgets-in-python","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/141443"}},{"articleId":139551,"title":"How to Interrupt a Program in Python","slug":"how-to-interrupt-a-program-in-python","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/139551"}}],"fromCategory":[{"articleId":264919,"title":"How to Define and Use Python Lists","slug":"how-to-define-and-use-python-lists","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264919"}},{"articleId":264911,"title":"How to Use Lambda Functions in Python","slug":"how-to-use-lambda-functions-in-python","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264911"}},{"articleId":264906,"title":"Your Guide to the Python Standard Library","slug":"your-guide-to-the-python-standard-library","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264906"}},{"articleId":264894,"title":"A Beginner’s Guide to Python Versions","slug":"a-beginners-guide-to-python-versions","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264894"}},{"articleId":264888,"title":"How to Build a Simple Neural Network in Python","slug":"how-to-build-a-simple-neural-network-in-python","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264888"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281835,"slug":"python-for-kids-for-dummies","isbn":"9781119093107","categoryList":["technology","programming-web-design","python"],"amazon":{"default":"https://www.amazon.com/gp/product/1119093104/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119093104/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119093104-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119093104/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119093104/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/python-for-kids-for-dummies-cover-9781119093107-203x255.jpg","width":203,"height":255},"title":"Python For Kids For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p>Brendan Scott is a dad who loves Python and wants kids to get some of its magic too. He started pythonforkids.brendanscott.com to help teach his oldest child to code. He maintains it to help other young people learn Python.</p>","authors":[{"authorId":9026,"name":"Brendan Scott","slug":"brendan-scott","description":" <p>Brendan Scott is a dad who loves Python and wants kids to get some of its magic too. He started pythonforkids.brendanscott.com to help teach his oldest child to code. He maintains it to help other young people learn Python.</p> ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9026"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;python&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119093107&quot;]}]\" id=\"du-slot-6350112f9b871\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;python&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119093107&quot;]}]\" id=\"du-slot-6350112f9c079\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Explore","lifeExpectancy":"One year","lifeExpectancySetFrom":"2022-01-25T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":139547},{"headers":{"creationTime":"2016-03-26T10:48:29+00:00","modifiedTime":"2022-10-19T14:13:42+00:00","timestamp":"2022-10-19T15:01:03+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Python","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33606"},"slug":"python","categoryId":33606}],"title":"How to Delete a File in Python","strippedTitle":"how to delete a file in python","slug":"how-to-delete-a-file-in-python","canonicalUrl":"","seo":{"metaDescription":"While you can use Python to delete information from files, you may find you no longer need the file at all. Here's how to delete it.","noIndex":0,"noFollow":0},"content":"While you can use Python to delete information from files, you may find you no longer need the file at all. The following steps describe how to delete files that you no longer need.\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Open a Python File window.</p>\r\n<p class=\"child-para\">You see an editor in which you can type the example code.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Type the following code into the window — pressing Enter after each line:</p>\r\n</li>\r\n \t<li>Choose Run→Run <a href=\"https://www.dummies.com/article/technology/programming-web-design/python/what-is-a-python-module-264471/\" target=\"_blank\" rel=\"noopener\">Module</a>\r\n\r\nThe application displays the File Removed! message. When you look in the directory that originally contained the ChangedFile.csv file, you see that the file is gone.\r\n<p class=\"child-para\">The task looks simple in this case, and it is. All you need to do to remove a file is call <span class=\"code\">os.remove()</span> with the appropriate filename and path (Python defaults to the current directory, so you don’t need to specify a path if the file you want to remove is in the default directory). The ease with which you can perform this task is almost scary because it’s too easy.</p>\r\n<p class=\"child-para\">Putting safeguards in place is always a good idea. You may want to remove other items, so here are other functions you should know about:</p>\r\n\r\n<ul class=\"level-two\">\r\n \t<li>\r\n<p class=\"first-para\"><b>os.rmdir():</b> Removes the specified directory. The directory must be empty or Python will display an exception message.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>shutil.rmtree():</b> Removes the specified directory, all subdirectories, and all files. This function is especially dangerous because it removes everything without checking (Python assumes that you know what you’re doing). As a result, you can easily lose data using this function.</p>\r\n</li>\r\n</ul>\r\n</li>\r\n</ol>","description":"While you can use Python to delete information from files, you may find you no longer need the file at all. The following steps describe how to delete files that you no longer need.\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Open a Python File window.</p>\r\n<p class=\"child-para\">You see an editor in which you can type the example code.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Type the following code into the window — pressing Enter after each line:</p>\r\n</li>\r\n \t<li>Choose Run→Run <a href=\"https://www.dummies.com/article/technology/programming-web-design/python/what-is-a-python-module-264471/\" target=\"_blank\" rel=\"noopener\">Module</a>\r\n\r\nThe application displays the File Removed! message. When you look in the directory that originally contained the ChangedFile.csv file, you see that the file is gone.\r\n<p class=\"child-para\">The task looks simple in this case, and it is. All you need to do to remove a file is call <span class=\"code\">os.remove()</span> with the appropriate filename and path (Python defaults to the current directory, so you don’t need to specify a path if the file you want to remove is in the default directory). The ease with which you can perform this task is almost scary because it’s too easy.</p>\r\n<p class=\"child-para\">Putting safeguards in place is always a good idea. You may want to remove other items, so here are other functions you should know about:</p>\r\n\r\n<ul class=\"level-two\">\r\n \t<li>\r\n<p class=\"first-para\"><b>os.rmdir():</b> Removes the specified directory. The directory must be empty or Python will display an exception message.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>shutil.rmtree():</b> Removes the specified directory, all subdirectories, and all files. This function is especially dangerous because it removes everything without checking (Python assumes that you know what you’re doing). As a result, you can easily lose data using this function.</p>\r\n</li>\r\n</ul>\r\n</li>\r\n</ol>","blurb":"","authors":[{"authorId":9109,"name":"John Paul Mueller","slug":"john-paul-mueller","description":" <p><b>John Paul Mueller</b> is a tech editor and the author of over 100 books on topics from networking and home security to database management and heads&#45;down programming. Follow John&#39;s blog at http://blog.johnmuellerbooks.com/. Luca Massaron is a data scientist who specializes in organizing and interpreting big data and transforming it into smart data. He is a Google Developer Expert &#40;GDE&#41; in machine learning. ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9109"}}],"primaryCategoryTaxonomy":{"categoryId":33606,"title":"Python","slug":"python","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33606"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":250588,"title":"How to Get Additional Python Libraries","slug":"get-additional-python-libraries","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/250588"}},{"articleId":250582,"title":"Printing Lists Using Python","slug":"printing-lists-using-python","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/250582"}},{"articleId":250578,"title":"Understanding How Permanent Storage Works for Python Programming","slug":"understanding-permanent-storage-works-python-programming","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/250578"}},{"articleId":250575,"title":"Extending Python Classes to Make New Classes","slug":"extending-python-classes-make-new-classes","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/250575"}},{"articleId":250571,"title":"Understanding the Python Class as a Packaging Method","slug":"understanding-python-class-packaging-method","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/250571"}}],"fromCategory":[{"articleId":264919,"title":"How to Define and Use Python Lists","slug":"how-to-define-and-use-python-lists","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264919"}},{"articleId":264911,"title":"How to Use Lambda Functions in Python","slug":"how-to-use-lambda-functions-in-python","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264911"}},{"articleId":264906,"title":"Your Guide to the Python Standard Library","slug":"your-guide-to-the-python-standard-library","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264906"}},{"articleId":264894,"title":"A Beginner’s Guide to Python Versions","slug":"a-beginners-guide-to-python-versions","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264894"}},{"articleId":264888,"title":"How to Build a Simple Neural Network in Python","slug":"how-to-build-a-simple-neural-network-in-python","categoryList":["technology","programming-web-design","python"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/264888"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281830,"slug":"beginning-programming-with-python-for-dummies-2nd-edition","isbn":"9781119457893","categoryList":["technology","programming-web-design","python"],"amazon":{"default":"https://www.amazon.com/gp/product/1119457890/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119457890/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119457890-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119457890/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119457890/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/beginning-programming-with-python-for-dummies-2nd-edition-cover-9781119457893-203x255.jpg","width":203,"height":255},"title":"Beginning Programming with Python For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9109\">John Paul Mueller</b> is a freelance author and technical editor with more than 107 books and 600 articles to his credit. His subjects range from networking and artificial intelligence to database management and heads-down programming. He also consults and writes certification exams. Visit his website at http://www.johnmuellerbooks.com/. </p>","authors":[{"authorId":9109,"name":"John Paul Mueller","slug":"john-paul-mueller","description":" <p><b>John Paul Mueller</b> is a tech editor and the author of over 100 books on topics from networking and home security to database management and heads&#45;down programming. Follow John&#39;s blog at http://blog.johnmuellerbooks.com/. Luca Massaron is a data scientist who specializes in organizing and interpreting big data and transforming it into smart data. He is a Google Developer Expert &#40;GDE&#41; in machine learning. ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9109"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;python&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119457893&quot;]}]\" id=\"du-slot-6350112f9230e\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;python&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119457893&quot;]}]\" id=\"du-slot-6350112f92b6c\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Solve","lifeExpectancy":"One year","lifeExpectancySetFrom":"2021-09-13T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":148235},{"headers":{"creationTime":"2016-03-26T20:43:38+00:00","modifiedTime":"2022-09-30T20:09:43+00:00","timestamp":"2022-09-30T21:01:04+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"SQL","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33608"},"slug":"sql","categoryId":33608}],"title":"SQL Data Types","strippedTitle":"sql data types","slug":"sql-data-types","canonicalUrl":"","seo":{"metaDescription":"Depending on their histories, different SQL implementations support a variety of data types. Here, are lists of nine general types.","noIndex":0,"noFollow":0},"content":"Depending on their histories, different SQL implementations support a variety of data types. The SQL specification recognizes nine predefined general types, shown in the lists below.\r\n\r\n<b>Exact Numerics:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">INTEGER</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">SMALLINT</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">BIGINT</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">NUMERIC</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">DECIMAL</p>\r\n</li>\r\n \t<li>DECFLOAT</li>\r\n</ul>\r\n<b>Approximate Numerics:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">REAL</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">DOUBLE PRECISION</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">FLOAT</p>\r\n</li>\r\n</ul>\r\n<b>Boolean:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">BOOLEAN</p>\r\n</li>\r\n</ul>\r\n<b>Character Strings:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">CHARACTER (CHAR)</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">CHARACTER VARYING (VARCHAR)</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">NATIONAL CHARACTER (NCHAR)</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">NATIONAL CHARACTER VARYING (NVARCHAR)</p>\r\n</li>\r\n</ul>\r\n<b>Datetimes:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">DATE</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">TIME</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">TIMESTAMP</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">TIME WITH TIMEZONE</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">TIMESTAMP WITH TIMEZONE</p>\r\n</li>\r\n</ul>\r\n<b>Intervals:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">INTERVAL DAY</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">INTERVAL YEAR</p>\r\n</li>\r\n</ul>\r\n<b>Large Objects:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">BLOB</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">CLOB</p>\r\n</li>\r\n</ul>\r\n<b>Collection Types:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">ARRAY</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">MULTISET</p>\r\n</li>\r\n</ul>\r\n<b>Other Types:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">ROW</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">XML</p>\r\n</li>\r\n</ul>","description":"Depending on their histories, different SQL implementations support a variety of data types. The SQL specification recognizes nine predefined general types, shown in the lists below.\r\n\r\n<b>Exact Numerics:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">INTEGER</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">SMALLINT</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">BIGINT</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">NUMERIC</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">DECIMAL</p>\r\n</li>\r\n \t<li>DECFLOAT</li>\r\n</ul>\r\n<b>Approximate Numerics:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">REAL</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">DOUBLE PRECISION</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">FLOAT</p>\r\n</li>\r\n</ul>\r\n<b>Boolean:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">BOOLEAN</p>\r\n</li>\r\n</ul>\r\n<b>Character Strings:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">CHARACTER (CHAR)</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">CHARACTER VARYING (VARCHAR)</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">NATIONAL CHARACTER (NCHAR)</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">NATIONAL CHARACTER VARYING (NVARCHAR)</p>\r\n</li>\r\n</ul>\r\n<b>Datetimes:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">DATE</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">TIME</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">TIMESTAMP</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">TIME WITH TIMEZONE</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">TIMESTAMP WITH TIMEZONE</p>\r\n</li>\r\n</ul>\r\n<b>Intervals:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">INTERVAL DAY</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">INTERVAL YEAR</p>\r\n</li>\r\n</ul>\r\n<b>Large Objects:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">BLOB</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">CLOB</p>\r\n</li>\r\n</ul>\r\n<b>Collection Types:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">ARRAY</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">MULTISET</p>\r\n</li>\r\n</ul>\r\n<b>Other Types:</b>\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">ROW</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">XML</p>\r\n</li>\r\n</ul>","blurb":"","authors":[{"authorId":9559,"name":"Allen G. Taylor","slug":"allen-g-taylor","description":" <p><b>Allen G. Taylor</b> is a 30&#45;year veteran of the computer industry and the author of over 40 books, including <b><i>SQL For Dummies</i></b> and <i>Crystal Reports For Dummies.</i> He lectures nationally on databases, innovation, and entrepreneurship. He also teaches database development internationally through a leading online education provider. ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9559"}}],"primaryCategoryTaxonomy":{"categoryId":33608,"title":"SQL","slug":"sql","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33608"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":208690,"title":"SQL All-in-One For Dummies Cheat Sheet","slug":"sql-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/208690"}},{"articleId":188700,"title":"SQL Criteria for Normal Forms","slug":"sql-criteria-for-normal-forms","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/188700"}}],"fromCategory":[{"articleId":260869,"title":"Using SQL Constraints Within Transactions","slug":"using-sql-constraints-within-transactions","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260869"}},{"articleId":260866,"title":"How to Use the SQL Union Join","slug":"how-to-use-the-sql-union-join","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260866"}},{"articleId":260727,"title":"How to Declare a SQL Cursor","slug":"how-to-declare-a-sql-cursor","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260727"}},{"articleId":260720,"title":"What is SQL?","slug":"what-is-sql","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260720"}},{"articleId":260678,"title":"ODBC: Interfacing with SQL Databases","slug":"odbc-interfacing-with-sql-databases","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260678"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281870,"slug":"sql-all-in-one-for-dummies-3rd-edition","isbn":"9781119569619","categoryList":["technology","programming-web-design","sql"],"amazon":{"default":"https://www.amazon.com/gp/product/1119569613/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119569613/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119569613-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119569613/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119569613/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/sql-all-in-one-for-dummies-3rd-edition-cover-9781119569619-203x255.jpg","width":203,"height":255},"title":"SQL All-in-One For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9559\">Allen G. Taylor</b> is a 40-year veteran of the computer industry and the author of more than 40 books, including <i>SQL For Dummies</i> and <i>Database Development For Dummies</i>. For the latest news on Allen's activities, check out his online courses (at pioneer-academy1.teachable.com) and his blog (at www.allengtaylor.com). You can contact Allen at [email protected] </p>","authors":[{"authorId":9559,"name":"Allen G. Taylor","slug":"allen-g-taylor","description":" <p><b>Allen G. Taylor</b> is a 30&#45;year veteran of the computer industry and the author of over 40 books, including <b><i>SQL For Dummies</i></b> and <i>Crystal Reports For Dummies.</i> He lectures nationally on databases, innovation, and entrepreneurship. He also teaches database development internationally through a leading online education provider. ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9559"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;sql&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119569619&quot;]}]\" id=\"du-slot-633759100f0ba\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;sql&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119569619&quot;]}]\" id=\"du-slot-633759100f98e\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Two years","lifeExpectancySetFrom":"2022-09-30T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":188699},{"headers":{"creationTime":"2016-03-26T21:45:57+00:00","modifiedTime":"2022-09-30T20:00:53+00:00","timestamp":"2022-09-30T21:01:03+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"SQL","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33608"},"slug":"sql","categoryId":33608}],"title":"SQL Criteria for Normal Forms","strippedTitle":"sql criteria for normal forms","slug":"sql-criteria-for-normal-forms-2","canonicalUrl":"","seo":{"metaDescription":"In SQL, normal forms are defining characteristics of relational databases. Learn about the first, second, and third normal forms.","noIndex":0,"noFollow":0},"content":"To ensure that database tables are designed in such a way that they will hold your data reliably, you need to be sure that they are not subject to modification anomalies. Normalizing your databases will give you that assurance. Compare the SQL criteria in the following list to the tables in your database. Doing so will alert you to the possibility of anomalies, when you find that your database is not sufficiently normalized.\r\n\r\nFirst Normal Form (1NF):\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Table must be two-dimensional, with rows and columns.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Each row contains data that pertains to one thing or one portion of a thing.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Each column contains data for a single attribute of the thing being described.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Each cell (intersection of row and column) of the table must be single-valued.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">All entries in a column must be of the same kind.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Each column must have a unique name.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">No two rows may be identical.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">The order of the columns and of the rows does not matter.</p>\r\n</li>\r\n</ul>\r\nSecond Normal Form (2NF):\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Table must be in first normal form (1NF).</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">All non-key attributes (columns) must be dependent on the entire key.</p>\r\n</li>\r\n</ul>\r\nThird Normal Form (3NF):\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Table must be in second normal form (2NF).</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Table has no transitive dependencies.</p>\r\n</li>\r\n</ul>\r\nDomain-Key Normal Form (DK/NF):\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Every constraint on the table is a logical consequence of the definition of keys and domains.</p>\r\n</li>\r\n</ul>","description":"To ensure that database tables are designed in such a way that they will hold your data reliably, you need to be sure that they are not subject to modification anomalies. Normalizing your databases will give you that assurance. Compare the SQL criteria in the following list to the tables in your database. Doing so will alert you to the possibility of anomalies, when you find that your database is not sufficiently normalized.\r\n\r\nFirst Normal Form (1NF):\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Table must be two-dimensional, with rows and columns.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Each row contains data that pertains to one thing or one portion of a thing.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Each column contains data for a single attribute of the thing being described.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Each cell (intersection of row and column) of the table must be single-valued.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">All entries in a column must be of the same kind.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Each column must have a unique name.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">No two rows may be identical.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">The order of the columns and of the rows does not matter.</p>\r\n</li>\r\n</ul>\r\nSecond Normal Form (2NF):\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Table must be in first normal form (1NF).</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">All non-key attributes (columns) must be dependent on the entire key.</p>\r\n</li>\r\n</ul>\r\nThird Normal Form (3NF):\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Table must be in second normal form (2NF).</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Table has no transitive dependencies.</p>\r\n</li>\r\n</ul>\r\nDomain-Key Normal Form (DK/NF):\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Every constraint on the table is a logical consequence of the definition of keys and domains.</p>\r\n</li>\r\n</ul>","blurb":"","authors":[{"authorId":9559,"name":"Allen G. Taylor","slug":"allen-g-taylor","description":" <p><b>Allen G. Taylor</b> is a 30&#45;year veteran of the computer industry and the author of over 40 books, including <b><i>SQL For Dummies</i></b> and <i>Crystal Reports For Dummies.</i> He lectures nationally on databases, innovation, and entrepreneurship. He also teaches database development internationally through a leading online education provider. ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9559"}}],"primaryCategoryTaxonomy":{"categoryId":33608,"title":"SQL","slug":"sql","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33608"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":260869,"title":"Using SQL Constraints Within Transactions","slug":"using-sql-constraints-within-transactions","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260869"}},{"articleId":260866,"title":"How to Use the SQL Union Join","slug":"how-to-use-the-sql-union-join","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260866"}},{"articleId":260727,"title":"How to Declare a SQL Cursor","slug":"how-to-declare-a-sql-cursor","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260727"}},{"articleId":260720,"title":"What is SQL?","slug":"what-is-sql","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260720"}},{"articleId":260678,"title":"ODBC: Interfacing with SQL Databases","slug":"odbc-interfacing-with-sql-databases","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260678"}}],"fromCategory":[{"articleId":260869,"title":"Using SQL Constraints Within Transactions","slug":"using-sql-constraints-within-transactions","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260869"}},{"articleId":260866,"title":"How to Use the SQL Union Join","slug":"how-to-use-the-sql-union-join","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260866"}},{"articleId":260727,"title":"How to Declare a SQL Cursor","slug":"how-to-declare-a-sql-cursor","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260727"}},{"articleId":260720,"title":"What is SQL?","slug":"what-is-sql","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260720"}},{"articleId":260678,"title":"ODBC: Interfacing with SQL Databases","slug":"odbc-interfacing-with-sql-databases","categoryList":["technology","programming-web-design","sql"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/260678"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281871,"slug":"sql-for-dummies-9th-edition","isbn":"9781119527077","categoryList":["technology","programming-web-design","sql"],"amazon":{"default":"https://www.amazon.com/gp/product/1119527074/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119527074/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119527074-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119527074/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119527074/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/sql-for-dummies-9th-edition-cover-9781119527077-203x255.jpg","width":203,"height":255},"title":"SQL For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9559\">Allen G. Taylor</b> is a 30-year veteran of the computer industry and the author of over 40 books, including <b><i>SQL For Dummies</i></b> and <i>Crystal Reports For Dummies.</i> He lectures nationally on databases, innovation, and entrepreneurship. He also teaches database development internationally through a leading online education provider. </p>","authors":[{"authorId":9559,"name":"Allen G. Taylor","slug":"allen-g-taylor","description":" <p><b>Allen G. Taylor</b> is a 30&#45;year veteran of the computer industry and the author of over 40 books, including <b><i>SQL For Dummies</i></b> and <i>Crystal Reports For Dummies.</i> He lectures nationally on databases, innovation, and entrepreneurship. He also teaches database development internationally through a leading online education provider. ","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9559"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;sql&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119527077&quot;]}]\" id=\"du-slot-6337590f711d8\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;sql&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119527077&quot;]}]\" id=\"du-slot-6337590f71ae2\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Two years","lifeExpectancySetFrom":"2022-09-30T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":194143},{"headers":{"creationTime":"2016-03-26T13:13:28+00:00","modifiedTime":"2022-09-19T20:11:14+00:00","timestamp":"2022-09-20T16:51:28+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"HTML5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"},"slug":"html5","categoryId":33601}],"title":"How to Make an AJAX Request with jQuery for HTML5 and CSS3 Programming","strippedTitle":"how to make an ajax request with jquery for html5 and css3 programming","slug":"how-to-make-an-ajax-request-with-jquery-for-html5-and-css3-programming","canonicalUrl":"","seo":{"metaDescription":"The primary purpose of an AJAX library like jQuery is to simplify AJAX requests for HTML5 and CSS3 programmers. It's hard to believe how easy this can be with j","noIndex":0,"noFollow":0},"content":"The primary purpose of an AJAX library like jQuery is to simplify AJAX requests for HTML5 and CSS3 programmers. It's hard to believe how easy this can be with jQuery.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/414071.image0.jpg\" alt=\"Preview of a HTML site using Ajax.\" width=\"533\" height=\"400\" />\r\n<h2 id=\"tab1\" >How to include a text file with AJAX</h2>\r\nCheck out this clean code:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n &lt;meta charset=\"UTF-8\"&gt;\r\n &lt;title&gt;ajax.html&lt;/title&gt;\r\n &lt;script type = \"text/javascript\"\r\n src = \"jquery-1.10.2.min.js\"&gt;&lt;/script&gt;\r\n &lt;script type = \"text/javascript\"&gt;\r\n $(document).ready(getAJAX);\r\n function getAJAX(){\r\n $(\"#output\").load(\"hello.txt\");\r\n }\r\n &lt;/script&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;div id = \"output\"&gt;&lt;/div&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nThe HTML is very clean. It simply creates an empty div called <span class=\"code\">output</span>.\r\n<p class=\"Remember\">This example does use AJAX, so if it isn't working, you might need to remember some details about how AJAX works. A program using AJAX should be run through a web server, not just from a local file. Also, the file being read should be on the same server as the program making the AJAX request.</p>\r\nThe <span class=\"code\">load()</span> mechanism described here is suitable for a basic situation where you want to load a plain-text or HTML code snippet into your pages.\r\n<h2 id=\"tab2\" >Building a poor man's CMS with AJAX</h2>\r\nAJAX and jQuery can be a very useful way to build efficient websites, even without server-side programming. Frequently a website is based on a series of smaller elements that can be swapped and reused. You can use AJAX to build a framework that allows easy reuse and modification of web content.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/414072.image1.jpg\" alt=\"A website created with Ajax and JQuery.\" width=\"533\" height=\"400\" />\r\n\r\nAlthough nothing is all that shocking about the page from the user's perspective, a look at the code can show some surprises:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang = \"en\"&gt;\r\n &lt;head&gt;\r\n &lt;meta charset = \"UTF-8\"&gt;\r\n &lt;title&gt;CMS Using AJAX&lt;/title&gt;\r\n &lt;link rel = \"stylesheet\"\r\n type = \"text/css\"\r\n href = \"cmsStd.css\" /&gt;\r\n &lt;script type = \"text/javascript\"\r\n src = \"jquery-1.10.2.min.js\"&gt;&lt;/script&gt;\r\n &lt;script type = \"text/javascript\"&gt;\r\n $(init);\r\n function init(){\r\n $(\"#heading\").load(\"head.html\");\r\n $(\"#menu\").load(\"menu.html\");\r\n $(\"#content1\").load(\"story1.html\");\r\n $(\"#content2\").load(\"story2.html\");\r\n $(\"#footer\").load(\"footer.html\");\r\n };\r\n &lt;/script&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;div id = \"all\"&gt;\r\n &lt;!-- This div centers a fixed-width layout →\r\n &lt;div id = \"heading\"&gt;\r\n &lt;/div&gt;&lt;!-- end heading div →\r\n &lt;div id = \"menu\"&gt;\r\n &lt;/div&gt; &lt;!-- end menu div →\r\n &lt;div class = \"content\"\r\n id = \"content1\"&gt;\r\n &lt;/div&gt; &lt;!-- end content div →\r\n &lt;div class = \"content\"\r\n id = \"content2\"&gt;\r\n &lt;/div&gt; &lt;!-- end content div →\r\n &lt;div id = \"footer\"&gt;\r\n &lt;/div&gt; &lt;!-- end footer div →\r\n &lt;/div&gt; &lt;!-- end all div →\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nLook over the code, and you can see these interesting features:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><b>The page has no content!</b> All the divs are empty. None of the text shown in the screen shot is present in this document, but all is pulled from smaller files dynamically.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The page consists of empty named divs.</b> Rather than any particular content, the page consists of placeholders with IDs.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>It uses jQuery.</b> The jQuery library is used to vastly simplify loading data through AJAX calls.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>All contents are in separate files.</b> Look through the directory, and you can see very simple HTML files that contain small parts of the page. For example, story1.html looks like this:</p>\r\n\r\n<pre class=\"code\">&lt;h2&gt;Book I - Creating the HTML Foundation&lt;/h3&gt;\r\n&lt;ol&gt;\r\n &lt;li&gt;Sound HTML Foundations&lt;/li&gt;\r\n &lt;li&gt;It's All About Validation&lt;/li&gt;\r\n &lt;li&gt;Choosing your Tools&lt;/li&gt;\r\n &lt;li&gt;Managing Information with Lists and Tables&lt;/li&gt;\r\n &lt;li&gt;Making Connections with Links&lt;/li&gt;\r\n &lt;li&gt;Adding Images&lt;/li&gt;\r\n &lt;li&gt;Creating forms&lt;/li&gt;\r\n&lt;/ol&gt;</pre>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The </b><span class=\"code\"><b>init()</b></span><b> method runs on </b><span class=\"code\"><b>document.ready</b></span><b>.</b> When the document is ready, the page runs the <span class=\"code\">init()</span> method.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The</b><span class=\"code\"><b> init() </b></span><b>method uses AJAX calls to dynamically load content.</b> It's nothing more than a series of jQuery <span class=\"code\">load()</span> methods.</p>\r\n</li>\r\n</ul>\r\nThis approach may seem like a lot of work, but it has some very interesting characteristics:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">If you're building a large site with several pages, you usually want to design the visual appearance once and reuse the same general template repeatedly.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Also, you'll probably have some elements that will be consistent over several pages. You could simply create a default document and copy and paste it for each page, but this approach gets messy. What happens if you have created 100 pages according to a template and then need to change the header? You need to make the change on 100 different pages.</p>\r\n</li>\r\n</ul>\r\nThe advantage of the template-style approach is code reuse. Just like the use of an external style allows you to multiply a style sheet across hundreds of documents, designing a template without content allows you to store code snippets in smaller files and reuse them. All 100 pages point to the same menu file, so if you want to change the menu, change one file and everything changes with it.\r\n\r\nHere's how you use this sort of approach:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Create a single template for your entire site.</p>\r\n<p class=\"child-para\">Build basic HTML and CSS to manage the overall look and feel for your entire site. Don't worry about content yet. Just build placeholders for all the components of your page. Be sure to give each element an ID and write the CSS to get things positioned as you want.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Add jQuery support.</p>\r\n<p class=\"child-para\">Make a link to the jQuery library, and make a default <span class=\"code\">init()</span> method. Put in code to handle populating those parts of the page that will always be consistent.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Duplicate the template.</p>\r\n<p class=\"child-para\">After you have a sense of how the template will work, make a copy for each page of your site.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Customize each page by changing the<span class=\"code\"><b> init() </b></span>function.</p>\r\n<p class=\"child-para\">The only part of the template that changes is the <span class=\"code\">init()</span> function. All your pages will be identical, except they have customized <span class=\"code\">init()</span> functions that load different content.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Load custom content into the divs with AJAX.</p>\r\n<p class=\"child-para\">Use the <span class=\"code\">init()</span>function to load content into each div.</p>\r\n</li>\r\n</ol>\r\n<p class=\"Tip\">This is a great way to manage content, but it isn't quite a full-blown content-management system. Even AJAX can't quite allow you to <i>store</i> content on the web. More complex content management systems also use databases rather than files to handle content. You'll need some sort of server-side programming (like PHP) and usually a database (like mySQL) to handle this kind of work.</p>","description":"The primary purpose of an AJAX library like jQuery is to simplify AJAX requests for HTML5 and CSS3 programmers. It's hard to believe how easy this can be with jQuery.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/414071.image0.jpg\" alt=\"Preview of a HTML site using Ajax.\" width=\"533\" height=\"400\" />\r\n<h2 id=\"tab1\" >How to include a text file with AJAX</h2>\r\nCheck out this clean code:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n &lt;meta charset=\"UTF-8\"&gt;\r\n &lt;title&gt;ajax.html&lt;/title&gt;\r\n &lt;script type = \"text/javascript\"\r\n src = \"jquery-1.10.2.min.js\"&gt;&lt;/script&gt;\r\n &lt;script type = \"text/javascript\"&gt;\r\n $(document).ready(getAJAX);\r\n function getAJAX(){\r\n $(\"#output\").load(\"hello.txt\");\r\n }\r\n &lt;/script&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;div id = \"output\"&gt;&lt;/div&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nThe HTML is very clean. It simply creates an empty div called <span class=\"code\">output</span>.\r\n<p class=\"Remember\">This example does use AJAX, so if it isn't working, you might need to remember some details about how AJAX works. A program using AJAX should be run through a web server, not just from a local file. Also, the file being read should be on the same server as the program making the AJAX request.</p>\r\nThe <span class=\"code\">load()</span> mechanism described here is suitable for a basic situation where you want to load a plain-text or HTML code snippet into your pages.\r\n<h2 id=\"tab2\" >Building a poor man's CMS with AJAX</h2>\r\nAJAX and jQuery can be a very useful way to build efficient websites, even without server-side programming. Frequently a website is based on a series of smaller elements that can be swapped and reused. You can use AJAX to build a framework that allows easy reuse and modification of web content.\r\n\r\n<img src=\"https://www.dummies.com/wp-content/uploads/414072.image1.jpg\" alt=\"A website created with Ajax and JQuery.\" width=\"533\" height=\"400\" />\r\n\r\nAlthough nothing is all that shocking about the page from the user's perspective, a look at the code can show some surprises:\r\n<pre class=\"code\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang = \"en\"&gt;\r\n &lt;head&gt;\r\n &lt;meta charset = \"UTF-8\"&gt;\r\n &lt;title&gt;CMS Using AJAX&lt;/title&gt;\r\n &lt;link rel = \"stylesheet\"\r\n type = \"text/css\"\r\n href = \"cmsStd.css\" /&gt;\r\n &lt;script type = \"text/javascript\"\r\n src = \"jquery-1.10.2.min.js\"&gt;&lt;/script&gt;\r\n &lt;script type = \"text/javascript\"&gt;\r\n $(init);\r\n function init(){\r\n $(\"#heading\").load(\"head.html\");\r\n $(\"#menu\").load(\"menu.html\");\r\n $(\"#content1\").load(\"story1.html\");\r\n $(\"#content2\").load(\"story2.html\");\r\n $(\"#footer\").load(\"footer.html\");\r\n };\r\n &lt;/script&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;div id = \"all\"&gt;\r\n &lt;!-- This div centers a fixed-width layout →\r\n &lt;div id = \"heading\"&gt;\r\n &lt;/div&gt;&lt;!-- end heading div →\r\n &lt;div id = \"menu\"&gt;\r\n &lt;/div&gt; &lt;!-- end menu div →\r\n &lt;div class = \"content\"\r\n id = \"content1\"&gt;\r\n &lt;/div&gt; &lt;!-- end content div →\r\n &lt;div class = \"content\"\r\n id = \"content2\"&gt;\r\n &lt;/div&gt; &lt;!-- end content div →\r\n &lt;div id = \"footer\"&gt;\r\n &lt;/div&gt; &lt;!-- end footer div →\r\n &lt;/div&gt; &lt;!-- end all div →\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre>\r\nLook over the code, and you can see these interesting features:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\"><b>The page has no content!</b> All the divs are empty. None of the text shown in the screen shot is present in this document, but all is pulled from smaller files dynamically.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The page consists of empty named divs.</b> Rather than any particular content, the page consists of placeholders with IDs.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>It uses jQuery.</b> The jQuery library is used to vastly simplify loading data through AJAX calls.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>All contents are in separate files.</b> Look through the directory, and you can see very simple HTML files that contain small parts of the page. For example, story1.html looks like this:</p>\r\n\r\n<pre class=\"code\">&lt;h2&gt;Book I - Creating the HTML Foundation&lt;/h3&gt;\r\n&lt;ol&gt;\r\n &lt;li&gt;Sound HTML Foundations&lt;/li&gt;\r\n &lt;li&gt;It's All About Validation&lt;/li&gt;\r\n &lt;li&gt;Choosing your Tools&lt;/li&gt;\r\n &lt;li&gt;Managing Information with Lists and Tables&lt;/li&gt;\r\n &lt;li&gt;Making Connections with Links&lt;/li&gt;\r\n &lt;li&gt;Adding Images&lt;/li&gt;\r\n &lt;li&gt;Creating forms&lt;/li&gt;\r\n&lt;/ol&gt;</pre>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The </b><span class=\"code\"><b>init()</b></span><b> method runs on </b><span class=\"code\"><b>document.ready</b></span><b>.</b> When the document is ready, the page runs the <span class=\"code\">init()</span> method.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\"><b>The</b><span class=\"code\"><b> init() </b></span><b>method uses AJAX calls to dynamically load content.</b> It's nothing more than a series of jQuery <span class=\"code\">load()</span> methods.</p>\r\n</li>\r\n</ul>\r\nThis approach may seem like a lot of work, but it has some very interesting characteristics:\r\n<ul class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">If you're building a large site with several pages, you usually want to design the visual appearance once and reuse the same general template repeatedly.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Also, you'll probably have some elements that will be consistent over several pages. You could simply create a default document and copy and paste it for each page, but this approach gets messy. What happens if you have created 100 pages according to a template and then need to change the header? You need to make the change on 100 different pages.</p>\r\n</li>\r\n</ul>\r\nThe advantage of the template-style approach is code reuse. Just like the use of an external style allows you to multiply a style sheet across hundreds of documents, designing a template without content allows you to store code snippets in smaller files and reuse them. All 100 pages point to the same menu file, so if you want to change the menu, change one file and everything changes with it.\r\n\r\nHere's how you use this sort of approach:\r\n<ol class=\"level-one\">\r\n \t<li>\r\n<p class=\"first-para\">Create a single template for your entire site.</p>\r\n<p class=\"child-para\">Build basic HTML and CSS to manage the overall look and feel for your entire site. Don't worry about content yet. Just build placeholders for all the components of your page. Be sure to give each element an ID and write the CSS to get things positioned as you want.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Add jQuery support.</p>\r\n<p class=\"child-para\">Make a link to the jQuery library, and make a default <span class=\"code\">init()</span> method. Put in code to handle populating those parts of the page that will always be consistent.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Duplicate the template.</p>\r\n<p class=\"child-para\">After you have a sense of how the template will work, make a copy for each page of your site.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Customize each page by changing the<span class=\"code\"><b> init() </b></span>function.</p>\r\n<p class=\"child-para\">The only part of the template that changes is the <span class=\"code\">init()</span> function. All your pages will be identical, except they have customized <span class=\"code\">init()</span> functions that load different content.</p>\r\n</li>\r\n \t<li>\r\n<p class=\"first-para\">Load custom content into the divs with AJAX.</p>\r\n<p class=\"child-para\">Use the <span class=\"code\">init()</span>function to load content into each div.</p>\r\n</li>\r\n</ol>\r\n<p class=\"Tip\">This is a great way to manage content, but it isn't quite a full-blown content-management system. Even AJAX can't quite allow you to <i>store</i> content on the web. More complex content management systems also use databases rather than files to handle content. You'll need some sort of server-side programming (like PHP) and usually a database (like mySQL) to handle this kind of work.</p>","blurb":"","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected]","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}}],"primaryCategoryTaxonomy":{"categoryId":33601,"title":"HTML5","slug":"html5","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33601"}},"secondaryCategoryTaxonomy":{"categoryId":34324,"title":"CSS3","slug":"css3","_links":{"self":"https://dummies-api.dummies.com/v2/categories/34324"}},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[{"label":"How to include a text file with AJAX","target":"#tab1"},{"label":"Building a poor man's CMS with AJAX","target":"#tab2"}],"relatedArticles":{"fromBook":[{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":203865,"title":"How to Use IrfanView’s Built-In Effects for HTML5 and CSS3 Programming","slug":"how-to-use-irfanviews-built-in-effects-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203865"}},{"articleId":203862,"title":"How to Implement a Database in MySQL for HTML5 and CSS3 Programming","slug":"how-to-implement-a-database-in-mysql-for-html5-and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203862"}},{"articleId":203861,"title":"How to Run a Script with phpMyAdmin in SQL for HTML5and CSS3 Programming","slug":"how-to-run-a-script-with-phpmyadmin-in-sql-for-html5and-css3-programming","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203861"}},{"articleId":203857,"title":"How to Register a Domain Name for Your HTML5 and CSS3 Site","slug":"how-to-register-a-domain-name-for-your-html5-and-css3-site","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203857"}}],"fromCategory":[{"articleId":207867,"title":"Beginning HTML5 & CSS3 For Dummies Cheat Sheet","slug":"beginning-html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207867"}},{"articleId":207816,"title":"HTML5 & CSS3 For Dummies Cheat Sheet","slug":"html5-css3-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207816"}},{"articleId":207788,"title":"HTML5 and CSS3 All-in-One For Dummies Cheat Sheet","slug":"html5-and-css3-all-in-one-for-dummies-cheat-sheet","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/207788"}},{"articleId":204537,"title":"How to Create a New JavaScript File in Komodo Edit","slug":"how-to-create-a-new-javascript-file-in-komodo-edit","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204537"}},{"articleId":204532,"title":"How to Create Cascading Style Sheets (CSS) Simply and Easily","slug":"how-to-create-cascading-style-sheets-css-simply-and-easily","categoryList":["technology","programming-web-design","html5"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/204532"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281736,"slug":"html5-and-css3-all-in-one-for-dummies-3rd-edition","isbn":"9781118289389","categoryList":["technology","programming-web-design","html5"],"amazon":{"default":"https://www.amazon.com/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1118289382-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1118289382/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/html5-and-css3-all-in-one-for-dummies-3rd-edition-cover-9781118289389-203x255.jpg","width":203,"height":255},"title":"HTML5 and CSS3 All-in-One For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"<p><b data-author-id=\"9189\">Andy Harris</b> taught himself programming because it was fun. Today he teaches computer science, game development, and web programming at the university level; is a technology consultant for the state of Indiana; has helped people with disabilities to form their own web development companies; and works with families who wish to teach computing at home.</p>","authors":[{"authorId":9189,"name":"Andy Harris","slug":"andy-harris","description":" <b>Andy Harris</b> earned a degree in Special Education from Indiana University/Purdue University&#8211;Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.<br /> Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.<br /> Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.<br /> Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.<br /> Andy welcomes comments and suggestions about his books. He can be reached at [email protected]","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9189"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-6329ef90e6c04\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;html5&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781118289389&quot;]}]\" id=\"du-slot-6329ef90e750f\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Two years","lifeExpectancySetFrom":"2022-09-19T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":156689}],"_links":{"self":{"self":"https://dummies-api.dummies.com/v2/categories/33592/categoryArticles?sortField=time&sortOrder=1&size=10&offset=0"},"next":{"self":"https://dummies-api.dummies.com/v2/categories/33592/categoryArticles?sortField=time&sortOrder=1&size=10&offset=10"},"last":{"self":"https://dummies-api.dummies.com/v2/categories/33592/categoryArticles?sortField=time&sortOrder=1&size=10&offset=1382"}}},"objectTitle":"","status":"success","pageType":"article-category","objectId":"33592","page":1,"sortField":"time","sortOrder":1,"categoriesIds":[],"articleTypes":[],"filterData":{"categoriesFilter":[{"itemId":0,"itemName":"All Categories","count":1390},{"itemId":33593,"itemName":"3D Printing","count":33},{"itemId":33594,"itemName":"App Development","count":85},{"itemId":34376,"itemName":"Blogging & Website Platforms","count":65},{"itemId":33595,"itemName":"C","count":17},{"itemId":33596,"itemName":"C#","count":29},{"itemId":33597,"itemName":"C++","count":63},{"itemId":33598,"itemName":"Cisco Programming","count":1},{"itemId":33599,"itemName":"Coding","count":106},{"itemId":34324,"itemName":"CSS3","count":4},{"itemId":33610,"itemName":"General Programming & Web Design","count":206},{"itemId":34511,"itemName":"Go Programming Language","count":1},{"itemId":33600,"itemName":"HTML","count":8},{"itemId":33601,"itemName":"HTML5","count":265},{"itemId":33602,"itemName":"Java","count":122},{"itemId":33603,"itemName":"JavaScript","count":86},{"itemId":33604,"itemName":"MATLAB","count":83},{"itemId":33592,"itemName":"Programming & Web Design","count":2},{"itemId":33606,"itemName":"Python","count":83},{"itemId":33607,"itemName":"R","count":99},{"itemId":33608,"itemName":"SQL","count":26},{"itemId":34338,"itemName":"Web Hosting","count":6}],"articleTypeFilter":[{"articleType":"All Types","count":1390},{"articleType":"Articles","count":1284},{"articleType":"Cheat Sheet","count":50},{"articleType":"Step by Step","count":56}]},"filterDataLoadedStatus":"success","pageSize":10},"adsState":{"pageScripts":{"headers":{"timestamp":"2023-02-03T05:50:01+00:00"},"adsId":0,"data":{"scripts":[{"pages":["all"],"location":"header","script":"<!--Optimizely Script-->\r\n<script src=\"https://cdn.optimizely.com/js/10563184655.js\"></script>","enabled":false},{"pages":["all"],"location":"header","script":"<!-- comScore Tag -->\r\n<script>var _comscore = _comscore || [];_comscore.push({ c1: \"2\", c2: \"15097263\" });(function() {var s = document.createElement(\"script\"), el = document.getElementsByTagName(\"script\")[0]; s.async = true;s.src = (document.location.protocol == \"https:\" ? \"https://sb\" : \"http://b\") + \".scorecardresearch.com/beacon.js\";el.parentNode.insertBefore(s, el);})();</script><noscript><img src=\"https://sb.scorecardresearch.com/p?c1=2&c2=15097263&cv=2.0&cj=1\" /></noscript>\r\n<!-- / comScore Tag -->","enabled":true},{"pages":["all"],"location":"footer","script":"<!--BEGIN QUALTRICS WEBSITE FEEDBACK SNIPPET-->\r\n<script type='text/javascript'>\r\n(function(){var g=function(e,h,f,g){\r\nthis.get=function(a){for(var a=a+\"=\",c=document.cookie.split(\";\"),b=0,e=c.length;b<e;b++){for(var d=c[b];\" \"==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(a))return d.substring(a.length,d.length)}return null};\r\nthis.set=function(a,c){var b=\"\",b=new Date;b.setTime(b.getTime()+6048E5);b=\"; expires=\"+b.toGMTString();document.cookie=a+\"=\"+c+b+\"; path=/; \"};\r\nthis.check=function(){var a=this.get(f);if(a)a=a.split(\":\");else if(100!=e)\"v\"==h&&(e=Math.random()>=e/100?0:100),a=[h,e,0],this.set(f,a.join(\":\"));else return!0;var c=a[1];if(100==c)return!0;switch(a[0]){case \"v\":return!1;case \"r\":return c=a[2]%Math.floor(100/c),a[2]++,this.set(f,a.join(\":\")),!c}return!0};\r\nthis.go=function(){if(this.check()){var a=document.createElement(\"script\");a.type=\"text/javascript\";a.src=g;document.body&&document.body.appendChild(a)}};\r\nthis.start=function(){var t=this;\"complete\"!==document.readyState?window.addEventListener?window.addEventListener(\"load\",function(){t.go()},!1):window.attachEvent&&window.attachEvent(\"onload\",function(){t.go()}):t.go()};};\r\ntry{(new g(100,\"r\",\"QSI_S_ZN_5o5yqpvMVjgDOuN\",\"https://zn5o5yqpvmvjgdoun-wiley.siteintercept.qualtrics.com/SIE/?Q_ZID=ZN_5o5yqpvMVjgDOuN\")).start()}catch(i){}})();\r\n</script><div id='ZN_5o5yqpvMVjgDOuN'><!--DO NOT REMOVE-CONTENTS PLACED HERE--></div>\r\n<!--END WEBSITE FEEDBACK SNIPPET-->","enabled":false},{"pages":["all"],"location":"header","script":"<!-- Hotjar Tracking Code for http://www.dummies.com -->\r\n<script>\r\n (function(h,o,t,j,a,r){\r\n h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\r\n h._hjSettings={hjid:257151,hjsv:6};\r\n a=o.getElementsByTagName('head')[0];\r\n r=o.createElement('script');r.async=1;\r\n r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\r\n a.appendChild(r);\r\n })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\r\n</script>","enabled":false},{"pages":["article"],"location":"header","script":"<!-- //Connect Container: dummies --> <script src=\"//get.s-onetag.com/bffe21a1-6bb8-4928-9449-7beadb468dae/tag.min.js\" async defer></script>","enabled":true},{"pages":["homepage"],"location":"header","script":"<meta name=\"facebook-domain-verification\" content=\"irk8y0irxf718trg3uwwuexg6xpva0\" />","enabled":true},{"pages":["homepage","article","category","search"],"location":"footer","script":"<!-- Facebook Pixel Code -->\r\n<noscript>\r\n<img height=\"1\" width=\"1\" src=\"https://www.facebook.com/tr?id=256338321977984&ev=PageView&noscript=1\"/>\r\n</noscript>\r\n<!-- End Facebook Pixel Code -->","enabled":true}]}},"pageScriptsLoadedStatus":"success"},"navigationState":{"navigationCollections":[{"collectionId":287568,"title":"BYOB (Be Your Own Boss)","hasSubCategories":false,"url":"/collection/for-the-entry-level-entrepreneur-287568"},{"collectionId":293237,"title":"Be a Rad Dad","hasSubCategories":false,"url":"/collection/be-the-best-dad-293237"},{"collectionId":295890,"title":"Career Shifting","hasSubCategories":false,"url":"/collection/career-shifting-295890"},{"collectionId":294090,"title":"Contemplating the Cosmos","hasSubCategories":false,"url":"/collection/theres-something-about-space-294090"},{"collectionId":287563,"title":"For Those Seeking Peace of Mind","hasSubCategories":false,"url":"/collection/for-those-seeking-peace-of-mind-287563"},{"collectionId":287570,"title":"For the Aspiring Aficionado","hasSubCategories":false,"url":"/collection/for-the-bougielicious-287570"},{"collectionId":291903,"title":"For the Budding Cannabis Enthusiast","hasSubCategories":false,"url":"/collection/for-the-budding-cannabis-enthusiast-291903"},{"collectionId":291934,"title":"For the Exam-Season Crammer","hasSubCategories":false,"url":"/collection/for-the-exam-season-crammer-291934"},{"collectionId":287569,"title":"For the Hopeless Romantic","hasSubCategories":false,"url":"/collection/for-the-hopeless-romantic-287569"},{"collectionId":296450,"title":"For the Spring Term Learner","hasSubCategories":false,"url":"/collection/for-the-spring-term-student-296450"}],"navigationCollectionsLoadedStatus":"success","navigationCategories":{"books":{"0":{"data":[{"categoryId":33512,"title":"Technology","hasSubCategories":true,"url":"/category/books/technology-33512"},{"categoryId":33662,"title":"Academics & The Arts","hasSubCategories":true,"url":"/category/books/academics-the-arts-33662"},{"categoryId":33809,"title":"Home, Auto, & Hobbies","hasSubCategories":true,"url":"/category/books/home-auto-hobbies-33809"},{"categoryId":34038,"title":"Body, Mind, & Spirit","hasSubCategories":true,"url":"/category/books/body-mind-spirit-34038"},{"categoryId":34224,"title":"Business, Careers, & Money","hasSubCategories":true,"url":"/category/books/business-careers-money-34224"}],"breadcrumbs":[],"categoryTitle":"Level 0 Category","mainCategoryUrl":"/category/books/level-0-category-0"}},"articles":{"0":{"data":[{"categoryId":33512,"title":"Technology","hasSubCategories":true,"url":"/category/articles/technology-33512"},{"categoryId":33662,"title":"Academics & The Arts","hasSubCategories":true,"url":"/category/articles/academics-the-arts-33662"},{"categoryId":33809,"title":"Home, Auto, & Hobbies","hasSubCategories":true,"url":"/category/articles/home-auto-hobbies-33809"},{"categoryId":34038,"title":"Body, Mind, & Spirit","hasSubCategories":true,"url":"/category/articles/body-mind-spirit-34038"},{"categoryId":34224,"title":"Business, Careers, & Money","hasSubCategories":true,"url":"/category/articles/business-careers-money-34224"}],"breadcrumbs":[],"categoryTitle":"Level 0 Category","mainCategoryUrl":"/category/articles/level-0-category-0"}}},"navigationCategoriesLoadedStatus":"success"},"searchState":{"searchList":[],"searchStatus":"initial","relatedArticlesList":[],"relatedArticlesStatus":"initial"},"routeState":{"name":"ArticleCategory","path":"/category/articles/programming-web-design-33592/","hash":"","query":{},"params":{"category":"programming-web-design-33592"},"fullPath":"/category/articles/programming-web-design-33592/","meta":{"routeType":"category","breadcrumbInfo":{"suffix":"Articles","baseRoute":"/category/articles"},"prerenderWithAsyncData":true},"from":{"name":null,"path":"/","hash":"","query":{},"params":{},"fullPath":"/","meta":{}}},"sfmcState":{"status":"initial"},"profileState":{"auth":{},"userOptions":{},"status":"success"}}
Logo
  • Articles Open Article Categories
  • Books Open Book Categories
  • Collections Open Collections list
  • Custom Solutions

Article Categories

Book Categories

Collections

Explore all collections
BYOB (Be Your Own Boss)
Be a Rad Dad
Career Shifting
Contemplating the Cosmos
For Those Seeking Peace of Mind
For the Aspiring Aficionado
For the Budding Cannabis Enthusiast
For the Exam-Season Crammer
For the Hopeless Romantic
For the Spring Term Learner
Log In
  • Home
  • Technology Articles
  • Programming & Web Design Articles

Programming & Web Design Articles

Ever wonder what makes the software, websites, and blogs you use every day function properly (or improperly)? It's programming. Our articles reveal the ins and outs of programming and web design.

Browse By Category

Go Programming Language

3D Printing

App Development

C

C#

C++

Cisco Programming

Coding

HTML

HTML5

Java

JavaScript

MATLAB

Python

R

SQL

General Programming & Web Design

CSS3

Web Hosting

Blogging & Website Platforms

Previous slideNext slide

Go Programming Language

3D Printing

App Development

C

C#

C++

Cisco Programming

Coding

HTML

HTML5

Java

JavaScript

MATLAB

Python

R

SQL

General Programming & Web Design

CSS3

Web Hosting

Blogging & Website Platforms

Articles From Programming & Web Design

page 1
page 2
page 3
page 4
page 5
page 6
page 7
page 8
page 9
page 10
page 11
page 12
page 13
page 14
page 15
page 16
page 17
page 18
page 19
page 20
page 21
page 22
page 23
page 24
page 25
page 26
page 27
page 28
page 29
page 30
page 31
page 32
page 33
page 34
page 35
page 36
page 37
page 38
page 39
page 40
page 41
page 42
page 43
page 44
page 45
page 46
page 47
page 48
page 49
page 50
page 51
page 52
page 53
page 54
page 55
page 56
page 57
page 58
page 59
page 60
page 61
page 62
page 63
page 64
page 65
page 66
page 67
page 68
page 69
page 70
page 71
page 72
page 73
page 74
page 75
page 76
page 77
page 78
page 79
page 80
page 81
page 82
page 83
page 84
page 85
page 86
page 87
page 88
page 89
page 90
page 91
page 92
page 93
page 94
page 95
page 96
page 97
page 98
page 99
page 100
page 101
page 102
page 103
page 104
page 105
page 106
page 107
page 108
page 109
page 110
page 111
page 112
page 113
page 114
page 115
page 116
page 117
page 118
page 119
page 120
page 121
page 122
page 123
page 124
page 125
page 126
page 127
page 128
page 129
page 130
page 131
page 132
page 133
page 134
page 135
page 136
page 137
page 138
page 139
page 140

Filter Results

1,392 results
1,392 results
Java Java All-in-One For Dummies Cheat Sheet

Cheat Sheet / Updated 01-11-2023

Writing Java statements (like for and if) and classes (like Math and NumberFormat) help you start and build strong programs. Variables hold different kinds of Java data types: numbers, characters, and true/false numbers. You designate Java operations that can be performed on operands, including arithmetic operators, relational operators (or binary) and logical operators (or Boolean).

View Cheat Sheet
R R All-in-One For Dummies Cheat Sheet

Cheat Sheet / Updated 01-11-2023

R provides a wide array of functions to help you with your work — from simple statistics to complex analyses. This Cheat Sheet is a handy reference for Base R statistical functions, interactive applications, machine learning, databases, and images.

View Cheat Sheet
General Blogging & Website Platforms Blogging All-in-One For Dummies Cheat Sheet

Cheat Sheet / Updated 11-21-2022

All blogs start in the same way: A person picks a blogging application, creates a blog, and publishes a post online. What happens then depends on each individual blogger. This Cheat Sheet supplements the information provided in Blogging All-in-One For Dummies and helps you find resources and tools to make your blog a unique place that allows you to reach your goals.

View Cheat Sheet
Coding Coding For Kids For Dummies Cheat Sheet

Cheat Sheet / Updated 11-14-2022

Coding, or computer programming, is your way of communicating with technology. It’s the new literacy you need to master to be successful in the coming decades. Like any form of communication, coding takes place through language. Just as there are many human languages (English, French, Mandarin, Spanish, and so on), there are many coding languages! Two examples of coding languages are Scratch and JavaScript. Scratch is perfect as a coding language for kids because it’s easy and fun to use, Scratch coding for kids allows you to build programs by snapping together commands in the same way you assemble a puzzle. JavaScript is a step up in difficulty because it’s an authentic programming language, used by real coders. JavaScript powers many technologies, and you can use it to make both apps for your phone and control code for operating electronics gadgets. You can ease into JavaScript by using blocks to build programs (just like Scratch) and then switching to text-based coding when you’re ready. Here, discover tips for creating programs in Scratch, coding JavaScript apps in App Lab, and writing JavaScript code in MakeCode to operate the micro:bit electronics board.

View Cheat Sheet
Python How to Install Python on Your Computer

Article / Updated 10-19-2022

Whether you use a Mac, Windows, or Linux OS (operating system), you can find and install Python on your computer. The following sections give you instructions for each OS. How to install Python on Mac OSX To find and start Python on Mac OSX computers, follow these steps: Press Cmd+spacebar to open Spotlight. Type the word terminal. Or, from the Finder, select Finder→Go→Utilities→Terminal. The Terminal window opens. In the terminal, type python. The Python interpreter that's built in to Mac OSX opens. How to install Python on Windows Unfortunately, Python doesn't come on Windows. If you're running Windows, then you need to download and install Python by following the instructions here. Installing Python on Windows isn't difficult. If you can download a file from a website, you have the skills to install Python. Fortunately, the Python Foundation (the peeps who guide the development of Python) makes installable files available from its website. Firefox and Internet Explorer responded differently to the Python download website, so the instructions are based on which of these browsers you use. If you use a whole other browser altogether, try the Internet Explorer instructions. Installing with Firefox To install Python on a Windows machine with Firefox, follow these steps: Visit www.python.org/downloads. Click the button that says Download Python 2.7.9. Or, if it's there, click a more recent version number that starts with 2.7. Clicking this button automatically downloads and saves an msi file for you. If not, try the instructions for Internet Explorer. See Figure 1. Figure 1: Download Python with Firefox. When the download's complete, click the icon for Firefox's download tool. Click the file called python-2.7.9.msi (or the more recent version, if you downloaded one). Python 2.7.9 installs on your computer. Installing with Internet Explorer To install Python on a Windows machine with Internet Explorer, follow these steps: Visit www.python.org/downloads. From the menu bar, select Downloads→Windows. You can see the menu options in Figure 2. Figure 2: Download Python with Internet Explorer. Scroll down to the heading Python 2.7.9-2014-12-10. Or scroll to a more recent version, which starts with Python 2.7, if one is available. Under this heading, click the link titled Download Windows x86 MSI Installer. See Figure 3. This is a link for a 32-bit installation, which makes things work better with third-party libraries. Use the 32-bit installer even if you have a 64-bit machine and even if you have no idea what this paragraph is talking about. Figure 3: Python x86 MSI Installer. If you're asked to choose whether to run or save the file, choose Run. This downloads python2.7.9.msi and starts running the installer. If you get a security warning when the installer begins (or at random times during the installation), choose Run. Accept the default installation options that the installer provides. How to install Python for Linux If you're running Linux, confirm that you have version 2.7.9 of Python installed, rather than version 3. This shouldn't be a problem because Python 2.7 is installed by default in recent versions of OpenSuSE, Ubuntu, and Red Hat Fedora. In the nutty odd case when someone has Python 3 but not Python 2.7, read your distribution's documentation for how to use the package manager and get Python 2.7 and IDLE.

View Article
Python Write a Simple Program in Python

Article / Updated 10-19-2022

Tradition dictates that Hello World! be the first program that you write when you're learning a new programming language like Python. You're following in the footsteps of many great programmers when you create this project. To create your Hello World! program, follow these steps: Open your Start menu and choose Python (command line). You should get a prompt that looks like >>>. At the moment, you're doing everything in interactive mode in the Python interpreter. That's where the >>> comes in. Python shows you >>> when you're supposed to type something. At the prompt, type the following. Use a single quote at the start and the end — it's beside the Enter key: print('Hello World!') Press the Enter key. Python runs the code you typed. You see the output shown in Figure 1. Congratulations — you've written your first program. Welcome to the Python-programmers-in-training club. If you don't see what's in Figure 1, check that you typed in the text from Step 2 exactly as it's written: Check that the parentheses and single quotes are in the right places. Check that for each opening parenthesis there is a closing parenthesis. (Otherwise, you're left hanging. Check that for each opening quote there's a closing quote. Programming languages have their own grammar and punctuation rules. These rules are the language's syntax. Humans, can work most stuff out even if perfect not you're is grammar (See? You figured out what that sentence was trying to say), but Python pretty much freaks out if you get the syntax wrong.

View Article
Python How to Delete a File in Python

Article / Updated 10-19-2022

While you can use Python to delete information from files, you may find you no longer need the file at all. The following steps describe how to delete files that you no longer need. Open a Python File window. You see an editor in which you can type the example code. Type the following code into the window — pressing Enter after each line: Choose Run→Run Module The application displays the File Removed! message. When you look in the directory that originally contained the ChangedFile.csv file, you see that the file is gone. The task looks simple in this case, and it is. All you need to do to remove a file is call os.remove() with the appropriate filename and path (Python defaults to the current directory, so you don’t need to specify a path if the file you want to remove is in the default directory). The ease with which you can perform this task is almost scary because it’s too easy. Putting safeguards in place is always a good idea. You may want to remove other items, so here are other functions you should know about: os.rmdir(): Removes the specified directory. The directory must be empty or Python will display an exception message. shutil.rmtree(): Removes the specified directory, all subdirectories, and all files. This function is especially dangerous because it removes everything without checking (Python assumes that you know what you’re doing). As a result, you can easily lose data using this function.

View Article
SQL SQL Data Types

Article / Updated 09-30-2022

Depending on their histories, different SQL implementations support a variety of data types. The SQL specification recognizes nine predefined general types, shown in the lists below. Exact Numerics: INTEGER SMALLINT BIGINT NUMERIC DECIMAL DECFLOAT Approximate Numerics: REAL DOUBLE PRECISION FLOAT Boolean: BOOLEAN Character Strings: CHARACTER (CHAR) CHARACTER VARYING (VARCHAR) NATIONAL CHARACTER (NCHAR) NATIONAL CHARACTER VARYING (NVARCHAR) Datetimes: DATE TIME TIMESTAMP TIME WITH TIMEZONE TIMESTAMP WITH TIMEZONE Intervals: INTERVAL DAY INTERVAL YEAR Large Objects: BLOB CLOB Collection Types: ARRAY MULTISET Other Types: ROW XML

View Article
SQL SQL Criteria for Normal Forms

Article / Updated 09-30-2022

To ensure that database tables are designed in such a way that they will hold your data reliably, you need to be sure that they are not subject to modification anomalies. Normalizing your databases will give you that assurance. Compare the SQL criteria in the following list to the tables in your database. Doing so will alert you to the possibility of anomalies, when you find that your database is not sufficiently normalized. First Normal Form (1NF): Table must be two-dimensional, with rows and columns. Each row contains data that pertains to one thing or one portion of a thing. Each column contains data for a single attribute of the thing being described. Each cell (intersection of row and column) of the table must be single-valued. All entries in a column must be of the same kind. Each column must have a unique name. No two rows may be identical. The order of the columns and of the rows does not matter. Second Normal Form (2NF): Table must be in first normal form (1NF). All non-key attributes (columns) must be dependent on the entire key. Third Normal Form (3NF): Table must be in second normal form (2NF). Table has no transitive dependencies. Domain-Key Normal Form (DK/NF): Every constraint on the table is a logical consequence of the definition of keys and domains.

View Article
HTML5 How to Make an AJAX Request with jQuery for HTML5 and CSS3 Programming

Article / Updated 09-19-2022

The primary purpose of an AJAX library like jQuery is to simplify AJAX requests for HTML5 and CSS3 programmers. It's hard to believe how easy this can be with jQuery. How to include a text file with AJAX Check out this clean code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>ajax.html</title> <script type = "text/javascript" src = "jquery-1.10.2.min.js"></script> <script type = "text/javascript"> $(document).ready(getAJAX); function getAJAX(){ $("#output").load("hello.txt"); } </script> </head> <body> <div id = "output"></div> </body> </html> The HTML is very clean. It simply creates an empty div called output. This example does use AJAX, so if it isn't working, you might need to remember some details about how AJAX works. A program using AJAX should be run through a web server, not just from a local file. Also, the file being read should be on the same server as the program making the AJAX request. The load() mechanism described here is suitable for a basic situation where you want to load a plain-text or HTML code snippet into your pages. Building a poor man's CMS with AJAX AJAX and jQuery can be a very useful way to build efficient websites, even without server-side programming. Frequently a website is based on a series of smaller elements that can be swapped and reused. You can use AJAX to build a framework that allows easy reuse and modification of web content. Although nothing is all that shocking about the page from the user's perspective, a look at the code can show some surprises: <!DOCTYPE html> <html lang = "en"> <head> <meta charset = "UTF-8"> <title>CMS Using AJAX</title> <link rel = "stylesheet" type = "text/css" href = "cmsStd.css" /> <script type = "text/javascript" src = "jquery-1.10.2.min.js"></script> <script type = "text/javascript"> $(init); function init(){ $("#heading").load("head.html"); $("#menu").load("menu.html"); $("#content1").load("story1.html"); $("#content2").load("story2.html"); $("#footer").load("footer.html"); }; </script> </head> <body> <div id = "all"> <!-- This div centers a fixed-width layout → <div id = "heading"> </div><!-- end heading div → <div id = "menu"> </div> <!-- end menu div → <div class = "content" id = "content1"> </div> <!-- end content div → <div class = "content" id = "content2"> </div> <!-- end content div → <div id = "footer"> </div> <!-- end footer div → </div> <!-- end all div → </body> </html> Look over the code, and you can see these interesting features: The page has no content! All the divs are empty. None of the text shown in the screen shot is present in this document, but all is pulled from smaller files dynamically. The page consists of empty named divs. Rather than any particular content, the page consists of placeholders with IDs. It uses jQuery. The jQuery library is used to vastly simplify loading data through AJAX calls. All contents are in separate files. Look through the directory, and you can see very simple HTML files that contain small parts of the page. For example, story1.html looks like this: <h2>Book I - Creating the HTML Foundation</h3> <ol> <li>Sound HTML Foundations</li> <li>It's All About Validation</li> <li>Choosing your Tools</li> <li>Managing Information with Lists and Tables</li> <li>Making Connections with Links</li> <li>Adding Images</li> <li>Creating forms</li> </ol> The init() method runs on document.ready. When the document is ready, the page runs the init() method. The init() method uses AJAX calls to dynamically load content. It's nothing more than a series of jQuery load() methods. This approach may seem like a lot of work, but it has some very interesting characteristics: If you're building a large site with several pages, you usually want to design the visual appearance once and reuse the same general template repeatedly. Also, you'll probably have some elements that will be consistent over several pages. You could simply create a default document and copy and paste it for each page, but this approach gets messy. What happens if you have created 100 pages according to a template and then need to change the header? You need to make the change on 100 different pages. The advantage of the template-style approach is code reuse. Just like the use of an external style allows you to multiply a style sheet across hundreds of documents, designing a template without content allows you to store code snippets in smaller files and reuse them. All 100 pages point to the same menu file, so if you want to change the menu, change one file and everything changes with it. Here's how you use this sort of approach: Create a single template for your entire site. Build basic HTML and CSS to manage the overall look and feel for your entire site. Don't worry about content yet. Just build placeholders for all the components of your page. Be sure to give each element an ID and write the CSS to get things positioned as you want. Add jQuery support. Make a link to the jQuery library, and make a default init() method. Put in code to handle populating those parts of the page that will always be consistent. Duplicate the template. After you have a sense of how the template will work, make a copy for each page of your site. Customize each page by changing the init() function. The only part of the template that changes is the init() function. All your pages will be identical, except they have customized init() functions that load different content. Load custom content into the divs with AJAX. Use the init()function to load content into each div. This is a great way to manage content, but it isn't quite a full-blown content-management system. Even AJAX can't quite allow you to store content on the web. More complex content management systems also use databases rather than files to handle content. You'll need some sort of server-side programming (like PHP) and usually a database (like mySQL) to handle this kind of work.

View Article
page 1
page 2
page 3
page 4
page 5
page 6
page 7
page 8
page 9
page 10
page 11
page 12
page 13
page 14
page 15
page 16
page 17
page 18
page 19
page 20
page 21
page 22
page 23
page 24
page 25
page 26
page 27
page 28
page 29
page 30
page 31
page 32
page 33
page 34
page 35
page 36
page 37
page 38
page 39
page 40
page 41
page 42
page 43
page 44
page 45
page 46
page 47
page 48
page 49
page 50
page 51
page 52
page 53
page 54
page 55
page 56
page 57
page 58
page 59
page 60
page 61
page 62
page 63
page 64
page 65
page 66
page 67
page 68
page 69
page 70
page 71
page 72
page 73
page 74
page 75
page 76
page 77
page 78
page 79
page 80
page 81
page 82
page 83
page 84
page 85
page 86
page 87
page 88
page 89
page 90
page 91
page 92
page 93
page 94
page 95
page 96
page 97
page 98
page 99
page 100
page 101
page 102
page 103
page 104
page 105
page 106
page 107
page 108
page 109
page 110
page 111
page 112
page 113
page 114
page 115
page 116
page 117
page 118
page 119
page 120
page 121
page 122
page 123
page 124
page 125
page 126
page 127
page 128
page 129
page 130
page 131
page 132
page 133
page 134
page 135
page 136
page 137
page 138
page 139
page 140

Quick Links

  • About For Dummies
  • Contact Us
  • Activate A Book Pin

Connect

Opt in to our newsletter!

By entering your email address and clicking the “Submit” button, you agree to the Terms of Use and Privacy Policy & to receive electronic communications from Dummies.com, which may include marketing promotions, news and updates.

About Dummies

Dummies has always stood for taking on complex concepts and making them easy to understand. Dummies helps everyone be more knowledgeable and confident in applying what they know. Whether it's to pass that big test, qualify for that big promotion or even master that cooking technique; people who rely on dummies, rely on it to learn the critical skills and relevant information necessary for success.

Terms of Use
Privacy Policy
Cookies Settings
Do Not Sell My Personal Info - CA Only