Post Top Ad

Tuesday, September 3, 2019

September 03, 2019

Laravel 6 Is Now Released

Here are some of the new features included in Laravel 6:

Laravel 6 Is Now Released

Laravel 6.0 Is the New LTS

The release of Laravel 6.0 marks the new LTS version of Laravel, with bugfixes until September 3rd, 2021 and security fixes until September 3rd, 2022. Laravel 5.5 was the previous LTS (with security fixes until August 30th, 2020). Here’s the updated table with versions and dates of the latest versions of Laravel:
VersionReleaseBug Fixes UntilSecurity Fixes Until
V1June 2011
V2September 2011
v3February 2012
v4May 2013
5.0Feb 4th, 2015Aug 4th, 2015Feb 4th, 2016
5.1 (LTS)Jun 9th, 2015Jun 9th, 2017Jun 9th, 2018
5.2Dec 21st, 2015Jun 21st, 2016Dec 21st, 2016
5.3Aug 23rd, 2016Feb 23rd, 2017Aug 23rd, 2017
5.4Jan 24th, 2017Jul 24th, 2017Jan 24th, 2018
5.5 (LTS)Aug 30th, 2017Aug 30th, 2019Aug 30th, 2020
5.6Feb 7th, 2018Aug 7th, 2018Feb 7th, 2019
5.7Sep 4, 2018Feb 4th, 2019Sep 4th, 2019
5.8Feb 26th, 2019Aug 26th, 2019Feb 26th, 2020
6.0 (LTS)Sept 3rd, 2019Sept 3rd, 2021Sept 3rd, 2022

Semantic Versioning

The Laravel release notes clarify semantic versioning going forward in Laravel 6.0 and beyond:
The Laravel framework (laravel/framework) package now follows the semantic versioning standard. This makes the framework consistent with the other first-party Laravel packages which already followed this versioning standard. The Laravel release cycle will remain unchanged.

Improved Authorization Responses

Previously it was difficult to provide custom error messages around authorization to end users. Laravel 6 introduces a Gate::inspect method which provides the authorization policy’s response:
$response = Gate::inspect('view', $flight);

if ($response->allowed()) {
    // User is authorized to view the flight...
}

if ($response->denied()) {
    echo $response->message();
}

Job Middleware

Job Middleware is a feature contributed by Taylor Otwell, which allows jobs to run through middleware:
// Add a middleware method to a job class
public function middleware()
{
     return [new SomeMiddleware];
}

// Specify middleware when dispatching a job
SomeJob::dispatch()->through([new SomeMiddleware]);
The middleware will help you avoid custom logic in the body of your job’s handle() method. Learn more in our post: Job Middleware is Coming to Laravel 6.

Lazy Collections

Lazy collections are a game-changer for working with extensive collections of data, including Eloquent model collections. A new Illuminate\Support\LazyCollection class leverages PHP’s generators to keep memory low while working with large datasets. Check out Lazy Collections documentation for more details on this impressive new feature!

Eloquent Subquery Enhancements

Learn more about Jonathan Reinink’s contributions to subqueries in his post on Laravel News – Eloquent Subquery Enhancements in Laravel 6.0. Also, check out Jonathan’s excellent talk on using subqueries (among other techniques) in his Laracon talk Eloquent Performance Patterns.

Laravel UI

The frontend scaffolding provided with Laravel 5.x releases is now extracted into a separate laravel/ui Composer package. This allows first-party UI scaffolding to be iterated on separately from the primary framework.
If you want the Traditional Bootstrap/Vue/ scaffolding, you will run the following command:
composer require laravel/ui
php artisan ui vue --auth

Learn More

You should now be able to start a new Laravel 6 application with the laravel CLI tool:
laravel new my-app
Here’s a few resources related to Laravel 6 that you should check out:

Monday, August 26, 2019

August 26, 2019

The hundred-page machine learning

                                                                              GET


The hundred-page machine learning book



cover


Author(s): Burkov, Andriy

Publisher: Andriy Burkov, Year: 2019

ISBN: 9781999579500,199957950X,9781999579517,1999579518

Search in WorldCat | Search in Goodreads | Search in AbeBooks | Search in Amazon.com

Description:
If you find the book useful, please support the author, Andriy Burkov http://themlbook.com/, who has provided the content of his book online in good faith.

This copy of the book was created from joined chapters from the book wiki at http://themlbook.com/wiki/doku.php

@book{burkov_hundred-page_2019,
title = {The hundred-page machine learning book},
isbn = {978-1-9995795-0-0},
language = {English},
author = {Burkov, Andriy},
year = {2019},
note = {OCLC: 1089445188},
}

Saturday, August 10, 2019

August 10, 2019

PHP Basic in Web Development Course




## Week I

* Introduction to Ubuntu 18.04 
* Ubuntu Basic Command & Basic `GIT` usage
* Install PHP, Web Server, Database MySQL
* Introduction to PHP and Syntax Overview
* PHP Variable Types, Constants
* PHP String
* PHP Array
* PHP If...else...elseif
* PHP Switch
* PHP For Loops
* While Loops
* PHP Function
* Lab 1. Form


> Let's get details : 

###  Introducton to Ubuntu 18.04 LTS

Introducton to Ubuntu 18.04 LTS  [here](https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes)

###  Ubuntu Basic Command

> You can try 10 command line on Ubuntu 18.04 LTS  
1. sudo
This SuperUserDo is the most important command Linux newbies will use. Every single command that needs root’s permission, need this sudo command. You can use `sudo` before each command that requires root permissions –
```bash
    sudo su
```

2. ls (list)
Just like the other, you often want to see anything in your directory. With list command, the terminal will show you all the files and folders of the directory that you’re working in. Let’s say I’m in the `/home` folder and I want to see the directories & files in /home. 
```bash
    /home ls
```

3. cd
​Changing directory (cd) is the main command that always is in use in the terminal. It’s one of the most Linux basic commands. Using this is easy. Just type the name of the folder you want to go in from your current directory. If you want to go up just do it by giving double dots (..) as the parameter.
​
Let’s say I’m in /home directory and I want to move in usr directory which is always in the /home. Here is how I can use `cd` commands –

```bash 
    cd /home/username/Desktop
```

4. mkdir
Just changing directory is still incomplete. Sometimes you want to create a new folder or subfolder. You can use mkdir command to do that. Just give your folder name after mkdir command in your terminal.
```bash
    mkdir folderName
```

5. cp
copy-and-paste is the important task we need to do to organize our files. Using `cp` will help you to copy-and-paste the file from the terminal. First, you determine the file you want to copy and type the destination location to paste the file.
```bash
    cp src des
```

> Note: If you’re copying files into the directory that requires root permission for any new file, then you’ll need to use `sudo` command.  

6. rm
`rm` is a command to remove your file or even your directory. You can use `-f` if the file need root permission to be removed. And also you can use `-r` to do recursive removal to remove your folder.
```bash
    rm myfile.txt
```

7. apt-get
This command differs distro-by-distro. In Debian based Linux distributions, to install, remove and upgrade any package we’ve Advanced Packaging Tool (APT) package manager. The apt-get command will help you install the software you need to run in your Linux. It is a powerful command-line tool which can perform installation, upgrade, and even removing your software.​

```bash
sudo apt-get update
```

8. grep
You need to find a file but you don’t remember its exact location or the path. grep will help you to solve this problem. You can use the grep command to help to find the file based on given keywords.
```bash
    grep user /etc/passwd
```

9. cat
As a user, you often need to view some of text or code from your script. Again, one of the Linux basic commands is cat command. It will show you the text inside your file.
```bash
    cat CMakeLists.txt
```
10. poweroff
And the last one is `poweroff`. Sometimes you need to poweroff directly from your terminal. This command will do the task. Don’t forget to add sudo at the beginning of the command since it needs root permission to execute poweroff.

```bash
    sudo poweroff
```


### Install PHP, Web Server, Database MySQL

1. if you are on Ubuntu. Please follow [here](https://www.rosehosting.com/blog/how-to-install-php-7-3-on-ubuntu-16-04/) 
2. If you are window. Please install [Warm Server](http://www.wampserver.com/en/), [Xampp Server](https://www.apachefriends.org/index.html)

### Introduction to PHP and Syntax Overview

1. Introduction to PHP

`PHP` started out as a small open source project that evolved as more and more people found out how useful it was. Rasmus Lerdorf unleashed the `first version of PHP` way back in `1994`.
* `PHP` stand for `Hypertext Preprocessor`
* `PHP` is a server side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session, tracking, even build entire e-commerce sites. 
* It is intergrated with a number of popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.
* PHP suport a large number of majors protocol such as POP3, IMAP, and LDAP, from `PHP4` added support for Java and distributed ojbect architectures. 

2. Syntax Overview

The PHP parsing engine needs a way to differentiate PHP code from other elements in the page. There are four ways to do this

* Canonical PHP tags
    The most universally effective PHP tag style is: 

    ```bash
        
    ```
* Short-open tags
    Short or short-open tags look like this 
    ```bash
        
    ```
* ASP-Style 
    ASP-style tags mimic the tag used by Active Server Pages to delineate code blocks.

    ```bash
        <% 

        %>
    ```
* HTML script tags
    HTML script tags look like this 
    ```bash
        
    ```

###  PHP Variable Types, Constants

> Here are the most important things to know about variables in PHP.
* All variables in PHP are denoted with a leading dollar sign `$`.
* The value of a variable is the value of its most recent assignment.
* Variables are assigned with the `=` operator, with the variable on the left-hand side and the expression to be evaluated on the right.
* Variables can, but do not need, to be declared before assignment.
* Variables in PHP do not have intrinsic types - a variable does not know in advance whether it will be used to store a number or a string of characters.

* Variables used before they are assigned have default values.

* PHP does a good job of automatically converting types from one to another when necessary.


1. PHP Variable Types

    * Integers: are whole numbers, without a decimal point like 2019.
    * Doubles:  are flaoting-point numbers, like 3.14159, or 201.9.
    * Booleans: have only two possible values either `true` or `false`.
    * NULL: is a special type that only has one value NULL.
    * Strings: are sequences of characters 
    * Array: are nmae and indexed collections of other values.
    * Ojbects: are instances of programmer-defined classes.
    * Resources: are special vairables that hold references to resources external to PHP(such as database connections)

2. PHP Constant 

What is PHP Constant ? 

* A constant is a name or an identifier for a simple value
* A constant value cannot change during the execution of the script
* By default, a constant is case-sensitive
* By convention, constant identifiers are always uppercase. A constant name starts with a letter or underscore, followed by any number of letters, numbers, or underscores

```bash

```
* We define constant `MINSIZE` with value 50.
* We print out `MINSIZE` value.
* We use `constant()` function to get value of `MINSIZE`

> Note: Only scalar data (boolean, integer, float and string) can be contained in constants.

### PHP String

> They are sequences of characters, PHP supports string operations.

1. String Concatenation Operator

    To concatenate two string variables together, we us dot(`.`) operators.

    ```bash
        
    ```


2. Get The Length of a String

    The `strlen()` function is used to find the lenght of a string. 
    ```bash
        echo strlen("web development course");
    ```

3. Search For a Specific Text Within a String

    The `strpos()` function is used to search for a string or character with a string.

    ```bash 
    
    ```

4. Count The Number of Words in a String

    PHP `str_word_count()` function is used to count the number of word in a string. 

    ```bash
        
    ```

5. Reverse a String

    The PHP `strrev()` function reverses a string. 
    ```bash 
        
    ```
    please try to reverse: `web development course` to `course development web`. 

6. Replace Text Within a String

    The PHP `str_replace()` function replaces some characters with some other characters in string.

    ```bash
        
    ```

### PHP Array

> An array is a special variable, which can hold more than one value at a time.

```bash 
    $cars1 = "Volvo";
    $cars2 = "BMW";
    $cars3 = "Toyota";
```

1. Create an Array in PHP

    In PHP, there are three types of arrays:
    
    * Indexed arrays - Arrays with a numeric index
        ```bash 
            $cars = array("Volvo", "BMW", "Toyota");
        ```
        The index can be assigned automatically.  the index can be assigned manually:
        ```bash
            $cars[0] = "Volvo";
            $cars[1] = "BMW";
            $cars[2] = "Toyota";
        ```

    * Associative arrays - Arrays with named keys
        ```bash
            $age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
        ```
        or 
        ```bash 
            $age['Peter'] = "35";
            $age['Ben'] = "37";
            $age['Joe'] = "43";
        ```
        Associative arrays are arrays that use named keys that you assign to them.
        


    * Multidimensional arrays - Arrays containing one or more arrays

### PHP IF else elseif 

1. PHP IF Else Statment

    In if  Statements Output will appear when only Condition must be true.
    > If Statement works  much like the English language statement, “if X happens, then do Y.”

```bash
    if (condition)
        code to be executed if condition is true;
    else
        code to be executed if condition is false;
```
> let check example:

```bash
    
    
    
        
    
    
    
```

> Exercise 1. Write a PHP program to check whether the given number is a `negative` or `positive` number.   

> Exercise 2. Write a PHP program to check whether the given number is a `odd` or `even` number. 


2. The ElseIf Statement

If you want to execute one code of the several condtion are true. We use `elseif` statment

> Syntax 

```bash

    if (condition)
         code to be executed if condition is true;
    else if (condition)
         code to be executed if condition is true;
    else
        code to be executed if condition is false;

```


### PHP Switch 

If you want to select one of many blocks of code to be executed

```bash 


```

> We can use default switch case statement. By use keyword : `default`

### PHP For Loop

> In `for loop` specified condition is predifined. 

```bash
    for (initialization; condition; increment){
        code to be executed;
    }
```

Example : 
```bash
    
    
        
        
    
    
    
```

### PHP While Loop

> `while loop` executes the statement while the specific condition is true. 

```bash
    while (condition) {
        code to be executed;
    }
```  

Example: 

```bash
    
    
    
        
        
    
    

```


### do-while 

> `do-while loop` execute the statement then check the condition, it mean if the condition is false in that case `one time` statement execute. 

```bash
    do {
        code to be executed;
    } while (condition);
```

Example: 

```bash
    html>
    
      
    
``` ### PHP Function > Function are self contained block of statement which used to perform any specific task. ##### Types of Function * System defined function or build in function * User defined function ###### Advantages of Function > A function is created once but used many time from more than one program. > It reduce duplication within a program. ###### How to define Function. A function will be executed by a call to the function. Syntax: ```bash function function_name( ) { code to be executed; } ``` 1. A simple function ```bash ```

Monday, July 22, 2019

Friday, June 21, 2019

Monday, March 11, 2019

March 11, 2019

C++ : Display Array Element

Create an array that store 10 integer numbers (2 4 6 8 10 12 14 16 18 20). Then display those array elements on screen.






/******************************************************************************

        Create an array that store 10 integer numbers (2 4 6 8 10 12 14 16 18 20). 
        
                    Then display those array elements on a screen.
*******************************************************************************/

#include <iostream>

using namespace std;

int main()
{
   int arrayInteger[10] = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20};
   cout << "All element in array : " << endl;
   for (int i = 0; i < 10; i++) {
       cout << "Element " << i+1 << " is : " << arrayInteger[i] << endl;
   }

    return 0;

}

Tuesday, February 26, 2019

February 26, 2019

My first impression when I’ve arrived Yogyakarta (Indoneisa city of culture)

On 1st August 2016, I have a flight with two of my schoolmate from my born country and arrived at Adisutjipto International Airport(Yogyakarta airport) around  8:40 pm to pursuing my master degree. On the way went to my boarding house with a super speed taxi I have never met before. The driver in Yogyakarta drives very fast and high speed than Cambodia, however, Since I’ve arrived here I’ve never seen an accident. Because they drive with the high speed, high confidence, and respect to another driver. The first impression on the first at Jogja is the food is a bit different from my home country. If you order chicken fry, you are lucky. Because of the chicken fry made from the chicken boil(Just Kidding). The drinking task is made a different way with Cambodian. The first arrival day, I have to order green tea, but the taste is very strange to compare with the green tea in my home country.
Image result for yogyakarta airport at night
Adisutjipto International Airport( Yogyakarta airport)

Saturday, February 16, 2019

February 16, 2019

GitHub News: GitHub Add Draft Pull Request

In the announcement release Here, GitHub launched a brand new feature call draft pull request which allows the developer to send pull request before they are going to finish the implementation on that feature. 
Image result for github draft pull request

It's interesting for us a developer. We could send a pull request and make the discussion about our features then we could finish it or merge when the feature is already done. 

Saturday, February 2, 2019

February 02, 2019

Laravel 5.8 Deprecates String and Array Helpers

         In the upcoming release of laravel 5.8, the array & string helper are deprecated. The next release of laravel 5.9 will be removed the array and string helper. It's based on the discussion of the PR 26898

The previous version of laravel

// Deprecated array_add($array, $key, $value);


The upcoming release of laravel 

// Use this directly Arr::add($array, $key, $value);


If you prefer to use the helper in your project.
Taylor suggests to pack into the packages laravel/helper




Sunday, January 20, 2019

January 20, 2019

C++ Program to Check the Integer is Odd or Even


In order to solve this problem, you need to understand about IF-ELSE.

what is even number? The even number is the integer number which is divided by 2.







C++ Program:

#include <iostream>
using namespace std;

int main()
{
    int n;

    cout << "Enter an integer: ";
    cin >> n;

    if ( n % 2 == 0)
        cout << n << " is even.";
    else
        cout << n << " is odd.";

    return 0;
}