পৃষ্ঠাসমূহ
Labels
Search Your Article
CS
Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.
At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.
What We Offer:
-
📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.
-
💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.
-
🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.
-
🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.
✔ Latest world News
Our Vision
To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.
Why Choose Us?
✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing
We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.
📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.
Pageviews
Saturday, March 25, 2017
Perl - Date & Time
Current Date & Time
Let's start with localtime() function, which returns values for the current date and time if given no arguments. Following is the 9-element list returned by the localtime function while using in list context −sec, # seconds of minutes from 0 to 61 min, # minutes of hour from 0 to 59 hour, # hours of day from 0 to 24
Perl - Subroutines
Perl uses the terms subroutine, method and function interchangeably.
Perl - References
You can construct lists containing references to other lists, which can contain references to hashes, and so on. This is how the nested data structures are built in Perl.
Perl - Formats
Define a Format
Following is the syntax to define a Perl format −format FormatName = fieldline value_one, value_two, value_three fieldline value_one, value_two
Perl - File I/O
Perl - Directories
opendir DIRHANDLE, EXPR # To open a directory readdir DIRHANDLE # To read a directory rewinddir DIRHANDLE # Positioning pointer to the begining telldir DIRHANDLE # Returns current position of the dir seekdir DIRHANDLE, POS # Pointing pointer to POS inside dir closedir DIRHANDLE # Closing a directory.
Perl - Error Handling
The program stops if an error occurs. So a proper error handling is used to handle various type of errors, which may occur during a program execution and take appropriate action instead of halting program completely.
Perl - Special Variables
Most of the special variables have an english like long name, e.g., Operating System Error variable $! can be written as $OS_ERROR.
Perl - Coding Standard
The most important thing is to run your programs under the -w flag at all times. You may turn it off explicitly for particular portions of code via the no warnings pragma or the $^W variable if you must. You should also always run under use strict or know the reason why not. The use sigtrap and even use diagnostics pragmas may also prove useful.
Perl - Regular Expressions
The basic method for applying a regular expression is to use the pattern binding operators =~ and !~. The first operator is a test and assignment operator.
There are three regular expression operators within Perl.
Perl - Sending Email
Using sendmail Utility
Sending a Plain Message
If you are working on Linux/Unix machine then you can simply use sendmail utility inside your Perl program to send email. Here is a sample script that can send an email to a given email ID. Just make sure the given path for sendmail utility is correct. This may be different for your Linux/Unix machine.#!/usr/bin/perlPerl - Socket Programming
What is a Socket?
Socket is a Berkeley UNIX mechanism of creating a virtual duplex connection between different processes. This was later ported on to every known OS enabling communication between systems across geographical location running on different OS software. If not for the socket, most of the network communication between systems would never ever have happened.Object Oriented Programming in PERL
Perl - Database Access
Perl - CGI Programming
What is CGI ?
- A Common Gateway Interface, or CGI, is a set of standards that defines how information is exchanged between the web server and a custom script.
- The CGI specifications are currently maintained by the NCSA and NCSA defines CGI is as follows − The Common Gateway Interface, or CGI, is a standard for external gateway programs to interface with information servers such as HTTP servers.
- The current version is CGI/1.1 and CGI/1.2 is under progress.
Perl - Packages & Modules
What are Packages?
The package statement switches the current naming context to a specified namespace (symbol table). Thus −- A package is a collection of code which lives in its own namespace.
- A namespace is a named collection of unique variable names (also called a symbol table).
- Namespaces prevent variable name collisions between packages.
- Packages enable the construction of modules which, when used, won't clobber variables and functions outside of the modules's own namespace.
Perl - Process Management
- You can use special variables $$ or $PROCESS_ID to get current process ID.
- Every process created using any of the mentioned methods, maintains its own virtual environment with-in %ENV variable.
Perl - Embedded Documentation
Start your documentation with an empty line, a =head1 command at the beginning, and end it with a =cut command and an empty line.
Friday, March 24, 2017
Perl Questions and Answers
Perl - Quick Guide
Perl - Introduction
Perl is a general-purpose programming language originally developed for text manipulation and now used for a wide range of tasks including system administration, web development, network programming, GUI development, and more.Perl - Useful Resources
Useful Links on Perl
- Perl at Wikipedia − It is the Perl Programming Language on Wikipedia.
- Perl Blog − It consists of news and views about Perl Programming Language.
- Perl official site − This is the official website of Perl.
Discuss Perl
This tutorial provides a complete understanding on Perl.
NumPy - Introduction
Numeric, the ancestor of NumPy, was developed by Jim Hugunin. Another package Numarray was also developed, having some additional functionalities.
NumPy - Environment
Try it Option Online
We have set up the NumPy Programming environment online, so that you can compile and execute all the available examples online. It gives you confidence in what you are reading and enables you to verify the programs with different options. Feel free to modify any example and execute it online.
NumPy - Ndarray Object
Every item in an ndarray takes the same size of block in the memory. Each element in ndarray is an object of data-type object (called dtype).
NumPy - Data Types
| S.No | Data Types & Description |
|---|---|
| 1. | bool_ Boolean (True or False) stored as a byte |
NumPy - Array Attributes
ndarray.shape
This array attribute returns a tuple consisting of array dimensions. It can also be used to resize the array.Example 1
import numpy as np a = np.array([[1,2,3],[4,5,6]]) print a.shapeThe output is as follows −
(2, 3)
NumPy - Array Creation Routines
numpy.empty
It creates an uninitialized array of specified shape and dtype. It uses the following constructor −numpy.empty(shape, dtype = float, order = 'C')The constructor takes the following parameters.
NumPy - Array From Existing Data
numpy.asarray
This function is similar to numpy.array except for the fact that it has fewer parameters. This routine is useful for converting Python sequence into ndarray.numpy.asarray(a, dtype = None, order = None)The constructor takes the following parameters.
NumPy - Array From Numerical Ranges
numpy.arange
This function returns an ndarray object containing evenly spaced values within a given range. The format of the function is as follows −numpy.arange(start, stop, step, dtype)The constructor takes the following parameters.
NumPy - Indexing & Slicing
As mentioned earlier, items in ndarray object follows zero-based index. Three types of indexing methods are available − field access, basic slicing and advanced indexing.
NumPy - Advanced Indexing
There are two types of advanced indexing − Integer and Boolean.
NumPy - Broadcasting
NumPy - Iterating Over Array
Let us create a 3X4 array using arange() function and iterate over it using nditer.
NumPy - Array Manipulation
Changing Shape
| S.No | Shape & Description |
|---|---|
| 1. | reshape
Gives a new shape to an array without changing its data |
NumPy - Binary Operators
| S.No | Operation & Description |
|---|---|
| 1. | bitwise_and
Computes bitwise AND operation of array elements |
NumPy - String Functions
NumPy - Mathematical Functions
NumPy - Arithmetic Operations
Example
import numpy as np a = np.arange(9, dtype = np.float_).reshape(3,3)
NumPy - Statistical Functions
NumPy - Sort, Search & Counting Functions
NumPy - Byte Swapping
NumPy - Copies & Views
NumPy - Matrix Library
matlib.empty()
The matlib.empty() function returns a new matrix without initializing the entries. The function takes the following parameters.numpy.matlib.empty(shape, dtype, order)Where,
NumPy - Linear Algebra
| S.No | Function & Description |
|---|---|
| 1. | dot
Dot product of the two arrays |
NumPy - Matplotlib
Matplotlib module was first written by John D. Hunter. Since 2012, Michael Droettboom is the principal developer. Currently, Matplotlib ver. 1.5.1 is the stable version available. The package is available in binary distribution as well as in the source code form on www.matplotlib.org.
NumPy - Histogram Using Matplotlib
I/O with NumPy
- load() and save() functions handle /numPy binary files (with npy extension)
- loadtxt() and savetxt() functions handle normal text files
NumPy - Quick Guide
NumPy - Introduction
NumPy is a Python package. It stands for 'Numerical Python'. It is a library consisting of multidimensional array objects and a collection of routines for processing of array.Numeric, the ancestor of NumPy, was developed by Jim Hugunin. Another package Numarray was also developed, having some additional functionalities.
NumPy - Useful Resources
Discuss NumPy
Lua - Overview
It was designed from the beginning to be a software that can be integrated with the code written in C and other conventional languages.
Lua - Environment
Try it Option Online
We have set up the Lua Programming environment online, so that you can compile and execute all the available examples online. It gives you confidence in what you are reading and enables you to verify the programs with different options. Feel free to modify any example and execute it online.
Lua - Basic Syntax
First Lua Program
Interactive Mode Programming
Lua provides a mode called interactive mode. In this mode, you can type in instructions one after the other and get instant results. This can be invoked in the shell by using the lua -i or just the lua command. Once you type in this, press Enter and the interactive mode will be started as shown below.Lua - Variables
The name of a variable can be composed of letters, digits, and the underscore character. It must begin with either a letter or an underscore. Upper and lowercase letters are distinct because Lua is case-sensitive. There are eight basic types of values in Lua −
Lua - Data Types
In Lua, though we don't have variable data types, but we have types for the values. The list of data types for values are given below.
Lua - Operators
- Arithmetic Operators
- Relational Operators
- Logical Operators
- Misc Operators
Lua - Loops
Lua - Decision Making
Lua - Functions
Lua - Strings
- Characters between single quotes
- Characters between double quotes
- Characters between [[ and ]]
Lua - Arrays
In Lua, arrays are implemented using indexing tables with integers. The size of an array is not fixed and it can grow based on our requirements, subject to memory constraints.
Lua - Iterators
Lua - Tables
Introduction
Tables are the only data structure available in Lua that helps us create different types like arrays and dictionaries. Lua uses associative arrays and which can be indexed with not only numbers but also with strings except nil. Tables have no fixed size and can grow based on our need.Lua - Modules
What is a Module?
Module is like a library that can be loaded using require and has a single global name containing a table. This module can consist of a number of functions and variables. All these functions and variables are wrapped in to the table which acts as a namespace. Also a well behaved module has necessary provisions to return this table on require.Lua - Metatables
- Changing/adding functionalities to operators on tables.
- Looking up metatables when the key is not available in the table using __index in metatable.
Lua - Coroutines
Introduction
Coroutines are collaborative in nature, which allows two or more methods to execute in a controlled manner. With coroutines, at any given time, only one coroutine runs and this running coroutine only suspends its execution when it explicitly requests to be suspended.Lua - File I/O
For the following examples, we will use a sample file test.lua as shown below.
-- sample test.lua -- sample2 test.lua
Lua - Error Handling
Need for Error Handling
Error handling is quite critical since real-world operations often require the use of complex operations, which includes file operations, database transactions and web service calls.In any programming, there is always a requirement for error handling. Errors can be of two types which includes,
Thursday, March 23, 2017
Lua - Debugging
The functions available in the Lua debug library are listed in the following table along with its uses.
Lua - Garbage Collection
- No need to worry about allocating memory for objects.
- No need to free them when no longer needed except for setting it to nil.
Lua - Object Oriented
Introduction to OOP
Object Oriented Programming(OOP), is one the most used programming technique that is used in the modern era of programming. There are a number of programming languages that support OOP which include,Lua - Web Programming
Even though, there are other web frameworks using Lua that have been developed, we will be primarily focusing on the components provided by Kepler community.
Lua - Database Access
Lua - Game Programing
- Corona SDK
- Gideros Mobile
- ShiVa3D
- Moai SDK
- LOVE
- CryEngine
Lua - Standard Libraries
These standard libraries built in official C API are provided as separate C modules. It includes the following
Lua - Math library
Lua - Operating System Facilities
| S.N. | Library / Method & Purpose |
|---|---|
| 1. | os.clock () Returns an approximation of the amount in seconds of CPU time used by the program. |
| 2. | os.date ([format [, time]]) |
Lua - Quick Guide
Lua - Overview
Lua is an extensible, light-weight programming language written in C. It started as an in-house project in 1993 by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes.It was designed from the beginning to be a software that can be integrated with the code written in C and other conventional languages.
Lua - Useful Resources
Discuss Lua
JavaScript - Overview
What is JavaScript ?
Javascript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user and make dynamic pages. It is an interpreted programming language with object-oriented capabilities.JavaScript - Syntax
You can place the <script> tags, containing your JavaScript, anywhere within your web page, but it is normally recommended that you should keep it within the <head> tags.
The <script> tag alerts the browser program to start interpreting all the text between these tags as a script. A simple syntax of your JavaScript will appear as follows.
Enabling JavaScript in Browsers
JavaScript - Placement in HTML File
- Script in <head>...</head> section.
- Script in <body>...</body> section.
- Script in <body>...</body> and <head>...</head> sections.
- Script in an external file and then include in <head>...</head> section.
JavaScript - Variables
JavaScript Datatypes
One of the most fundamental characteristics of a programming language is the set of data types it supports. These are the type of values that can be represented and manipulated in a programming language.JavaScript allows you to work with three primitive data types −
JavaScript - Operators
What is an operator?
Let us take a simple expression 4 + 5 is equal to 9. Here 4 and 5 are called operands and ‘+’ is called the operator. JavaScript supports the following types of operators.- Arithmetic Operators
- Comparision Operators
- Logical (or Relational) Operators
- Assignment Operators
- Conditional (or ternary) Operators
JavaScript - if...else Statement
JavaScript supports conditional statements which are used to perform different actions based on different conditions. Here we will explain the if..else statement.
JavaScript - Switch Case
Starting with JavaScript 1.2, you can use a switch statement which handles exactly this situation, and it does so more efficiently than repeated if...else if statements.
JavaScript - While Loops
JavaScript supports all the necessary loops to ease down the pressure of programming.
JavaScript - For Loop
- The loop initialization where we initialize our counter to a starting value. The initialization statement is executed before the loop begins.
JavaScript for...in loop
JavaScript - Loop Control
JavaScript - Functions
JavaScript - Events
What is an Event ?
JavaScript's interaction with HTML is handled through events that occur when the user or the browser manipulates a page.When the page loads, it is called an event. When the user clicks a button, that click too is an event. Other examples include events like pressing any key, closing a window, resizing a window, etc.
JavaScript and Cookies
What are Cookies ?
Web Browsers and Servers use HTTP protocol to communicate and HTTP is a stateless protocol. But for a commercial website, it is required to maintain session information among different pages. For example, one user registration ends after completing many pages. But how to maintain users' session information across all the web pages.JavaScript - Page Redirection
What is Page Redirection ?
You might have encountered a situation where you clicked a URL to reach a page X but internally you were directed to another page Y. It happens due to page redirection. This concept is different from JavaScript Page Refresh.There could be various reasons why you would like to redirect a user from the original page. We are listing down a few of the reasons −
JavaScript - Dialog Boxes
JavaScript - Void Keyword
JavaScript - Page Printing
The JavaScript print function window.print() prints the current web page when executed. You can call this function directly using the onclick event as shown in the following example.
JavaScript - Objects Overview
- Encapsulation − the capability to store related information, whether data or methods, together in an object.
- Aggregation − the capability to store one object inside another object.
- Inheritance − the capability of a class to rely upon another class (or number of classes) for some of its properties and methods.
JavaScript - The Number Object
JavaScript - The Boolean Object
Syntax
Use the following syntax to create a boolean object.var val = new Boolean(value);
JavaScript - The Strings Object
As JavaScript automatically converts between string primitives and String objects, you can call any of the helper methods of the String object on a string primitive.
JavaScript - The Arrays Object
JavaScript - The Date Object
Once a Date object is created, a number of methods allow you to operate on it. Most methods simply allow you to get and set the year, month, day, hour, minute, second, and millisecond fields of the object, using either local time or UTC (universal, or GMT) time.
JavaScript - The Math Object
Thus, you refer to the constant pi as Math.PI and you call the sine function as Math.sin(x), where x is the method's argument.
Regular Expressions and RegExp Object
The JavaScript RegExp class represents regular expressions, and both String and RegExp define methods that use regular expressions to perform powerful pattern-matching and search-and-replace functions on text.
JavaScript - Document Object Model or DOM
A Document object represents the HTML document that is displayed in that window. The Document object has various properties that refer to other objects which allow access to and modification of document content.
JavaScript - Errors & Exceptions Handling
Syntax Errors
Syntax errors, also called parsing errors, occur at compile time in traditional programming languages and at interpret time in JavaScript.For example, the following line causes a syntax error because it is missing a closing parenthesis.
<script type="text/javascript">
JavaScript - Form Validation
JavaScript - Animation
- Fireworks
- Fade Effect
- Roll-in or Roll-out
- Page-in or Page-out
- Object movements
JavaScript - Multimedia
JavaScript - Debugging
The process of finding and fixing bugs is called debugging and is a normal part of the development process. This section covers tools and techniques that can help you with debugging tasks..
JavaScript - Image Map
The image that is going to form the map is inserted into the page using the <img /> element as normal, except that it carries an extra attribute called usemap.
JavaScript - Browsers Compatibility
To get information about the browser your webpage is currently running in, use the built-in navigator object.
Javascript Questions and Answers
JavaScript - Quick Guide
JavaScript - Overview
What is JavaScript ?
Javascript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user and make dynamic pages. It is an interpreted programming language with object-oriented capabilities.JavaScript Built-in Functions
Number Methods
The Number object contains only the default methods that are part of every object's definition.| Method | Description |
|---|---|
| constructor() | Returns the function that created this object's instance. By default this is the Number object. |
| toExponential() | Forces a number to display in exponential notation, even if the number is in the range in which JavaScript normally uses standard notation. |
Definitive Resources & Frameworks
- ECMAScript - Official website for ECMAScript. Learn about the ECMAScript language and discover the ECMAScript community.
Wednesday, March 22, 2017
Yii - Overview
Yii provides secure and professional features to create robust projects rapidly. The Yii framework has a component-based architecture and a full solid caching support.
Yii - Installation
Step 1 − Find a suitable directory in your hard drive and download the Composer PHAR (PHP archive) via the following command.
Yii - Create Page
Actions are declared in controllers. The end user will receive the execution result of an action.
Step 1 − Declare the speak action in the existing SiteController, which is defined in the class file controllers/SiteController.php.
Yii - Application Structure
Note − All project dependencies are located in the composer.json file. Yii2 has a few important packages that are already included in your project by Composer. These packages are the following −
Yii - Entry Scripts
The following illustration shows the structure of an application −
Yii - Controllers
Yii - Using Controllers
Let us create an example controller in the controllers folder.
Yii - Using Actions
Step 1 − Let us define the hello-world action in our ExampleController.
<?php
Yii - Models
Attributes
Attributes represent the business data. They can be accessed like array elements or object properties. Each attribute is a publicly accessible property of a model. To specify what attributes a model possesses, you should override the yii\base\Model::attributes() method.Let us have a look at the ContactForm model of the basic application template.
Yii - Widgets
Step 1 − To see widgets in action, create an actionTestWidget function in the SiteController with the following code.
Yii - Modules
Step 1 − Create a folder called modules inside your project root. Inside the modules folder, create a folder named hello. This will be the basic folder for our Hello module.
Step 2 − Inside the hello folder, create a file Hello.php with the following code.
Yii - Views
Creating Views
Step 1 − Let us have a look at the ‘About’ view of the basic application template.<?php /* @var $this yii\web\View */ use yii\helpers\Html; $this->title = 'About';
Yii - Layouts
Let us have a look at the main layout of the basic application template −
Yii - Assets
Yii - Asset Conversion
Yii - Extensions
Using Extensions
Most extensions are distributed as Composer packages. Composer installs packages from Packagist – the repository for Composer packages.To install a third-party extension, you should −
Yii - Creating Extensions
Step 1 − Create a folder called hello-world in your hard drive but not inside the Yii basic application template). Inside the hello-world directory, create a file named composer.json with the following code.
Yii - HTTP Requests
The methods get() and post() return request parameters of the request component.
Example −
Yii - Responses
Yii - URL Formats
Yii - URL Routing
Step 1 − Modify the config/web.php file in the following way.
<?php $params = require(__DIR__ . '/params.php'); $config = [ 'id' => 'basic',
Yii - Rules of URL
To parse a request, the URL manager obtains the rules in the order they are declared and looks for the first rule.
Yii - HTML Forms
Yii - Validation
Yii - Ad Hoc Validation
Step 1 − Add the actionAdHocValidation method to the SiteController.
Yii - AJAX Validation
Step 1 − To enable the AJAX validation, modify the registration view this way.
<?php use yii\bootstrap\ActiveForm; use yii\bootstrap\Html; ?>
Yii - Sessions
When a session starts, the following happens −
Yii - Using Flash Data
- Is set in one request.
- Will only be available on the next request.
- Will be automatically deleted afterwards.
Yii - Cookies
There are three steps to identify a returning user −
- Server sends a set of cookies to the client (browser). For example, id or token.
- Browser stores it.
- Next time a browser sends a request to the web server, it also
sends those cookies, so that the server can use that information to
identify the user.
Yii - Using Cookies
Yii - Files Upload
Create a directory ‘uploads’ in the root folder. This directory will hold all of the uploaded images. To upload a single file, you need to create a model and an attribute of the model for uploaded file instance. You should also validate the file upload.
Yii - Formatting
Step1 − Add the actionFormatter method to the SiteController.
public function actionFormatter(){ return $this->render('formatter');
Yii - Pagination
To show pagination in action, we need data.
Yii - Sorting
To show sorting in action, we need data.
Yii - Properties
A getter method starts with the word get. A setter method starts with set. You can use properties defined by getters and setters like class member variables.
Yii - Data Providers
Yii includes −
Yii - Data Widgets
Yii - ListView Widget
Step 1 − Modify the actionDataWidget() method this way.
public function actionDataWidget() { $dataProvider = new ActiveDataProvider([ 'query' => MyUser::find(), 'pagination' => [ 'pageSize' => 20,
Yii - GridView Widget
Step 1 − Modify the datawidget view this way.
<?php use yii\grid\GridView; echo GridView::widget([ 'dataProvider' => $dataProvider,
Yii - Events
An event handler is a PHP callback. You can use the following callbacks −
Yii - Creating Event
Preparing the DB
Step 1 − Create a new database. Database can be prepared in the following two ways.- In the terminal run mysql -u root –p
- Create a new database via CREATE DATABASE helloworld CHARACTER SET utf8 COLLATE utf8_general_ci;
Yii - Behaviors
Step 1 − To define a behavior, extend the yii\base\Behavior class.
Yii - Creating a Behavior
Step 1 − Inside the components folder, create a file called UppercaseBehavior.php with the following code.
<?php
Yii - Configurations
The following is an example of the database configuration −
<?php
Yii - Dependency Injection
It supports the following kinds of DI −
- Setter and property injection
- PHP callable injection
- Constructor injection
- Controller action injection
Yii - Database Access
Yii DAO supports the following databases −
Yii - Data Access Objects
- Create an yii\db\Command with an SQL query.
- Bind parameters (not required)
- Execute the command.
Yii - Query Builder
To use query builder, you should follow these steps −
- Build an yii\db\Query object.
- Execute a query method.
Yii - Active Record
Yii provides the Active Record support for the following relational databases −
Yii - Database Migration
Yii provides the following migration command line tools −
Yii - Theming
You should also define the following properties −
Yii - RESTful APIs
- Quick prototyping
- Customizable object serialization
- Response format (supporting JSON and XML by default)
- Formatting of collection data and validation errors
- Efficient routing
Yii - RESTful APIs in Action
Step 1 − Create a file called UserController.php inside the controllers folder.
<?php
Yii - Fields
Yii - Testing
Automatic test approach makes sense for long term projects, which are −
Yii - Caching
Yii - Fragment Caching
Step 1 − Add a new function called actionFragmentCaching() to the SiteController.
public function actionFragmentCaching() { $user = new MyUser(); $user->name = "cached user name";
Yii - Aliases
To define an alias you should call the Yii::setAlias() method −
// an alias of a file path
Yii::setAlias('@alias', '/path/to/alias');
// an alias of a URLYii - Logging
To log a message, you should call one of the following methods −
- Yii::error() − Records a fatal error message.
- Yii::warning() − Records a warning message.
- Yii::info() − Records a message with some useful information.
- Yii::trace() − Records a message to trace how a piece of code runs.
Yii - Error Handling
- Converts all non-fatal PHP errors into catchable exceptions.
- Displays all errors and exceptions with a detailed call stack.
- Supports different error formats.
- Supports using a controller action to display errors.
Yii - Authentication
To use the Yii authentication framework, you need to −
Yii - Authorization
Yii - Localization
Locale is a set of parameters that specify a user's language and country. For example, the en-US stands for the English locale and the United States.
Yii - Gii
By default, the following generators are available −
- Model Generator − Generates an ActiveRecord class for the specified database table.
- CRUD Generator − Generates a controller and views that implement CRUD (Create, Read, Update, Delete) operations for the specified model.
Gii - Creating a Model
<?php namespace app\models; use app\components\UppercaseBehavior; use Yii; /**
Gii - Generating Controller
Step 1 − To generate a controller with several actions, open the controller generator interface fill in the form.
Gii - Generating Module
Step 1 − To generate a module, open the module generation interface and fill in the form.
Yii - Quick Guide
Yii - Overview
The Yii[ji:] framework is an open-source PHP framework for rapidly-developing, modern Web applications. It is built around the Model-View-Controller composite pattern.Yii provides secure and professional features to create robust projects rapidly.
Yii - Useful Resources
Useful Links on Yii
- Yii Wikipedia - Wikipedia Reference for Yii.
- Yii Official Site - Official Site for Yii.
Discuss Yii
Monday, March 20, 2017
XHTML - Introduction
XHTML is almost identical to HTML 4.01 with only few differences. This is a cleaner and stricter version of HTML 4.01. If you already know HTML, then you need to give little attention to learn this latest version of HTML.
XHTML - Syntax
Here are the important points to remember while writing a new XHTML document or converting existing HTML document into XHTML document −
XHTML vs HTML
XHTML - Doctypes
XHTML 1.0 document type definitions correspond to three DTDs −
XHTML - Attributes
Core Attributes
Not valid in base, head, html, meta, param, script, style, and title elements.| Attribute | Value | Description |
|---|---|---|
| class | class_rule or style_rule | The class of the element. |
| Id | id_name | A unique id for the element. |
XHTML - Events
We can write our event handlers in JavaScript or VBScript and can specify these event handlers as a value of event tag attribute. The XHTML 1.0 has a similar set of events which is available in HTML 4.01 specification.
XHTML - Version 1.1
XHTML - Tips & Tricks
Tips for Designing XHTML Document
Here are some basic guidelines for designing XHTML documents −XHTML - Validations
Once you are ready to validate your XHTML document, you can use W3C Validator to validate your document. This tool is very handy and helps you to fix the problems with your document. This tool does not require any expertise to perform validation.
XHTML - Summary
XHTML - Quick Guide
XHTML - Introduction
XHTML stands for EXtensible HyperText Markup Language. It is the next step in the evolution of the internet. The XHTML 1.0 is the first document type in the XHTML family.XHTML is almost identical to HTML 4.01 with only few differences. This is a cleaner and stricter version of HTML 4.01. If you already know HTML, then you need to give little attention to learn this latest version of HTML.
XHTML - Useful Resources
Useful Links on XHTML
- XHTML Specification - Official website of HTML 4.01 Specification.
- XHTML - A vocabulary and associated APIs for HTML and XHTML
- Domain Names - Details of the domain system and protocol.
Discuss XHTML
WordPress - Overview
WordPress - Installation
System Requirements for WordPress
- Database − MySQL 5.0 +
- Web Server −
- WAMP (Windows)
- LAMP (Linux)
- XAMP (Multi-platform)
- MAMP (Macintosh)
WordPress - Dashboard
Following are the steps to access the general settings −
Step 1 − Click on Settings → General option in WordPress.
WordPress - Writing Setting
Following are the steps to access the writing settings −
Step (1) − To change writing settings, go to Settings → Writing option.
WordPress - Reading Setting
Following are the steps to access the reading settings −
Step (1) − Click on Settings → Reading option in WordPress.
WordPress - Discussion Setting
Following are the steps to access the Discussion setting −
WordPress - Media Setting
Step (1) − Click on Settings → Media option in WordPress.
WordPress - Permalink Setting
Step (1) − Click on Settings → Permalinks option from the left navigation menu.
WordPress - Plugin Setting
WordPress - Add Category
To access the Category section, follows the mentioned steps −
Step (1) − Click on Posts → Categories option in WordPress.
WordPress - Edit Category
Following are the simple steps to edit categories in WordPress.
Step (1) − Click on Posts → Categories in WordPress.
WordPress - Delete Category
Following are the simple steps to delete categories in WordPress.
Step (1) − Click on Posts → Categories in WordPress.
WordPress - Arrange Categories
Step (1) − Click on Posts → Category Order in WordPress. The Category Order menu displays after adding the Category Order plugin. You can study how to install plugins in the chapter Install Plugins.
WordPress - Add Posts
Following are the simple steps to Add Posts in WordPress.
Step (1) − Click on Posts → Add New in WordPress.
WordPress - Edit Posts
Following are the simple steps to Edit Posts in WordPress.
Step (1) − Click on Posts → All Posts in WordPress.
WordPress - Delete Posts
Following are the steps to Delete Posts in WordPress.
Step (1) − Click on Posts → All Post in WordPress.
WordPress - Preview Posts
Following are the simple steps to Preview Posts in WordPress.
Step (1) − Click on Posts → All Posts in wordPress.