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
/** | |
* 部分オブジェクトを取り出す。 | |
* @param {string[]} keys 抜き出すキーの配列 | |
* @param {Record<string, any>} obj 元のオブジェクト | |
* @returns {Record<string, any>} 指定されたキーのオブジェクトを返す(値は共有している) | |
*/ | |
function getPartialObject(keys, obj) { | |
return (Object.entries(obj) | |
.filter(([key]) => keys.includes(key)) | |
.reduce((obj, [key, value]) => { |
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
<Window x:Class="StudyDotNet.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:StudyDotNet" | |
xmlns:vm="clr-namespace:StudyDotNet.ViewModels" | |
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" | |
xmlns:tr="clr-namespace:StudyDotNet.Triggers" | |
mc:Ignorable="d" |
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
<Window x:Class="BindDataGridColumnVisibility.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:BindDataGridColumnVisibility" | |
mc:Ignorable="d" | |
Title="MainWindow" Height="376" Width="634" WindowState="Maximized"> | |
<Grid> | |
<Grid.Resources> |
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
// NAME | |
// | |
// jquery_plugin_class - javascriptのクラスをjQueryプラグインとして登録する | |
// | |
// DESCRIPTION | |
// | |
// クラス名を指定して呼び出せば、そのクラスをjQueryプラグインとして登録します。 | |
// クラスのコンストラクタは、グローバルスコープの関数でないといけません。 | |
// コンストラクタの第1引数には関連するDOM要素が渡されます。 | |
// |
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> | |
#include <unistd.h> | |
#include <stdarg.h> | |
#include <signal.h> | |
#include <syslog.h> | |
static int daemonized = 0; /* daemonized flag */ | |
int daemonize( | |
const char* pidfilepath, |
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
cmake_minimum_required(VERSION 2.8) | |
project(hogehoge) | |
add_executable(hoge hoge.c) | |
if(CMAKE_GENERATOR MATCHES "MinGW") | |
target_link_libraries(hoge foo bar) | |
else() | |
target_link_libraries(hoge foo) | |
endif() |
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
# vim: set fileencoding=utf-8 : | |
import sys | |
import numpy as np | |
import cv2 | |
from naoqi import ALProxy | |
if(len(sys.argv) <= 2): | |
print "parameter error" | |
print "python " + sys.argv[0] + " <ipaddr> <port>" | |
sys.exit() |
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
<?php | |
if(count($argv) != 2) { | |
exit; | |
} | |
$executable_suffixies = array("cmd", "bat", "dll", "exe"); | |
$filename = $argv[1]; | |
$no_suffix = !has_suffix($filename, $executable_suffixies); | |
$pathes = preg_split('/;/', getenv('PATH')); | |
foreach( $pathes as $path ) { | |
echo_file_exists("$path\\$filename"); |
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
$.fn.uitext = function() { | |
this.addClass("ui-spinner-input") | |
.css({'margin-right':'.4em'}) | |
.appendTo( | |
$('<span/>') | |
.addClass("ui-spinner") | |
.addClass("ui-widget") | |
.addClass("ui-widget-content") | |
.addClass("ui-corner-all") | |
.insertBefore(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
<?php | |
/** | |
* e-mail address specification. | |
* | |
* http://blog.livedoor.jp/dankogai/archives/51189905.html | |
* | |
* RFC-2822 3.4.1 Addr-spec specification | |
* https://www.ietf.org/rfc/rfc2822.txt | |
*/ | |
class RFC2822_AddrSpec { |
NewerOlder