Skip to content

Instantly share code, notes, and snippets.

@tueda
tueda / x
Last active May 21, 2024 01:56
Running a development version of FORM. #bin #sh #launcher #dev #form
#!/bin/bash
#
# Usage:
# ./x [update]
# [4.1.0|4.2.0|4.2.1|4.3.0|4.3.1]
# [check|time [-n <times>]]
# [coverage|gprof|valgrind [<valgrind options>]|helgrind|drd|sanitize]
# [form|vorm|tform|tvorm|parform|parvorm]
# [args...]
#
@hyuki
hyuki / chat.md
Created March 17, 2023 01:12
ChatGPT と結城浩の対話(矛盾や反復を含んだ対話によってAIと人間の識別は行えるか)

こんにちは。今後、GPT-4を使ったアプリケーションやサービスがたくさん登場してくると思います。その中には、たとえばSNSを利用したbotもたくさん出てくるでしょう(現在でもすでにありますけれど)。そこで質問なんですが、SNSでおしゃべりしている相手が、人間なのか、GPT-4などの技術を使ったAIなのかを識別するにはどのような会話をしてみればいいでしょうか。一般的なAIでは難しいかもしれないので、GPT-4に限ってもいいです。あなたの考えを聞かせてください。

GPT-4のような高度なAIと人間を識別するのは、時に難しいことがあります。しかし、いくつかの方法を試してみることで、相手が人間かAIかを見極めることができるかもしれません。

  1. 複雑な感情やニュアンスについて尋ねる: AIは感情やニュアンスを理解するのが苦手です。複雑な感情を表現する文章やシチュエーションについて尋ねてみて、その反応を見てください。
@tueda
tueda / tetris.py
Last active April 1, 2024 03:15
A simple tetris-ish game in Python with the curses library. #python #game #curses
# テトリスもどき(Replitのコンソールで動作する)
# 左/右/下: 移動
# (半角)スペース: 回転
import curses
import random
import time
def main(stdscr):
@mattn
mattn / README.md
Last active February 8, 2024 04:58
blacklist/whitelist master/slave に関する情報集め

blacklist/whitelist master/slave に関する情報集め

blacklist/whitelist、master/slave という単語は相応しくないという意見に OSS がどの様に対応すべきかを自身で考える為の情報集めです。見つけ次第、逐次更新していきます。

僕(mattn) 自身は black lives matter に同意をしています。blacklist/whitelist、master/slave という単語を廃止する事が、歴史的背景を持たない文化圏では特定の意味を持たなかった為、個人的には若干思う所はありますが、廃止自身に反対するつもりはありません。

昔から、主副を表す物には master/slave という単語が使われてきました。ハードディスクの IDE、仮想端末(pty)、色々あります。またネットワークの IP フィルタリングに関しては blacklist/whitelist と表記した物が今でも沢山あります。

我々日本人が意識せずに使っていた blacklist/whitelist、master/slave という単語が、人々にどの様に影響しうるのか、今後 OSS としてどの様に関わっていけば良いかを理解する上で、自分なりの情報集めをしたいと思っています。

@mbinna
mbinna / effective_modern_cmake.md
Last active May 21, 2024 08:25
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@averagesecurityguy
averagesecurityguy / pdf_flatedecode.py
Last active April 20, 2024 17:56
Decompress FlateDecode Objects in PDF
#!/usr/bin/env python3
# This script is designed to do one thing and one thing only. It will find each
# of the FlateDecode streams in a PDF document using a regular expression,
# unzip them, and print out the unzipped data. You can do the same in any
# programming language you choose.
#
# This is NOT a generic PDF decoder, if you need a generic PDF decoder, please
# take a look at pdf-parser by Didier Stevens, which is included in Kali linux.
# https://tools.kali.org/forensics/pdf-parser.
#
@ahendrix
ahendrix / gist:7030300
Created October 17, 2013 18:56
bash stacktrace
function errexit() {
local err=$?
set +o xtrace
local code="${1:-1}"
echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err"
# Print out the stack trace described by $function_stack
if [ ${#FUNCNAME[@]} -gt 2 ]
then
echo "Call tree:"
for ((i=1;i<${#FUNCNAME[@]}-1;i++))