Read Excel file in Pandas
import pandas as pd
excel_file = 'movies.xls' movies = pd.read_excel(excel_file)
movies_sheet1 = pd.read_excel(excel_file, sheetname=0, index_col=0)
import pandas as pd
excel_file = 'movies.xls' movies = pd.read_excel(excel_file)
movies_sheet1 = pd.read_excel(excel_file, sheetname=0, index_col=0)
window.scroll({ top: 100, left: 100, behavior: 'smooth' });
var elmnt = document.getElementById("content"); elmnt.scrollIntoView();
var elmnt = document.getElementById("myDIV"); var x = elmnt.scrollLeft; var y = elmnt.scrollTop;
References
https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll
https://www.w3schools.com/jsref/met_element_scrollintoview.asp
https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
https://www.w3schools.com/jsref/prop_element_scrolltop.asp
https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop
<textarea #someVar id="tasknote" name="tasknote" [(ngModel)]="taskNote" placeholder="{{ notePlaceholder }}" style="background-color: pink" (blur)="updateNote() ; noteEditMode = false " (click)="noteEditMode = false"> {{ todo.note }} </textarea>
import {ElementRef,Renderer2} from '@angular/core'; @ViewChild('someVar') el:ElementRef; constructor(private rd: Renderer2) {} ngAfterViewInit() { console.log(this.rd); this.el.nativeElement.focus(); // we can access it after ngAfterViewInit }
References
https://stackoverflow.com/questions/38944725/how-to-get-dom-element-in-angular-2
If you deleted a few files and you have not made a commit yet, Revert will work just fine. Selecting TortoiseGit -> Revert… will display a window for you to select the files you want restored. Deleted files will show in red.
If you already committed the delete, then you can Reset to a commit before you deleted the files. Be warned that if you use reset, you will no longer see in your log the commit(s) after the commit you reset to.
If you want to preserve in your log the commit that deleted the files, you can Checkout the commit before the delete into a new branch, copy the restored files into a separate folder, switch back to your original branch, then add the files back to your original branch.
References
https://stackoverflow.com/questions/1335644/tortoisegit-revert
We want to listen for scroll events using addEventListener
. We’ll set a delayed timeout function to run a few milliseconds after the event, but with each scroll event we’ll clear that timeout function so it doesn’t run.
When scrolling has stopped, the delayed function doesn’t get cleared and runs.
// Setup isScrolling variable var isScrolling; // Listen for scroll events window.addEventListener('scroll', function ( event ) { // Clear our timeout throughout the scroll window.clearTimeout( isScrolling ); // Set a timeout to run after scrolling ends isScrolling = setTimeout(function() { // Run the callback console.log( 'Scrolling has stopped.' ); }, 66); }, false);
References
https://gomakethings.com/detecting-when-a-visitor-has-stopped-scrolling-with-vanilla-javascript/
pkill openvpn
p.title.text = title p.title_location = "above"
References
http://docs.bokeh.org/en/1.3.2/docs/user_guide/styling.html#title
p = figure(width=300, height=300, x_axis_label='Initial xlabel') p.xaxis.axis_label = 'New xlabel'
References
https://stackoverflow.com/questions/24131501/x-and-y-axis-labels-for-bokeh-figure
set FLASK_APP=app.py set FLASK_ENV=development REM set FLASK_ENV=production set FLASK_DEBUG=TRUE venv\Scripts\python.exe -m flask run --host=0.0.0.0 --port=14002
References
https://flask.palletsprojects.com/en/1.1.x/quickstart/
https://flask.palletsprojects.com/en/1.0.x/cli/
https://flask.palletsprojects.com/en/1.1.x/config/
https://stackoverflow.com/questions/29882642/how-to-run-a-flask-application
p.sizing_mode = "scale_both"
References
https://docs.bokeh.org/en/latest/docs/user_guide/layout.html#sizing-mode