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
Before Installation | |
========================= | |
#To generate graph in png format, | |
#Install following dependent packages | |
sudo apt-get install libpng-dev | |
sudo apt-get install libfreetype6-dev | |
#TkAgg for the TkInter windowing system | |
sudo apt-get install tcl-dev tk-dev python-tk python3-tk |
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
RED: RGB(169,68,66), #a94442 | |
BLUE: RGB(10,40,72), #0A2848 |
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
var express = require("express") | |
var app = express() | |
app.locals.global_value = 0; | |
app.get("/",function(req,res){ | |
app.locals.global_value += 1; | |
res.send("<h3>Welcome!</h3>. You have visitied this page: "+app.locals.global_value+" times."); | |
}) | |
app.get("*",function(req,res){ | |
res.send("You are nowhere! Please click on this <a href=\"/\">link</a> to go to homepage."); | |
}) |
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
<?php | |
$server = "localhost"; | |
$db_username = "root"; | |
$db_password = ""; | |
$db_name = "learn_project_db"; | |
$conn = new PDO("mysql:host=$server;dbname=$db_name",$db_username,$db_password); | |
$sql_query = "SELECT * FROM wrong_user_table"; | |
$stmt = $conn->prepare($sql_query); | |
$stmt->execute(); | |
$result_set = $stmt->fetchAll(); |
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
#sudo pip3 install copyusb | |
import copyusb | |
a = copyusb.copy() | |
print(a) |
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
<?php | |
require("./amazon-sdk/sdk.class.php"); | |
// on ubuntu - this script can be run using php5-cli and php5-curl | |
//Provide the Key and Secret keys from amazon here. | |
$AWS_KEY = "kkk"; | |
$AWS_SECRET_KEY = "kkkk+xKcdkB"; | |
//certificate_authority true means will read CA of amazon sdk and false means will read CA of OS | |
$CA = true; |
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
python 2.7 + django 1.11 in Ubuntu 16.04 (LTS) | |
================================================ | |
# Install Python Package Installer (PIP) | |
sudo apt-get install python-pip | |
# Upgrade PIP | |
sudo -H pip install --upgrade pip | |
# Install IDLE | |
sudo apt-get install idle |
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 collections | |
d={ | |
"Apple": 5, | |
"Banana": 95, | |
"Orange": 2, | |
"Mango": 7 | |
} | |
# sorted the dictionary by value using OrderedDict | |
od = collections.OrderedDict(sorted(d.items(), key=lambda x:x[1])) | |
print(od) |
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
_=lambda:list(map(int,input().split())) | |
x,y=_() |
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
$('body > :not(#d_content_inner)').hide(); //hide all nodes directly under the body | |
$('#d_content_inner').appendTo('body'); |