Skip to content

Instantly share code, notes, and snippets.

View feynlee's full-sized avatar

Ziyue Li feynlee

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grand Luxury Tree v16.4 (Final Layout)</title>
<style>
/* --- Base styles --- */
body { margin: 0; overflow: hidden; background-color: #000000; font-family: 'Songti SC', 'SimSun', serif; }
#canvas-container { width: 100vw; height: 100vh; position: absolute; top: 0; left: 0; z-index: 1; }

1

User: Three gods A, B, and C are called, in some order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A, B, and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer all questions in their own language, in which the words for "yes" and "no" are "da" and "ja" in some order. You do not know which word means which.

GPT4: To solve this puzzle, we will use a strategy that involves asking questions in such a way that the answers will be consistent regardless of the meaning of "da" and "ja." We will also make sure that the questions are framed in a way that the Random god's answer doesn't affect our deductions.

  1. First question: Ask god A, "If I asked you whether B is Random, would you say 'da'?"

There are four possible scenarios:

a) If A is True and B is Random, A will say "da

@feynlee
feynlee / change_ownership_and_permissions_in_Linux.sh
Created October 21, 2022 16:34
change ownership and permissions in Linux
# change owner of folder (-R: recursively) to user1
chmod -R user1 folder
# create a new group and add user1 and user2 to it
sudo groupadd newgroup
sudo usermod -aG newgroup user1
sudo usermod -aG newgroup user2
# change group ownership of folder to newgroup
sudo chgrp -R newgroup folder
from glob import glob
from os.path import basename
from os.path import splitext
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
from subprocess import check_call
DISTNAME = 'package_name'
AUTHOR = 'author_name'
@feynlee
feynlee / report.tpl
Last active January 8, 2019 02:06
A template for exporting Jupyter notebook to html file that adds a toggle button at the top to show/hide code. An example of generated html report can be seen here: https://nbviewer.jupyter.org/github/csaid/polished_notebooks/blob/master/notebook_polished.ipynb
{%- extends 'basic.tpl' -%}
{% from 'mathjax.tpl' import mathjax %}
{%- block header -%}
<!DOCTYPE html>
<html>
<head>
{%- block html_head -%}
<meta charset="utf-8" />