Git Workflow

April 27, 2014 Leave a comment

This is probably one of the greatest blogs I have read about Git so just wanted to share it. Here is the picture that summarizes the whole thing for me.

 

cN5oZ9Kq4sk1-C8bEg4nbTl72eJkfbmt4t8yenImKBVvK0kTmF0xjctABnaLJIm9

Categories: Uncategorized

Oracle 11g PL/SQL: Getting Turkish name for a month

March 20, 2014 Leave a comment

Use this very handy argument to your ‘TO_CHAR’ function in order to get the Turkish name of a month.

(TO_CHAR (SYSDATE,  'MONTH',  'NLS_DATE_LANGUAGE = TURKISH')))

EDIT: Just realized that this actually does not work well (I am not sure if it is due to my regional settings) but it fails to convert some of the months names correctly.

For example, it returns ŞUBAT correctly while it will return HAZIRAN instead of HAZİRAN so be careful with it.

Categories: Uncategorized Tags: , , ,

Website for looking up various Software Licenses

February 28, 2014 Leave a comment

This website will provide you summarized information about various software licenses used in the industry. Comes handy especially for open source project licenses.

https://tldrlegal.com/

Categories: Uncategorized

Setting up an Android device for debugging (with an IDE)

December 29, 2013 Leave a comment

1) Enable usb debuggin mode (if it is hidden tap 7 times)

For Windows:

If it still doesn’t work go to device manager and look for ”other devices”. In my case I had a sony xperia tipo and there was just Android. Right click on that and select ”Update Driver Software”

If automatic update does not work, select the browse my computer option and see if there is one located under:

<Your Android SDK location>\extras\google\usb_driver

Otherwise try:

Browse my computer for driver software -> Let me pick from a list of device drivers on my computer -> Android Phone/Google Inc -> Some ADB driver version. This should solve the problem.

After all these, if, in debugging options, you still see a warning sign nest to your (now supposed-to-be-recognized) phone, you may have done something wrong in one of these steps or you may need to try an alternative step to the one you have done initially.

References: Stackoverflow

Categories: Uncategorized

Play Framework – eclipsify problem

December 29, 2013 Leave a comment

After you create a play project, you can easily convert it to an eclipse project by running “play eclipse” (which was “play eclipsify” in the older versions). However, when you get a legacy play project you may run into issues when doing this. Kinds of errors you may get are:

You can give these a try in order to solve the problem:

  1. Make sure you have the latest version of play framework
  2. Check if your project contains a “project” folder. If not, just create a new play project and copy that folder to your project. If there is one, make sure that the sbt version is up-to-date and plugin path definition is correct in respective files (build.properties & plugins.sbt)
Categories: Uncategorized

Xcode : lipo-error-cant-open-input-file

August 19, 2013 Leave a comment

If you get this error in Xcode for some reason (although there can be many solutions), try doing this which worked for me:

Project target-> Build setting-> Build Active Architecture only and set this Build Active Architecture only to “YES”

References: http://stackoverflow.com/questions/17348912/lipo-error-cant-open-input-file

Categories: Uncategorized

Creating a RadioLog Listener in Android

July 24, 2013 Leave a comment
public class RadioLogListener
{
	public static void start() 
	{
		
	    final Handler radioLogHandler = new Handler();
		
	    new Thread(new Runnable() 
	    {
	    	
	    	public void run() 	        
	        {

	            Process process = null;
	            try {
	                // Clear the log first
	                String clearRadioLog[]= {"logcat","-b", "radio", "-c"};
	                String getRadioLog[]= {"logcat","-b", "radio"};

	                Runtime.getRuntime().exec(clearRadioLog);	
	                process = Runtime.getRuntime().exec(getRadioLog);
	                
	                Log.e("RadioLog", "RadioLogProc: " + process);
	
	                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
	                while (true) {
	                    final String line = bufferedReader.readLine();
	                    if (line != null) {
	                        if (line.contains("disconnectCauseFromCode") || line.contains("LAST_CALL_FAIL_CAUSE {")) {
	                            Log.d("RadioLog", "RadioLog: " + line);
	                            radioLogHandler.post(new Runnable() {
	                                public void run() 
	                                {
	                                    //Save the line to a file 
	                            		try 
	                            		{
		                                	FileOutputStream fos = new FileOutputStream(Environment.getExternalStorageDirectory() +"/"+ "TTG_RADIO_LOG.txt", true);
		                                	DataOutputStream out = new DataOutputStream(fos);
	                            			out.writeUTF(new String(line + "\n\n"));
	                            		} catch (FileNotFoundException e1) {
	                            			e1.printStackTrace();
	                            		}
	                            		 catch (IOException e1) {
	                            			e1.printStackTrace();
	                            		}
	                            		
	                            		// Parse the cause code 
	                            		int causeCode = -1;
	                            		
	                            		try
	                            		{
	                            			String[] result = line.split(" ");
	                            		
	                            			String rawCauseCode = result[result.length-1].trim();
	                            		
	                            			rawCauseCode = rawCauseCode.substring(1, rawCauseCode.length() - 1);
	                            			
	                            			causeCode = Integer.parseInt(rawCauseCode); 
	                            			
	                            		}
	                            		catch(Exception e)
	                            		{
	                            			Log.d("RADIO_LOG", "PARSE_ERROR");
	                            			System.out.println(e.getMessage());	                            			
	                            		}
	                            		
	                            		//and log accordingly
	                            		logFailCause(causeCode);
	                                }
	                            });
	                        }
	                    }
	                }
	            } catch (IOException e) {
	                Log.e("RadioLog", "Can't get radio log", e);
	            } finally {
	                if (process != null) {
	                    process.destroy();
	                }
	            }	     	
	        }	    		
	    }).start();	
	}

	private static void logFailCause(int causeCode) 
	{
		// Normal call end
		if(causeCode == CallFailCause.NORMAL_CLEARING)
		{
			new Event("CALL_DISCONNECTED", "Calling party hung-up");
		}
		
		if(causeCode == CallFailCause.ERROR_UNSPECIFIED)
		{
			new Event("CALL_ERROR_GENERAL");
			new Event("CALL_DISCONNECTED");
		}
		
		if(causeCode == CallFailCause.TEMPORARY_FAILURE)
		{
			new Event("CALL_ERROR_GENERAL");
			new Event("CALL_DISCONNECTED");
		}
		
		if(causeCode == CallFailCause.NO_CIRCUIT_AVAIL)
		{
			new Event("CALL_ERROR_CONGESTION");
			new Event("CALL_DISCONNECTED");
		}
		
		if(causeCode == CallFailCause.SWITCHING_CONGESTION)
		{
			new Event("CALL_ERROR_CONGESTION");
			new Event("CALL_DISCONNECTED");
		}
		
		if(causeCode == CallFailCause.CHANNEL_NOT_AVAIL)
		{
			new Event("CALL_ERROR_CONGESTION");
			new Event("CALL_DISCONNECTED");
		}
		
		if(causeCode == CallFailCause.QOS_NOT_AVAIL)
		{
			new Event("CALL_ERROR_CONGESTION");
			new Event("CALL_DISCONNECTED");
		}
		
		if(causeCode == CallFailCause.BEARER_NOT_AVAIL)
		{
			new Event("CALL_ERROR_CONGESTION");
			new Event("CALL_DISCONNECTED");
		}

Categories: Uncategorized
Follow

Get every new post delivered to your Inbox.