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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>test page</title> | |
</head> | |
<body> | |
<p id="test1" name="test">test1</p> | |
<p id="test2" name="test">test2</p> | |
<p id="test3" name="test">test3</p> | |
<p id="test4" name="test">test4</p> |
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 AsyncAccess | |
{ | |
public IObservable<string> requestHttpGET(string url) | |
{ | |
var request = WebRequest.Create(url); | |
return Observable.FromAsyncPattern<WebResponse>( | |
request.BeginGetResponse, request.EndGetResponse) | |
.Invoke() | |
.Select(resp => |
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
[TestClass] | |
public class AsyncAccessTest : SilverlightTest | |
{ | |
[TestMethod, Asynchronous] | |
public void Test_AsyncHTTPGET_Success() | |
{ | |
var accesser = new AsyncAccess(); | |
accesser | |
.requestHttpGET("http://www.google.co.jp"). | |
ObserveOnTest(this). |
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; | |
using System.Linq; | |
using Microsoft.Build.Utilities; | |
using Microsoft.SmartDevice.Connectivity; | |
using System.Threading; | |
using System.Globalization; | |
using System.IO; | |
using Microsoft.Build.Framework; | |
namespace MyMsBuildTask |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<Project DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" > | |
<UsingTask TaskName="MyMsBuildTask.RunWP7UnitTestsInEmulator" | |
AssemblyFile="MyMsBuildTask.dll"/> | |
<PropertyGroup> | |
<SourceFilesPath>$(MSBuildProjectDirectory)</SourceFilesPath> | |
</PropertyGroup> |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<Project DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" > | |
<UsingTask TaskName="MyMsBuildTask.RunWP7UnitTestsInEmulator" | |
AssemblyFile="MyMsBuildTask.dll"/> | |
<PropertyGroup> | |
<SourceFilesPath>$(MSBuildProjectDirectory)</SourceFilesPath> | |
</PropertyGroup> |
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
#! ruby | |
class DUP | |
def initialize(name, age) | |
@name = name | |
@age = age | |
end | |
attr_accessor :name,:age | |
end | |
def make_random_picker(dup) |
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
val makeRandomChooser = (shops : List[Shop]) => { | |
val sortedList = shops.sort(_.likely > _.likely) | |
var likeSum = 0.0 | |
sortedList.foreach(likeSum += _.likely) | |
val targetList = sortedList.map{tem => new Shop(0, tem.name, tem.likely / likeSum)} | |
println(targetList) | |
sortedList.foreach(likeSum += _.likely) | |
def choosen (targetList : List[Shop], likeSum : Double) = { |
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
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_sudo); | |
SQLiteDatabase userDB = SQLiteDatabase.openOrCreateDatabase( | |
"/data/data/com.facebook.katana/databases/users_db2", null); | |
Cursor cursor = userDB.query(Scheme.TABLE, Scheme.COLUMNSS, null, null, | |
null, null, null, null); | |
cursor.moveToFirst(); |
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 interface Outputalbe { | |
public String output(); | |
} |