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 | |
# make matrix with numpy | |
A = np.matrix('[6, 1; 2, 3]') | |
# applying matrix.itemset() method | |
A.itemset((1, 0), 5) | |
print(A) | |
[[6, 1] | |
[5, 3]] |
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
apk add inotify-tools |
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
$(document).on('change', 'input', function(){ | |
var options = $('datalist')[0].options; | |
var val = $(this).val(); | |
for (var i=0;i<options.length;i++){ | |
if (options[i].value === val) { | |
alert(val); | |
break; | |
} | |
} | |
}); |
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
## Customer Functions for manipulating screen cursor from awk | |
function CURSOR_CLS() {printf "\033[2J"} #Clear full screen and move cursor to 0,0 | |
function CURSOR_ERASE() {printf "\033[K"} #Clear current line | |
function CURSOR_SAVE() {printf "\033[s"} #Save cursor position | |
function CURSOR_RESTORE() {printf "\033[u"} #Restore cursor position back to last save | |
function CURSOR_SET(LINE,COLUMN) {printf "\033["LINE";"COLUMN"H"} #Set cursor to row,column position | |
function CURSOR_UP(NUM) {printf "\033["NUM"A"} #Move cursor up x rows | |
function CURSOR_DOWN(NUM) {printf "\033["NUM"B"} #Move cursor downn x rows | |
function CURSOR_RIGHT(NUM) {printf "\033["NUM"C"} #Move cursor right x columns | |
function CURSOR_LEFT(NUM) {printf "\033["NUM"D"} #Move cursor left x columns |
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 apt install gnome-shell-extensions-gpaste |
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
def toto(*a): | |
print a | |
for i in range(len(a)): | |
print a[i] | |
toto('x', 'y', 'z', 't') | |
('x', 'y', 'z', 't') | |
x | |
y | |
z |
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
DB::table('user')->whereIn('id', [100,200])->get(); | |
$users = User::whereIn('id', array(1, 2, 3))->get(); |
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 | |
// Include the database configuration file | |
include_once 'dbconfig.php'; | |
// Get current page URL | |
$protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; | |
$user_current_url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . $_SERVER['QUERY_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
redirection(){ | |
window.location.href="yourpagedomain/login" | |
} |