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.
Articles From Programming & Web Design
Filter Results
Article / Updated 05-30-2024
For each web coding issue identified by a validator, you need to determine what course of action to take. Although some culprits that repeatedly crop up are easy to fix, such as missing alt text and <noscript> tags, you’re bound to find coding issues that completely baffle and stump you. For instance, if you get an error message that reads XML Parsing Error: Opening and ending tag mismatch: br line 52 and body, it might be difficult to figure out what that means, let alone why it was caused and how you should fix it. As a strategy then, try to fix the issues within the code from the top down, as they’re listed in the validation results, because sometimes fixing one issue resolves another. With the XML parsing error, that issue might disappear when you correct for an omitted closing element on a <br /> tag listed earlier in the error results. The best way to find out how to code better and make fewer mistakes before validation testing is to make lots of honest mistakes and figure out how to correct them on your own. Most often, you can fix noncompliant code by hand or with the help of a good HTML editor. To help you identify some of the more common coding mistakes, here several code issues along with suggestions about how to fix them. Problem Solution alt text attribute missing from <img> tag Add the alternative text attribute, either with or without a description, as in <img src="images/logo.gif" width="150" height="150" alt="Pete’s Pizza"> <img src="images/flourish.gif" width="200" height="150" alt=""> . <noscript> tags missing from code Add <noscript> tags below each instance when JavaScript is present in in-line JavaScript or at the end of the content before the closing body tag. Between the <noscript> tags, insert HTML content (text, graphics, media files, and so on) that describes the function of the JavaScript and, when appropriate, how visitors can access the information revealed by it, as shown here: <script language="JavaScript" src="bookmark.js" type="text/javascript"></script><noscript>The JavaScript used on this page provides a quick link that allows visitors to automatically bookmark this page. As an alternative, please use your browser’s Bookmark This Page feature.</noscript> Flashing or flickering element(s) detected, such as animated GIFs, Java applets, and other multimedia plug-ins Adjust the speed of any animations to avoid causing the screen to flicker with a frequency between 2 Hz and 55 Hz. Animations that exceed these two measures may cause seizures in visitors with photosensitive epilepsy. No DOCTYPE specified Add a valid DOCTYPE above the opening <head> tag. No HTTP charset parameter specified This special meta tag specifies the character set used in the HTML code. Some HTML editors include it automatically when generating new blank web pages. If validation finds that this tag is missing from your HTML or XHTML code, insert the following code by hand: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> . For HTML5, insert <meta charset="utf-8"> . No <title> tag specified Add a unique title between <title> tags in the head area on each page. No <meta> tags specified Add meta keywords and meta description tags to the head of each page. These can be identical on every page on the site. If desired, you may also add additional meta tags as needed. No Robots tags specified Add the Robots <meta> tag in the head of the page to instruct web spiders and robots whether to index the page and follow any hyperlinks, such as <meta name="Robots" content="All"> . Deprecated <font> tags detected Move all the presentation markup of the HTML (page, fonts, tables, links, and so on) to an external CSS file and remove all <font> tags and HTML and inline formatting attributes. Deprecated table height attribute detected Control table cell heights, when necessary, with CSS styles. Style attributes detected in the opening <body> tag Move body attributes, like margin attributes and background page color, to a BODY tag redefine style in an external CSS file. type attribute not specified for JavaScript or CSS Add the type="text/css" attribute for <style> tags and the type="text/javascript" attribute for <script> tags: <style type="text/css" ><script type="text/javascript"> . Entity name used instead of entity number Change the entity name to an entity number, such as using $#169; instead of © to create the copyright symbol (c). No background color attribute was specified for a CSS style that specifies text color Provide each style that contains a text color attribute with an attending background color attribute. The background color should match, or closely match, the background color upon which the text will display on. When you’re finished identifying and adjusting all the noncompliant code identified by the validation tools, and have fixed everything that needed fixing, move on to the retesting and acceptable failure phase of the testing process.
View ArticleArticle / Updated 05-30-2024
The success of your DevOps initiative relies heavily on following the process, but it’s also important to use the right tools. Selecting a cloud service provider isn’t an easy choice, especially when DevOps is your driving motivation. GCP (Google Cloud Platform), AWS (Amazon Web Services), and Azure have more in common than they do apart. Often, your decision depends more on your DevOps team’s comfort level with a particular cloud provider or your current stack more than the cloud provider itself. After you’ve decided to move to the cloud, the next decision is to decide on a cloud provider that fits your DevOps needs. Here are some things to consider when evaluating cloud providers with DevOps principles in mind: Solid track record. The cloud you choose should have a history of responsible financial decisions and enough capital to operate and expand large datacenters over decades. Compliance and risk management. Formal structure and established compliance policies are vital to ensure that your data is safe and secure. Ideally, review audits before you sign contracts. Positive reputation. Customer trust is absolutely key. Do you trust that you can rely on this cloud provider to continue to grow and support your evolving DevOps needs? Service Level Agreements (SLAs). What level of service do you require? Typically cloud providers offer various levels of uptime reliability based on cost. For example, 99.9 percent uptime will be significantly cheaper than 99.999 percent uptime. Metrics and monitoring. What types of application insights, monitoring, and telemetry does the vendor supply? Be sure that you can gain an appropriate level of insight into your systems in as close to real-time as possible. Finally, ensure the cloud provider you choose has excellent technical capabilities that provide services that meet your specific DevOps needs. Generally, look for Compute capabilities Storage solutions Deployment features Logging and monitoring Friendly user interfaces You should also confirm the capability to implement a hybrid cloud solution in case you need to at some point, as well as to make HTTP calls to other APIs and services. The three major cloud providers are Google Cloud Platform (GCP), Microsoft Azure, and Amazon web Services (AWS). You can also find smaller cloud providers and certainly a number of private cloud providers, but the bulk of what you need to know comes from comparing the public cloud providers. Amazon Web Services (AWS) As do the other major public cloud providers, AWS provides on-demand computing through a pay-as-you-go subscription. Users of AWS can subscribe to any number of services and computing resources. Amazon is the current market leader among cloud providers, holding the majority of cloud subscribers. It offers a robust set of features and services in regions throughout the world. Two of the most well-known services are Amazon Elastic Compute Cloud (EC2) and Amazon Simple Storage Service (Amazon S3). As with other cloud providers, services are accessed and infrastructure is provisioned through APIs. Microsoft Azure Before Microsoft launched this cloud provider as Microsoft Azure, it was called Windows Azure. Microsoft designed it to do just what the name implies — serve as a cloud provider for traditionally Windows IT organizations. But as the market became more competitive and Microsoft started to better understand the engineering landscape, Azure adapted, grew, and evolved. Although still arguably less robust than AWS, Azure is a well-rounded cloud provider focused on user experience. Through various product launches and acquisitions — notably GitHub — Microsoft has invested heavily in Linux infrastructure, which has enabled it to provide more robust services to a wider audience. Google Cloud Platform (GCP) The Google Cloud Platform (GCP) has the least market share of the three major public cloud providers but offers a substantial set of cloud services throughout nearly two dozen geographic regions. Perhaps the most appealing aspect of GCP is that it offers users the same infrastructure Google uses internally. This infrastructure includes extremely powerful computing, storage, analytics, and machine learning services. Depending on your specific product, GCP may have specialized tools that are lacking (or less mature) in AWS and Azure. Finding DevOps tools and services in the cloud Literally hundreds of tools and services are at your disposal through the major cloud providers. Those tools and services are generally separated into the following categories: Compute Storage Networking Resource management Cloud Artificial Intelligence (AI) Identity Security Serverless IoT Following is a list of the most commonly used services across all three of the major cloud providers. These services include app deployment, virtual machine (VM) management, container orchestration, serverless functions, storage, and databases. Additional services are included, such as identity management, block storage, private cloud, secrets storage, and more. It’s far from an exhaustive list but can serve as a solid foundation for you as you begin to research your options and get a feel for what differentiates the cloud providers. App deployment: Platform as a Service (PaaS) solution for deploying applications in a variety of languages including Java, .NET, Python, Node.js, C#, Ruby, and Go Azure: Azure Cloud Services AWS: AWS Elastic Beanstalk GCP: Google App Engine Virtual machine (VM) management: Infrastructure as a Service (IaaS) option for running virtual machines (VMs) with Linux or Windows Azure: Azure Virtual Machines AWS: Amazon EC2 GCP: Google Compute Engine Managed Kubernetes: Enables better container management via the popular orchestrator Kubernetes Azure: Azure Kubernetes Service (AKS) AWS: Amazon Elastic Container Service (ECS) for Kubernetes GCP: Google Kubernetes Engine Serverless: Enables users to create logical workflows of serverless functions Azure: Azure Functions AWS: AWS Lambda GCP: Google Cloud Functions Cloud storage: Unstructured object storage with caching Azure: Azure Blob Storage AWS: Amazon S3 GCP: Google Cloud Storage Databases: SQL and NoSQL databases, on demand Azure: Azure Cosmos DB AWS: Amazon Relational Database Service (RDS) and Amazon DynamoDB (NoSQL) GCP: Google Cloud SQL and Google Cloud BigTable (NoSQL) As you explore the three major cloud providers, you notice a long list of services. You may feel overwhelmed by the hundreds of options at your disposal. If, by chance, you can’t find what you need, the marketplace will likely provide something similar. The marketplace is where independent developers offer services that plug into the cloud — hosted by Azure, AWS or GCP. The table below lists additional services provided by most, if not all, cloud providers. Common Cloud Services Service Category Functionality Block storage Data storage used in storage-area network (SAN) environments. Block storage is similar to storing data on a hard drive. Virtual Private Cloud (VPC) Logically isolated, shared computing resources. Firewall Network security that controls traffic. Content Delivery Network (CDN) Content delivery based on the location of the user. Typically utilizes caching, load balancing and analytics. Domain Name System (DNS) Translator of domain names to IP addresses for browsers. Single Sign-On (SSO) Access control to multiple systems or applications using the same credentials. If you’ve logged into an independent application with your Google, Twitter or GitHub credentials, you’ve used SSO. Identity and Access Management (IAM) Role-based user access management. Pre-determined roles have access to a set group of features; users are assigned roles. Telemetry, monitoring and logging Tools to provide application insights on performance, server load, memory consumption and more. Deployments Configuration, infrastructure and release pipeline management tools. Cloud shell Shell access from a command-line interface (CLI) within the browser. Secrets storage Secure storage of keys, tokens, passwords, certificates and other secrets. Message Queues Dynamically scaled message brokers. Machine Learning (ML) Deep learning frameworks and tools for data scientists. IoT Device connection and management.
View ArticleCheat Sheet / Updated 04-12-2024
SQL is a popular and useful programming language. You can make SQL even more useful if you know the phases of SQL development, the criteria for normal forms, the data types used by SQL, a little bit about set and value functions, as well as some tips on how to filter tables with WHERE clauses.
View Cheat SheetCheat Sheet / Updated 04-12-2024
Python is a flexible programming language that has become increasingly popular in the past few years. This cheat sheet is designed to give you a handy resource for common Python data types, Python operators, and Python functions. It includes Python data types, operators, special characters, f-strings, and functions for working with robots.
View Cheat SheetCheat Sheet / Updated 03-26-2024
If you want to build your own website from start to finish, this book serves as a great resource. It includes many secrets and best practices that web developers know and implement when building any quality website. This cheat sheet includes bits and pieces of what you'll find in the book.
View Cheat SheetCheat Sheet / Updated 01-18-2024
Tailor your blog with WordPress software, whether you're writing, editing, or publishing WordPress site content. An understanding of WordPress's dashboard controls and of the types of content available to you helps you get the most out of your website. Also, when all else fails, it's good to know where you can turn to for help with WordPress.
View Cheat SheetCheat Sheet / Updated 01-05-2024
One of the handiest features of web coding and development is that once you’ve learned a few basics, you can apply those basics to any project. A good example is the underlying structure of a page, which uses the same set of standard HTML tags, no matter how large or small the project. It’s also worth your time to learn how selectors work, because you use them to save you time both when you’re writing CSS rules and when you’re writing JavaScript code. Errors, too, are a fact of web coding life, so understanding the most common errors can help you debug your code faster and get back to more creative pursuits.
View Cheat SheetCheat Sheet / Updated 11-13-2023
Note: The following cheat sheet is from Building Websites All-in-One For Dummies which published in 2012; therefore, this content may be outdated. For more current information on website building, please see HTML, CSS, & JavaScript All-in-One For Dummies. Whether complex or simple, websites require that you make decisions — such as color, theme, and tone — and that you juggle many pieces of the project — like code, style sheets, and graphics. Knowing which resources to turn to for help implementing HTML5, and a few key points about incorporating graphics and video, can help you.
View Cheat SheetArticle / Updated 10-04-2023
Programming is an important skill. Python will serve you well for years to come. The tables here give you the core words, built-ins, standard library functions, and operators that you'll use most when you're coding with Python. Python Core Words KeywordSummaryExample and Logical operator to test whether two things are both True. andx>2 and x<10 as Assign a file object to a variable. Used with with.Let your code refer to a module under a different name (also called an alias). Used with import. with open(<name of file>,<file mode>) as <object name>:import cPickle as pickle break Stop execution of a loop. for i in range(10): if i%2 ==0: break class Define a custom object. class <name of class>(object): ""Your docstring"" class MyClass(object): ""A cool function."" continue Skip balance of loop and begin a new iteration. for i in range(10): if i%2 ==0: continue def Define a function. def <name of function>(): ""Your docstring"" def my_function(): ""This does... "" elif Add conditional test to an if clause. See if. else Add an alternative code block. See if. for Create a loop which iterates through elements of a list (or other iterable). for <dummy variable name> in <sequence>:for i in range(10): from Import specific functions from a module without importing the whole module. from <module name> import <name of function or object>from random import randint global Make a variable global in scope. (If a variable is defined in the main section, you can change its value within a function.) global x if Create a condition. If the condition is True, the associated code block is executed. Otherwise, any elif commands are processed. If there are none, or none are satisfied, execute the else block if there is one. if : [elif : , ...][else: ]if x == 1: print("x is 1")elif x == 2: print("x is 2")elif x > 3: print("x is greater than 3")else print("x is not greater than 3, nor is it 1 one or 2") import Use code defined in another file without retyping it. import <name of module>import random in Used to test whether a given value is one of the elements of an object. 1 in range(10) is Used to test whether names reference the same object. x = Nonex is None # faster thanx == None lambda Shorthand function definition. Usually used where a function needs to be passed as an argument to another function. lamda :times = lambda x, y: x*ycommand=lambda x: self.draw_line(self.control_points) not Logical negation, used to negate a logical condition. Don't use for testing greater than, less than, or equal. 10 not in range(10) or Logical operator to test whether at least one of two things is True. orx<2 or x>10 pass Placeholder keyword. Does nothing but stop Python complaining that a code block is empty. for i in range (10): pass print Output text to a terminal. print("Hello World!") return Return from the execution of a function. If a value is specified, return that value, otherwise return None. return return x+2 while Execute a code block while the associated condition is True. while :while True: pass with Get Python to manage a resource (like a file) for you. with open(,) as : Extend Python's core functionality with these built-ins. Python Built-ins Built-inNotesExample False Value, returned by a logical operation or directly assigned. ok_to_continue = Falseage = 16old_enough = age >=21(evaluates comparison age>=21 and assigns the result to old_enough) None Value used when representing the absence of a value or to initialise a variable which will be changed later. Returned by functions which do not explicitly return a value. x = None True Value, returned by a logical operation. ok_to_continue = Trueage = 16old_enough = age >=21(evaluates comparison age>=21 and assigns the result to old_enough) __name__ Constant, shows module name. If it's not "__main__", the code is being used in an import. if __name__=="__main__": dir List attributes of an item. dir(<object name>) enumerate Iterate through a sequence and number each item. enumerate('Hello') exit Exit Python (Command Line) interpreter. exit() float Convert a number into a decimal, usually so that division works properly. 1/float(2) getattr Get an attribute of an object by a name. Useful for introspection. getattr(<name of object>, <name of attribute>) help Get Python docstring on object. help(<name of object>)help(getattr) id Show the location in the computer's RAM where an object is stored. id(<name of object>)id(help) int Convert a string into an integer number. int('0') len Get the number of elements in a sequence. len([0,1]) object A base on which other classes can inherit from. class CustomObject(object): open Open a file on disk, return a file object. open(, )open('mydatafile.txt', 'r') # read(opens a file to read data from)open('mydatafile.txt', 'w') # write(creates a new file to write to, destroys any existing file with the same name)open('mydatafile.txt', 'a') # append(adds to an existing file if any, or createsa new one if none existing already) print Reimplementation of print keyword, but as a function.Need to import from the future to use it (srsly!) from future import print_functionprint ('Hello World!') range Gives numbers between the lower and upper limits specified (including the lower, but excluding the upper limit). A step may be specified. range(10)range(5,10)range(1,10,2) raw_input Get some text as a string from the user, with an optional prompt. prompt = 'What is your guess? 'players_guess = raw_input(prompt) str Convert an object (usually a number) into a string (usually for printing). str(0) type Give the type of the specified object. type(0)type('0')type([])type({})type(()) Use the work that others have already done. Try these modules from the Python standard library. Selected Functions from the Standard Library ModuleWhat It DoesSample Functions/Objects os.path Functions relating to files and file paths. os.path.exists() pickle, cPickle Save and load objects to/from a file. pickle.load(), pickle.dump(, ) random Various functions relating to random numbers. random.choice(), random.randint(, ), random.shuffle() String Stuff relating to strings. string.printable sys Various functions related to your computer system. sys.exit() Time Time-related functions. time.time() Tkinter User interface widgets and associated constants. Tkinter.ALLTkinter.BOTHTkinter.CENTERTkinter.ENDTkinter.HORIZONTALTkinter.LEFTTkinter.NWTkinter.RIGHTTkinter.TOPTkinter.YTkinter.Button(,text=)Tkinter.Canvas(, width=, height=)Tkinter.Checkbutton(, text=)Tkinter.Entry(, width=),Tkinter.Frame()Tkinter.IntVar()Tkinter.Label(, text = )Tkinter.mainloop()Tkinter.Menu()Tkinter.OptionMenu(, None, None)Tkinter.Scale(, from_=, to=)Tkinter.Scrollbar()Tkinter.StringVar()Tkinter.Tk() Add, subtract, divide, multiply, and more using these operators. Python Operators OperatorNameEffectExamples + Plus Add two numbers.Join two strings together. Add: >>> 1+12Join: >>> 'a'+'b''ab' – Minus Subtract a number from another.Can't use for strings. >>> 1-10 * Times Multiply two numbers.Make copies of a string. Multiply: >>> 2*24Copy: >>> 'a'*2'aa' / Divide Divide one number by another.Can't use for strings. 1/2 # integer division:Answer will be rounded down.1/2.0 # decimal division1/float(2) # decimal division % Remainder (Modulo) Give the remainder when dividing the left number by the right number.Formatting operator for strings. >>> 10%31 ** Power x**y means raise x to the power of y.Can't use for strings. >>> 3**29 = Assignment Assign the value on the right to the variable on the left. >>> a = 1 == Equality Is the left side equal to the right side? Is True if so; is False otherwise. >>> 1 == 1True>>> 'a' == 'a'True != Not equal Is the left side not equal to the right side? Is True if so; is False otherwise. >>> 1 != 1False>>> 1 != 2True>>> 'a' != 'a'True > Greater than Is the left side greater than the right side?>= means greater than or equal to >>> 2 > 1True < Less than Is the left side less than the right side?<= means less than or equal to >>> 1 < 2True & (or and) And Are both left and right True?Typically used for complex conditions where you want to do something if everything is True:while im_hungry and you_have_food: >>> True & TrueTrue>>> True and FalseFalse >>> True & (1 == 2)False | (or or) Or Is either left or right True?Typically used for complex conditions where you want at least one thing to be True:while im_bored or youre_bored: >>> True | FalseTrue>>> True or FalseTrue>>> False | FalseFalse>>> (1 == 1) | FalseTrue
View ArticleCheat Sheet / Updated 10-03-2023
Python is an incredible programming language that you can use to perform data science tasks with a minimum of effort. The huge number of available libraries means that the low-level code you normally need to write is likely already available from some other source. All you need to focus on is getting the job done. With that in mind, this Cheat Sheet helps you access the most commonly needed reminders for making your programming experience fast and easy.
View Cheat Sheet