Wednesday 28 November 2012

Spiritual Policy Planning


A plethora of articales written and speeches have been delivered on the importance of spiritual development along with the development in the physical world. Scholars having thoughts and ideology of this “style” often have a religious disposition. This is the reason why many modern people don’t consider it worthwhile as we have made religiosity a separate entity. But this matter is a grave one and deserves a serious thought in real life.

If we look at the ramifications of not considering spiritual building in our society we realize that this negligence has wreaked havoc in our society. Today our nation has an obvious outlook of a crowd, or a mod exaggeratingly. There are several reasons for this menacingly odd situation, all spiritual in nature. This is not because we have less developed roads and buildings, less jobs or less education, rather because we have less clarity of our objectives, and aimless beings. Nation states are made by common ideology, sacrifice, law abidingness and truthfulness. All these qualities are spiritual in nature not material and require justice, equality, opportunity and inspiration to flourish. Unless and until these trends hold ground in a society, it can’t prosper.

It’s the philosophy of spiritual development that compels individuals to become moral beings. Spiritual strength makes men to overcome the material hurdles and keep working honestly on their ends otherwise they are lured and tempted to mould their ambitions towards wealth accumulation as they enter practical life. This is why the innocent and competent students wishing to join medical for helping miserable humanity get status sick after passing out of medical colleges and same for army officers and the likes. There may not be much difference in the actions of a spiritual and material being but difference of view as what a materialistic man does for his personal gain, a spiritually developed man dose the same for the betterment of humanity. When the stress of society is upon the wealth as the social symbol of superiority then every individual would enter the same race even unknowingly.

The question arises what ought to be done on government and social level. I leave this question unto you to think, to ponder and prove to yourself because as much we think about a matter, its importance its reality is engraved in our heart to help change us for ourselves.

Usman Akhlaq
(white.snowpeaks@gmail.com)

Saturday 24 November 2012

Java: Converting millisecond to hours and minutes


I was looking at the way and found it in the stackoverflow website:

public String convertMS(float ms) {
   int seconds = (int) ((ms / 1000) % 60);
   int minutes = (int) (((ms / 1000) / 60) % 60);
   int hours = (int) ((((ms / 1000) / 60) / 60) % 24);


String sec, min, hrs;
    if(seconds<10)  sec="0"+seconds;
    else            sec= ""+seconds;
    if(minutes<10)  min="0"+minutes;
    else            min= ""+minutes;
    if(hours<10)    hrs="0"+hours;
    else            hrs= ""+hours;


   if(hours == 0)  return minutes+":"+seconds + " MM:SS";
   else    return hours+":"+minutes+":"+minutes + "HH:MM:SS";

}

Here is the conversion:


x = ms / 1000
seconds = x % 60
x /= 60
minutes = x % 60
x /= 60
hours = x % 24
x /= 24
days = x

Monday 19 November 2012

Android: Starting new Activity with custom object through Intent


public class TaskActivity extends Activity
{

@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.task);
Intent i = getIntent();
Task task = (Task) i.getSerializableExtra("task");

if (task != null) displayValues(task);
configureButtons();
}
}


For the part that how it gets this object from the intent and how was it set to the intent please view my previous post . This post is in continuation of the previous

Android: OnItemClickListener Example in a ListView


public class TaskListActivity extends Activity implements OnItemClickListener
{
private TaskListAdapter adapter = null;

private ArrayList<Task> taskList = null;

private ListView list = null;

@Override
public void onCreate(Bundle savedInstanceState)
{

                super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
setContentView(R.layout.task_list);

fillTaskList();
adapter = new TaskListAdapter(this, taskList);
list = (ListView) findViewById(R.id.task_listview);
list.setAdapter(adapter);
list.setOnItemClickListener(this);
list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
}

@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
TaskListAdapter adp = (TaskListAdapter)parent.getAdapter();
Task task = adp.getItem(position);
System.out.print(task.getAddress());
Intent i = new Intent(view.getContext(), TaskActivity.class);
i.putExtra("task", task);
this.startActivity(i);
}
}

Sunday 18 November 2012

Android: Center align a button in a Linear layout xml

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                android:weightSum="1" >

                <LinearLayout
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:layout_weight="1"
                    android:weightSum="1">

                    <Button
                        android:id="@+id/working_hours_exit_btn"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:layout_weight=".2"
                        android:background="@drawable/exit"
                        android:hint="@string/working_hours_exit_btn_hint" />
                </LinearLayout>
            </TableRow>

Saturday 17 November 2012

Randomly


Since several years I have been witnessing the passing of time getting swift day by day, night to night. All that discussed is that time has become quick, much quick indeed. The people who have experienced the slow times and the calmness associated can only take a deep sigh to recall the past but cannot alter their schedules and activities to re-attain that grace, lost. Actually it can be possible, but certainly on a cost.

First of all we need to check and think what has caused such an overwhelming change. The answer is that the number of increased activities has rendered this happen. Today in every walk of life people have several things to deal with. To the foremost is the mobile or the cell phone (rightly christened in both cases). Every single person receives 20-200 written messages daily and frequent calls from people all over the society and all around the world, every caller having his matters and dealings. This implies in simple as that u have to work for all those people in some manner or the other as all have contacted you for some of their personal matters, that they feel you can help in.

Second in the row is the easy access to the newest appliances that have been made to make your life easier. It will be quite satirical to say but the reality is that most of the people (me included) press their clothes because an educated Englishman has invented the Iron. Most of the government institutions send you to the photocopier not because they want to solve your problem but for the reason that . . . . . . . they don’t know themselves exactly. We are using different perfumes, cosmetics, soaps, shampoos and all of different brands available at distant and different stores. Quite interestingly men (and the better half of course), living at this end of city get their desired shopping form the other end and vice versa. People in the twin cities have their favorite mechanics, hotels and shopping markets in their twin city, sadly not in their own.

Thirdly the rise of urban societies has created uncountable opportunities for the people of every class and section, be him a student, businessperson, graduate seeking a job and whatsoever. A student (be him of primary or a university) has uncountable educational institutions and fields to be chosen from. And same is for the other segments.

All what we are doing must not be for its sake but purposeful, all these activities must be selfless and disciplined. In fact this is the materialistic and capitalist society in which everything we are doing or wanting to do is for some sort of materialistic gain. Where this factor comes in the calmness, serenity, beauty and satisfaction excuses itself. Although the point remains that we have made our lives difficult in these manners that needs to be reconsidered and pondered deeply by every individual, what for am I running (like a horse), but the other more sophisticated and spiritual subject lays here. Fate is we destined for, nothing more nothing less, no one ever carried anything from the world then such a haste, greed and efforts for what? When the effort is objective the person remains calm, and when the end becomes the objective he gets frustrated, and efforts respite. The roles we are given must be played well instead of longings for the other roles. Experience is that when you make your position your passion, you become satisfied of life and the Nature recognizes your selflessness in its own manner, making you different and superior to all others seeking promotions.

(Usman Akhlaq)
white.snowpeaks@gmail.com