Skip to content

Instantly share code, notes, and snippets.

import dgl
from dgl import DGLGraph
import torch
from dgl import DropEdge
def drop_edges_in_blocks(blocks, drop_prob=0.2):
new_blocks = []
for block in blocks:
kept_edges = {}
@penglin03
penglin03 / claude_3.5_sonnet_artifacts.xml
Created September 27, 2024 20:15 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt
<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times
###### Java
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=/Users/plin/Opt/apache-maven-3.5.2/bin:$PATH
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
alias j8="export JAVA_HOME=`/usr/libexec/java_home -v 1.8`; java -version"
alias j10="export JAVA_HOME=`/usr/libexec/java_home -v 10`; java -version"
###### Scala
@penglin03
penglin03 / latexmkrc
Last active September 9, 2018 22:13
.latexmkrc
### .latexmkrc starts
# $pdf_previewer = 'open -a Skim';
# $pdflatex = "xelatex -synctex=1 -interaction=nonstopmode";
$pdf_mode = 1;
$preview_continuous_mode = 1;
$pdf_update_method = 0;
$clean_ext = "synctex.gz acn acr alg aux bbl bcf blg brf fdb_latexmk glg glo gls idx ilg ind ist lof log lot out run.xml toc dvi";
# @generated_exts = (@generated_exts, 'synctex.gz');
rsync -chavzP --stats /path/to/source /path/to/target
$pdf_previewer = "open -a Skim"
http://mg.readthedocs.io/latexmk.html
((latex-mode
(TeX-master . "paper")))
## Wget Example
Download *.jpg files from https://example.com/XXX/YYY and its subdirectories to
the current directory, with USERNAME and PASSWORD if required.
```bash
$ wget -r -A .jpg -nd -np -c --user=USERNAME --password=PASSWORD https://example.com/XXX/YYY
```
"-r", recursive. Download recursively to search subdirectories.
[alias]
co = checkout
br = branch
ci = commit
st = status
df = diff
# Show verbose output about tags, branches or remotes
tags = tag -l
brs = branch -a
remotes = remote -v
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GF'
alias ll='ls -GFl'
alias lh='ls -GFlh'