Skip to content

Instantly share code, notes, and snippets.

View crssnky's full-sized avatar
🏍️
ブンブン

crssnky crssnky

🏍️
ブンブン
View GitHub Profile
@crssnky
crssnky / BirthDate.js
Last active May 8, 2019 14:18
im@sparql BirthDate
onload = function () {
var Query = ["PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>PREFIX schema: <http://schema.org/>SELECT (sample(?o) as ?date) (sample(?n) as ?name) WHERE { ?sub schema:birthDate ?o; rdfs:label ?n;FILTER(regex(str(?o), \"", "\" )).}group by(?n)order by(?name)"];
var date = new Date();
var month = date.getMonth() + 1;
var day = date.getDate();
var now = (month < 10 ? "0" + month : month) + "-" + (day < 10 ? "0" + day : day);
var url = 'https://sparql.crssnky.xyz/spql/imas/query?query=' + encodeURIComponent(Query[0] + now + Query[1]);
d3.json(url, function (error, data) {
var jsons = data["results"]["bindings"];
if (jsons.length == 0) {
PREFIX schema: <http://schema.org/>
PREFIX imas: <https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#>
SELECT ?o ?h
WHERE {
?s schema:name|schema:alternateName ?o;
schema:height ?h.
}order by(?h)
@crssnky
crssnky / おっぱい遺伝的アルゴリズム.cs
Last active August 16, 2017 17:24
遺伝的アルゴリズムで長さ4の遺伝子で「おっぱい」に近ければ得点が高いって風にしたら、すごい人間らしい遺伝子っぽくなりそう
using System;
namespace Oppai_GA {
class Program {
const int sedai = 10000;
const int rinnne = 1000;
const int oya = 500;
const int henni = 50;
static string IDEAL = "おっぱい";
static void Main(string[] args) {
@crssnky
crssnky / SniRepAR.js
Last active December 3, 2017 08:15
ejsの一部だよ
console.log("<%= url %>");
var type = true;
function hideMe() {
var elem = document.getElementById('description');
elem.style.display = 'none';
}
if (type) {
window.addEventListener('deviceorientation', function (ev) {
if (ev.alpha == null) {
PREFIX schema: <http://schema.org/>
PREFIX imas: <https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#>
SELECT ?ユニット名 (avg(?BMI)as ?平均BMI) (group_concat(distinct ?name)as ?左利きアイドル名)
WHERE {
?n schema:member ?s;
schema:name ?ユニット名.
?s schema:name ?name;
imas:Handedness "left"@en.
?n schema:member ?m.
PREFIX schema: <http://schema.org/>
PREFIX imas: <https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#>
SELECT (group_concat(distinct ?name)as ?名前) ?bust ?waist ?hip
WHERE {
?a schema:name ?name;
imas:bust ?bust;
imas:waist ?waist;
imas:hip ?hip.
}group by ?bust ?waist ?hip having(count(?name)>1) order by ?bust ?waist ?hip
PREFIX schema: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX imas: <https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#>
SELECT ?ユニット名 (group_concat(?名前;separator=", ")as ?メンバー)
WHERE {
?s rdf:type imas:Unit;
schema:name ?ユニット名;
schema:member/schema:name ?名前.
}group by (?ユニット名) order by(?ユニット名)
PREFIX schema: <http://schema.org/>
PREFIX imas: <https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#>
SELECT ?o ?h
WHERE {
?s schema:name|schema:alternateName ?o;
schema:height ?h.
}order by(?h)
PREFIX schema: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX imas: <https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#>
SELECT ?ユニット名 (avg(?h) as ?平均身長)
WHERE {
?s rdf:type imas:Unit;
schema:name ?ユニット名;
schema:member ?m.
?m schema:height ?h.
}group by(?ユニット名) order by desc(?平均身長)
PREFIX schema: <http://schema.org/>
PREFIX imas: <https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#>
select ?利き手 ?名前
where{
?s schema:name|schema:alternateName ?name;
imas:Handedness ?利き手;
filter(regex(str(?name), "まゆ")).
?idol imas:Handedness ?利き手;
schema:name ?名前.
}