Adsense
Popular Posts
- Amazon web serive
- MySQL workbench -"Could not decrypt password cache"
- git svn conversion
- increase mysql query speed
- Unix Utils and wget in Windows
- add comment to table columns in phpMyAdmin
- Special characters pronunciation link
- deposit cheque in TD bank using Mobile phone
- Setup vi syntax for PHP
- Get WAMP running on EC2
Wednesday, January 28, 2015
Post large array in PHP
To post large array in PHP, we need to modify max_input_nesting_level and max_input_vars inphp.ini, such as
max_input_nesting_level = 128
; How many GET/POST/COOKIE input variables may be accepted
max_input_vars = 5000
Saturday, January 17, 2015
underscore (-) and dollars sign ($) in Javascript variables and functions
underscore (-) and dollars sign ($) in Javascript variables are the same as other characters such as letters and number. For example _$.area is the as as other JS variables course123, c3 etc.
For dollars sign ($) in Javascript function may have special meaning, for example $() in jQuery represnets to call jQuery library. _() in Underscore.js call underscorelibrary.
Thursday, January 15, 2015
Latex: text wrap in multirow in tables
In latex, if we have a very long text in multirow in tables need to be wraped
\multicolumn{1}{|l|}{\multirow{2}{*}{ Very long text Very long text Very long text}} &
We can add {\parbox{7cm}} as below, where 7cm is the text length begin to wrap
\multicolumn{1}{|l|}{\multirow{2}{*}{\parbox{7cm}{Very long text Very long text Very long text }}} &
Thursday, January 8, 2015
Reset PHPMyAdmin
To reset PHPMyAdmin in Linux:
- Stop the MySQL server
sudo service mysql stop - Start mysqld
sudo mysqld --skip-grant-tables & - Login to MySQL as root
mysql -u root mysql - Change MYSECRET with your new root password
UPDATE user SET Password=PASSWORD('MYSECRET') WHERE User='root'; FLUSH PRIVILEGES; exit; - Kill mysqld
sudo pkill mysqld - Start mysql
sudo service mysql start - Login to phpmyadmin as root with your new password
C:\xampp_php5.4\phpMyAdmin\config.inc.php
Wednesday, January 7, 2015
Import large sql file in XAMPP
There is a limitation to import a sql file in PHPMyAdmin, default around 2 MB. You can increase the limit by changing php.ini. But it still depends on memory limit.
For example, I have MySQL dump file around 100 MB.To import this huge file to database, first go to mysql.exe installation directory in command prompt (assuming xampp installed in C:\xampp_php5.4) :
cd C:\xampp_php5.4\mysql\bin\
mysql -u root
type following commands assuming tracs.sql is in C:/tracs.sql
mysql> create database tracs;
mysql> use tracs;
mysql> source C:/tracs.sql;
Sort PHP associate array by element value
For example, I have PHP associate array parents as following:
$parents = array();
$parents[]=array("tp_journal_id"=> "1000", "tp_parent_journal_id"=> NULL, "Code_Id"=> "2",
"Rank_id"=> "0", "Stakeholder_Id"=>$instructor, "Tp_Categories_Id"=> NULL,
"Courses_Offered_Has_Stakeholder_Id"=> NULL, "Courses_Offered_Id"=> NULL, "StartTerm"=>"1161",
"EndTerm"=> "1161", "Transaction"=> NULL, "CourseReleaseValue"=> "0" ,
"StudyLeaveValue"=>"1", "JournalEntries"=> "", "Status"=>"Active", "code_id"=>"2",
"CodeAbb"=>"T", "Code"=>"Teaching", "Category"=> NULL, "tp_categories_id"=> NULL,
"InstructorOverload"=> NULL, "sort"=>"1161" );
$parents[] =array("tp_journal_id"=> "1000", "tp_parent_journal_id"=> NULL, "Code_Id"=> "1",
"Rank_id"=> "0", "Stakeholder_Id"=>$instructor, "Tp_Categories_Id"=> NULL,
"Courses_Offered_Has_Stakeholder_Id"=> NULL, "Courses_Offered_Id"=> NULL, "StartTerm"=>"1154",
"EndTerm"=> "1154", "Transaction"=> NULL, "CourseReleaseValue"=> "0" ,
"StudyLeaveValue"=>"0", "JournalEntries"=> "", "Status"=>"Active", "code_id"=>"1",
"CodeAbb"=>"R", "Code"=>"Research", "Category"=> NULL, "tp_categories_id"=> NULL,
"InstructorOverload"=> NULL, "sort"=>"1154" );
I want to sort array based on element StartTerm, PHP function usort can be used:
usort($parents, function($a, $b) {
return $a['StartTerm'] - $b['StartTerm'];
});
Tuesday, January 6, 2015
Using two CSS box shadow in one element
I have one CSS box shadow (inner line shadow red color in right side of inner box)
box-shadow: inset -10px 0 5px -5px hsla(0,100%,50%,0.5);
Another CSS box shadow (inner line shadow yellow in left side of inner box)
box-shadow: inset 10px 0 5px -5px hsla(30,40%,50%,1.5);
To combine these two shadows in one element, add comma and remove one of box-shadow:
box-shadow: inset 10px 0 5px -5px hsla(30,40%,50%,1.5), inset -10px 0 5px -5px hsla(0,100%,50%,0.5);
Subscribe to:
Posts (Atom)