This file contains 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
INCLUDE Irvine32.inc | |
.data | |
text DWORD 100 DUP(0), 0 ;text[100], init to 0 | |
.code | |
main PROC | |
mov esi, 0 ;int i = 0 | |
L1: | |
call ReadInt ;scanf("%d", &test[i]) |
This file contains 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
INCLUDE Irvine32.inc | |
.data | |
text DWORD 10 DUP(?) | |
.code | |
main PROC | |
mov esi, 0 | |
L1: |
This file contains 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
TITLE Reversing a String | |
INCLUDE Irvine32.inc | |
.data | |
buffer BYTE 100 DUP(0) | |
byteCount DWORD ? | |
.code | |
main PROC |
This file contains 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/ruby -w | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
$KCODE = 'u' | |
(50..67).each do |count| | |
html = open("http://whoswho.openfoundry.org/workshop/details/#{count}") rescue "404 Not Found" |
This file contains 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/ruby | |
require 'net/http' | |
require 'uri' | |
if ARGV.length < 1 then | |
puts "Usage: ./paste2plurk.rb [filename] ... " | |
exit | |
end | |
def get_language (filename) |
This file contains 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
// copyed from "iPhone Developer's Cookbook", Addison-Wesley 2009 | |
#import <UIKit/UIKit.h> | |
@interface HelloWorldViewController : UIViewController | |
@end | |
@implementation HelloWorldViewController | |
- (void) loadView | |
{ |
This file contains 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
<% uuid = (rand * 1e10).floor %> | |
<script type="text/javascript"> | |
var timer; | |
var elapsed; | |
function update_progress() { | |
elapsed += 1; | |
jQuery.ajax({ | |
type: "GET", | |
url: "/progress", | |
dataType: "json", |
This file contains 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
/* 引入 Win32 API 中的 User32.DLL | |
* 需要加上 using System.Runtime.InteropServices; | |
*/ | |
[DllImport("user32.dll")] | |
public static extern Boolean GetWindowRect(IntPtr hWnd, ref Rectangle bounds); | |
public void CaptureWindow () { | |
/* 取得目標視窗的 Handle | |
* 需要加上 using System.Diagnostics; | |
*/ |
This file contains 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
#include <security/pam_modules.h> | |
#include <security/pam_appl.h> | |
#include <sys/types.h> | |
#include <gcrypt.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <time.h> | |
#define SERVER_SECRET "MY_SECRET" | |
void gen_otp (char **otp) { |
This file contains 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
class Sobel | |
require 'RMagick' | |
include Magick | |
@@kernels = { | |
:up => [1, 2, 1, 0, 0, 0, -1, -2, -1], | |
:down => [-1, -2, -1, 0, 0, 0, 1, 2, 1], | |
:left => [1, 0, -1, 2, 0, -2, 1, 0, -1], | |
:right => [-1, 0, 1, -2, 0, 2, -1, 0, 1] | |
} |
OlderNewer