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.

Saturday, 28 May 2016

FREE DATA BACKUP

Backup pawimawhzia hi 2010 hnu lamah pawh a tam zawk chuan kan la hrethiam tawk kher lovang. Chutihrualin data pawimawhzia chu nitin kan hriatbelh zel thung a ni. Backup hi a Zotawng chuan dahthat/vawnthat tiin a sawi mai theih ang. Mihring kan changkang chho tulh tulh a, Digital device chi hrang hranga kan innghahna pawh a sang chho ve zel a. Heta pawimawh ber chu device-a kan data hrang hrang te hi an ni a, mahse heng data te hi hlohpalh, rukchhuah leh khawihchhiat awl tak vek an ni. A tlangpuiin kan data te chu Hard drive leh memory card-ah te kan vawngtha/dahtha thin a. Hard drive leh memory card te hi buai thei, chhe thei, ruk theih, tihbo theih, virus tihchhiat theih leh kang thei lo pakhat mah an awm lo. 
 
Thil che chi reng reng hi kumkhaw daih a awm thei lo tiin an sawi thin a. Chutiang bawkin Hard drive te hi beisei lawk miah loh pawha chhe thut thei vek an ni. Hetia kan data vawnthatna ber hi rintlak tawpthang a nih tak si lovah chuan mi chengvawng deuh te chuan Hard Disk dang leh Memory Card, Disk, Pendrive dang dangah te kan data pawimawh tak tak te chu kan dahtha (backup) thin a. Computer-ah chuan a tlangpuiin C drive chu System drive kan ti a, Operating System a chhiatpalh a hlauhawm thin bawk avangin kan mimal data pawimawh dah nan Drive dang kan hmang thin a. Entirnan kan Computer Drive C,D,E te kan nei a, C Drive hi System Drive a nih angin System file ho awmna a ni a, D leh E, F te hi data hrang hrang..thlalak, video, mp3 leh software backup dah nan te kan hmang thin a ni. Mahse hei pawh hi a him tawk thin lo va, chuvangin hard Disk leh memory dangah te dahtha kan awm thin bawk a. Mizoram bikah chuan Pendrive hi kan hman rinrawl ber a ni. Tun dinhmunah chuan a tam zawk chuan Pendrive, Computer Hard Disk leh Memory Card vel bak data vawnthatna dang kan la melh lutuk lo ni pawhin a lang.
 
Thenkhat tan chuan kan data te hi an hlu hle a, chuvangin a him thei ang bera vawn that pawh tihmakmawhah kan ngai a ni. http://typesofbackup.com/-in a tarlan dan chuan Data dahthat(backup) dan hi chi hrang 11 vel a awm a. Chipchiar takin kan sawi hman dawn lo va, hriatchian duh chuan a site-ah hian luh mai tur. Backup kan hman atan tha http://typesofbackup.com/ kan chhiar atanga lang te tlem han tarlang ila.
 
Off-site Backup: Data a awmna pangai ni lo, hmun danga kan dahthat hian Off-site backups a awm huam ber a. Hei hi data bo laka invenna tha tak chu a ni meuh mai, Mahse building khatah vek kan data chu an awm si chuan kangmei leh khuarel chhiatna dang lakah erawh an him hauh chuang lo. Chuvangin hmun dang, khaw danga dahthat a kawk ber a ni.
 
Online Backups or Cloud Backup: Online backup hi tunlaia backup hmanlar ber pawl a ni tawh a. Mahse, hman fimkhur a ngai ve hle thung a. Data paihsual(delete by mistake) leh replace(thlak sual) a awl thin hle a. Kan data-a kan khawih vel dan history zawng zawng a lan theih loh tlangpui bawk avangin Undo(tihthat/siamthat) theih a ni lo bawk.
 
Offline Backup: A tir lama kan sawi ang khan hei hi data vawn that nana kan hman nasat ber pawl a ni a. Data kan hman lohna drive-a dahthat a kawk ber a. Entirnan Pagemaker chu C drive-ah kan install-a D drive-ah zip-in a backup kan dahtha thin a. Hei hian Virus, malware leh ransomeware lakah kan backup chu a lo vawnghim ve thin a ni. Chutihrualin kan system a buai tak tak chuan kan backup hi a him bik chuang lo a ni. Offline backup hian Pendrive, CD, DVD leh memory card-a vawn that te pawh a huam tel vek a. An him lohna ber chu Virus khawihbuai theih an ni vek leh tihbo leh tihchhiat palh theih vek an ni hi a ni.
 
Backup dan tha leh him ber: Data vawnthat nan hian engmah hi him tawk a awm thei tak tak lo va, chutihrualin tha leh rintlak bik erawh a awm ve bawk. Mizo te pawhin kan intihhmuh tan Cloud Backup solution hi rintlak chho ber tura ngaih a ni. A bikin Commercial Cloud backup solution te hi eng emaw thut lakah pawh lukhawng nei deuh an nih avangin a tha ber tia sawi theih an ni bawk ang. Cloud backup solution te hi computer leh smartphone te nena awlsam taka thlunzawm vek theih an ni a, man chawi ngai (Commercial) solution, PC Magazine review lang te chu:
 
1. IDrive - 1TB $59.50 per year
2. CrashPlan - Unlimited $59.99 per year
3. SOS Online Backup - unlimited $79.99 per year
4. Carbonite - unlimited $59.99 per year
5. SpiderOak - 1TB $129 per year
6. BackBlaze - Unlimited $50 per year
Man chawi ngai(Commercial) kher lo, a thlawna hman theih te pawh an awm ta fur a, chung zinga lar zual deuh te chu:
1. Google Drive - 15 GB
3. Apple iCloud - 5 GB
4. iDrive - 4GB
5. SpiderOak - 2GB
7. NerobackitUp - 5GB
8. OpenDrive - 5GB
te hi an ni a. Free storage dang lar zual te chu:
1. Drop Box - 3 GB
2. Box - 10GB
te hi an ni. Kan sawi tawh ang khan heng cloud backup solution tam zawk hi chuan kan file history an chhui vek lem loh avangin fimkhur taka hman a pawimawh a ni. Online storage that lohna dang leh nia lang chu Internet Connection tha a mamawh hi a ni.

Wednesday, 25 May 2016

PORTABLE WAMP (PHP 7.0.6, MYSQL 5.7 & APACHE 2.4.20)


PHP 7 an release-na pawh a lo rei ve leh ta. Mahse internet lamah hian PHP 7 leh Mysql latest version, leh apache 2.4 support portable server emaw wamp stack hmuh tur erawh a la awm lo va. Then khat tan chuan heng technology version thar te hi an la naupang lutuk te pawh a ni mahna. Mahse PHP 7 chakzia te leh mysql leh apache version thar thatna tem chhin chak ve leh hmang duh kan awm ka ring a. Tichuan ka theihpatawpin awlsam taka miin an hman theih nan Portable Wamp chu mahni pualin remkhawm ve kan tum ta a.  Tichuan Zoweb Portable hi a lo piang ta a ni. PHP, mysql leh apache chu zip distribution package ang angin ka hmang a, thil then khat compilation siamna tura an dahtel ang chi leh tangkai lo nia ka hriat te chu a file size a tet deuh nan ka paih then bawk a ni. He Portable Wamp (Windows Apache, Mysql, Php) hi Wampserver or Xampp ang chuan feature a ngah lo va. Mahni khawla Wamp stack latest version hmang duh ve te atan erawh a tangkai ve thei hle thung ang. A feature te chu:
  1. PHP 7.0.6 (Latest PHP version)
  2. Mysql 5.7. (Latest Mysql Community Edition)
  3. Apache 2.4.20 (Latest Version)
  4. Phpmyadmin 4.6.1 (latest stable release)

Starting Zoweb Portable


Integrated mysql console
Download now

Tuesday, 24 May 2016

Mark Calculation for HSLC Mizoram Board of School Education (MBSE)

MBSE chuan tun session atanga hman tan turin Integrated Evaluation System thar a duang chhuak a. He Scheme hnuaiah hi HSLC Board Exam-ah zirtirtute'n an zirlaite mark pek ve theihna an nei tawh dawn a. Mahse Mark khawl calculation dan vel hi a awlsam lem lo hle a. MBSE-a mark submit tur hi subject-wise leh All subject-in a ni a. Hrechiang duh tan a hnuaia download link-ah hian kimchang tar tarlanna a ni bawk e.

Heng Calculation vel hi a hautak em avang leh best of two lak chhuah tih vel te hi Excel hmang pawha a awlsam loh avangin a khawih awlsamna tur Desktop Application a free-a download tur a lo awm reng mai a, Hrechiang duh tan hetah hian entur: HL Mark Management for HSLC. Serial Key hi 123-456 a ni.
 
screen of hl mark management for hslc
Main Screen of HL Mark Management System


He Application hmang hi chuan Student dahluh tawpa, Class Test , Assignment, attendance leh Term Exam-a an mark hmuh ang ang chhut luh tawp a ni a, a bak chu software hian a lo chawkchhuak vek thei a ni. MBSE-a submit tur pawh PDF leh Excel version-in a a export thei vek bawk a. Class Test, Assignment, Term Exam report bakah marksheet print-na a nei nghal vek bawk a. Hmang thei turin thiamna em em a ngai lo va. Excel hmang thiam lo tan pawh hman theih turin zo tawkin siam a ni a. A security leh stability-ah pawh excel aiin a tha zawk bawk a. A thlawnin a la hman theih zui bawk a ni.

Download the integrated Evaluation Scheme document (pdf)
Download HL Mark Management for HSLC (32bit)

Tuesday, 26 April 2016

EXPORT DATA TO EXCEL IN PHP

Question: I have recently made a website and have a members table in my sql. I have an admin page that has the ability to download that with column names; however I used to use INTO OUTFILE but that is not allowed on my host. I came up with this code to download the file:
<?php
if(file_exists('downloads/members_'.date("m-d-Y").'.csv') == true){
    header("Location: /downloads/members_".date("m-d-Y").".csv");
} 
$output=fopen('downloads/members_'.date("m-d-Y").'.csv','w+');
fputcsv($output,array(
                 'memberID','username','password','email',
                 'active','resetToken','resetComplete',
                 'support','supportToken'
             )
);
$rows =mysql_query("SELECT * FROM members;");
while($row=mysql_fetch_assoc($rows))
    fputcsv($output,$row);
header("Location: /downloads/members_".date("m-d-Y").".csv");
exit;
?>

This just outputs the column names and I have never used fputcsv before and am a tad confused on what I am doing wrong. I get the file to download but not with the table in it.
[EDIT] I just tried it with a valid sql query and it does not work. updated code above. Also There is stuff in the members table.
Answer: Try this and read the comments carefully:
<?php
try {
    /**************************************
    * Create sqllite3 database and        *
    * open connections                    *
    * Coded by Mawia HL for SO Answer     *
    **************************************/ 
    // Create (connect to) SQLite database in file
    $file_db = new PDO('sqlite:messaging.sqlite3');
    // Set errormode to exceptions
    $file_db->setAttribute(PDO::ATTR_ERRMODE, 
                            PDO::ERRMODE_EXCEPTION);
    $file_db->query("CREATE TABLE IF NOT EXISTS `members` (
               member_id INTEGER PRIMARY KEY, 
               username TEXT, 
               password TEXT, 
               email TEXT, 
               active TEXT, 
               resetToken TEXT, 
               resetComplete TEXT, 
               support TEXT, 
               supportToken TEXT
            )");
     $insert = "INSERT INTO members (member_id, username, password, 
                  email,active,resetToken,resetComplete,support,supportToken) 
         VALUES ('1', 'John', 'john123', 'john@gmail.com','2','4757ghf',
                '657hfd','657hdhd','857tydhdn')";
     $file_db->query($insert);
}catch(PDOException $e) {
    // Print PDOException message
     echo $e->getMessage();
  }
function getRow($result) {
     return $result->fetch(PDO::FETCH_ASSOC);
}
if (isset($_POST['download'])) {
    $result = $file_db->query('SELECT * FROM members');
    header('Content-Type: text/csv');
    header('Content-Disposition: attachment;filename=yourcsv.csv');
    header('Cache-Control: no-cache, no-store, must-revalidate');
    header('Pragma: no-cache');
    header('Expires: 0');
    $csvoutput = fopen('php://output', 'w');
    $row = getRow($result);
    $headers = array_keys($row);//columns from db e.g, memberID','username',...
    fputcsv($csvoutput, $headers);
    fputcsv($csvoutput, $row);
    while ($row = getRow($result)) {
        fputcsv($csvoutput, $row);
    }
    fclose($csvoutput);
    exit;
   }
$listing = $file_db->query('SELECT * FROM members');
?>
<h1>Members Listing</h1>
    <?php while ($row = getRow($listing)) { ?>
    <h2><?php echo $row['member_id']; ?></h2>
    <ul>
        <li>Member Name: <?php echo $row['username']; ?></li>
        <li>Password: <?php echo $row['password']; ?></li>
        <li>Email: <?php echo $row['email']; ?></li>
        <li>Active: <?php echo $row['active']; ?></li>
    </ul>
   <hr>
    <?php } ?>
   <form method="post">
        <fieldset>
            <legend>Download Results in CSV Format</legend>
            <p>
                <input type="submit" name="download"
                    id="download" value="Download File">
            </p>
        </fieldset>
    </form>

Here is real-time demo with sqllite3 database. Uncomment the create database and insert statement in order to see the working demo. I am using sqllite3 because it is testable online. You can easily integrate it in mysql database or any other databases.

Namespaces in PHP

Introduction

PHP-ah hian Best Practice (Hmandan tunlai ber) tih hi sawi a awm ta fo mai a. Chutiang best practise huangah chuan NAMESPACES hi hmaih thiang lo khawp a pawimawh a ni a. Mawl te, zir tan te tana hriat fuh har ve fu si hi a ni a. Best practice han tih hian mithiam zawkte'na code dan kalphung tha bera an ngaih leh chin zui tlaka an ngaih an sawina ni berin kei chuan ka hria a. Thiam inti ve tak te chuan thenkhatin best practise an tih pawh kha best practise a ni lo ve thei tho bawk a ni. Namespaces an tih chu enge a nih a, kan hun leh tha, sum leh pai ngaihtuahin chin zui tlak a ni dawn em tih te, kan mamawh ve dawn em tih te i lo en dawn teh ang.

Definition

PHP.NET (php document inpui) ka thlir changa ka nin deuh mai chu an ziahna tawngkam vel hi a ni. Hriatthiam awl taka ziak ve mai ta lo hian technical em em hian an ziak thin a, ngeiawm ve mai mai! Mahse, PHP chungchang kan sawi dawn chuan kan rawn ber a ni lo thei si lo. Awle, PHP documentation-in Namespaces awmzia a hrilhfiah dan hi i lo en phawt teh ang.
What are namespaces? In the broadest definition namespaces are a way of encapsulating items. This can be seen as an abstract concept in many places. For example, in any operating system directories serve to group related files, and act as a namespace for the files within them. As a concrete example, the file foo.txt can exist in both directory /home/greg and in /home/other, but two copies of foo.txt cannot co-exist in the same directory. In addition, to access the foo.txt file outside of the /home/greg directory, we must prepend the directory name to the file name using the directory separator to get /home/greg/foo.txt. This same principle extends to namespaces in the programming world.

Mizo tawngin:Namespaces hi enge? Thil(code items) thliar hranna siamtu tiin huapzau awmzia kan neihtir thei a. Hei hi Programming kalkawng tinah mitthla tur a awm thei ang. Entirnan, OS hrang hrang (Windows, Macintosh, Linux, etc.) ah te hian directory(folder) hrang hrang kan nei thluah a, folder chhungah khan file kan nei leh thluah thei bawk a. Tichuan folder chhunga file te tan folder kha an namespaces a ni. A ruh langin lo sawi ta ila, file pakhat foo.txt chu /home/greg folder leh /home/other folder chhungah a awm ve ve a. /home/greg chhunga foo.txt hawng tur chuan /home/greg/foo.txt (a file hming a tawpa dahin) hmangin ka hawng thei a. Hetiang chiah hian programming khawvelah namespaces hi hman a ni ve bawk.

PHP Language-ah

PHP-ah chuan Namespaces hi Libraries leh Application siamtute'n hman nawn theih tura code elements: classes leh functions an siam laia buaina an tawh thin chinfel nana ruahman (designed) a ni.
  1. Kan code ziah-a hming in ang thliar hran nan. Third Party libraries leh function te khan kan function leh class hming ang chiahin function leh class hming an lo nei ve thei a. Midangin kan hming hman ang hmang mahse namespaces hmangin a thliar hranna awlsam tein kan siam thei tihna a ni.
  2. Class leh function hming sei pui pui tihtawina leh chhiar nuam zawka dahna a ni bawk.

Examples:

Entirna nen hian lo sawifiah ila a chiang zawk awm e:
function con( )
{ 
       echo ‘Connecting to Members’; 
}
A chunga mi ang hian function ka lo siam ta a, ka siam ang chiah hian library leh code dang ka hman te khan an lo siam ve theih avangin a pumpelh nan mahni phuahchawp liau liau namespace siamin function zz_db_connect(){ } tiin zz chu namespace leh db sub-namspace atan ka hmang ta a, hei hian hming in ang awm thei(name collisions) lakah ka code chu a humhim thei a ni. Mahse hei aia namespaces siam dan tha zawk kan nei thei a, chu chu kan thupui ber namespaces hi a ni. Code example tlem lo tarlang ve ila:
//index.php:
<?php
require_once ('func.php');
echo con();//Output: Connecting to Members
?>
A hnuaia mi ang hian func.php chu:
//func.php
<?php 
function con( )
{ 
       return 'Connetion to Members'; 
}
?>
A chunga code-ah hian index.php-ah func.php-a kan database connection chu kan lalut a. Hei hi namespaces-ah kan chantir dawn chuan a hnuaia mi ang hian tihtur a ni ang:
//func.php
<?php namespace ZZ\DB;
function con( )
{ 
       return 'Connetion to Members'; 
}
?>
tiin kan dah thei ang. Mahse index.php hi kan run chuan error a lo lang ngei ang. Chuvangin index.php-ah hian eng emaw kan thlak ve a ngai dawn a ni. Eng tak ni ang maw? Awle hetiang hian kan index.php chu kan thlak ve a ngai ang.
//index.php
<?php
require_once ('func.php');
echo ZZ\DB\con( );
?>
A chunga kan hmuh ang hian namespaces kan siam kha kan hman chhuahnaah pawh kan hman leh a ngai dawn tihna a ni. Mahse hei pawh hi function kan ngah chuan chhut ve zel a ngaih dawn avangin a lo tha tawk chuang lo. Entirnan, func.php-ah khan function query( ){ 'SELECT data'; } te hi lo neih belh leh ta ila, index.php-ah kan hman chhuah dawn chuan index.php chu a hnawk chho nghal ang:
//index.php:
<?php
require_once ('func.php');
echo ZZ\DB\con( );
echo ZZ\DB\query( );
?>
Kan hmuh ang hian ZZ\DB kan hman ve zel ngai lo hian index.php page-ah a chungber php(<?php) tag hnuaiah chiah khan namespace ZZ\DB; tiin namespace kan hawng thei a ang. Tichuan ZZ\DB hi hman nawn sek ngai lovin kan function(class pawh nise) an hming put ang ang khan kan hmang thei dawn a ni. Tichuan index.php thar chu:
//index.php
<?php
namespace ZZ\DB;
require_once ('func.php');
echo con( );
echo query( );
?>
Tih dan dang awm leh thei chu use keyword hman hi a ni. use keyword kan hman chuan a sub-namespace kha function-ah kan beitir zel a ngai thung ang. Entirnan:
//index.php:
<?php
require_once ('func.php');
use ZZ\DB;
echo DB\con( );
echo DB\query( );
?>
References:
  1. Namespaces in php
  2. Namespaces Overview
  3. Defining Namespaces

Saturday, 23 April 2016

printf() in PHP

Thil ziahchhuah (Text Output) nan echo() function leh print() function hi PHP-ah chuan hman tam ber a ni thin a. Mithiam zawk te chuan print aiin echo hi a performance tha zawkin an tarlang a. Tun tumah hian kan hman tam lutuk loh thilziah chhuah(text output)-na hmanraw changkang deuh zawk printf chungchang inthlahrung takin in sawi lang ve leh dawn teh ang.
printf () hi print format tihna a ni a, kan output tur format-na a ni. Entirna nen lo tarlang ila a chiang leh zual ngei ang:
E.g. 
printf("There are %d items in your basket", 3);

Example-a kan hmuh ang hian printf chuan argument pahnih a nei a. %d hi specifier an ti a, format-na hmanrua ber a ni a, Kan argument pahnihna `3` hi kan format tur string a ni. Argument hi Specifier kan neih ang zat zat kan nei thei bawk a ni. Specifier hrang hrang te chu:
  • % : % character
  • b : Binary integer-a dahna
  • c : ASCII character-a dahna
  • d : Signed decimal integer-a dahna
  • e : scientific notation-a dahna
  • f : floating-point-a dahna
  • o : octal number-a dahna
  • s : string-a dahna
  • u : unsigned decimal-a dahna
  • x : lowercase hexadecimal-a dahna
  • X : uppercase hexadecimal-a dahna
Argument leh specifier hi a inzat chhung chuan specifier hi duh zat zat neih theih a ni a, mahse % symbol hi a hmaah dah zel tur a ni. Entirnan:
E.g.
printf("My name is %s. I'm %d years old, which is %X in hexadecimal",'Sir Sama', 33, 33);
//Output: "My name is Sir Sama. I'm 33 years old, which is 21 in hexadecimal".
Warning: Argument pakhat lek pawh i hmaih chuan parse error a awm nghal ang a. ') was unexpected encountered' tih ang vel error a lo awm ang.
Hmanna dang:
1.
printf("<span style='color:#%X%X%X'>Hello</span>", 65, 127, 245);

Output: <span style='color:#417FF5'>Hello</span>

Hrilhfiahna: hetah hian color red=65, green=127, blue=245 chu hexadecimala convert buai ngai lovin printf hmangin awlsam zawkin kan convert thei a ni.
2.
printf("The result is: $%.2f", 123.42 / 12);

Output
: The result is $10.29
Hrilhfiahna
: Pawisa (currency) hi 2 digit precision nei vek tura ngaih a ni a, mahse calculation a tam chuan digit 3/4 te a ni chho mai thin a, chumi pumpelh nan chuan %.2f hmangin 2 digit chauh hmang turin kan siam thei a ni. Hei hi number_format() hmang pawhin tihtheih a ni tho bawk a ni.
3.
printf("The result is $%15f\n", 123.42 / 12);

output
: The result is $ 10.285000
Hrilhfiahna: %15f\n hian $ leh kan number inkarah 15 space a dah a ni.
Real World Example:
//id: integer, max width 10
//code: string max width 2
$records =$mysqli->query("SELECT id, code from country");

$divider=printf("+%-10s+%-13s+",'-','-');

$lines[]=$divider;

$lines[]=printf("|%10s|%13s|",'id','countryCode');
//header
$lines[]=$divider;

while($line=$records->fetch_assoc()) {
//store the formatted output
   
$lines[]=printf("| %10u | %2.2s |", $line['id'],$line['code']);

}
$table=implode("\n",$lines);
echo
$table;
Output:
+----+-------------+
| id | countryCode |
+----+-------------+
| 1 | ES |
| 2 | AN |
| 3 | AF |
| 4 | AX |
| 5 | AL |
| 6 | DZ |
| 7 | AS |
| 8 | AD |
| 9 | AO |
| 10 | AI |
+----+-------------+

Saturday, 2 April 2016

Stackoverflow hi ka inzirna hmun

Stackoverflow hi khawvela programmer zawhna leh chhanna community lian ber a ni a. An kalphung hi ho te a ni a. Mi tu pawhin awlsam tein a thlawnin an zawm thei a. Programming-a an harsatna te an zawt thei a, mi zawhna an chhang thei bawk a. Zawhna chu programming lam a nih ngei ngei a ngai a, code inziahsakna hmun a ni lo va, code dik lo leh bug in solve-sakna hmunpui a ni. Tam tak chuan mawl tak takin zawhna an zawt a, chutiang te chu zawtna zawt thei tawh lo tura block hmak hmak an ni bawk. Zawhna chhanna pawh sawifiahna tlem tal a tel loh chuan vote downa ni tlangpui thin. Zawhna tha leh chhanna tha chuan vote up an hlawh tlangpui bawk a ni.
Kan zawhna leh chhanna tang hian vote hmangin reputation point leh score te pek kan ni a, kan zawhna leh chhanna chu vote down a nih chuan kan point kan hloh ve zel thei bawk a ni. Kan reputation point bakah hian kan score atangin badge hrang hrang kan hlawh leh thei a. badge-ah rau rau pawh tag badge hlawhchhuah hi a awl ai lo hle a ni. Tag badge hi Bronze, Silver leh Gold-ah then hran a ni a, Bronze badge hlawh tur hian kan chhanna tag entirnan PHP-ah khan 100 tal kan score a ngai a ni. Hei hian a entir ber chu PHP language basic chu kan nal ve thawkhat tih a entir ber a ni. Silver badge kan hlawh chuan Intermediate level php Programmer vel kan ni tihna a ni leh ang a, Gold tag badge kan hlawh chuan PHP expert kan ni tihna a ni. Silver badge hlawh tur hian php tag-ah 400 tal score a ngai a, Gold badge hlawh tur hian 1000 tal kan score a ngai bawk a ni.
A chipchiar takin engkim ka sawi hman lo va (hetah hian lo bih la). Ka sawi duh ber zawk chu stackoverflow-ah hian kum 2 leh thla 9 member ka ni tawh a, eng eng emaw vangin ka active thei lo va, member ni reng chung siin member ni lo ang velin kum 2 chu ka hmang liam a, tun hnai thla hnih thum vel hian ka lu ve ta zeuh zeuh a. A bikin tun kar chho phei hi chuan ka awl tawh phawt chuan ka lut ve ta ziah a. He ta ka thil hmuhchhuah chuan nasa takin ka improve tih hi a ni. Zawhna chu ka zawt chiam lo va, mi zawhna ka chhang ber a. Member 4.7 million karah zawhna lo lut chhan inchuh chu a hau tak cher cher khawp mai. Kan chhanna an accept loh phei chuan eng reputation leh point mah kan hlawh chhuak (score) thei bawk si lo. Mahse hetiang zawng hian ka ngaihtuah a, pratice-na ni mai alawm. tiin. Mithiam pui pui kara chhanna lo pek ve chu a inthlahrunawm duh thin kher mai. Buaithlak leh bawk chu chhanna ka ziak tan ve dawn chauh a, mi pahnih pathumin an lo chhang hman zel thin hi a ni. Mahse tim hauh lovin inzir nan tiin ka chhang ve ta zel a. Tichuan hman ni khan unsung Hero (gold Bagde) ka hlawhchhuak ve ta a.

Stackoverflow hian dataquery an lo dah reng mai a: Chhanna ka pek atanga an lo accept dan average chu 34.% vel a ni. Stackoverflow-a points hmu sang ber leh ranking-a pakhatna ni mek Jonskeet chhanna acceptance % chu 60.42% a ni a. 60% pelh hi thil theih loh ang hialin sapho pawhin an sawi a ni.

Stackoverflow-a thil chhinchiahtlak tak mai an dah dang leh chu answer score graph hi a ni.
 Community pumpui kan chhanna that dan (effectiveness) lan tirtu ber chu average answer score hi a ni bawk a. Kei chuan ka la score chhe hle: Ka average score chu 1.05 tih vel chauh a la ni a, Jon Skeet ve thung chu 8.16 vel a ni, a san belh leh tawh mai thei bawk. He data hi a pawimawh hle, kan chhanna a that chuan kan score pawh a pung ve thin a. Miin kan zawhna an accept khan reputation chu point 15-in a pung ngei a, mahse score engmah kan nei lo va, mi dangin kan chhanna kha tha an tih a, an vote up chauh khan score kan nei a ni. Chuvangin Answer pakhat zela 1.05 vel score pawh hi hau tak tak chu a ni. Chhan uluk a ngai a nih ber chu.
A chunga ka sawi bak pawh hi data query atang khan zirchian zel theih a ni a. A pawimawh ber chu mi zawhna kan chhan khan kan hriatna kan tuaithar leh zel tihna a ni a. Chhang dik turin keimahni pawh kan inzir belh ve zel a ngai bawk a ni. Programming eng pawh i tui a nih chuan stackoverflow-a awm hi thil tihmakmawh a ni. Stackoverflow hian reputation 200 (reputation hi point 200 aia tam ni khatah hlawh theih a ni lo) chuang nei chin atangin ranking a siam a, tuna member 5,396,014 atanga ka ranking chu 53277 a ni a. Hmabak a la ko hle mai.

Eng language-ah pawh expert nih i duh chuan Gold Badge hlawhchhuah tum la, i hlawh chhuak thei ngat a nih chuan expert i tihna a ni ang. Reputation tih vel hi chu a hming mai a ni a,  1000 i score theih chuan nasa takin i problem solving skill pawh i improve ngei ang. Stackoverflow site kalphung hi a fel fai hle a, vote abuse vel pawh thiltheih loh a ni a. Entirnan account pathum pali pawh nei la, i ip address leh i voting kalphung hmangin mi pakhat angin i awm reng tho ang. A tir chuan ka awih chiah lo va, reputation abuse tumin account dang te kan hawng vel chhin a, vote ka han inpe sang sang a, a hnu rei lo teah chuan he message hi ka dawng nawlh mai a: This account is temporarily suspended for voting irregularities. The suspension period ends in 7 days. Fake vote chu an paih nghal vek bawk a ni.
My account is suspended due to fake votes
Hei vang hian ni 7 ral hma chu min zawhna pawh ka chhang thei tawh lova, midang zawhna ka chhan tawh, comment hmanga kan inhrilhfiah mek te, zawhna ka chhan theihna te, mi ka vote-up theihna te chu ni 7 chhung tan hman theih lohvin a awm ta hmiah mai a, ka reputation pawh 1-ah lock a ni bawk. Fake vote chu an man thiam khawp mai, khawl dang leh ip dang atang pawh ti mah ila an man nghal chat chat thei a ni. Mahse an fair ve leh na em em chu zawhna kan chhan atanga vote dik tak kan hmuh chu paih a ni dawn lo, tih moderator te'n chat atangin min hrilh a, ka experiment-na a ni a, ka fake reputation kha chu paih vek ula, a ngaiin min kaltir leh rawh u, ka tih pawhin a theih loh thu leh ni 7 hnuah chauh a ngaia ka kal theih tur thu min hrilh a, tun hnua hetiang thil a thleng leh a nih chuan i account pawh remove hial a ni ang tih thlengin min hrilh ta mai a ni. Stackoverflow fair zia chu a takin ka hmu ta a ni.