Categories

Custom Java Events

To create custom Java events we need basicly three classes:

The event class which will be fired
An interface which indicating responsibility of event listeners of this event
The class which fires the Java events

When these classes are prepared, other classes can subscribe to events  by providing their event listener.

An event class must extend java.util.EventObject class. Below you [...]

Basketball Game: Robot (www.onlinegames.com/basketball/)

I have coded another helper program to a popular game using Robot class of Java. In this game, players are trying to score baskets in a 2d pitch by shooting the ball random positions to a basket of which position remains unchanged. The players only decide highest point of the path of the ball. By [...]

Setting Java Character Encoding

When operations on different character sets need to be done in Java, we need to initialize JVM with required options.

First lets have a look at basics of java character encodings.

Internally the JVM always operates with Unicode.
Data transferred in or out of the JVM is converted to a format specified in the file.encoding property of the [...]

Farmville: Clicking Robot

Too many clicks are needed while playing games like farmville. To this automatically, firstly I used a tool named xdotools which generates false keyboard and mouse input. But, since xdotools only supports X11, I switched to Java to have a platform independent program.

java.awt.Robot class can be used to generate false input in Java. You can [...]

Dealing with lots of paranthesis…

While dealing with lambda calculus expression that I mentioned in my previos post, from time to time many paranthesis appears. Exampli gratia: While trying to SKI equivalent of

λx.λy.+ x y,

intermediate expressions like

S (S (K S) (S (K (S (K +))) (S (λx K) (λx x)))) (λx I)

can be encountered. While dealing with such expression text [...]

Finding SKI Equivalents of λ-Calculus Expressions

Define S, K and I as

S x y z = x z (y z)

K x y = x

I x = x

Apply following transformations to lambda calculus expression until the expression becomes free of lambda abstractions and variables.

1) λx.e1 e2 => S (λx e1) (λx e2)

2) λx.x => I

3) λx.c => K c [Here, c should [...]

MySQL Workbench ile MySQL veritabanı oluşturma

Bir masaüstü ya da web uygulaması geliştirirken çoğunlukla süreklilik gösterecek (persistent) veriye gereksinim duyulur. Süreklilik gösterecek veriler dosya sistemi ya da veritabanı gibi araçlar kullanarak saklanıp kullanılabilir. Bu yazımda MySQL Workbench kullanarak nasıl veritabanı oluşturulacağından söz edeceğim.

MySQL’de komut satırı kullanarak veritabanı, tablo vs. oluşturmaktansa MySQL Workbench kullanarak verimizi daha hızlı bir biçimde tasarlayıp verimize uygun [...]