Skip to content

Instantly share code, notes, and snippets.

How not to rm yourself

Copied from https://github.com/sindresorhus/guides/blob/master/how-not-to-rm-yourself.md

The rm command is inherently dangerous and should not be used directly. It can at worst let you accidentally remove everything. Here's how you can protect you from yourself.

Use trash

The trash command-line tool will move stuff to the trash instead of permanently deleting it. You should not alias rm to trash as it will break external scripts relaying on the behavior of rm. Instead use it directly: trash image.jpg.

@airlsyn
airlsyn / Activate_Windows_11_Pro_free.md
Created December 31, 2023 11:35 — forked from kimgiftww/Activate_Windows_11_Pro_free.md
Activate Windows 11 Pro free

An guide how to activate Windows 11 Pro for free

Why?

Because you will get some more features like an Bitlocker and host your device as an External Desktop which can be accessed through the internet

Am i also able to switch from any other edition to Pro?

The answer is yes! You can switch from almost any edition to Pro completely for free!

Note for users with unactivated Pro edition

People which already have Pro, but not activated, can skip to this step.

Getting started

What you first need to do is open CMD (Command Prompt) as Administrator using this keyboard key:

Reinforcement Learning for Language Models

Yoav Goldberg, April 2023.

Why RL?

With the release of the ChatGPT model and followup large language models (LLMs), there was a lot of discussion of the importance of "RLHF training", that is, "reinforcement learning from human feedback". I was puzzled for a while as to why RL (Reinforcement Learning) is better than learning from demonstrations (a.k.a supervised learning) for training language models. Shouldn't learning from demonstrations (or, in language model terminology "instruction fine tuning", learning to immitate human written answers) be sufficient? I came up with a theoretical argument that was somewhat convincing. But I came to realize there is an additional argumment which not only supports the case of RL training, but also requires it, in particular for models like ChatGPT. This additional argument is spelled out in (the first half of) a talk by John Schulman from OpenAI. This post pretty much

@airlsyn
airlsyn / Install_gcc7_ubuntu_16.04.md
Created May 18, 2020 13:40 — forked from jlblancoc/Install_gcc7_ubuntu_16.04.md
Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial

Run the following in the terminal:

Install the gcc-7 packages:

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y

Set it up so the symbolic links gcc, g++ point to the newer version:

@airlsyn
airlsyn / environment-pyinstaller-osx-compatibility.md
Created April 29, 2020 09:34 — forked from phfaist/environment-pyinstaller-osx-compatibility.md
Create mac binaries with pyinstaller that are backwards-compatible on Mac OS X

Make mac binaries with pyinstaller that are backwards-compatible on Mac OS X

Here are some instructions to freeze Python applications that are compatible with versions of OS X earlier than the one that PyInstaller is used on.

These steps involve compiling and installing Python, PyQt5 etc. manually. Surprisingly, on my 2016 MacBook, it didn't take too long to set up. The basic idea is that Apple's LLVM/clang compiler can produce binaries that are

// derived from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
function map() {
emit(1, // Or put a GROUP BY key here
{sum: this.value, // the field you want stats for
min: this.value,
max: this.value,
count:1,
diff: 0, // M2,n: sum((val-mean)^2)
});
@airlsyn
airlsyn / sso.js
Created February 27, 2013 10:33 — forked from Homlean/sso.js
/**
* ssologin.js
*/
function SSOController() {
var me = this; // use in private function
var updateCookieTimer = null;
var updateCookieTimeHardLimit = 1800; // 在该时间内不允许更新cookie,默认30分钟
var cookieExpireTimeLength = 3600 * 24; // cookie过期时间为24小时
var crossDomainForward = null ; // 广播操作完成后执行的动作