Skip to content

Instantly share code, notes, and snippets.

@koduki
koduki / Main.java
Created March 27, 2015 12:02
Orient DB Example
public class Main {
private OServer server;
public void exec() throws Exception {
OObjectDatabaseTx db = new OObjectDatabaseTx("memory:persondb").create();
db.getEntityManager().registerEntityClass(Person.class);
Person nanoha = db.newInstance(Person.class);
nanoha.setName("Nanoha");
{
"exercises":[
{"question":"ボクと契約して、魔法少女になってよ!", "answer":"Make a contract with me, and become a Magical Girl!"},
{"question":"問おう。貴方が私のマスターか?", "answer":"I ask you. Are you my master?"}
]
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package sandbox;
import java.io.File;
import java.text.Normalizer;
@koduki
koduki / StatelessSessionBeans.md
Last active August 29, 2015 14:14
JSR 318 ejb-3_1-fr-spec の抜粋

4.7 Stateless Session Beans

Stateless session beans are session beans whose instances have no conversational state. This means that all bean instances are equivalent when they are not involved in servicing a client-invoked method.

The term “stateless” signifies that an instance has no state for a specific client.

However, the instance variables of the instance can contain the state across client-invoked method calls.

@koduki
koduki / EJBExample
Created February 5, 2015 23:18
Stateless session bean Test
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cn.orz.pascal.javaee.simpletester.resources;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ws.rs.GET;
@koduki
koduki / gist:b61566fdb63a7ac42e20
Created January 5, 2015 16:47
samba install with centos7
sudo yum -y install samba
sudo vi /etc/samba/smb.conf
sudo systemctl start smb
sudo systemctl start nmb
sudo systemctl enable smb
sudo systemctl enable nmb
sudo firewall-cmd --add-service=samba
sudo firewall-cmd --permanent --add-service=samba
@koduki
koduki / file0.txt
Last active August 29, 2015 14:11
goqueryでHTMLの解析をする ref: http://qiita.com/koduki/items/393576193c25dbb477ed
$ go get github.com/PuerkitoBio/goquery
class Character
attr_accessor :name, :hp, :df
def initialize name, hp
@name = name
@hp = hp
@atk = 2
@df = 1
end
@koduki
koduki / install-glassfish.md
Last active August 29, 2015 14:11
How to create Glassfish Cluster with CLI(asadmin)

Prepare

  • Install Glassfish on AdminServer(172.17.0.5)
  • Create 'glassfish' user on ManagedServer(172.17.0.6)
  • Create 'glassfish:glassfish /opt/glassfish4' directory on ManagedServer(172.17.0.6)
  • Change SSH public key

Create Cluster

<html>
<head>
<title>DataSheet</title>
<script type="text/javascript">
main_data = {
"Description":"GlassFish Application Server",
"Environment":["production"],
"Network":{
"Host":["localhost.localdomain"],
"IP":["enp0s3", "10.0.2.15"]