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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.cloudfoundry.samples</groupId> | |
<artifactId>hello-java</artifactId> | |
<version>1.0</version> | |
<packaging>war</packaging> | |
<dependencies> | |
<dependency> |
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
else if (expression.indexOf("=>") == -1) | |
{ | |
return new Function("$,$$,$$$,$$$$", "return " + expression).bind(Enumerable); | |
} | |
else | |
{ | |
var expr = expression.match(/^[(\s]*([^()]*?)[)\s]*=>(.*)/); | |
return new Function(expr[1], "return " + expr[2]); | |
} |
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
$sh = new-object -com shell.application | |
$path = $args[0] | |
$targetfolder = Split-Path $path -parent | |
$zipFile = [System.IO.Path]::ChangeExtension($path,".zip") | |
Copy-Item $path $zipFile | |
$sh.namespace($zipFile).ParseName("xl\media\") | % { $sh.namespace($targetfolder).copyhere($_.Path) } | |
Remove-Item $zipFile | |
Join-Path $targetfolder "media" | Invoke-Item |
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 static class DistanceCalc | |
{ | |
/// <summary> | |
/// 長半径(赤道半径) at WGS84 (GPS) | |
/// </summary> | |
private const double equationalRaius = 6378137.000; | |
/// <summary> | |
/// 短半径(極半径) at WGS84 (GPS) | |
/// </summary> | |
private const double polarRadius = 6356752.314245; |
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"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>BindableProperty を定義します</Title> | |
<Shortcut>propb</Shortcut> | |
<Description>DependencyProperty をバッキング ストアとして使用するプロパティのコード スニペット</Description> | |
<Author>Microsoft Corporation</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> |
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 ColorViewModel | |
{ | |
public ColorViewModel(string text, Color color) | |
{ | |
this.Text = text; | |
this.Color = color; | |
this.ColorBrush = new SolidColorBrush(color); | |
} | |
public string Text { get; set; } | |
public Color Color { get; set; } |
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
protected async override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState) | |
{ | |
var cli = await Client.ConnectClient(); | |
var user = await cli.GetMe(); | |
var quota = await cli.GetStorageQuota(); | |
userText.Text = user.Name != null ? string.Format("ようこそ{0}さん", user.Name) : "ようこそ"; | |
quotaText.Text = string.Format("{0}%使用中({1} bytes中{2} 使用可能)", | |
((int)(quota.AvailableBytes / quota.QuotaBytes) * 100), | |
quota.QuotaBytes, quota.AvailableBytes); | |
} |
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 static class StringExtention | |
{ | |
public static string LeftB(this string s, Encoding encoding, int maxByteCount) | |
{ | |
var bytes = encoding.GetBytes(s); | |
if (bytes.Length <= maxByteCount) return s; | |
var result = s.Substring(0, | |
encoding.GetString(bytes, 0, maxByteCount).Length); | |
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
static Task RunProcess(ProcessStartInfo psi) | |
{ | |
var tcs = new TaskCompletionSource<bool>(); | |
var process = new Process | |
{ | |
StartInfo = psi, | |
EnableRaisingEvents = true | |
}; | |
process.ErrorDataReceived += (s, e) => tcs.SetException(new Exception("err")); | |
process.Exited += (sender, args) => tcs.SetResult(true); |
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
yum -y install flex bison openssl-devel rpm-build gcc pam-devel | |
wget http://mmonit.com/monit/dist/monit-5.5.tar.gz | |
tar zxvf monit-5.5.tar.gz | |
mkdir -p /root/rpmbuild/SOURCES | |
cp monit-5.5.tar.gz /root/rpmbuild/SOURCES/monit-5.5.tar.gz | |
cd monit-5.5 | |
rpmbuild -bb --clean contrib/packages/redhat/monit.spec | |
rpm -ivh /root/rpmbuild/RPMS/x86_64/monit-5.5-1.x86_64.rpm |
OlderNewer