JICsrc v1.0 “src” Downloader

JICsrc v1.0

I thinked that an online src downloader may be interesting and useful for some stuffs. I released online src downloader named JICsrc v1.0 . Currently fetches javascript, css and image files of a website from websites using url. Read more »

Http Get Request Example in Android and Java for Web Services

Following code is for making HTTP request by GET method. Actually I use that code for my Android projects.

@parameter String[] key : This parameter is for get method parameter keys

@parameter String[] values: This parameter contains values of key by order

@parameter String mainUrl: Main address of your request file. e.g. mron.us/mywebservice.php


public static String postData(String[] keys, String[] values, String mainUrl) {
	// Create a new HttpClient and Post Header
	HttpClient httpclient = new DefaultHttpClient();
	StringBuilder builder = new StringBuilder();

	try {
		// Add your data
		String params = "";
		if (keys != null && values != null) {
			for (int i = 0; i < keys.length; i++) {
				params += keys[i] + "=" + values[i] + "&";
			}
		}
		// params = params.substring(0, params.length()-1);
		String url = mainUrl + "?" + params;
		Log.d("HttpRequestURL", url);
		URL adr = new URL(url);

		HttpURLConnection httpGetConn = (HttpURLConnection) adr.openConnection();

		httpGetConn.setAllowUserInteraction(false);
		httpGetConn.setInstanceFollowRedirects(true);
		httpGetConn.setRequestMethod("GET");
		httpGetConn.connect();

		if(httpGetConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
			InputStream content = httpGetConn.getInputStream();

			BufferedReader reader = new BufferedReader( new InputStreamReader(content));
			String line;
			while ((line = reader.readLine()) != null) {
				builder.append(line);
			}

		}
		return builder.toString();
	} catch (Exception e) {
		Log.e("Exception", e.getMessage());
	}

return null;
}

Read more »

Uppercase First Letter and Lowercase Others Encoding UTF-8

Following SQL selects all “data” columns’ values from “dataTable” as first letter in uppercase and the others in lowercase. It works with almost all langauges (supported by utf-8) . You can change encoding type by changing “utf8″ words in SQL. The replacing is just for Turkish “I” letter. You can use it directly just by changing “data” by your column name and “dataTable” by your table name.


SELECT CONCAT( UPPER( CONVERT( SUBSTRING( REPLACE("data", "I", "ı")
FROM 1
FOR 1 )
USING utf8 )) , LOWER( CONVERT( SUBSTRING( REPLACE("data", "I", "ı")
FROM 2
FOR (
CHAR_LENGTH( "data") -1 ) )
USING utf8 ) )) AS edited, location
FROM "dataTable"

GWT-Locale Sorting Problem and Turkey City List Database

Hi everyone. The GWT sorting problem will be handled with an example database table. I have prepared a database table that contains city list of turkey. Cities are generally used in a combo boxes (or dropdown lists). Sorting is a problem in some development platforms like GWT for Turkish special chars. This table contains ordered city ids that is ordered according to cities’ first letters.

I encountered with sorting problem in GWT.  java.util.Locale cannot be used in GWT. Read more »

Non-Regularized Linear Regression

There are many article about this subject in English. So, I will write this post as Turkish, because of lack of articles about this subject as Turkish. If you familiar with Linear Regression, already you can understand from codes too. If you have a question, please let me know.

Bu makalede Linear Regression hakkında teorik bilgi değil pratik uygulama anlatacağım. Teorik olarak İngilizce olsun, Türkçe olsun yeterli kaynak olduğunu düşünüyorum ama pratikte uygulamaları internet ortamında Türkçe anlatımlı pek olmadığından bu makaleyi Türkçe olarak yazmayı uygun gördüm. Read more »

CSS3 – Stylized 3D Text Shadow Effect

Text are able to be displayed with shadow anymore with CSS3. Now, we will use some tricks and make 3d shadow effect on a text. It is very simple and useful. “The text-shadow property is supported in all major browsers, except Internet Explorer.” (1)

“text-shadow” property supports multiple shadow. We will add 5 shadow for drop shadow view and we will add 7 shadow for outor glow effect.

/*Darkness of colors which are used for shadow
effect increases shadow by shadow from 1st shadow effect*/

text-shadow:
0 1px 0 #ccc, /*1st shadow effect,*/
0 2px 0 #c9c9c9, /*2nd shadow effect*/
0 3px 0 #bbb, /*3rd shadow effect*/
0 4px 0 #b9b9b9, /*4th shadow effect*/
0 5px 0 #aaa, /*5th shadow effect*/
0 6px 1px rgba(0,0,0,.1), /*1st outer glow effect*/
0 0 5px rgba(0,0,0,.1), /*2nd outer glow effect*/
0 1px 3px rgba(0,0,0,.3), /*3rd outer glow effect*/
0 3px 5px rgba(0,0,0,.2), /*4th outer glow effect*/
0 5px 10px rgba(0,0,0,.25), /*5th outer glow effect*/
0 10px 10px rgba(0,0,0,.2), /*6th outer glow effect*/
0 20px 20px rgba(0,0,0,.15) /*7th outer glow effect*/;

DEMO

http://www.w3schools.com/cssref/css3_pr_text-shadow.asp

GWT Grid Table – An alternative way to set colspan on cells

As all you know (gwt users) grid table doesn’t support colspan attribute for cells. You can overcome this problem using horizontal panel for colspan. If you confused about that, you can look at the following image.

GWT Grid Table Set Colspan

CSS Background Transparency Without Affecting Child Elements

CSS “opacity” property affects all child elements when it is applied to directly a container such as “table” or “div”. We can solve that problem, not affecting child elements, with gradient technique. ColorZilla’s gradient generator will help us for this solution with cross-browser support. The main idea is using gradient opacity. For example; if we want a black background Read more »

Best Way For Position Tracking

LBS, GPS, WAASi CORS, NDGPS, GDGPS

Contents

  1. GPS
  2. What is GPS?
  3. How to calculate position in GPS?
  4. What is the accuracy of GPS? (GPS Augmentation)
  5. Comparison of accuracy
  6. What are the restrictions on civilian use?
  7. Sources

Read more »

Machine to Machine (M2M)

1.     Definition

M2M defines communications between machines (machine to machine – m2m) with machine language. A machine captures information or data from other machine.  This information is in form of machine language. Captured data in machine language is translated into a meaningful, useful data and this data is used for some operations such as alert on high temperature, tracking and etc. This communication is established by Read more »

« Older Entries