Skip to content

Instantly share code, notes, and snippets.

View graph.ctp
<script src="https://d3js.org/d3.v3.min.js"></script>
<?php echo $this->Html->script('d3.layout.cloud.js');?>
<script>var tags = [
<?php for($index = 0; $index < count($weight); $index++){ ?>
{"key": "<?php echo $weight[$index][0];?>", "value": <?php echo $weight[$index][1];?>},
<?php }?>
]
</script>
<div id="vis"></div>
<?php echo $this->Html->script('word-cloud.js');?>
View bubble.js
var svgWidth = 2080; // SVG領域の横幅
var svgHeight =1080; // SVG領域の縦幅
var diameter = 1080; // 一番大きい円のサイズ
var color = new Array(100);
color[0] = "none";
for(var index = 1; index <= 100; index++){
color[index] = rgbTo16("rgb("+Math.floor(Math.random()*256)+","+Math.floor(Math.random()*256)+","+Math.floor(Math.random()*256)+")");
}
//var color = ["none", "#ff0000", "#", "orange", "#ffe090", "#a0ff90", "cyan", "#ccc", "#ff8080", "#c0ffc0", "#4090ff"];
View bubble-view
<div id="myGraph"></div>
<script>
var list = {
"name": "Keyphrase",
"children": [
{
"name": "twitter",
"children": [
<?php for($index = 0; $index < $count; $index++){ ?>
{ "name": "<?php echo $weight[$index][0];?>", "households": <?php echo $weight[$index][1];?> },
View MySQL.R
mysql.connect <- function(){
dbconnector <<- dbConnect(dbDriver("MySQL"),dbname="XXXXX",user="YYYYY", password="ZZZZZZ")
}
mysql.getSelect <- function(){
mysql.data <<- dbGetQuery(dbconnector, "SELECT `attack`, `defence`, `hp`, `exp`, `gold`, `water` FROM `monsters` ")
}
View Basic.R
basic.summary <- function(){
summary(mysql.data)
write.csv(summary(mysql.data), file="summary.csv")
}
basic.boxplot <- function(name){
boxplot(name)
}
basic.hist <- function(name){
View Cluster.R
cluster.agnes <- function(name){
cluster.agnes <- agnes(name, stand = T)
plot(cluster.agnes, which = 2, main = "", xlab = "", ylab = "")
}
cluster.diana <- function(name){
cluster.diana <- agnes(name, stand = T)
plot(cluster.diana, which = 2, main = "", xlab = "", ylab = "")
}
View PCA.R
pca.pca <- function(name){
pca_result <<- prcomp(name, scale=T)
pca_result
}
pca.summary <- function(name){
summary(name)
}
pca.biplot <- function(name){
View AsyncHttp.java
package com.example.mizuno.prog17_01;
import android.os.AsyncTask;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
View activity_prog1702.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Latitude"
android:id="@+id/latitude"
View AsyncTaskGetJson.java
package com.example.mizuno.prog17_02;
import android.os.AsyncTask;
import android.util.Log;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
You can’t perform that action at this time.