Skip to content

Instantly share code, notes, and snippets.

View tmk815's full-sized avatar
🏠
Working from home

Tomoki Monden tmk815

🏠
Working from home
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tmk815
tmk815 / euclid.c
Created June 1, 2018 12:51
ユークリッドの互除法
#include <stdio.h>
int gcd(int,int);
int main(void) {
int a, b;
a=394;
b=985;
printf("%d\n",gcd(a,b));
@tmk815
tmk815 / database.yml
Created April 28, 2018 09:24
AzureのPostgreへの接続設定
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
username: サーバー管理者ログイン名
password: パスワード
host: サーバー名
@tmk815
tmk815 / mainwindow.cpp
Last active April 22, 2018 07:19
Qt_SQLiteSample
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlQuery>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
@tmk815
tmk815 / sample.fxml
Created July 31, 2017 01:33
fxmlSample
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.Pane?>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.Controller">
<children>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical"
tools:context="com.example.hoge.buttontest.MainActivity">
<LinearLayout
android:orientation="horizontal"
@tmk815
tmk815 / Sample.java
Created June 9, 2017 13:55
SimpleCursorAdapter_Sample
public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
switch (columnIndex) {
case 0:
TextView date = (TextView) view;
date.setText(cursor.getString(1) + "-" + cursor.getString(2) + "-" + cursor.getString(3));
return true;
case 1:
TextView id = (TextView) view;
int time = 1;
int minute = 30;
@tmk815
tmk815 / preference.xml
Last active May 18, 2017 16:03
preference.xml
<!--省略-->
<PreferenceCategory
android:layout="@layout/sampleview">
</PreferenceCategory>
<!--省略-->
@tmk815
tmk815 / sampleview.xml
Last active May 18, 2017 16:03
sampleview.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/texiView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample" />
</LinearLayout>
@tmk815
tmk815 / MainActivity.java
Created December 18, 2016 10:45
TextToSpeech_Sample
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import java.util.Locale;
public class MainActivity extends AppCompatActivity implements TextToSpeech.OnInitListener {