Wednesday, 30 November 2016

Who killed Premier League for the poor in India?

Premier League ka en lohna pawh a lo rei ve leh ta hle mai. India ram leh khawvel hmun dangah pawh ni se mi hausa fa te chauh hian Premier League hi an en nasa bik lo va, rethei fa, tuktin eichawp zawng te pawhin kan hun hlu tak paih ngamin kan en awl lo va. Premier League hi a lo hmuhnawm em tin ni! Kan TV hnung pawng chi sawk vel pawh dawl em em mai hian Inrinni tlai zanriah eikhama Vanglaini chanchinbu-in hmelhma kumhlun an indo tur thu a sawi ngei mai, Premier League team pahnih insu tur emaw a sakechek ho religation battle an tih mai tlak hlauh vanga a kaw tawpa tan khawh ho te min hlui tur a nei tawh lo hi tuar a harin kan tuarah vanpui a chim a ni ringawt mai. Chauh thu barawh na ek thai tak tak hun a lo thlen chuan Online streaming service te ka dap ruai a. Topup ringa internet hmang pha ve zeuh zeuh chauh kan lo ni vei bawk nen, kan sorkar-in bandwidth satel bak min hlui tur a nei thei lo bawk nen, a tawpa Google-a Premier league table tih emaw Premier League tih emaw type-a an inkhel zo result chan bak tih theih tak tak ka nei ta lo. Keini rethei fa te Mit titlaitu thin em em tu chu kan ban phakah a awm ta lo! Veng thenawm leh vengchhunga thim hlim inkhel en authawm pawh hriat tur a awm ta lo, thenawm pa thirbel khawn ri pawh hriat tur a awm ta lo. A reh ruih mai! Heng zawng  zawng hi eng vang nge ni ang? Black money vang chu a nih loh hram beisei ang.

Ka search Engine hman thiam em em mai Google Search chu Ka VCR monitor-ah kan hawng lang ruah mai a. Ti hian kan type tan ta a, 'Who kills Premier League for the poor in India?'. Ka beisei ang ngeiin Google Search chuan chhanna min rawn list sak zawt zawt mai a. Kan chhiar zau zel a, ka tawpna chu Starsport CEO suihlungmawla hi a ni. Pawi ta ber chu he pa hi Mizo emaw Sap emaw a ni lo va, Vai a lo ni tlat pek a. a chhip ler atanga a ke hmawr thleng hian Cricket rim bak nam tur pawh awmin ka hre lo. A bul ber chu sum a duh thang huam hi a ni. Black money rim pawh a nam tanin ka hria. Sum duh luat vangin SD atangin HDD min nem kai luh tal a tum a ni. Hei vang hian keini SD chauh nei pha te chuan hmanlai Cricket vel leh thil ngai leh ngai hlir min entir a. Sual tak a ni. HD subcription in neih chuan in en thei ang, an ti maw..HD subcription hian mirethei te tan chuan na vei vei tak a ni. Eng pawhnise kan tapchhak zawl atang hi chuan engmah kan thlak danglam ve tak tak thei dawn chuang lo va. Hetiang hruaitu mawl hi India ram khawi khawi kawm kar kilah hian an lo awm ve leh zauh hi rethei tam zawk te hian kan tuar tlawk tlawk a nih ber hi.

HD subcription ngai ta hi India rama football ngainatu te tan chuan a lungchhiatthlak hle a, Democracy rama mirethei hnuaichhiahna lian tak (BUREAUCRACY ) a ni a. Indian Super League te pechhuak ve bawk mahse Premier League chu a pha lo hle tih tlang hriat a ni. Chuvangin Start Sport hian SD-a Premier League min hlui thei lo rau rau a nih chuan min hlui ma lek se ni mai, Ten Network te, Sony TV te kutah dah mai se, anni hian UEFA Champion League tha takin min hlui reng thei a, hetianga sum atchilh ho hi Mizoram pawh hian kan kham ve tak zet a, he CEO pawh hi Mizoramah chuan awm se, MZP, MSU leh YMA ang te pawhin an kawtkaiah a office kal tur dan hial kan nap ang, tiin ka ngaihtuah a, ka mut a lo chhuak tan der hi a lo ni.

Tuesday, 15 November 2016

Mahni-a Development Server Siam Dan

Introduction

PHP 7 lo chhuahna pawh a IT lama khawvel hmasawn chak dan thlir chuan a lo rei ve leh ta hle mai a. PHP 8-ah pawh kan hnaih leh rawk tawh mai thei a ni. Tun hmaa version an siamdan kalphung chhawm zelin PHP viltute pawhin PHP 7 hi tuaihnum chho zelin 7.0.1 - 7.0.13 thleng an peih tawh a. Version thar a lo pian hian a hmaa buaina awm neuh neuh (bug) te an fix bakah eng eng emaw thil tangkai an dahbelh rualin tul lo nia an hriat te an paih ve reng a ni. Kan sawi fo tawh angin PHP7 hi a chak tha hle a, tun aia chak tur hi chuan Engine thar hlaka an thlak tawh pawh a ngai ta ve ang. Chu lah tun dinhmunah thil harsa a nih a la rinawm bawk a. Kan peng thui deuh ta. Tun tumah hian PHP version thar ber PHP 7, Mysql Version thar ber Mysql 5.7 leh Apache Version thar ber Apache 2.4 hmanga mahni development enviroment setup dan kan sawi dawn a ni.

Apache Server atangin tan ang aw:

PHP hnathawh theia siamtu ber hi Apache Webserver a ni a. He thu ka ziak lai mek hian Apache Version 2.4.20 chu http://www.apachelounge.com/download/ link atang hian download theih a ni a. Hei aia thar pawh hi download tur a lo awm leh der tawh mai thei a ni. Download link-ah hian 32 bit leh 64 bit edition thlan tur a awm a. A pahnih hian Visual Studio 2015 (VC14)-a compile ve ve a ni a. PHP 7 hian 64 bit a mil tho avangin a hnuhnung zawk hi download mai tur a ni ang.



Download archive-ah hian Apacher24 folder a awm a, extract chhuah a. D:\samp (self apache-mysql-php) chhungah dah vek tur. Kan extract zawh vek hnu chuan a hnuaia mi ang hi kan folder structure tur chu a ni ang.

D:
  +—samp
    +—apache
      +— apache files leh folder zawng zawng awmna..etc..

Apache hian runtime atan Visual C++ Redistributable for Visual Studio 2015 a mamawh a. Chuvangin http://www.microsoft.com/en-us/download/details.aspx?id=48145 atang hian kan download ang. 32bit OS hmang kan nih chuan 32 bit download mai tur a ni ang a, 64 bit tan 64 bit download mai tur.

PHP 7 download
Server configuration lam chu lo dah tha phawt ila. PHP 7 nen a rualin kan configure zawk dawn a ni. PHP windows binary te chu windows.php.net-ah hian an dahkhawm a. Version chi a tam avangin kan Apache Server nena inmil tan kan thlan ve a ngai a ni. 64bit Windows kan hman chuan thread safe VC14 kan mamawh dawn tihna a ni. Thread Safe leh Non Thread Safe Binaries awmzia chu nakinah an ka sawi ang.
Non-thread version kan hman chuan PHP hi CGI binary angin kan install dawn tihna a ni.

PHP binary kan download chuan subfolder eng eng emaw kan siam a tul a. A hmasa berin D:\samp chhungah lut la. php tih folder siam la, hetah hian php file i download zawng zawng kha dahlut vek ang che. Folder dang pahnih kan siam leh ang a. htdocs-kan php code dahna tur leh tmp- temporary file session data vel dahna tur kan siam ang. Tichuan a hnuaia mi ang hi kan folder structure thar chu a ni ang:

D:
  +— samp
    +— apache
      +— apache files leh folder zawng zawng awmna..etc..
    +— htdocs (tunah chuan a la ruak rih)
    +— php
      +— dev
      +— ext
      +— extras
        +— ssl
         — openssl.cnf
      +— lib
         +— enchant
          — libenchant_ispell.dll
          — libenchant_myspell.dll
      +— sasl2
      (php file hrang hrang.....)
    +— tmp (tuna tan chuan a la ruak rih)

Configuration

Files leh folder te an awmna hmun tur a chunga kan siam-ah theuh khian kan dahluh vek tawh chuan Webserver leh php hnathawk thei tura kan configure thei tawh ang. Kan server siam tur hi drive dang danga copy kual pawha buai lo tura kan duh chuan relative path kan siam a ngai dawn a ni. Relative path kan configure dik chuan Pendrive atang pawhin kan server hi a run theih dawn tihna a ni.

A hmasa berin D:\samp\php\php.ini file hi a awmsa loh avangin kan siamchawp a ngai dawn a. php.ini-development tih kha a copy siam la. php.ini tiin a hmingthlak (rename) tur a ni ang. php.ini i siamthar chu hawng la. extension_dir tih hi zawng chhuak la; a thuziak hmaah ;(semicolon) i hmu ngei ang a. chu semicolon chu paih mai tur a ni. Tichuan,

;extension_die = "ext" tih chu
extension_dir = "..\..\php\ext" tia thlak tur a ni.

;(semicolon) kan paih hian extension kan tinung tihna a ni a. Hetiang hian extension dang pawh kan tinung zel thei a ni. Extension kan mamawh tlangpui te chu curl, gd2, mbstring, mysqli, sockets leh xmlrpc.

Temporary file leh session file vel awmna tur directory tmp kan siam tawh kha kan la hre reng ang a. Kha kha file kan upload vel temporary-a lo dah chhung nan leh session data dah nan php.ini tang bawk hian kan siam thei a ni. Tichuan

upload_tmp_dir = "..\tmp"
session.save_path = "..\tmp"

tih a lo ni tawh ang.

Apache Webserver Configuration file hi httpd.conf a ni a. D:\samp\apache\conf\httpd.conf chhungah kan hmu thei ang. httpd.conf hi kan hawn chuan configuration option tam tak kan hmu ang a. Kan thlak ngai te chu —› veilamah ka dah zel a, dinglama mi hi a thlakna tur a ni ang.

ServerRoot "C:/Apache24"        —›    ServerRoot ".."
Listen 80        —›    Listen 82
LoadModule php7_module "../php/php7apache2_4.dll"

#ServerName www.example.com:80 —› ServerName localhost:82

Require all denied (Directory tag chhungah) —› Require all granted

DocumentRoot "C:/Apache24/htdocs"    —›    DocumentRoot "..htdocs

<Directory "C:/Apache24/htdocs">    —›    <Directory "../htdocs">

DirectoryIndex index.html    —›    DirectoryIndex index.oho index.html

AddType application/x-httpd-php .php
(He thil hi <IfModule mime_module> directive tawpah dah tur a ni a. Directive AddType application/x-gzip. gz .tgz hnungah tihna a nih chu)

I file tawpa a hnuaia mi hi dah leh bawk ang che
PHPIniDir ../php

Port 80 hi default port a ni a. Skype leh application dang dang te hian port 80 hi an lo hmang ve nawlh thin a, chuvangin kan port atan hian 82 kan hmang ta a ni. Port number hi kan siamchawp a nih chuan URL-ah pawh type tel zel a ngai tih hriat tur. Chuvangin http://localhost or http://127.0.0.1 hmang ringawtin i lut thei dawn lo va. port number kha i ziah leh a ngai dawn a ni. Tichuan i url thar tur chu http://localhost:82 or http://127.0.0:82 tih tur. Port number dang dang pawh hman vek theih a ni a, a free em tih check hmasak phawt a tha ang.

He tutorial-a configuration kan hman te hi Testing na mai a nih avangin Production-ah chuan a hman chi dawn loh va. Entirnan `Require all granted` tih te hi a him lo a ni.

Testing
Test turin command prompt hawng la (Win+cmd) Apache Directory-ah a hnuaia mi ang hian lut ang che.

cd D:\samp\apache\bin

I server on turin a hnuaia mi hi type leh enter rawh:

httpd

Blank command prompt tih loh thil dang a rawn lan loh chuan a tha tihna a ni mai. Eng emaw error message dang lo lang a awm chuan Google pun la. I la tidik thei lo fo a nih chuan Stackoverflow-ah zawt tawp rawh.

Apache i start theih tawh chuan: htdocs chhungah index.php  file siam la, a hnuaia mi hi ziak rawh le:

<?php phpinfo();?>

I server a work ngei a nih chuan PHP Version 7.0.1 tih a chung berah i hmu kalh mai ang.

Database

PHP hian database software chi hrang hrang a hmang thei a. MYSQL nen hian an inkawp rem bik nia sawi thin a ni. Chuvangin tun tumah pawh hian Mysql kan setup tel ve dawn a ni. Mysql Community Edition hi a thlawnin Mysql Dev Site atangin download theih a ni. Mysql hi a lian ang reng ve hle bawk. 64 Bit OS kan hman chuan 64 bit OS version kha tunlai ber (latest) kha download mai tur a ni ang. MSI installer Version ni lovin a ZIP version kan download thung dawn a ni. Kan download zawh veleh kan folder structure-ah khan samp chhungah mysql folder kan siam ve ang. Tichuan kan folder structure pawh a hnuaia mi ang hi a ni tawh ang.


D:
  +— samp
    +— apache
      +— apache files leh folder zawng zawng awmna..etc..
    +— htdocs (tunah chuan a la ruak rih)
    +— php
      +— dev
      +— ext
      +— extras
        +— ssl
         — openssl.cnf
      +— lib
         +— enchant
          — libenchant_ispell.dll
          — libenchant_myspell.dll
      +— sasl2
      (php file hrang hrang.....)
    +— tmp (tuna tan chuan a la ruak rih)
    +— mysql
       (mysql community edition zip kan extract-na tur)

mysql directory-ah hian my-default.ini tih file a awm a. my.ini tia thlak(rename) tur a ni. MySQL hman theih tura setup kalkawng hmasa ber command hmanga initialize a ni.

bin\mysqld --initialize --console

A chunga mi kan run hian data directory te kan mysql folder-ah khan min siamsak dawn a ni. Hei bakah hian root account leh expired password a siam tel nghal bawk a. Data directory hi lo siam thei lo palh a nih pawhin basedir leh datadir command hmangin kan siamtir thei tho a:

bin\mysqld --initialize --basedir=D:samp\mysql --datadir=D:\samp\mysql\data --console

command prompt atang vekin a hnuaia command hmang hian mysql kan start thei ang.

bin\mysql -u root -p

expired password i thlak hma chuan engmah vak i tithei dawn lo va, chuvangin a hnuaia one-liner hmang hian thlak ang che:

mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'YourPassword';


Phpmyadmin

Mysql kan install zawh ruala pawimawh leh hmasa ber chu GUI hmanga database khawih theihna hi a ni. Command prompt atangin duh tawkin database chu kan siamin kan chawkkual vel thei tho va, mah se, rang zawk leh chiang zawka khawih nan chuan GUI tha tawk tak kan mamawh a ni. Man nei si lo, tha bawk si Phpmyadmin hi mysql database khawih nan chuan ka hman nasat leh tha ka tih ber a ni a. Kan setup-a lak luh dan lo sawi dawn teh ang.
Phpmyadmin version thar ber chu 4.6.4 a ni a, A hnuaia link atang hian download theih a ni.

https://files.phpmyadmin.net/phpMyAdmin/4.6.4/phpMyAdmin-4.6.4-all-languages.7z
https://files.phpmyadmin.net/phpMyAdmin/4.6.4/phpMyAdmin-4.6.4-all-languages.zip


Kan download zawh tawh chuan, kan folder main ber samp/ chhungah khan kan extract chhuak ang. A configuration hi a awlsam ang reng khawp tawh a. Kan extract chhuah zingah khan config.sample.inc.php file a awm tel a..chu chu config.inc.php tia thlak (rename) tur a ni. config.inc.php hi a lo awmsa theih tho avangin backup-a dahthat hmasak tur a ni ang.

Apache Service leh Mysql Service Install Dan:

Hei hi tamtak buaipui a nih bawk avangin rawn sawi tel hram thain ka hria a. Apache kan start hian blank command prompt a inhawng ngei ngei a...hei hi Laravel hmang thang te chuan kan bel viau ang. Mahse blank command prompt chu kan close a nih chuan Apache chu kan titawp (stop) tihna a ni. Tichuan Command Prompt kha hnawksak takin a lo awm ve reng tihna a nih chu. Chuvangin Command prompt lang buai miah lo va, a ruala mysql leh apache start dan trick ho te kan sawi lang ve dawn a ni.



Apache Service Install dan:
Command prompt hawng la, i apache folder chhunga bin-ah cd lut la, a hnuaia command hi type ang che.
httpd.exe -k install -n "Apache2.4"
Mysql Service install dan:
Command prompt hawng la, mysql folder chhunga bin-ah cd lut  la, a hnuaia command hi type leh enter ang che:
mysqld --install
 Awle Mysql service leh Apache Service kan install tawh chuan Windows kan start/on apiangin kan server chu a hman ve nghal theih zel dawn tihna a ni.

Mysql Service install-na leh Apache Service install-na tur hi setup mawl te pakhat ka siam a, nakinah ka la rawn phochhuak ve ang....

PHP OOP Hmelhriatna

PHP Object Oriented Bul leh bal:
Object Oriented Programming-a bet tlat term pawimawh te hi lo hmelhriat ve ila.

Class: Class hi OOP paradigm tawngkam lar tak a ni a. abstraction, modularity leh a dang tam tak-ah kan code min pui a ni.
Member function: Class chhunga function kan siam te.
Member Variable: Class chhunga variable kan siam te sawina a ni. Heng varibles te hi Object attribute tiin an sawi bawk.
Object: Object hi i class siam entirna (aiawhtu=instance) a ni. Class i siam a, object tam tak i nei thei. Object hi instance tia sawi a ni bawk.
Inheritance: Inheritance hi OOP hmanraw tangkai ber te zinga mi a ni. Inheritance hian i class siam tawh (base class/parent class) hmanga class tam tak siam theihna a ni.
Parent class: Class  danga inghahna class base class or super class tia sawi a ni bawk.
Child Class: Class dang atanga class peng. subclass or derived class an ti bawk.
Polymorphism: Poly (tam tak tihna) and morph (forms tihna). behaviors hranga operation thuhmun.
Overloading: Overloading chu child class-a parental behaviour thlak tihna.
Data Abstraction: Data entirna a ni a, ahmanna tak tak chu thuhruk (abstract) vek a ni.
Encapsulation: OOP that bikna em em chu data thuhruk (encapsulation) hi a ni. Class pawn atanga data direct access theih loh turin hide vek a ni.
Constructor: Class Constructor nei chuan he method hi object kan siam apiangin a ko chhuak thei a. Object kan siam hmaa bul tanna siamna a ni ber.
Destructors: Scope pawn lama object a kal emaw delete a nih apianga Function automatic-a kan kohchhuah theih.
 
Structuring Classes
Class siam hi thil mawlmang ve tak leh awlsam tak Class tih thumal hmanga kan chinfel theih mai a ni.

<?php
    class myFirstClass {
        #code
    }
?>
  Hei hi i class i siam dan tur leh a chhunga i code dah dan tur a ni.

     <?php
    class kaClassHmasaber {

        function kaFunction(){
            echo "Ka function";
        }
 }
?>
Member Variable:
<?php
    class kaClassHmasaber {
        $var1 = "hello";
        $var2;
    }
?>
Objects siam dan-PHP

I class chu i siam tawh chuan Object chu i duh zat zat i nei thei ta.

<?php
$objc1 = new kaClassHmasaber();
$objc2 = new kaClassHmasaber();
?>
Hei hi Class atanga Object kan siam dan a ni.

Class Member function hmanchhuah dan.

<?php
  $obj = new kaClassHmasaber(); // object of the class

  $obj->kaFunction(); // member function call
?>

Inheritance
PHP class chu parent class atangin extends keyword hmangin inhlanchhawn theih a ni.
<?php
    class kaClassHmasaber {

        function kaFunction(){
            echo "function 1";
        }

    }
    class childClass extends kaClassHmasaber  {
        #code
    }
?>
child class (or subclass or derived class) characteristics hetiang hian a nei a:

1. Member variable declaration.
2. Same member functions as the parent and all work same as parent work.
Here childClass is the the Child Class of Parent Class myFirstClass.

Polymorphism

Polymorphism hi behaviour hrang operation in ang: entirnan ramsa(animal) tawng dan (talk beviour)  chu a in ang a mah se a ri (sound) chu ramsa zawng zawngah a danglam vek a ni.
<?php class animalClass {
      protected $name;
      public function __construct($animalName)
      {
         $this->name = $animalName;
      }

      public function getName()
      {
         return $this->name;
      }

      public function talk()
      {
         return $this->getName().' is talking <br />';
      }
   }

   class dogClass extends animalClass
   {
      public function getName()
      {
         return 'Dog: '.parent::getName();
      }
   }

$a = new dogClass("My dog");
echo $a->talk();
$b = new animalClass("some Cat");
echo $b->talk();
?>
Ramsa chi hrang hrangin aw chi hrang vek an nei. Mahse chu chu an tawng ve dan a ni.

Overloading

Class-in hming in ang Function pahnih or a aia tam a neih a, number hrang/data types of paramerters hrang a accept-in .
PHP-ah chuan run-time-a Object members heng __set,__get, __call hmanga kan add hian Overloading an ti.

<?php
class myClass {
    public function __call($method, $args) {

        if ($method === 'myFunction') {
            echo 'Sum is calculated to ' . $this->getSum($args);
        } else {
            echo "Called method $method";
        }
    }

    private function getSum($args) {
        $sum = 0;
        foreach ($args as $arg) {
            $sum += $arg;
        }
        return $sum;
    }
}

$obj = new myClass;
$obj->myFunction(10,25,30,12);
$obj->myFunction(21,20,1);
?>
Encapsulation
Class pawn atanga data access theihna hide tu. Encapsulation hi chi thum a awm thei a:

1. Public Members: Hei hi methods and properties of a class default state a ni, class pawn atang pawha luh theih a ni a, class chhung atang pawhin a khawih theih a, a class kan hmanna class dangah pawh acccess theih a la zel bawk.

Class chu a pawn lama hman theih loh tura i dah duh chuan a member te chu private or protected-in a dah thei ang.

2. Private Members: Class member chu private-a i dah tawh chan class kan declare (siamchhuahna) ngei ngeiah pawh khawih turin tihdan bik hman a ngai tawh a ni. Class Private-a dah dan chu a member hmaah Private keyword hman mai tur a ni.
<?php
    class myFirstClass {
        function myFunction(){
            echo "public one";
        }
        private function myPrivateFunction(){
            echo "I'm  not visible outside!";
        }
    }
?>

Class danga he class hi extend a nih pawhin access myPrivateFunction hi access theih a ni lo, a private property vang hian.

3. Protected Members: Class chhunga property or method private-a kan dah tawh chuan, a class atangin access theih a ni a. Class property-a protected-a kan dah dawn chuan a member hmaah dah tur.

<?php
    class myFirstClass {
        function myFunction(){
            echo "public one";
        }
        protected function myprotectedFunction(){
            echo "I'm  visible in child class!";
        }
    }
?>

Constructor Functions:
Constructor function chu class atanga object kan siam function kha a ni. Object kan siamnaa thil tam tak bul tanna tura siam a ni.*/
<?php
    class myFirstClass {
        __construct($par1, $par2){
            $this->price = $par1;
            $this->title = $par2;
        }
        function myFunction(){
            echo $this->price." ".$this->title;
        }
    }
    $obj = new myFirstClass('Hello',7);
    $obj->myFunction();
?>
PHP hian function special tak __construct() hi constructor siam nan a nei sa. Constructor function-ah hian argument i duh zat zat i dah thei a ni.

Destructor:
Constructor ang thovin  __destruct() hmangin kan siam thei a. Destructor chhungah chuan resources zawng zawng i release thei a ni.

GD LIBRARY

GD hi C graphics library .jpegs, .pngs, leh .wbmps. thlalak siamna leh suasamna ber a ni a. .gifs file a support lo va. Version thar zelah chuan a support thuai a rinawm bawk. PNG hian gif zia zawng zawng a neih tho bawk avangin lungngaihna tur erawh a awm hran lo.

INSTALLATION

GD hmang thei tur chuan php_gd2.dll file hi installation package-ah a tel sa vek a. php.ini hawn a extension=php_gd2.dll line kha uncomment mai tur a ni.php.ini file-a enable kher lo pawhin a hnuaia code hmang hian enable theih a ni bawk.
dl(‘php_gd2.dll’);

I host chuan UNIX system nge Windows system an hman i chian loh chuan..a hnuaia mi ang hian GD library i load thei ang.

<?php
if(!extension_loaded(‘gd’)){
     if(strtoupper(substr(PHP_OS, 3)) == “WIN”){
        dl(‘php_gd2.dll’);
        }else{
           dl(‘gd.so’);
        }
  }
?>

IMAGE RESOURCE SIAM LEH HMAN DAN

Image siam nan hian GD hian functions pahnih a nei a, an pahnih hian argument pahnih width leh height an nei ve ve a.

ImageCreate(width, height)
ImageCreateTrueColor(width, height)

Hei bakah hian GD hian file awmsa atang image siamna function a nei bawk a. ImageCreate() function hi kan zir hmasa phawt ang.

ImageCreate(); kan hriat tawh angin Width leh Height neia blank image siam tawpna a ni deuh tlawng a. COlor a hman hi Index Color a nih avangin color chi hrang 256 a awm thei tihna a ni.

<?php
if(!extension_loaded(‘gd’)){
    if(strtoupper(substr(PHP_OS, 3)) == “WIN”){
        dl(‘php_gd2.dll’);
      }else{
        dl(‘gd.so’);
        }
    }
$imageResource = ImageCreate(100, 100);
?>

Image 100px width leh 100px height kan lo nei ta a. Kan duh dan takin GD library function min chhawpchhuah hrang hrangin kan suasam thei tawh tihna a ni. Kan luhchilh tak tak hmain ImageCreateTrueColor() function chungchang hi tlem lo bih leh phawt ila. ImageCreate() ang deuh tho a ni a, a danglam bikna chu Index Color pallete hmang lovin True Color Pallete a hmang hi a ni. Chuvangin element hrang hrang nei thei tur complex graphic siam nan duhthusam a ni.

Geometric shape ziah kual vel tak tak hmain color thlan leh hman dan i hriat a pawimawh phawt a. Color function pariat(8) a hnuaia mi ang hian kan nei thei a.

1. ImageColorAllocate(resource image, int red, int green, int blue)
2. ImageFill(resource image, int x, int y, int color)
3. ImageColorTransparent(resource image, int color)
4. ImageTrueColorToPalette(resource image, bool dither, int colors)
5. ImageColorsTotal(resource image)
6. ImageColorAt(resource image, int x, int y)
7. ImageColorsForIndex(resource image, int index)
8. ImageColorSet(resource image, int index, int red, int green, int blue)

Kan hmuh ang hian image resource hi argument hmasa bera tan an hmang vek a, argument mal te te hi zir chian a, nal chuan GD kan hman dan tur chu a lang uai nghal a ni mai. (int = integer tihna.)

ImageColorAllocate() hian argument pali a nei a, a hmasa ber hi resource image a ni a. int red hi thlalak a red color value sawina a ni a, a dawttu hi green value a ni leh a, atawp bera mi hi blue a ni ve thung. blue pek tam i duh chuan a number tihtam mai tur a ni. RGB color awmzia i la hriat ngai loh chuan color value hi 0-255 a awm thei tih tal hria la, a tawk viau mai. Entirnan black siam tur chuan a hnuaia mi ang hian

$black = ImageColorAllocate($someImageResource, 0, 0, 0);

Next-ah chhunzawm a ni ang.

Saturday, 12 November 2016

Donald Trump leh inhnawhchhuah runpui

Donald Trump chu America President 45-na ni turin January ni 20-ah lakluh a ni dawn ta a. A Immigration policy vangin khawvela media lian ber ber BBC leh CNN te sawisel luai luai chung pawha a tling ta mai hian mi tam tak a barakhaih chiang hle mai.

A policy te hi a rum hle hlawm a, a tak taka a kalpui ngat chuan khawvel hi nasa takin a nghawng dawn tih a chiang em em bawk a ni.

Trump-a policy point 10 hi lo sawilang ve zuai teh ang:

Donald J. Trump’s 10 Point Plan to Put America First
  1. Begin working on an impenetrable physical wall on the southern border, on day one. Mexico will pay for the wall.
    = America chhim lam Mexican border-a indaidanna bang siam tura thawh tan nghal.
  2. End catch-and-release. Under a Trump administration, anyone who illegally crosses the border will be detained until they are removed out of our country.
    = Ram dangmi tang man chhuah leh tihtawp. Trump-a rorelna hnuaiah chuan dan lova America ram lut reng reng te chu America ram an chhuahsan hma chu khungbeh tlat.
  3. Move criminal aliens out day one, in joint operations with local, state, and federal law enforcement. We will terminate the Obama administration’s deadly, non-enforcement policies that allow thousands of criminal aliens to freely roam our streets.
    = Khawtlang, state leh federal law enforcement te nen tangkawpa America mi ni lo misual reng reng hnawhchhuah. Obama dan leh hrai te hi kan titawp vek ang a. Kan khawlaia misual duh tawka an len theihna policy te thiah vek.
  4. End sanctuary cities.
    = Raltlan te khawpui te tih tawp.
  5. Immediately terminate President Obama’s two illegal executive amnesties. All immigration laws will be enforced - we will triple the number of ICE agents. Anyone who enters the U.S. illegally is subject to deportation. That is what it means to have laws and to have a country.
    = Obama' lak illegal executive (dan bawhchhia politic atanga ngaihdam) te pahnih pawh ban hmak. Immigration law a taka hman - ICE agents te pawh a let thumin kan tipung ang. Dan lova USA-a lo lut reng reng hnawhchhuah nghal vek. Hei dan a nihna leh ram kan neihchhan a ni.
  6. Suspend the issuance of visas to any place where adequate screening cannot occur, until proven and effective vetting mechanisms can be put into place.
    = US-a VISA dil pawh uluk taka anmahni bihchiahna a awm loh chuan visa pek loh tawp.
  7. Ensure that other countries take their people back when we order them deported.
    = Ram dang mi kan rama awm te kan hnawhchhuah hun an ram te'n an la let vek ngei tih chian.
  8. Ensure that a biometric entry-exit visa tracking system is fully implemented at all land, air, and sea ports.
    = US atanga lut leh chhuak reng reng visa hmanga an biometric enfiah nghal zel.
  9. Turn off the jobs and benefits magnet. Many immigrants come to the U.S. illegally in search of jobs, even though federal law prohibits the employment of illegal immigrants.
    = Ramdang mi tan Hna leh hlawkna awm thei tihtawp. Federal law-in khap mah se hna zawngin US-a tam tak an lo lut a ni.
  10. Reform legal immigration to serve the best interests of America and its workers, keeping immigration levels within historic norms.
    = America leh a mipui tana a that theih dan tur bera immigration law siamthat.
A chunga a policy te hian a elpui Clinton policy an kalh fai deuh vek a, birthright citizenship pawh tin tawp a tum a, a chhan ber chu dan lova pem luh theihna hiptu lian ber a nih vang a ti. Hei vang hian mi tam tak chu an rilru a hahin tap hawm hawm te pawh an awm a ni. Tuna US-a cheng mek Canada lama pem tum pawh an tam tawh hle a ni.

US-ah hian a ram ang zawng chuan Burma atangin pem lut leh Refugee an tam ber a, 2015-a statics-a a landan chuan refugee luh zawng zawng a 24% hi Burma atangin a ni:

Chin – 6,130
Karen – 1,029
Karenni (Kayah) – 296
Kachin – 104
Arakanese – 85
Burman – 81
Mon – 77
Shan – 23
Others – 81

Obama hun lai hian Refugee lut thei zat an pawm 70000 chu 85000-ah tihpun a ni a. mahse Trump a lo lang a, engkim a buai ta. He pa hian Refugee te chu rul tur hlauhawm tak nei angah a ngai hmiah mai a, a fapa pawhin skittles angin a khaikhin bawk a. Oscar Brown Jr. Poem phuah the Snake tih chu a campaign-naah a chhiar chhuak thin a, a phuahtu pawh hian a khap hial a ni.

Donald Trump rolrelna hian eng angin nge min nghawng ve ang tih hi chu sawi thiam a har a, a ka a kua a, a sawi ve mai mai nge a ti tak tak ang tih chu hunin a la hril ang.

Saturday, 5 November 2016

Framework te hi eng teh ual an lo ni lo....

(Framework hi Laravel leh Code Igniter bak hi chu tih takzeta khawih ka nei hran lo va, heng pawh hi ka thiam tawk loh vang leh zirna hun ka insiam hman tawh loh avangin ka chawlhsan tawh a, core language leh libraries erawh ka khawl ten tun a, Framework aia programming language thiam duhte tan Peteris Krumins' (https://www.browserling.com) a thuziak ka rawn dahchhuak ve e). 
Framework hi software development-a anti-pattern (Bad programming practice) lian ber a ni a. Zir a har a. Project an ti complex-in thil dangah a in nghah tam em em a. A enkawltute’n an peih loh san hun hun kha an tawp hun a ni mai a. Chhan mumal tak awm si lovin version thar a lo chhuah apiangin i in update a ngai ve zel a. Buaina i tawhin midang tanpuina leh thurawn dap a ngai a. Framework-in feature a neih zinga tlem te bak i lo mamawh a lo ni reng thei a. Eng teh ual a lo ni lo.
Framework aiah helper libraries leh abstraction mawl te hman pawh hi a thlanawm zawk a, chung dang zawng ai chuan core language thiam hi a hlu zawk. Software chu mawlmang thei ang ber, thil danga in nghat tlem thei ang ber leh tuna tang kum 20 hnu pawha la hmantlak tura fundamental tool (core language) hmanga hun, tha leh zung seng tlem thei ang bera develop tur a ni a. A nihna takah chuan Framework hian software siam hi a tiawlsam hran lo va, a ti complex zawk a , pumpelh tum hram hram tur a ni. Thil complex reng reng chu a suala sualchhuah ngai vek an ni a, Framework hi ka hmang lo va, hmang tura midang fuih phei chu hla tak a ni.
Browserling-a software siam chungchanga kan dan pawimawh tak chu a tam thei bera core language hman tur tih a ni. Framework hman tulna chhan tam tak a awm thei ang. Mahse tun thleng chuan framework pakhat mah kan la hmang lo va, kan thilsiam duh chu library then khat leh core language hmangin kan la ti vek thei a ni. Then khat chuan Framework hman tul leh hman ngei ngei ngai angin an sawi a. Browserling-ah mawlmang taka thil chinfel theih hi kan thupui ber a ni. Ka hnathawk te chu framework engmah hmang lo turin ka ti a. Problem an neih reng reng core language leh tools hmanga chingfel vek turin ka ti mai thin.
Framework aia core language hman a that zawkna hrang hrang ka hmuhdan te chu:
Framework te hi thiam har leh thiam tul lo an ni: Framework zir hian hun a heh em em a, fundamental tool leh core computer concept leh programming kalphung dik tak zawm lovin thil eng emaw bik tihna zir ang chauh i ni dawn a, a daih rei lo vang. Thenkhatin framework an hmu chhuak a, chu chu thenkhatin an lo hmang a, i hman ve kher a tul tihna a ni chuang lo. Chu mi kha mi chuan a hmang a, ka hmang ve dawn, tih leh ringawt thin hi a zia lo. Programmer dik tak chuan Framework tel lovin tih hi kan ngaihtuah tur a ni a. Ka thil duh siam puitlin nan eng feature leh core concept nge kan mamawh tih te, heng kan feature duh ang te hi framework tel lovin code line za vel lekin ka siam ve thei em tih te, he framework hi tute siam nge? kum 2/1 lekah an thil siam hi an hnuchhawn leh mai lawng maw tih te, kan ngaihtuah kim tur a ni.
Framework hian kan ngaihtuahna hmanthiamna a tizim: Framework hian kan ngaihruat thiamna zau zawka hman min phal sak lo va. Box pakhat chauh chhunga kan ngaihtuahna sawrbing turin min phuarbet tlat a ni. Chuvangin mawl tak bakah a chhuah lo ang che. Buaina i tawh a, tih ngaihna i hriat loh tawp khawkah pawh framework chuan a tih theih bakah engmah a tihtir hauh dawn lo che. Mithiam zawk te i rawn reng a ngai ang a, i tha leh zung i seng thlawn tam lutuk dawn a ni. Framework siamtute kha i thil siam duh apiang i siamtirin framework kalphung i thlak kual tir thei ngawt lo bawk. A nihna takah chuan i productah chuan thuneitu ber i ni tur a ni.
Frameworks te hian i project an ti complex-in thil dangah an innghat tam: Thil danga innghat nasa lutuk leh complexe lutuk thil reng reng hi engmah tlo reng a awm lo. I project chu enkawl nuam leh thil danga in nghat tam lo thei ber a ni tur a ni. Project complexity leh dependency chu enkawltu an awm loh chuan thil danga in nghahna a sang tulh tulh ang a, a tawpah phei chuan framework sawm hnih chuang leh language chili chi nga lai i lo hmang reng thei a ni. Project-a tool i hman tur chungchangah dan khauh tak zam tura thutlukna siam mai loh chu tih theih i nei lovang.
A tirah kalphung awmze nei hmang em em lo pawhin framework tharlam ber ber i hman theih leh thiam vang chuan i lang cool viau mai thei, mahse hun a lo rei a, i application chu nasa takin a lo complex chho tan a, i application hnathawh dan kalkawng pawh i lo bo ta map mai. Enkawl hleihtheih pawh a lo ni ta lo. A tir thla hnih thum velah chuan thil hi tih deuh zung zung theih angin lang mah se, i project-in hmalam a pan zel khan i team te hnathawh a muang ve telh telh ang. A chhan chu thil dangah i innghah tam vang leh i application chu a lo complex tak em avangin. I application enkawl turin hnathawktu tam zawk i lo mamawh tawh ang. Thiamna bik nei mi tam zawk i mamawh tawh dawn tihna a ni. I lead developer-in a mangtha ni che chu i tawp ni a ni ve nghal ang.
Complexity hi lo lakluh mai chi a ni lo va, a suala sual chhuah ngai a ni. Framework leh Library kan hman tam zel hian kan project chu kan ti complex tulh tulh tihna a ni. Chuvangin Framework leh library hi i ni khatna ni atangin pumpelh nghal ang che.
Framework te hi ruah mual liam ang an ni. Framework hmuhchhuah tam zawk hi lo lar huk a, a thar dangin a rawn luahlan leh mai thin. Ti chuan framework thar chu a tirte atang bawka i zir leh a ngai ang. Tha leh zung, sum leh pai sen a ngai ve bawk. Framework hlui tih tak zeta i lo zir chu a thar a lo chhuah avang chuan i hnuchhawn a ngai leh si. I thiamna lo neih tawh te chu hmantlak loh an lo ni leh ta.
Miin framework thar that zia leh hman nawm dan te an lo tlangaupui ta a. Chutiang thiam lo bik nih chu i duh hauh lovang le. Mahse rilru sen hah lohna turah i rilru i seng thlawn ang lek chauh ah ngai zawk rawh. Core fundamental tool te hian framework-in a tih theih ang chu an ti thei vek a. Thil thar engmah solve theihna nei bik pawh ni lovah i hun i sengthlawn lek chauh a ni. Framework chu a lar poh leh a rintlak loh leh zual tih hi hriat tur.
Hei aia chanchin lungchhiatthlak leh zual chu Framework author thenkhat hi an project hi an nin chinah an hnuchhawn hmaka an delete leh hmiah mai bawk thin a. Author pakhat vangin i build zawng zawng a buai vek thei. Core fundamental tool hman nasat hi a thain hun lokal leh zel turah pawh rintlak ber tura ngaih a ni.
Framework te hi inthlak danglam chho reng an ni a, chuvangin kan framework version leh a dependency te kan update ve reng a ngai thin: Framework te hi a version thar an siamchhuak chak ang reng hlawm hle a, i in update ve zung zung loh chuan thil thar i zir reng a ngai ang. I code update-in i buai thei viau bawk ang. Framework developers'ten functionality eng eng emaw an dah te hi kan mamawh ber an ni hran lo va. Kan mamawh loh tawp an ni duh tlangpui.
Chhan mumal tak awm si lovin framework developers te hian an project hi an update ve reng a. A tlangpuiin software chu tih tur chin kan siamsak a, dik leh fel fai taka a tih theih chuan update emaw thlak danglam a tul vakna a awm lo. Software hman tlak leh tha te chu kum 10/20 kal taa an lo siam tawh te kha an ni zawk. Chhan mumal tak awm si lova software version update vak hi anti-pattern lian tak a ni. Software chu version X-ah a that fel kim chuan chhan mumal tak awm si lo va upgrade a tulna pakhat mah a awm lo.
Midang pum reng ngai hi: I framework hman laiah buaina i lo tawhin i chinfel dan hre hlauh pawh ni la framework-in tihtheih chin a bithliahsak bak che in engmah i tithei lovang. Mithiam zawk(expert) puihna i mamawhin sum seng hial i rawn pawh a ngai thei. Thil dangah i innghat tam lo a nih chuan mithiam (expert) chu nangmah kha i ni mai.
Framework feature tlem te bak i lo mamawh lo: Ka thilhriat zin em em chu thenkhatin ropui takin framework hmangin project an khawih thin a, chutih laiin framework atanga an mamawh tak tak (feature) chu tlem te chauh a lo ni lawi si. Hetiang hi a nih avangin an project chu an tikhawlo der tihna a ni hial mai. Project i khawih dawnin 'Eng framework nge ka hman ang tih' i lo inzawt thin a nih chuan i tisual hle tihna a ni ang. I project chu engmah lo atangin tan la, programming leh helper libraries tlema zawng hmang la, tha takin siamchhuah tum zawk ang che.
A tul hunah chauh framework chu hmang ang che: Framework te hi hmanna awm hlo leh laktlak loh ber chu an ni em bik lo va. Image processing, sound processing leh machine learning -ah te chuan code tam tak hmanga siam a ngaih avangin framework te hi an hman tlak ve ang.
Thiante u, framework hi in thiante hmantir lovang che u.