Skip to content

Instantly share code, notes, and snippets.

@kiichi54321
kiichi54321 / test_extend.cs
Created October 10, 2018 07:10
Testプロジェクト用、拡張メソッド
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace MyLib.Test.Extend
{
public static class TestExtend
{
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>RelayCommand</Title>
<Author>kiichi</Author>
<Description>Creates and initializes a new RelayCommand with an Execute lambda. (V5.2.4.0)</Description>
@kiichi54321
kiichi54321 / fetch_contain_words.rb
Last active September 20, 2017 10:56
文章から、言葉のリストに含まれている言葉を探す
def fetch_contain_words(text, word_list, head_size = 2)
word_hash = word_list.group_by{|item| item[0,head_size]}.map{|key,list| [key,list.sort_by{|i| i.size * -1}]}.to_h
word_positon_list = []
# textをhead_sizeずつ、とりだして、なめる
index = 0
text.chars.each_cons(head_size) do |items|
head = items.join
if word_hash.key?(head)
word_positon_list << { words: word_hash[head], positon:index}
end
@kiichi54321
kiichi54321 / gist:86e7c8d36aa624ed5edf
Created July 10, 2015 10:02
レイソル掲示板用Rawler
<ReportStock DoSave="False" FileName="ErrReport.txt" IsStock="True" xmlns="clr-namespace:Rawler.Tool;assembly=Rawler" xmlns:ra="clr-namespace:RawlerExpressLib.Automation;assembly=RawlerExpressLib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SetWorkFolder SpecialFolder="MyDocuments" Folder="Rawlerレイソル"></SetWorkFolder>
<WebClient AddUserAgent="True" Encoding="" ErrMessage="" Referer="http://bm.best-hit.tv/reysol/?page=2" SleepSeconds="0" TryCount="3" UseCache="False" UserAgent="Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)" VisbleErr="True">
<Data FileName="レイソル掲示板.txt" SaveFileType="Tsv">
<Page ClearUrlHistory="True" Encoding="" MethodType="GET" OncePageLoad="True" Referer="" Url="http://bm.best-hit.tv/reysol/" UseReferer="True" VisbleErr="True">
<GetPageHtml>
<Tags ClassName="log-frame" EmptyReport="False" IsSingle="False" Tag="div" TagVisbleType="Inner" UseTagRank="False">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
@kiichi54321
kiichi54321 / pixiv.xaml
Last active August 29, 2015 14:04
Webからのデータ取得プログラミング言語を作ったよ ref: http://qiita.com/kiichi54321/items/8f69ad8cbf182981b027
<WebClient Comment=""
xmlns="clr-namespace:Rawler.Tool;assembly=Rawler"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:NPL="clr-namespace:Rawler.NPL;assembly=Rawler"
AddUserAgent="True"
>
<SetWorkFolder SpecialFolder="MyDocuments" Folder="Rawler"/>
<Data>
<Document TextValue="適当なテキスト">
<!--前処理。半角全角を揃える。大文字小文字を揃えるなど。-->
for line in data:
d2 = [ x for a in data2 if a["id"] == line["id"]][0]:
d3 = [ x for a in data3 if a["id"] == line["id"]][0]:
data4.append({"id":line["id"],"v1":line["value"],"v2":line["value2"],"v3":d2["value"],"v4":d3["value"]})
@kiichi54321
kiichi54321 / gist:7210269
Created October 29, 2013 07:14
Yahoo!の形態素解析API用のライブラリ。簡易的に同期版もある。
using System;
using System.Net;
using System.Xml.Linq;
using System.Linq;
using System.Collections.Generic;
namespace MyLib.WebAPI.Yahoo
{
public static class YahooAPI
{
@kiichi54321
kiichi54321 / クラス
Last active December 15, 2015 17:39
CSVFileを読むクラス Silverlight対応
public class CSVFile
{
StreamReader steram;
public CSVFile(StreamReader stream)
{
this.steram = stream;
}
public CSVFile(string fileName)
{
@kiichi54321
kiichi54321 / XAMLファイル
Created April 2, 2013 08:38
XAMLでクロス表っぽいものを作る
<ScrollViewer Grid.Row="1" Name="scrollViewer1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<ContentControl Name="ClusterTable">
<StackPanel >
<StackPanel Orientation="Horizontal">
<Border Width="50"></Border>
<ItemsControl ItemsSource="{Binding Categories}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"></StackPanel>
</ItemsPanelTemplate>