Search Blog

Search duranek.blogspot.com

Friday, October 28, 2016

Confirm Uniqueness of Columns

To confirm uniqueness of column_A x column_B in a table, add unique constraint:
#alter table x add unique ( column_A,column_B )

To see the constraint do:
#show create table;

#desc table;
if you see MUL near a column, this means it is a part of a unique index. keywords: mysql unique constraint column

To remove it:

#show index from modulestepwriteaccess
#DROP index moduleId on modulestepwriteaccess

Thursday, October 27, 2016

A good mybatis cheatsheet

<script>
SELECT * FROM STUDENT
WHERE DEPARTMENT_ID = #{depId}
<if test='joiningDate != null'> 
<![CDATA[
AND STUDENT_ID <= #{joiningDate} 
]]>
</if>
</script>

Tuesday, October 25, 2016

JSP Eclipse Line Width Format

Window - Preferences - Web - JSP Files - Editor. Click on the link for your kind of JSP (HTML or XML content), and adjust the line width.

Thursday, March 15, 2012

Mercurial Hgweb CGI Windows Apache Howto

1) Apache httpd kurulur
2) mercurial 2.1.1 kurulur
3) python 2.6.6 kurulur
4) http://mercurial.selenic.com/wiki/Download
uzerinden Mercurial-2.1.1 (32-bit py2.6)  python library'si kurulur
5) deneme yapmak icin
   command prompt ta python de
   import mercurial
   yaz, calisiyorsa, library yi yukledin demektir.
6) Asagidaki hgweb.cgi yazilir,
    apache nin cgi-bin'inine atilir.


#!D:/Python26/python.exe -u
#
# An example hgweb CGI script, edit as necessary
# See also http://mercurial.selenic.com/wiki/PublishingRepositories

# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "D:\Apache2.2\cgi-bin\hgweb.config"

# Uncomment and adjust if Mercurial is not installed system-wide:
#import sys; sys.path.insert(0, "/path/to/python/lib")

# Uncomment to send python tracebacks to the browser if an error occurs:
import cgitb; cgitb.enable()

from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)
wsgicgi.launch(application)

7) Yine ayni sekilde cgi-bin'e

hgweb.config dosyasi

[paths]
/Production = D:/repository/JavaMail/*
/WSTest = D:/repository/WSTest/*
[web]
allow_push = *
style = monoblue
contact = xxx.yyy@test.com.ua
push_ssl = false

Atilir.

8) DAha sonra apache'nin config'inde httpd.conf a

ScriptAlias /hg "D:\Apache2.2\cgi-bin\hgweb.cgi"

eklenir.

Redmine Mylyn Connector

Eclipse Side:

1) http://redmin-mylyncon.sourceforge.net/update-site/N/

update-site den burayi ekle ve update et.

2) Bu site cok yardimci oldu 

http://thecrumb.com/2011/03/07/installing-redmine-mylyn-connector/

3) Bu directory e gel

C:\Program Files\Bitnami Redmine Stack\apps\redmine\vendor\plugins

4) Git bash tan

git clone git://redmin-mylyncon.git.sourceforge.net/gitroot/redmin-mylyncon/redmine-mylyn-connector

de redmine mylyn connector u yukle

5) webrick'i tekrar calistir

6) administrator ile login ol

8) settings/authentication altindan

enable REST web services checkbox isaretle

Wednesday, February 8, 2012

Software Design Principles

Design Principles

1)    Open Close Principle
    Means : open for extension, closed for modification.
    Bir class'i degistirmek istiyorsan, extend et, degistirme.
    Bunun nedeni, backward compatibility, regression testing.

2)     Dependency Inversion Principle

    Dependency injection, for low coupling, inject the dependency,
instead of creating in your body.

3)    Interface Segregation Principle

    Interface'in icine sadece gerekli metodlari koy. Fazla koyarsan
gereksiz yere implementor lar, uygulamak zorunda kalir bu metodlari.

4)    Single Responsibility Principle.
    Eger bir class'in birden cok responsibility'si varsa, o class'i ayirmak lazim.
    Ayirmazsak, o class'i bir nedenden dolayi degistirdigimizde, diger
    nedenlerden dolayi da degistirmek zorunda kalabiliriz.

5)    Liskov's Subtitution Principle

    Child class 'in ozellikleri, base class in ozelliklerini bozmayacak.

    Yani child class'i istedigimiz zaman base class ile degistirebilmeliyiz.
    ve bir sorun yasamamaliyiz

Strongly Typed Language

Tipleri ozellikle belirterek variable yaratilan programlama dili