Skip to content

Instantly share code, notes, and snippets.

View mehmetbebek's full-sized avatar
🎯
Focusing

Mehmet BEBEK mehmetbebek

🎯
Focusing
View GitHub Profile
@mehmetbebek
mehmetbebek / android_text_alignment
Created February 12, 2014 21:57
Android Text Alignment
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView2"
android:layout_alignBottom="@+id/textView2"
android:layout_alignLeft="@+id/imageView2"
android:layout_marginLeft="16dp"
android:gravity="center"
To work with groovy at eclipse we should insert required plugins for eclipse.My eclipse version is Kepler so i will show you at kepler you can find detailed information for other versions below link.
Open your eclipse and open Help -> Install New Software
Paste this url to "work with" area : http://dist.springsource.org/release/GRECLIPSE/e4.3/
After installing this plugin you should restart your eclipse.
Good Work.
@mehmetbebek
mehmetbebek / password_encrypt
Created February 17, 2014 14:10
Encryption With MD5 at Java
try {
Scanner input = new Scanner(System.in);
System.out.println("Input Value");
String willEncryptText = input.next();
byte[] bytesOfMessageText = willEncryptText.getBytes("UTF-8");
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] thedigest = md.digest(bytesOfMessageText);
System.out.println(thedigest);
@mehmetbebek
mehmetbebek / port
Created February 18, 2014 20:53
Ubuntu Open 8080 Port
netstat -anp | grep 8080
Linux:
kill -9 248
Windows:
taskkill /f /pid 248
@mehmetbebek
mehmetbebek / solutions
Created February 27, 2014 13:14
ORACLE JAVA
For Oracle:
Jdbc Driver Name="oracle.jdbc.driver.OracleDriver" (if you have it on your system)
Url format="jdbc:oracle:thin:@hostname:port Number:databaseName"
For Odbc:
Odbc bridge="sun.jdbc.odbc.JdbcOdbcDriver"
Url format="jdbc:odbc:dsn_name"
@mehmetbebek
mehmetbebek / answer_rotation
Last active August 29, 2015 13:56
Find If A String is Rotation of Another String
/* algorithm checkRotation(string s1, string s2)
if( len(s1) != len(s2))
return false
if( substring(s2,concat(s1,s1))
return true
return false
end */
//In Java:
@mehmetbebek
mehmetbebek / process_builder
Created March 5, 2014 09:50
Java Process Builder
String programDir = "C:/Program Files (x86)/Notepad++/";
String docDir = "C:/Users/XXXX/Desktop/";
ProcessBuilder builder = new ProcessBuilder(new String[] {
programDir + "notepad++.exe",docDir + "svncommands.txt",docDir + "export.txt" });
// builder.directory(new File(
// docDir + "export.txt"));
Process newProcess = builder.start();
@mehmetbebek
mehmetbebek / jvm_jre_jdk
Created March 11, 2014 19:22
JVM JRE JDK
JVM (Java Virtual Machine) : Bir Java dosyası derlendiği(compile) zaman .class uzantılı java byte kodları oluşur . Java byte kodları işletim sisteminde kurulu olan JVM ile makina kodlarına çevrilir . Bu sayede java kodları derlendikten sonra farklı işletim sistemlerinde sorunsuz olarak çalışır . JVM sayesinde Java da sıkça duyduğumuz ve Javayı Java yapan "Write Once, Run Anywhere" özelliğini kullanabilmekteyiz . Her işletim sisteminin kendi sanal makinası vardır
JRE (Java Runtime Edition) : Bir Java uygulamasını çalıştırmak için gerekli olan Java kütüphanelerini ve JVM içerir
JRE = Java Kütüphaneleri + JVM
JDK (Java Development Kit ) : Java ile geliştirme yapmak için ve yazdığımız java kodlarını compile edip .class uzantılı dosyaları oluşturmamızı sağlayan tool dur.
JDK = JRE + derleyici + Java Compiler
@mehmetbebek
mehmetbebek / android_and_webservice
Last active August 29, 2015 13:57
Keep in Mind
http://androidprogramz.blogspot.co.uk/2012/07/connect-mysql-database-from-android.html
http://stackoverflow.com/questions/19217835/can-an-android-app-connect-directly-to-an-online-mysql-database
http://www.helloandroid.com/tutorials/connecting-mysql-database
@mehmetbebek
mehmetbebek / random_rename.reg
Last active August 29, 2015 13:57
Rename a File With Explorer Right Click
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\mgnfcnt]
@="Random Rename"
[HKEY_CLASSES_ROOT\*\shell\mgnfcnt\command]
@="java -jar \"C:\\mgnfcnt.jar\" \"%1\""