- There are three types of permissions in files and folders in unix
- Read (r)
- Write (w)
- Execute (x)
- And, there is a classification of users called UGO (explained bellow):
- U ~> User (usually, you)
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 streamlit as st | |
from persist import persist, load_widget_state | |
def main(): | |
if "page" not in st.session_state: | |
# Initialize session state. | |
st.session_state.update({ | |
# Default page. | |
"page": "home", |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
"""Hack to add per-session state to Streamlit. | |
Usage | |
----- | |
>>> import SessionState | |
>>> | |
>>> session_state = SessionState.get(user_name='', favorite_color='black') | |
>>> session_state.user_name | |
'' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from cgi import FieldStorage | |
from io import BytesIO | |
def parse_into_field_storage(fp, ctype, clength): | |
fs = FieldStorage( | |
fp=fp, | |
environ={'REQUEST_METHOD': 'POST'}, | |
headers={ | |
'content-type': ctype, |
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 | |
from statsmodels.robust.scale import huber | |
# Mean and standard deviation to generate normal random variates | |
mean, std_dev = 0, 2 | |
sample_size = 25 | |
np.random.seed(42) | |
x = np.random.normal(mean, std_dev, sample_size) | |
# Appends a couple of outliers |
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
using Castle.MicroKernel.Registration; | |
using Castle.MicroKernel.SubSystems.Configuration; | |
using Castle.Windsor; | |
using MyApp.BusinessLogic.Facades; | |
namespace MyApp.Web.PresentationLogic.Container | |
{ | |
public class BusinessLogicInstaller : IWindsorInstaller | |
{ | |
public void Install(IWindsorContainer container, IConfigurationStore store) |
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
// knockout 2.2.1 | |
ko.utils.arrayFilter = function (array, predicate) { /* .. */ } | |
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ } | |
ko.utils.arrayForEach = function (array, action) { /* .. */ } | |
ko.utils.arrayGetDistinctValues = function (array) { /* .. */ } |
NewerOlder