This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print (x for x in [0..9999] when Math.floor(x/1000) + Math.floor(x/100%10) == Math.floor(x/10%10) - x % 10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun celsius-to-fahrenheit (number) | |
"Celsius to fahrenheit" | |
(interactive "nCelsius:") | |
(let ((fahrenheit (+ (* number (/ 9.0 5.0)) 32.0))) | |
(message "Fahrenheit:%f" fahrenheit))) | |
(defun fahrenheit-to-celsius (number) | |
"Fahrenheit to celsius" | |
(interactive "nFahrenheit:") | |
(let ((celsius (* (- number 32.0) (/ 5.0 9.0)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print "Merry Xmas" | |
print "".join(["\n" if x==20 and y<8 else " " if (x<10-y or x>10+y) else "*" for y in range(0,9) for x in range(0, 21)]) | |
print " ****\n" * 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print ''.join(map(lambda x:(10-x)*' '+(x*2+1)*'*'+('\n' if x < 8 else ''), range(0,9))); print (' ' * 9 + '*' * 3 + '\n') * 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Merry Xmas' displayNl | |
(0 to: 9) do: [:x| (0 to: (9 - x)) do: [:y| ' ' display]. (0 to: (x * 2)) do: [:y| '*' display]. '' displayNl] | |
(0 to: 3) do: [:x| (0 to: 8) do: [:y| ' ' display]. (0 to: 2) do: [:y| '*' display]. '' displayNl] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun osstatus (number) | |
"Convert osstatus" | |
(interactive "nOSStatus:") | |
(let* ((a (logand (lsh number -24) 255)) | |
(b (logand (lsh number -16) 255)) | |
(c (logand (lsh number -8) 255)) | |
(d (logand (lsh number 0) 255))) | |
(message (format "Output: %c%c%c%c" a b c d))) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
create_wifi = u''' | |
property CreateMenuName : "Create Network…" | |
property NetworkName : "%s" | |
tell application "System Events" | |
tell process "SystemUIServer" | |
tell menu bar 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *test1() | |
{ | |
char chr[17] = "abcdabcdabcdabcd"; | |
char output[33]; | |
for (int i = 0; i < 16; i++) { | |
sprintf((char *)(output + i * 2), "%02x", chr[i]); | |
} | |
return [NSString stringWithUTF8String:output]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/> | |
<script src="http://cmx.io/v/0.1/cmx.js"></script> | |
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style> | |
<body> | |
<div style="max-width:900px; -webkit-transform:rotate(0deg);"> | |
<scene id="scene1"> | |
<label t="translate(0,346)"> |