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
| #import <UIKit/UIKit.h> | |
| @interface MyTextView : UITextView | |
| - (void)replaceSelectionWithAttributedText:(NSAttributedString *)text; | |
| - (void)replaceRange:(NSRange)range withAttributedText:(NSAttributedString *)text; | |
| @end |
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
| #import <Foundation/Foundation.h> | |
| #import <objc/runtime.h> | |
| @interface NSUndoManager (Logging) | |
| @end | |
| @implementation NSUndoManager (Logging) | |
| + (void)load |
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
| CLASS_NAME = MyObject | |
| OBJS = main.o $(CLASS_NAME).o $(CLASS_NAME)Tests.o | |
| PROGRAM = a.out | |
| CFLAGS = -Wall -F$(FWPATH) | |
| LIBS = -F$(FWPATH) -framework XCTest -framework Foundation | |
| FWPATH = /Applications/Xcode.app/Contents/Developer/Library/Frameworks | |
| XCTEST = /Applications/Xcode.app/Contents/Developer/usr/bin/xctest |
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
| import junit.framework.TestCase; | |
| public class MyTest extends TestCase { | |
| private int a, b; | |
| @Override | |
| public void setUp() { | |
| a = 1; | |
| b = 2; | |
| } |
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/perl | |
| use strict; | |
| use Fcntl ':mode'; | |
| use File::stat 'stat'; | |
| use Net::SFTP::Foreign; | |
| my $HOST = 'user@example.com'; | |
| my $PASS = '********'; | |
| my $MORE = [ -o => 'StrictHostKeyChecking no' ]; |
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
| Webプログラミング入門 | |
| 1. ネットワークプログラミングの基礎 | |
| 講義 | |
| - ネットワークの論理構成 | |
| - ホスト名とIPアドレス | |
| - TCP/UDPとポート番号 | |
| - プロトコル、ステートフルとステートレス | |
| 演習 | |
| 簡単なチャットプログラム |
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
| import java.io.*; | |
| import java.net.*; | |
| /** | |
| * ちょーかんたんなサーバー。 | |
| */ | |
| public class Server { | |
| /** | |
| * ポート番号。 | |
| */ |
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
| module.exports = function (session) { | |
| var Store = session.Store; | |
| function MyMemoryStore(options) { | |
| Store.call(this, options || {}); | |
| this.debug = options && options.debug; | |
| this.sessions = {}; | |
| } | |
| MyMemoryStore.prototype.__proto__ = Store.prototype; |
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
| var express = require('express'); | |
| var cgi = require('./cgi'); | |
| app = express(); | |
| var script = __dirname + '/hello.cgi'; | |
| app.get('/', cgi(script, function (req, options) { | |
| options.env.USERNAME = 'Mr. User'; | |
| })); | |
| app.use(function (err, req, res, next) { |
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
| package main | |
| import ( | |
| "net/http" | |
| "strings" | |
| ) | |
| var CustomTypeMap = map[string]string{ | |
| "text/x-java-source": "text/plain", | |
| } |
OlderNewer