- 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 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 | |
| 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 |
Download the package form Robo3t or using wget
wget https://download.robomongo.org/1.2.1/linux/robo3t-1.2.1-linux-x86_64-3e50a65.tar.gz
tar -xvzf robo3t-1.2.1-linux-x86_64-3e50a65.tar.gz
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
| version: '3.8' | |
| services: | |
| # Database - Mongo DB | |
| mongo: | |
| image: mongo | |
| environment: | |
| MONGO_INITDB_ROOT_USERNAME: helpdev | |
| MONGO_INITDB_ROOT_PASSWORD: 123456 |
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
| function logClass(target: any) { | |
| // save a reference to the original constructor | |
| var original = target; | |
| // a utility function to generate instances of a class | |
| function construct(constructor, args) { | |
| var c : any = function () { | |
| return constructor.apply(this, args); | |
| } |
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 openai | |
| import streamlit as st | |
| from streamlit_chat import message | |
| from dotenv import load_dotenv | |
| import os | |
| from langchain.embeddings.openai import OpenAIEmbeddings | |
| from langchain.vectorstores import Chroma | |
| import openai | |
| from langchain.document_loaders import UnstructuredMarkdownLoader | |
| from langchain.chains.question_answering import load_qa_chain |
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
| #[test] | |
| fn iter_demo() { | |
| let v1 = vec![1, 2, 3]; | |
| let mut v1_iter = v1.iter(); | |
| // iter() returns an iterator of slices. | |
| assert_eq!(v1_iter.next(), Some(&1)); | |
| assert_eq!(v1_iter.next(), Some(&2)); | |
| assert_eq!(v1_iter.next(), Some(&3)); | |
| assert_eq!(v1_iter.next(), None); |
Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:
project-root/
├── cmd/
│ ├── your-app-name/
│ │ ├── main.go # Application entry point
│ │ └── ... # Other application-specific files
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
| from boto3.session import Session | |
| from botocore.auth import SigV4Auth | |
| from botocore.awsrequest import AWSRequest | |
| from botocore.credentials import Credentials | |
| from http.client import HTTPConnection, HTTPSConnection | |
| import json | |
| import os | |
| from urllib.parse import urlparse | |
| def sigv4_request( |
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
| from collections import defaultdict | |
| def reciprocal_rank_fusion(*list_of_list_ranks_system, K=60): | |
| """ | |
| Fuse rank from multiple IR systems using Reciprocal Rank Fusion. | |
| Args: | |
| * list_of_list_ranks_system: Ranked results from different IR system. | |
| K (int): A constant used in the RRF formula (default is 60). | |