To see the current default directory . Run this. It will open Explorer in the default directory. $ explorer . Goto GitBash shortcut and right click and select properties. Change the 'Start In' field accordingly. And also remove --cd-to-home from Target location field
This error is encountered when we are going to do addition with different types of variables. See following example $a = ""; $b = 3; try{ $c = $a + $b; }catch(\Exception $e){ var_dump($e->getMessage()); } Exception is occurred. Error is " A non-numeric value encountered " There are two solutions Solution 1 Change the value of variable $a into zero (0). So, both variables are getting the same type of value now. $a = 0; $b = 3; try{ $c = $a + $b; echo $c; }catch(\Exception $e){ var_dump($e->getMessage()); } Solution 2 You can simply cast $a when doing addition $a = ""; $b = 3; try{ $c = (int) $a + $b; echo $c; }catch(\Exception $e){ var_dump($e->getMessage()); } Enjoy..
Following regular expression will validate emails. var re = /^ [ A-Z0-9a-z \. _+ ] +@ [ A-Za-z0-9 \. - ] + \.([ A-Za-z ]{2,4}) $/ ; re . test ( value ); We will discuss above regular expression part by part. Examples - part1@part2.part3 1. abcd+ef@bbb.com 2. cccc_efg@bbb.lk 3. cccc.efg@bbb.net ^ ==> Start of the expression Part1 [ A-Z0-9a-z \. _+ ] + ==> There can be many of A-Z upper case characters, a-z lower case characters, 0-9 numbers, dots and plus signs. @ ==> There must be @ sign after first part of the email Part2 [ A-Za-z0-9 \. - ] + ==> After @ sign there can be same kind of character sets as part 1 (part 2 of email) \. ==> There must be dot character before 3rd part of the email. It should be properly escaped. That is why we use backslash (\) Part3 ([ A-Za-z ]{2,4}) ==> There are must be two to four characters({2,4})including A-Z upper case characters or a-z lower case characters. Curly brackets specify the range of characters. So, 2 is minimum num
Usage 1 SELECT CONCAT("This ", "is ", "test ", "concatenation") AS testConcatenation; Syntax concat(exp1, exp2, exp3, ..) - exp1 is required Usage 2 Concat table field and text together SELECT CONCAT(NAME, " is creted at ", created_at, " ") AS Address FROM province; Enjoy...
LOAD DATA INFILE "C:/Users/USER/Desktop/test.csv" INTO TABLE test COLUMNS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES; Change the file name accordingly. There may be some issues. 1. SQL Error (1290): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement You need to add LOCAL modifier LOAD DATA statement. Otherwise the following error occurred. So it looks as follows. LOAD DATA LOCAL INFILE "C:/Users/USER/Desktop/test.csv" INTO TABLE test COLUMNS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES; 2. Even if we add LOCAL modifier, there will be another issue as follows. SQL Error (3948): Loading local data is disabled; this must be enabled on both the client and server sides. 3. So you need to enable following SET @ @GLOBAL .local
Sometimes you modified files in a branch and you need to switch current branch into different branch without committing them. You need to stash them first. $ git checkout develop error: Your local changes to the following files would be overwritten ... Run git stash save, or just plain git stash which is short for save $ git stash save Those are safely stored in the repository. After switch branch and you want will apply them. $ git checkout develop Switched to branch 'develop' $ git stash apply If it is successful you need to delete references to the commits. $ git stash drop But if you apply option does a merge stashed changes. $ git stash apply There may be merge conflicts. All went successfully you can drop stash $ git stash drop git stash pop is short-hand for git stash apply && git stash drop