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
bool num_check(char c){ | |
return c == '0' || c == '1' || c == '2' || c == '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9'; | |
} |
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 <stdio.h> | |
void change(int *numA, int *numB){ | |
int temp; | |
temp = *numB; | |
*numB = *numA; | |
*numA = temp; | |
} | |
// | |
//メインの実装 |
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
/** 画面に表示するMapView */ | |
transient MapView mapView; | |
/** 地図のコントローラー */ | |
transient MapController mapController; | |
/** 現在位置を表示するオーバーレイ */ | |
transient NowLocationOverlay locationOverlay; | |
/** Activity生成時により呼び出されるメソッド。地図の初期化なんかを行う。 */ | |
@Override | |
public void onCreate(final Bundle sIState) { |
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
public class ConvininenceSearchActivity extends ActionBarActivity { | |
/** デバッグ用タグ */ | |
private static final String LOGTAG = ConvininenceSearchActivity.class | |
.getSimpleName(); | |
/** Yahoo!Map SDK のID */ | |
private static final String YOLP_ID = ""; | |
/** LastKnowLocationで得られる情報の古さの限界。5分 */ | |
private static final long LAST_KNOWN_MIN = 5 * 60 * 1000L; | |
/** 位置情報の更新間隔。60秒に1回更新 */ | |
private static final int MIN_TIME = 60 * 1000; |
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 Program | |
{ | |
static void Main(string[] args) | |
{ | |
loopCall(10, nTimes(5)); | |
} | |
static void loopCall(int max, Func<int, int> func) | |
{ | |
for (int i = 1; i < max+1; 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
void main() { | |
var start_day = new Date(2012,8,3,0,0,0,0); | |
var one_week_ago = new Date(2012,8,10,0,0,0,0); | |
var diff = one_week_ago.difference(start_day); | |
print(diff.inDays);//7 | |
var difference = difference(start_day, one_week_ago); | |
print(difference);//5 |
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
'指定したURLからファイルをダウンロードする. | |
'srctUrl : ダウンロード先のURL | |
'distFilename : ダウンロード先のファイルパス | |
'postBody : 中身 | |
'返り値 : 成功すればtrue | |
Function requestHttpPost(srcUrl As String, distFilepath As String, postBody As String) As Boolean | |
Dim i As Long, bLength As Long 'ループカウンター,バイト長 | |
Dim fileNum As Integer '保存先ファイルのファイル番号 | |
Dim responseBody As String 'レスポンスの中身 | |
Dim timByte() As Byte '一次バイト保存先 |
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
var geoWatcher = new GeoCoordinateWatcher(); | |
Observable.FromEvent<GeoPositionChangedEventArgs<GeoCoordinate>>(geoWatcher, "PositionChanged"). | |
ObserveOnDispatcher(). | |
Select(ev => ev.EventArgs.Position.Location). | |
Take(1). | |
Subscribe(location => Debug.WriteLine(location.Longitude.ToString()), () => { Debug.WriteLine("completed"); geoWatcher.Stop(); }); | |
geoWatcher.Start(); |
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
var geoWatcher = new GeoCoordinateWatcher(); | |
Observable.FromEvent<GeoPositionChangedEventArgs<GeoCoordinate>>(geoWatcher, "PositionChanged").ObserveOnDispatcher() | |
//位置情報だけクレ | |
.Select(ev => ev.EventArgs.Position.Location) | |
//場所が変わると呼ばれる | |
.Subscribe(location => { | |
//位置情報を使って何かやる | |
onLocationChanged(location); | |
//一回だけで良いわ |
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
using System.Linq; | |
using Newtonsoft.Json.Linq; | |
using System.Diagnostics; | |
namespace ConflimJsonParser | |
{ | |
public class MyParser | |
{ | |
private string json = "省略"; |
OlderNewer