This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Installtion | |
pip install django | |
Create Project | |
django-admin startproject home | |
Run server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
localization issue | |
http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue | |
installation php 5.6 | |
http://stackoverflow.com/questions/40567133/cannot-add-ppa-ppaondrej-php5-5-6 | |
add-apt-repository ppa:ondrej/php | |
apt-get update | |
apt-get install -y php5.6 php5.6-mcrypt php5.6-mbstring php5.6-curl php5.6-cli php5.6-mysql php5.6-gd php5.6-intl php5.6-xsl php5.6-zip libapache2-mod-php5.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
problem: | |
Problem 1 | |
- The requested PHP extension ext-gd * is missing from your system. Install or enable PHP's gd extension. | |
Problem 2 | |
- The requested PHP extension ext-curl * is missing from your system. Install or enable PHP's curl extension. | |
Problem 3 | |
- Installation request for braintree/braintree_php 2.39.0 -> satisfiable by braintree/braintree_php[2.39.0]. | |
- braintree/braintree_php 2.39.0 requires ext-curl * -> the requested PHP extension curl is missing from your system. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In Python "re" module is used to write regular expression. | |
What are various methods of Regular Expressions? | |
Most commonly used regular expressions are as follows: | |
1. re.match(pattern, string) | |
2. re.search(pattern, string) | |
3. re.findall(pattern, string) | |
4. re.split(pattern, string, [maxsplit=0]) | |
5. re.sub(pattern, repl, string) | |
6. re.compile(pattern, repl, string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Suppose we have following situation | |
$('#dom1').remove(); | |
$('#dom2').remove(); | |
$('#dom3').remove(); | |
$('#dom4').remove(); | |
So, we can write unit test as follows: | |
this.removeStub = sinon.stub($.fn, 'remove'); | |
it('Should remove dom', function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# Manual construction of arrays | |
# one dimension array | |
a = np.array([0,1,2,3]) | |
print(a) | |
print ('dimension', a.ndim) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array[start:end:step] # start through not past end, by step | |
start: the beginning index of the slice, it will include the element at this index unless it is the same as end, defaults to 0, i.e. the first index. | |
If it's negative, it means to start n items from the end. | |
end: the ending index of the slice, it does not include the element at this index, | |
defaults to length of the sequence being sliced, that is, up to and including the end. | |
step: the amount by which the index increases, defaults to 1. If it's negative, you're slicing over the iterable in reverse. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To Show installed versions | |
nvm ls | |
# Set 6.1.0 (or another version) as default | |
nvm alias default 6.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Link: | |
https://www.microsoft.com/net/core#macos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Let’s create a new virtual envirnoment, named myenv, using pyvenv: | |
pyvenv myenv3 | |
source myenv3/bin/activate | |
and you can start Python 3 by just typing: | |
$ python | |
Note that as you are inside the virtual environment, you don’t need to use the command python3 to open Python 3. |