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 -w | |
use strict; | |
use warnings; | |
use IO::Socket; | |
use Data::Dumper; | |
my $socket = IO::Socket::INET->new( | |
Proto => 'tcp', | |
Type => SOCK_STREAM |
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
Index: Classes/TibarModule.m | |
=================================================================== | |
--- Classes/TibarModule.m (revision 17) | |
+++ Classes/TibarModule.m (working copy) | |
@@ -257,6 +257,36 @@ | |
[pickerCancelCallback retain]; | |
} | |
+ // overlay view | |
+ if ([args objectForKey:@"overlay"] != nil) |
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
if (Ti.Platform.name == "android") { | |
var speechModule = require('org.mumumu.ti.android.speech'); | |
var voiceRecognitionProxy = speechModule.createVoiceRecognition(); | |
voiceRecognitionProxy.callback = function (e) { | |
var voice_recognition_enabled = e.voice_enabled; | |
var voice_results = e.voice_results; | |
if (e.voice_canceled) { | |
alert("voice recognition canceled"); | |
} else { | |
if (!voice_recognition_enabled) { |
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
//Add behavior for UI | |
label.addEventListener('click', function(e) { | |
var intent = Ti.Android.createIntent({ | |
action: "android.speech.action.RECOGNIZE_SPEECH" | |
}); | |
intent.putExtra("android.speech.extra.LANGUAGE_MODEL", "free_form"); | |
intent.putExtra("android.speech.extra.PROMPT","VoiceRecognitionTest"); | |
//intent発行&音声認識結果受け取り | |
Ti.Android.currentActivity.startActivityForResult( | |
intent, |
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 com.example.ini; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.Set; | |
import java.util.prefs.BackingStoreException; | |
import java.util.prefs.Preferences; | |
import org.ini4j.Ini; | |
import org.ini4j.IniPreferences; |
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.StringWriter; | |
import org.apache.velocity.VelocityContext; | |
import org.apache.velocity.Template; | |
import org.apache.velocity.app.Velocity; | |
import org.apache.velocity.exception.ResourceNotFoundException; | |
import org.apache.velocity.exception.ParseErrorException; | |
import org.apache.velocity.exception.MethodInvocationException; | |
import java.util.Vector; | |
/** |
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
#!/bin/sh | |
export LANG=C | |
testURLContentsChange() | |
{ | |
sysctl xen.independent_wallclock=1 | |
TEST_URL="http://www.example.com/" | |
TODAY_START_DATE=`date +'%Y-%m-%d 00:00:00'` |
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
#include <stdio.h> | |
/* | |
* int を2進表記にして出力する | |
* int を 32bit と仮定している | |
*/ | |
int binary(int num) | |
{ | |
// | |
// - 以下のルーチンでint の範囲に収まる値は扱うことができるが |
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
#include <stdio.h> | |
/* | |
* param の num 乗を出力する関数(二進累乗法の実装) | |
* | |
* TODO: オーバーフロー/アンダーフローのチェックをしていない | |
* TODO: num が負の時に対応していない | |
*/ | |
static void power(double param, long long int num) | |
{ |
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
/** | |
* 標準入力を1文字ずつ受け取り、それらを繋ぎ合わせて | |
* 整数として出力するプログラム 実行例は以下のとおり。 | |
* | |
* $ gcc convert_stdin_tointeger.c -o input2int | |
* $ ./input2int | |
* input one number (space to exit):- <= 最初の桁は + と - の入力可(数値でもよい) | |
* input one number (space to exit):1 | |
* input one number (space to exit):2 | |
* input one number (space to exit): <= input space |