This file contains hidden or 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
select username as schema_name | |
from sys.all_users | |
order by username; |
This file contains hidden or 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
select count(*) | |
from all_tab_columns | |
where owner = 'SOME_USER' --put yours | |
and table_name = 'SOME_TABLE'; --put yours in upper case. lower(table_name) for lower case | |
/* | |
e.g. | |
select count(*) | |
from all_tab_columns | |
where owner = 'IRIRPT' |
This file contains hidden or 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
DESCRIBE YourTableHere; |
This file contains hidden or 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
//You specify an array of item in the argument | |
function random_item(items) { | |
return items[Math.floor(Math.random()*items.length)]; | |
}; |
This file contains hidden or 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
//The follwoing will work | |
var nums = [1, 2, 3] | |
Math.min.apply(Math, nums) // 1 | |
Math.max.apply(Math, nums) // 3 | |
Math.min.apply(null, nums) // 1 | |
Math.max.apply(null, nums) // 3 | |
//This doesn't work | |
var nums = [1, 2, 3] | |
Math.min(nums) // NaN |
This file contains hidden or 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
def autolabel(rects, xpos='center'): | |
""" | |
Attach a text label above each bar in *rects*, displaying its height. | |
*xpos* indicates which side to place the text w.r.t. the center of | |
the bar. It can be one of the following {'center', 'right', 'left'}. | |
""" | |
xpos = xpos.lower() # normalize the case of the parameter | |
ha = {'center': 'center', 'right': 'left', 'left': 'right'} |
This file contains hidden or 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
#Refer to the documentaions for details -> https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/ | |
#Mac | |
python3 -m venv env | |
source env/bin/activate | |
#Windows | |
python -m venv env | |
.\env\Scripts\activate |
This file contains hidden or 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
#Do when your virtual environment is active | |
#source env/bin/activate | |
#pip install YOURPACKAGE | |
pip freeze > requirements.txt #Write installed pip packages to a text tile | |
pip install -r requirement.txt #install all packages in requirement.txt |
This file contains hidden or 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
// Toggle between terminal and editor focus | |
{ "key": "ctrl+`", "command": "workbench.action.terminal.focus"}, | |
{ "key": "ctrl+`", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus"} | |
This file contains hidden or 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 | |
def trimmean(arr, percent): | |
n = len(arr) | |
k = int(round(n*(float(percent)/100)/2)) | |
return np.mean(arr[k+1:n-k]) |
OlderNewer