Shammer's Philosophy

My private adversaria

Upgrade from Squeeze to Wheezy

Here is a procedure I did to upgrade Squeeze to Wheezy. edit /etc/apt/sources.list apt-get update apt-get upgrade apt-get dist-upgrade Changed points of /etc/apt/sources.list Disable squeeze repository link and add wheezy repository link #…

Disabled mouse action on Emacs

Intoroduce disable-mouse package I was bothered Emacs unexpectedly pop up menu on my Jessie and looking for how to disable this pop up, and find a package to do it, named disable-mouse. This package is provided via melpa. Installation proc…

Install XFCE4 into my Jessie

I used GNOME desktop environment on my debian, but I have a compliant. That is that GNOME environment doesn't take over the mouse/trackpad configuration set by system setting. In detail, natural scrolling is disabled on some applications. …

How to connect PostgreSQL via Common Lisp Application?

I found the link to describe the way how to handle PostgreSQL from Common Lisp application. There is a library named clsql. I have not tried it yet but this is a memo. I will try later when I can take a time.

jQuery Calendar doesn't work if multi text boxes in same HTML are using them

I use jQuery calendar input with the way I wrote in this article. It works fine if calendar is used from only one text box, but multi text boxes use calendar input at the same time, only first one shows up the calendar, ant the other text …

Debugging rows gotten by JSTL sql:query

I have some questions written in this article. Sometimes I want to handle the data gotten by sql:query, those can be accessed with the expression like ${row.id}. I don't know the class using as row in following JSTL. At first, trying to cl…

HTML Calendar Input Form with jQuery

I want to use HTML text form input with calendar, and I found the way in this article. That requires jQuery libraries links. Here is a procedure. Adding following lines in HTML header section. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

Searching JSTL document and found the answer

Looking for the detail about JSTL c:set because of JSTL helps us but... not clear for me... - Shammerism and found following site.java - I can pass a variable from a JSP scriptlet to JSTL but not from JSTL to a JSP scriptlet without an err…

JSTL helps us but... not clear for me...

I used JSTL SQL tag, it is very useful to implement web application to access the Database! I used JSTL SQL tag like below in this article, but I faced with some problems. <%@ page contentType="text/html;charset=UTF-8" %> <%@ taglib uri="h…

I may not need Safari Extension like Tab Mix Plus of Firefox

Mac

I desired Safari extension to enable displaying a lot of tabs with multi rows like Tab Mix Plus which is a one of extensions for Firefox. This extension is very useful for me, but there is no extension like it at least I was looking for. A…

How to define the SQL parameter in JSTL?

There is a JSTL to execute SQL, that is sql:query. I want to execute SQL with WHERE sentence in JSP with using HTTP request parameter in WHERE conditions. This is a sample. <%@ page contentType="text/html;charset=UTF-8" %> <%@ taglib uri="…

Enable TCP Fast Open on Debian Jessie

According to TCP FAST OPENとは? | REDBOX Labo, TCP Fast Open is supported on Linux since Kernel 3.6. The kernel of Debian Jessie is 3.16, so it is likely available. The configuration value is /proc/sys/net/ipv4/tcp_fastopen. The value of …

Ant Task Examples - 2016-06-02

Here is a basic example of Apache Ant task. Define properties, using this value ${property} like valuables <property name="tomcat.host" value="192.168.1.250" /> <property name="tomcat.port" value="8080" /> <property name="username" value="tomcat" /> <property name="password" value="password" /> Java…</property></property></property></property>

MacOS security update makes openssl version reset

I was faced with the issue that it takes for a while to launch Emacs GUI version and resolved it by the way written as Resolved the issue of 2016-02-12 - Shammerism. But this setting is reset by MacOS X security update. So, I looked for ot…

JSTL if-else sample with c:out

This is my memo. We can write JSP with using c:choose and c:when, c:otherwise behave as if-else syntax. This example inclues c:forEach and sql:query also. Getting some data from database with sql:query, and show them with c:forEach loop an…

How to accept the connection from remote host on PostgreSQL?

I use the postgresql with tomcat, related articles are PostgreSQL JDBC Driver on tomcat8 - Shammerism and Test connecting PostgreSQL DB from tomcat8 - Shammerism, but these article is the case that tomcat and postgresql are running on the …

web.xml config template for Restful Application

The web.xml file included war archive of Java WebApp tends to be bigger with a lot of URIs if there are a lot of functions like Restful Web Service Applications. The maintenance of such applications is very mistakable. The debugging URI mi…

Apache Ant Install into MacOS

Here is a procedure to install Apache Ant manually. Check the latest version at Apache Ant Site Getting latest version ZIP Expand the ZIP(automatically expanded into $HOME/Downloads, I believe) sudo mkdir /usr/local/share/ant sudo cp $ANT_…

Java16進数演算標準版?

Java16進数演算 on String - Shammerismで、自分で16進数の演算をやるようにしてみたが、なんかもっとうまいやり方がありそうな気がして調べたら・・・あった。標準ライブラリでできる。Integer.parseInt(String, int)とかInteger.toString(int, int)を使用…

Java16進数演算 on String

Javaで16進数の計算を行いたい。でも、Hexadecimalというようなクラスはない。String/Integer/Doubleなどのようにあってほしかったが。 とりあえず、16進数の任意の値を文字列で受け取り、それを計算する例。 public class Hexadecimal { private static fin…

Directory traversal check with Lisp

I want to write code to check directory traversal. In other words, replace ".." with other values if strings includes "..". For example, the string "/aaa/../index.html" should be replaced with "/index.html". And I want to write this code a…

別パッケージのコンディションを使用する

目的 Lispのパッケージで可読性が・・・ - Shammerismで、同一パッケージのソースコードを複数ファイルに分割可能とわかった。次のステップとしてアプリ・システム全体で独自のコンディションを使用してみる。個々の処理ごとに発生する可能性のあるコンディ…

Lispのパッケージで可読性が・・・

パッケージを多用した際の問題点 load したファイルで in-package しているとどうなる? - Shammerismで書いた内容に近いだろうか。Lispで大きいアプリケーションを書いていると、メソッド呼出の際のパッケージ名があちこちに入ってコードが読みにくくなる。…

rewrite http-read-line of http://d.hatena.ne.jp/shammer/20160320/p1

In the article Lisp HTTP Client handling chunked responses - Shammerism, I wrote a HTTP client which can handle chunked response. In this article, the function whose name is http-read-line uses do loop, but I would like to rewrite as recur…

Lisp repeat-string

I wrote this article to concatenate some character without dotimes, using with-output-to-string instead. But, I noticed more easy way to recursive function. Here is a last version. (defun str (x) (typecase x (cons (concatenate 'string (str…

How to add same character repeatedly without dotimes?

Sometimes I want to add some character repeatedly like generating something depended on how many there are. For example, organizing a file name with sequence numbers which might be different length, the length of sequence number 0 is 1, bu…

my is-dot-cons is a bad function...

I wrote is-dot-cons to check if it is a dot cons written at Is normal cons? Is dot cons? - Shammerism, but it has a bug. This function is not considered the following cons. ("100" . '(10 20 30))This is a dot cons, but cdr is not atom, so m…

Is normal cons? Is dot cons?

There is a case to want to know that the cons is normal cons or dotted cons. In detail, the cons is like ("A" "B") or ("A" . "B"). These cons have a difference how to handle right element. If the cons is like ("A" "B"), the function cadr c…

Using find-if instead of remove-if-not

This is a continuous article of remove-if と remove-if-not を理解する - Shammerism and find と remove-if-not - Shammerism. Lisp functions end-with -not would be deprecated in the future, so I have to get used to use functions which are not…

Lisp HTTP Client handling chunked responses

I wrote an HTTP client with ClozureCL, and this can handle chunked response. (defparameter *remote-host* "d.hatena.ne.jp") (defparameter *remote-port* 80) (defparameter *client-stream* nil) (defmacro connect-operation (&rest body) `(with-o…