Skip to content

Instantly share code, notes, and snippets.

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
try:
from keras_applications import resnext
except:
resnext = None
from tensorflow.python.keras.applications import keras_modules_injection

Eloquent Javascript by Marijn Haverbeke

  • Tree structure with document.documentElement serving as root.
    • Element nodes representing HTML tags e.g. document.body
    • Leaf nodes such as pieces of text or comment nodes.
    • Each node has nodeType property - Node.ELEMENT_NODE, Node.TEXT_NODE, Node.COMMENT_NODE
    • Element node has childNodes also firstChild, lastChild, previousSibling, nextSibling, parentNode
    • Finding elements
      1. getElementsByTagName
      2. getElementById
  1. getElementsByClassName
// ==UserScript==
// @name Kite rename instrument name
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://kite.zerodha.com/*
// @grant none
// ==/UserScript==

Language of data

  • way of organizing data as vectors, matrices.
  • perform computations on them.

Vectors

  1. ordered list of numbers X = [2, 3]
  2. an arrow (geometrical)
  3. Dimensionality - 2D
  4. Length = $\sqrt{2 ^ 2 + 3 ^ 2}$ = sqrt(13). Denoted as ||x||
@mkmohangb
mkmohangb / torch.md
Last active September 14, 2023 06:02

Tensors

Construction

There are a few main ways to create a tensor, depending on your use case.

  • To create a tensor with pre-existing data, use torch.tensor(). Constructs a tensor with no autograd history(leaf tensor) by copying data.
    • Letting t be a tensor, torch.tensor(t) is equivalent to t.clone().detach()
  • To create a tensor with specific size, use torch.* tensor creation ops (see Creation Ops).
  • To create a tensor with the same size (and similar types) as another tensor, use torch.*_like tensor creation ops (see Creation Ops).
  • To create a tensor with similar type but different size as another tensor, use tensor.new_* creation ops.

Components

  1. Models
  2. Prompts
  3. Indexes
  4. Chains
  5. Agents

Debug

import langchain

Complete JS course - Udemy

  • console.table
  • debugger (will launch debugger at current line)

Eloquent Javascript by Marijn Haverbeke

3rd Edition

Introduction

  • The art of programming is the skill of controlling complexity.
# https://towardsdatascience.com/different-ways-to-connect-google-drive-to-a-google-colab-notebook-pt-1-de03433d2f7a
from pydrive.auth import GoogleAuth
from google.colab import drive
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials
auth.authenticate_user()
gauth = GoogleAuth()
  1. Rugged Landscapes - strategy framework 1997

image

Companies navigate the mountain by changing their coordinates on the X and Z competitive axis. However, a market is not a single mountain to climb, it is a rugged landscape.

image