Archive for the ‘Yazılım’ Category

9
Dec

httping

   Posted by: myururdurmaz Tags: , , ,

is a small for ping http servers. Here an example

$ httping google.com

Pinging :http://google.com

9324 bytes from http://google.com: seq=1 rep=[200/OK] time=11201 ms
9356 bytes from http://google.com: seq=2 rep=[200/OK] time=834 ms
9342 bytes from http://google.com: seq=3 rep=[200/OK] time=822 ms
9342 bytes from http://google.com: seq=4 rep=[200/OK] time=827 ms

Avg :3421 ms - 9341 bytes
Speed :2KB/second
Health :%100

Download httping

Bookmark and Share
Tags: , , ,

a new local war file
-- -- =@war_file_path --user : http://_server_addr:8080/manager/html/upload

curl http://tomcat_server_addr:8080/manager/undeploy?path=/Context_Path --anyauth --user username:password

curl http://tomcat_server_addr:8080/manager/reload?path=/Context_Path --anyauth --user username:password

Bookmark and Share
Tags: , , , , , , , , , ,

Edit /etc/security/limits.conf add these lines

soft nofile 4096
username hard nofile 8192

remember change “username” with your username.
relogin and enjoy.

Bookmark and Share
Tags: , ,
8
Apr

python ile basit bir kod wrapper örneği

   Posted by: İsmail ÇAKIR Tags: ,

import sys

pre = ‘out.println("‘ # satirbasi sql.append(" gibi
pst = ‘")‘            # satirsonu ") gibi
addslash = 1          # tirnaklara backslash

if len(sys.argv) == 1:
    print "kullanim: \n \t\t  wrapper.py giris.txt \n  \t\t  > cikis.txt gerekiyorsa"
    sys.exit(1)

f = open(sys.argv[1] ,’r‘)

for r in f:
    if (addslash == 1):
        r = r.replace(‘"‘,’\\"‘)
    r = r.rstrip()
    line =  "%s%s%s" % (pre , r, pst)
    print line

Bookmark and Share
Tags: ,
29
Mar

haskell faktöriyel hesaplama

   Posted by: Muhammed YÜRÜRDURMAZ Tags: , ,


1 faktoriyel 0 = 1
2 faktoriyel a = a * faktoriyel (a - 1)
3 main = do putStrLn "Hangi Sayının faktöriyeli hesaplanacak ? "
4           say <- readLn
5           print (faktoriyel say)
6

Bookmark and Share
Tags: , ,
18
Mar

hibernate jointable kullanımı

   Posted by: Muhammed YÜRÜRDURMAZ Tags: , , ,


import .io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.JoinColumn;
import javax.persistence.;
import javax.persistence.ManyToMany;

/**
 *
 * @author Muhammed YÜRÜRDURMAZ
 */
@Entity
@Table(name = "KISI_TBL")
public class Kisi implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "KISI_ID")
    private int KisiId;
    @Column(name="ISIM", length=64, nullable=false)
    private String isim;
    @ManyToMany
    @JoinTable(name = "KISI_TELEFON_TBL", joinColumns = {
        @JoinColumn(name = "KISI_ID")},
    inverseJoinColumns = {
        @JoinColumn(name = "TELEFON_ID")})
    private List<Telefon> telefonlar;

    /**
     * @return the KisiId
     */
    public int getKisiId() {
        return KisiId;
    }

    /**
     * @param KisiId the KisiId to set
     */
    public void setKisiId(int KisiId) {
        this.KisiId = KisiId;
    }

    /**
     * @return the isim
     */
    public String getIsim() {
        return isim;
    }

    /**
     * @param isim the isim to set
     */
    public void setIsim(String isim) {
        this.isim = isim;
    }

    /**
     * @return the telefonlar
     */
    public List<Telefon> getTelefonlar() {
        return telefonlar;
    }

    /**
     * @param telefonlar the telefonlar to set
     */
    public void setTelefonlar(List<Telefon> telefonlar) {
        this.telefonlar = telefonlar;
    }
}



import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

/**
 *
 * @author Muhammed YÜRÜRDURMAZ
 */
@Entity
@Table(name = "TELEFON_TBL")
public class Telefon implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "TELEFO_ID")
    private int telefonId;
    @Column(name = "TELEFON_NO", length = 13, nullable = false)
    private String telefonNo;
    @ManyToMany(mappedBy="telefonlar")
    private List<Kisi> kisiler;

    /**
     * @return the telefonId
     */
    public int getTelefonId() {
        return telefonId;
    }

    /**
     * @param telefonId the telefonId to set
     */
    public void setTelefonId(int telefonId) {
        this.telefonId = telefonId;
    }

    /**
     * @return the telefonNo
     */
    public String getTelefonNo() {
        return telefonNo;
    }

    /**
     * @param telefonNo the telefonNo to set
     */
    public void setTelefonNo(String telefonNo) {
        this.telefonNo = telefonNo;
    }

    /**
     * @return the kisiler
     */
    public List<Kisi> getKisiler() {
        return kisiler;
    }

    /**
     * @param kisiler the kisiler to set
     */
    public void setKisiler(List<Kisi> kisiler) {
        this.kisiler = kisiler;
    }
}

Bookmark and Share
Tags: , , ,
5
Mar

log4j harici properties dosyası okuma

   Posted by: Muhammed YÜRÜRDURMAZ Tags: ,

public static void main(String args[]) {
  PropertyConfigurator.configure("c:\\dizin\\");
  log = Logger.getLogger("class adı");
  log.info("deneme");
}
Bookmark and Share
Tags: ,
3
Mar

hibernate blob kullanarak resim kaydetme

   Posted by: Muhammed YÜRÜRDURMAZ Tags: , , ,


import .io.Serializable;
import java.sql.;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;

@Entity(name="resim")
public class Resim implements Serializable {
    @Column(name="id")
    @Id
    private int id;
    @Column(name="resim")
    @Lob
    private Blob resim;

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the resim
     */
    public Blob getResim() {
        return resim;
    }

    /**
     * @param resim the resim to set
     */
    public void setResim(Blob resim) {
        this.resim = resim;
    }

}

Kullanım örneği

Resim r = new Resim();
r.setResim(.createBlob(new FileInputStream("resim.jpg")));
s.save(r);
Bookmark and Share
Tags: , , ,
1
Mar

netbeans web servisleri 64bit

   Posted by: Muhammed YÜRÜRDURMAZ Tags: , , , ,

üzerine 32bit jdk kurup web servislerini çalıştırmaya çalıştığınızda çalışmıyor. 64bit jdk deneyin

Bookmark and Share
Tags: , , , ,
26
Feb

jboss heap size ayarı

   Posted by: Muhammed YÜRÜRDURMAZ Tags: , , ,

ayarı bin/run.conf dosyasındaki

=

ile başlayan satırdan yapılabilir.

min. 256m max. 1024m

_OPTS=”-Xms256m -Xmx1024m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000″

değişikliklerden sonra jboss u kapatıp açmayı unutmayın

windows üzerinde bin/run.conf.bat içerisinden yapılıyor

Bookmark and Share
Tags: , , ,

Switch to our mobile site