<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dale Mooney</title>
	<atom:link href="http://www.dalemooney.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dalemooney.co.uk</link>
	<description>The Rants Of A Programmer</description>
	<lastBuildDate>Fri, 04 May 2012 17:45:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Using the VBulletin Mobile API</title>
		<link>http://www.dalemooney.co.uk/2012/05/04/using-the-vbulletin-mobile-api/</link>
		<comments>http://www.dalemooney.co.uk/2012/05/04/using-the-vbulletin-mobile-api/#comments</comments>
		<pubDate>Fri, 04 May 2012 17:45:25 +0000</pubDate>
		<dc:creator>Dale Mooney</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Vbulletin]]></category>

		<guid isPermaLink="false">http://www.dalemooney.co.uk/?p=649</guid>
		<description><![CDATA[<p>I thought i would write something on about to use the VBulletin Mobile API. I created a simple class to get it to work. Basically i am creating a simple class to help do this.</p> <p>Then we can set some of the basic variables to store the client details and so on.</p> <p>Then we can [...]]]></description>
			<content:encoded><![CDATA[<p>I thought i would write something on about to use the VBulletin Mobile API. I created a simple class to get it to work. Basically i am creating a simple class to help do this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
class EmbersVBConnect
{

}
?&gt;
</pre>
<p>Then we can set some of the basic variables to store the client details and so on.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
class EmbersVBConnect
{
    private $clientname = &quot;Client Name&quot;;
    private $clientversion = &quot;0.1&quot;;
    private $platformname = &quot;PHP&quot;;
    private $platformversion = &quot;2.5&quot;;
    private $UID;

    public static $APIKEY = &quot;API KEY&quot;;
    private static $APIURL = &quot;http://www.website.com/api.php&quot;;

    private $VBInfo;
    private $APIINITPARAMS;
    private $APIINITURL;
    private $APICOMMON;
    private $LOGGEDINURL;
    private $SECRET;
}
?&gt;
</pre>
<p>Then we can add a constructor and set some variables</p>
<pre class="brush: php; title: ; notranslate">
public function __construct()
{
        $this-&gt;UID = md5(&quot;NAME OF CLIENT OR SOMETHING&quot;); //The Unique ID, does not have to be a hash value.

        $this-&gt;APIINITPARAMS = array(&quot;clientname&quot; =&gt; $this-&gt;clientname, &quot;clientversion&quot; =&gt; $this-&gt;clientversion, &quot;platformname&quot; =&gt; $this-&gt;platformname, &quot;platformversion&quot; =&gt; $this-&gt;platformversion, &quot;uniqueid&quot; =&gt; $this-&gt;UID);
        $this-&gt;APIINITURL = EmbersVBConnect::$APIURL.&quot;?api_m=api_init&amp;&quot;.  EmbersVBConnect::buildURL($this-&gt;APIINITPARAMS);
        //Initialize
        $this-&gt;init($this-&gt;APIINITURL);
}
</pre>
<p>1 . So we have set the UID, which is just an hashed version of some text. It does not have to be a hash, but i thought would give  a good key at least.<br />
2. Then the APIINITPARAMS is basically an array that stores the client details that will be passed to the init method of the API.<br />
3. Then we set the APIINITURL, which is the actual URL we will make the request to (You must first make a request to init method). So we take our websites URL www.website.com/api.php and then we put the api_m=init to call the init method. Then we use a static method called buildURL to build the rest of the URL from the array we created in the line above it. </p>
<pre class="brush: php; title: ; notranslate">
/**
* Build and return a string for the Array
* @param type $arrayOfData
*/
public static function buildURL($arrayOfData)
{
   ksort($arrayOfData);
   return http_build_query($arrayOfData, &quot;&quot;,&quot;&amp;&quot;);
}
</pre>
<p>This will simply turn that array into something like clientname=name&#038;clientversion=1.0 and so on. Now we simple pass our new URL into a method that will run init.</p>
<pre class="brush: php; title: ; notranslate">
/**
* This is run first when registering the client
* @param type $URL
*/
public function init($URL)
{
   $this-&gt;VBInfo = json_decode(file_get_contents($URL), true);
   $this-&gt;APICOMMON = array(&quot;api_c&quot; =&gt; $this-&gt;VBInfo['apiclientid'], &quot;api_s&quot; =&gt; $this-&gt;VBInfo['apiaccesstoken'], &quot;api_v&quot; =&gt; $this-&gt;VBInfo['apiversion']);
   $this-&gt;SECRET = $this-&gt;VBInfo['secret'];
}
</pre>
<p>This method simply runs the URL we created within the constructor. This returns the VBulletin information, which also includes the secret, apiclientid, accesstoken and so on. So we store that information in a new array called APICOMMON (we also store the Secret in its own variable just in case).</p>
<p>So now we have the basics set up and got the information we need to send requests. So we can retrieve information about a member using a simple method.</p>
<pre class="brush: php; title: ; notranslate">
/**
* Return a member details from forums
* @param type $username
*/
public function getMember($username)
{
        // Get Member info into an array and format for Sign
        $ParamsArray = array(&quot;api_m&quot; =&gt; &quot;member&quot;, &quot;username&quot; =&gt; $username);
        $ParamsURL = EmbersVBConnect::buildURL($UserParamsArray);
        $UrlStructure = array_merge($ParamsArray, $this-&gt;APICOMMON);
        $UrlStructure = EmbersVBConnect::buildURL($UrlStructure ,&quot;&quot;,&quot;&amp;&quot;);

        //We need to create a sign to which we add to our URLStructure later
        $Sign = md5($UserParams.$this-&gt;VBInfo['apiaccesstoken'].$this-&gt;VBInfo['apiclientid'].$this-&gt;VBInfo['secret'] . EmbersVBConnect::$APIKEY); 

        $UserUrl = $this-&gt;VBInfo['bburl'] . &quot;/api.php?&quot; . $UrlStructure . &quot;&amp;api_sig=&quot; . $Sign;
        return file_get_contents($UserUrl);

}
</pre>
<p>If you ever want to send a post request to your script, then its pretty easy in PHP.</p>
<pre class="brush: php; title: ; notranslate">
/**
     * Do a post request to URL
     * @param type $url
     * @param type $data
     * @return type
     */
    public function do_post_request($url, $data)
    {
          $newdata = array(&quot;vb_login_username&quot; =&gt; $data[&quot;vb_login_username&quot;], &quot;vb_login_md5password&quot; =&gt; md5($data[&quot;vb_login_password&quot;]));

          $ch = curl_init($url);
          curl_setopt($ch, CURLOPT_POST, 1);
          curl_setopt($ch, CURLOPT_POSTFIELDS, EmbersVBConnect::buildURL($newdata));
          curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
          $data = curl_exec($ch);

          curl_close($ch);
          return $data;
    }
</pre>
<p>I shall write more on how to send a login details anther time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalemooney.co.uk/2012/05/04/using-the-vbulletin-mobile-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding the basics of making an Android App</title>
		<link>http://www.dalemooney.co.uk/2012/04/15/understanding-the-basics-of-making-an-android-app/</link>
		<comments>http://www.dalemooney.co.uk/2012/04/15/understanding-the-basics-of-making-an-android-app/#comments</comments>
		<pubDate>Sun, 15 Apr 2012 21:20:22 +0000</pubDate>
		<dc:creator>Dale Mooney</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Android App]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.dalemooney.co.uk/?p=611</guid>
		<description><![CDATA[<p>I thought i would put together a collection of tutorials to show how to make Android Apps using Eclipse. I won&#8217;t be going through how to actually install everything, but i would recommend that you follow the PhoneGap getting started guide. You don&#8217;t actually need to use PhoneGap, but it does show you what you [...]]]></description>
			<content:encoded><![CDATA[<p>I thought i would put together a collection of tutorials to show how to make Android Apps using Eclipse. I won&#8217;t be going through how to actually install everything, but i would recommend that you follow the PhoneGap getting started guide. You don&#8217;t actually need to use PhoneGap, but it does show you what you need to install and so on. That can be found <a href="http://phonegap.com/start#android">here</a>.</p>
<p>Now assuming you have installed everything required. You can go a head and open up Eclipse and we can create a simple application. So simply click on file > new > Android Project (If you don&#8217;t see Android Project then you have not installed it correctly)</p>
<p><a href="http://www.dalemooney.co.uk/wp-content/uploads/2012/04/newproj.jpg"><img src="http://www.dalemooney.co.uk/wp-content/uploads/2012/04/newproj.jpg" alt="" title="newproj" width="813" height="720" class="aligncenter size-full wp-image-612" /></a></p>
<p>Once we select that we then get a new popup to name our project. Just give it a name (anything you want, i called mine HelloWorldApp).</p>
<p>Now it asks for us to select an API target. Of course selecting the correct one is important. If you want your app to work on older phones, then you will need to select a low API number. For the sake of this tutorial i used Android Open Source Project &#8211; API 7. You can of course use anyone you want.</p>
<p><strong><br />
<h2>Application Information</h2>
<p></strong></p>
<p><strong>Application Name:</strong> This is just the name of your app<br />
<strong>Package Name: </strong>This is just the package all your code will be put into<br />
<strong>Create Activity:</strong> This will be the main Activity of your application. This will be the first Activity loaded and will basically be the start point.<br />
<strong>Minimum SDK: </strong>This is the Minimum version of Android needed to use your app.</p>
<p>Don&#8217;t worry about Create a Test Project</p>
<p><strong><br />
<h2>Getting Started</h2>
<p></strong></p>
<p>Now your workspace should be set up and in your Package Explorer (usually on the Left) you should see your App folder set up. You should see the following Folder set up.</p>
<p><strong>src -</strong> This is where your java files will be for your app. You will notice the Activity you created is in there.<br />
<strong>gen &#8211; </strong>This is not important, only you will be using the R.java file to access resources<br />
<strong>Android 2.1 (or whatever version you picked) -</strong> Dont worry about it<br />
<strong>Assets -</strong> Not needed in this tutorial. If you use PhoneGap, this folder will be used to store html files and so on.<br />
<strong>bin &#8211; </strong>Not needed in this tutorial<br />
<strong>res -</strong> This is the resource folder and will contain all your applications images, icons and layouts. These resources can be accessed using the R.java file (more on that later).</p>
<p><strong><br />
<h2>AndroidManifest.xml</h2>
<p></strong></p>
<p>Before the Android system can start an application component, the system must know that the component exists by reading the application&#8217;s AndroidManifest.xml file (the &#8220;manifest&#8221; file). Your application must declare all its components in this file, which must be at the root of the application project directory. </p>
<p>You can find out more <a href="http://developer.android.com/guide/topics/fundamentals.html#Manifest">here </a></p>
<p><strong><br />
<h2>Resources</h2>
<p></strong></p>
<p>Under the res folder you will notice a couple of other folders. All these resources can be accessed using the R.java file (explained later).</p>
<p><strong>drawable-hdpi </strong>- high quality images here<br />
<strong>drawable-ldpi </strong>- low quality images here<br />
<strong>drawable-mdpi</strong> &#8211; medium quality images here<br />
<strong>layout</strong> &#8211; stores XML layouts (made up of buttons, lists and so on).<br />
<strong>values </strong>- this stores values that can be used in the game. For instance if you wanted to support other languages. This could store values that can be referenced in your app. </p>
<h2>Looking at code</h2>
<p>Go ahead and open up the Activity file that was automatically created when you created the project. This is under the src > package name folder and you should see something as follows:</p>
<pre class="brush: java; title: ; notranslate">
package hello.world.app;

import android.app.Activity;
import android.os.Bundle;

public class HelloWorldAppActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}
</pre>
<p>When the application is started the onCreate method is always run first when an Activity starts. So this is a good place to do some setting up. You can also see that our HelloWorldActivity extends Activity and that we are overriding the Activity classes version of onCreate, but still sending data up to it.</p>
<p>You will also notice that we have set a content view and also used the R.java file as mentioned before (R.layout.main). This means we have loaded the layout file in the folder layout with the name main (with extension .xml). You can also open this file and mess with the layout. Luckily eclipse does allow you to view it as it would look on the phone and also allow you to click and drag new things onto it. (It can take a couple seconds to load the main.xml file).</p>
<p>We can also view the code of the file by selecting the the main.xml tab (next to Graphical Layout). The code looks like:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;fill_parent&quot;
    android:orientation=&quot;vertical&quot; &gt;

    &lt;TextView
        android:layout_width=&quot;fill_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;@string/hello&quot; /&gt;

&lt;/LinearLayout&gt;
</pre>
<p>You will notice a couple things. Where it says android:text&#8221;@string/hello&#8221;. Well this simply refers to the value stored in &#8220;hello&#8221; within the values folder and in the file strings.xml. </p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;resources&gt;

    &lt;string name=&quot;hello&quot;&gt;Hello World, HelloWorldAppActivity!&lt;/string&gt;
    &lt;string name=&quot;app_name&quot;&gt;HelloWorldApp&lt;/string&gt;

&lt;/resources&gt;
</pre>
<p>Thats the reason when in the graphical view of the main.xml file. We can see the text that is stored in the strings.xml file.</p>
<h2>Activity</h2>
<p>An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map. Each activity is given a window in which to draw its user interface. The window typically fills the screen, but may be smaller than the screen and float on top of other windows.</p>
<p>So our application will be made from a number of different Activities. You remember that we had in our activity onCreate method, but we can also override other methods (that should be implemented when cleaning up things)</p>
<pre class="brush: java; title: ; notranslate">
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // The activity is being created.
    }
    @Override
    protected void onStart() {
        super.onStart();
        // The activity is about to become visible.
    }
    @Override
    protected void onResume() {
        super.onResume();
        // The activity has become visible (it is now &quot;resumed&quot;).
    }
    @Override
    protected void onPause() {
        super.onPause();
        // Another activity is taking focus (this activity is about to be &quot;paused&quot;).
    }
    @Override
    protected void onStop() {
        super.onStop();
        // The activity is no longer visible (it is now &quot;stopped&quot;)
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        // The activity is about to be destroyed.
    }
</pre>
<p>You don&#8217;t have to implement them all, but you should be aware of them and understanding them will help you stop errors. You can understand how the life cycle works by looking at this picture.</p>
<p><img alt="" src="http://developer.android.com/images/activity_lifecycle.png" title="http://developer.android.com/images/activity_lifecycle.png" class="alignnone" width="523" height="673" /></p>
<h2>Making a new activity</h2>
<p>You can make a new activity simply by adding a new Java file (in the same folder the first Activity). There are a couple things you need to consider doing before it will work though. Whenever you add a new Activity, you need to add it to the AndroidManifest otherwise it won&#8217;t recognize it.</p>
<p>You can add a new Activity by right clicking on the package name under the src folder and click New > Class. When the popup appears simply give it a name. Its a good idea to give it a meaningful name and also finish it with Activity so, AboutActivity.java or something similar. This Activity will display show the about information.To make it easier you should place <strong>android.app.Activity</strong> in the superclass field provided.</p>
<p>When it is created it be as follows:</p>
<pre class="brush: java; title: ; notranslate">
package hello.world.app;

import android.app.Activity;

public class AboutActivity extends Activity {

}
</pre>
<p>It is missing the onCreate method of course.</p>
<pre class="brush: java; title: ; notranslate">
package hello.world.app;

import android.app.Activity;
import android.os.Bundle;

public class AboutActivity extends Activity {
	 /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}
</pre>
<p>As mentioned before we need to register that new Activity in the Manifest, so open the AndroidManifest and select the AndroidManifest.xml tab to view the code. We simply add a new Activity tag as follows.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;activity
   android:name=&quot;.AboutActivity&quot; &gt;
&lt;/activity&gt;
</pre>
<p>So now our manifest looks like</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    package=&quot;hello.world.app&quot;
    android:versionCode=&quot;1&quot;
    android:versionName=&quot;1.0&quot; &gt;

    &lt;uses-sdk android:minSdkVersion=&quot;7&quot; /&gt;

    &lt;application
        android:icon=&quot;@drawable/ic_launcher&quot;
        android:label=&quot;@string/app_name&quot; &gt;
        &lt;activity
            android:label=&quot;@string/app_name&quot;
            android:name=&quot;.HelloWorldAppActivity&quot; &gt;
            &lt;intent-filter &gt;
                &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;

                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
         &lt;activity
            android:name=&quot;.AboutActivity&quot; &gt;
         &lt;/activity&gt;
    &lt;/application&gt;

&lt;/manifest&gt;
</pre>
<p>We also need to add a new layout file for our new Activity. This is the layout that will be loaded when the Activity is created. So you can right click on the Layout folder in the Res folder <strong>> New > Android XML file</strong>. Then its a matter of selecting some settings to make it easier for yourself.</p>
<p><a href="http://www.dalemooney.co.uk/wp-content/uploads/2012/04/newxmlfile.jpg"><img src="http://www.dalemooney.co.uk/wp-content/uploads/2012/04/newxmlfile.jpg" alt="" title="newxmlfile" width="525" height="563" class="aligncenter size-full wp-image-635" /></a></p>
<p>Now we have a new layout and tell our AboutActivity to load that layout using the R.java file as used before. Now out AboutActivity code would like the following</p>
<pre class="brush: java; title: ; notranslate">

package hello.world.app;

import android.app.Activity;
import android.os.Bundle;

public class AboutActivity extends Activity {
	 /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.about);
    }
}
</pre>
<p>We have used <strong>R.layout.about </strong> to refer to our new layout file.</p>
<h2>Switching between Activities</h2>
<p>So now we can switch between the two activities. We shall create a button in our main.xml file as follows</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;fill_parent&quot;
    android:orientation=&quot;vertical&quot; &gt;

    &lt;TextView
        android:layout_width=&quot;fill_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;@string/hello&quot; /&gt;

    &lt;Button
        android:id=&quot;@+id/button1&quot;
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Show About&quot; /&gt;

&lt;/LinearLayout&gt;
</pre>
<p>So we now have a TextView and a button underneath it. Now we need to write the code to make that button do something when clicked. So we go back to our MainActivity java file and update it</p>
<pre class="brush: java; title: ; notranslate">
package hello.world.app;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class HelloWorldAppActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        //Our button in main.xml with the id button1
        Button aboutButton = (Button) this.findViewById(R.id.button1);
        aboutButton.setOnClickListener(new OnClickListener(){
		@Override
		public void onClick(View arg0) {

		}
        });
    }
}
</pre>
<p>So we have created a new variable with the data type Button (we have to import the library also). Then we use findViewById method to find the button we are looking (we reference to it by its id as defined in the XML file). Then we cast it to a Button.</p>
<p>Now we set the OnClickListener and create an instance of the <strong>OnClickListener </strong>interface and implement the required method <strong>onClick</strong>. Within this <strong>onClick </strong>method we simply put the code to jump to the other Activity we have created. Now when ever that button is clicked. That onClick method will be run and any code within it.</p>
<h2>Intent</h2>
<p>In order to switch between Activities and load other programs and so on. We need to use a thing known as an Intent. This is basically something that is passed to and from Activities to say you want to do something. So we want to load a new Activity. So we need to create an Intent and pass it to a function called <strong>startActivity</strong> and we need to pass it an Intent with the details of the intent we wish to run.</p>
<pre class="brush: java; title: ; notranslate">
@Override
public void onClick(View view) {
    view.getContext().startActivity(new Intent(view.getContext(), AboutActivity.class));
}
</pre>
<p>Now our onClick method looks as above. You will also need to important the Intent library to the top. You are to provide the Context and the name of the class of the Activity you wish to load (as shown above). Now when you run the code (it should load up Emulator, but you can connect your phone to test the app, which is faster)</p>
<p>I think that&#8217;s a good start. I shall continue soon <img src='http://www.dalemooney.co.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalemooney.co.uk/2012/04/15/understanding-the-basics-of-making-an-android-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Something from nothing</title>
		<link>http://www.dalemooney.co.uk/2012/02/14/something-from-nothing/</link>
		<comments>http://www.dalemooney.co.uk/2012/02/14/something-from-nothing/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 23:55:11 +0000</pubDate>
		<dc:creator>Dale Mooney</dc:creator>
				<category><![CDATA[Lawrence Krauss]]></category>
		<category><![CDATA[Richard Dawkins]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Something from nothing]]></category>

		<guid isPermaLink="false">http://www.dalemooney.co.uk/?p=572</guid>
		<description><![CDATA[<p></p> <p>After having watched a couple of things from Dr Lawrence Krauss. I have recently <a href="http://www.amazon.co.uk/gp/product/145162445X/ref=pd_lpo_k2_dp_sr_1?pf_rd_p=103612307&#038;pf_rd_s=lpo-top-stripe&#038;pf_rd_t=201&#038;pf_rd_i=0590472801&#038;pf_rd_m=A3P5ROKL5A1OLE&#038;pf_rd_r=0R393PY7FPXBPS1F0YPY">brought his book</a> to go with said subject and i would highly recommend it from what i have read so far.</p> <p>The good thing about Lawrence Krauss is that he makes science fun. He likes to drop in jokes [...]]]></description>
			<content:encoded><![CDATA[<p><iframe width="560" height="315" src="http://www.youtube.com/embed/YUe0_4rdj0U" frameborder="0" allowfullscreen></iframe></p>
<p>After having watched a couple of things from Dr Lawrence Krauss. I have recently <a href="http://www.amazon.co.uk/gp/product/145162445X/ref=pd_lpo_k2_dp_sr_1?pf_rd_p=103612307&#038;pf_rd_s=lpo-top-stripe&#038;pf_rd_t=201&#038;pf_rd_i=0590472801&#038;pf_rd_m=A3P5ROKL5A1OLE&#038;pf_rd_r=0R393PY7FPXBPS1F0YPY">brought his book</a> to go with said subject and i would highly recommend it from what i have read so far.</p>
<p>The good thing about Lawrence Krauss is that he makes science fun. He likes to drop in jokes now and then, which makes watching him all the better.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalemooney.co.uk/2012/02/14/something-from-nothing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apps are easy</title>
		<link>http://www.dalemooney.co.uk/2012/02/07/apps-are-easy/</link>
		<comments>http://www.dalemooney.co.uk/2012/02/07/apps-are-easy/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 14:39:26 +0000</pubDate>
		<dc:creator>Dale Mooney</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[PhoneGap]]></category>

		<guid isPermaLink="false">http://www.dalemooney.co.uk/?p=563</guid>
		<description><![CDATA[<p>Now over the past couple weeks or month. I have noticed how easy it is to make apps for phones now. What i mean by that is the fact that there so many new tools available to the average person now. Now in order to make an impressive app, id safely say you need some [...]]]></description>
			<content:encoded><![CDATA[<p>Now over the past couple weeks or month. I have noticed how easy it is to make apps for phones now. What i mean by that is the fact that there so many new tools available to the average person now. Now in order to make an impressive app, id safely say you need some programming experience, but now with the use of JQuery and HTML5 its making the whole process a lot easier.</p>
<p><strong>Dreamweaver CS5.5</strong></p>
<p>I have noticed that the newer version of Dreamweaver now allows you to create apps.</p>
<p><a href="http://www.dalemooney.co.uk/wp-content/uploads/2012/02/dreamweaver.png"><img src="http://www.dalemooney.co.uk/wp-content/uploads/2012/02/dreamweaver-1024x615.png" alt="" title="dreamweaver" width="915" height="549" class="aligncenter size-large wp-image-564" /></a></p>
<p>And the thing is that although i found installing the Android SDK onto your machine and setting it up via Eclipse can be a pain, but with Dreamweaver its no problem at all. Of course the fact you have to pay for Dreamweaver is a pain i know, but hey, its worth a trial run.</p>
<p><strong>Things to look into</strong></p>
<p>If you find yourself interested in learning how to make apps for your phone. Then i can suggest looking at the following:</p>
<ul>
<ol> http://phonegap.com/ </ol>
<ol> http://jquerymobile.com/ </ol>
</ul>
<p>I think at some point i shall write a small tutorial on how to make a simple app with the tools mentioned. So i guess watch this space.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalemooney.co.uk/2012/02/07/apps-are-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UK government bans creationist schools</title>
		<link>http://www.dalemooney.co.uk/2012/01/12/uk-government-bans-creationist-schools/</link>
		<comments>http://www.dalemooney.co.uk/2012/01/12/uk-government-bans-creationist-schools/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 13:10:10 +0000</pubDate>
		<dc:creator>Dale Mooney</dc:creator>
				<category><![CDATA[Atheist]]></category>
		<category><![CDATA[Creationism]]></category>
		<category><![CDATA[Religion]]></category>
		<category><![CDATA[Banned]]></category>
		<category><![CDATA[UK]]></category>

		<guid isPermaLink="false">http://www.dalemooney.co.uk/?p=543</guid>
		<description><![CDATA[<p>The British Humanist Association (BHA) has welcomed a new revision of the model funding agreement for Free Schools by the Government in order to preclude ‘the teaching, as an evidence-based view or theory, of any view or theory that is contrary to established scientific and/or historical evidence and explanations.’ This highly significant change has been [...]]]></description>
			<content:encoded><![CDATA[<p>The British Humanist Association (BHA) has welcomed a new revision of the model funding agreement for Free Schools by the Government in order to preclude ‘the teaching, as an evidence-based view or theory, of any view or theory that is contrary to established scientific and/or historical evidence and explanations.’ This highly significant change has been made in order to ban creationism from being taught in Free Schools, and prevent creationist groups from opening schools. The change follows the BHA coordinating the ‘Teach evolution, not creationism!’ campaign, which called for this precise change.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalemooney.co.uk/2012/01/12/uk-government-bans-creationist-schools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NewsBook Update</title>
		<link>http://www.dalemooney.co.uk/2012/01/07/newsbook-update/</link>
		<comments>http://www.dalemooney.co.uk/2012/01/07/newsbook-update/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 20:11:02 +0000</pubDate>
		<dc:creator>Dale Mooney</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[News Book]]></category>
		<category><![CDATA[News Script]]></category>
		<category><![CDATA[Simple News Script]]></category>

		<guid isPermaLink="false">http://www.dalemooney.co.uk/?p=548</guid>
		<description><![CDATA[<p>I have updated the newsbook script to add more features and make it look a lot better. </p> * Comments can now be toggled (hidden)<br /> * WYSIWYG editor has now been added to allow for HTML (safely)<br /> * Style has been updated<br /> * JQuery is now used to make system flow better [...]]]></description>
			<content:encoded><![CDATA[<p>I have updated the newsbook script to add more features and make it look a lot better. </p>
<ul>
* Comments can now be toggled (hidden)<br />
* WYSIWYG editor has now been added to allow for HTML (safely)<br />
* Style has been updated<br />
* JQuery is now used to make system flow better and look better<br />
* Copyright has been added to system (with link to my website)
</ul>
<p><a  title='NewsBook 1.0.1' href='http://www.dalemooney.co.uk/?wpdmact=process&did=MS5ob3RsaW5r' style="background:url('http://www.dalemooney.co.uk/wp-content/plugins/download-manager/icon/download.png') no-repeat;padding:3px 12px 12px 28px;font:bold 10pt verdana;">Download</a><br><small style='margin-left:30px;'>Downloaded 6229 times</small></p>
<p>You can find more information on the <a href="http://www.dalemooney.co.uk/news-book/">NewsBook</a> page</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalemooney.co.uk/2012/01/07/newsbook-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NASA investigates &#8220;tractor beams&#8221;</title>
		<link>http://www.dalemooney.co.uk/2012/01/06/nasa-investigates-tractor-beams/</link>
		<comments>http://www.dalemooney.co.uk/2012/01/06/nasa-investigates-tractor-beams/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 00:22:02 +0000</pubDate>
		<dc:creator>Dale Mooney</dc:creator>
				<category><![CDATA[Science]]></category>
		<category><![CDATA[Beam]]></category>
		<category><![CDATA[Tractor Beam]]></category>

		<guid isPermaLink="false">http://www.dalemooney.co.uk/?p=528</guid>
		<description><![CDATA[<p>It would seem that NASA is doing some investigation into &#8220;Tractor Beams&#8221;, which is a laser that can trap moving objects. It will be used to gather samples for analysis on distant planets and moons. The US space agency has handed out over £62,000 for an investigation into the best collection methods for use in [...]]]></description>
			<content:encoded><![CDATA[<p>It would seem that NASA is doing some investigation into &#8220;Tractor Beams&#8221;, which is a laser that can trap moving objects. It will be used to gather samples for analysis on distant planets and moons. The US space agency has handed out over £62,000 for an investigation into the best collection methods for use in space.</p>
<p>Dr Paul Stysley says</p>
<blockquote><p>&#8220;Experiments have shown that laser-based trapping of particles is not beyond us&#8221;</p></blockquote>
<p>Who is the principal investigator on tractor beam research at NASA&#8217;s Goddard Space Flight Center.</p>
<blockquote><p>&#8220;If we can figure out the best way to do it, then scale it up, we could collect samples from, say, comet tails over greater distances and longer time periods than is  possible.&#8221;</p></blockquote>
<p>The first technique being explored is &#8220;optical tweezers&#8221;, which is already used on Earth. Others include solenoid beams, Bessel beam, but of course it&#8217;s still early days.</p>
<blockquote><p>
  Just trying to move tiny particles at the distances required for sample collection is an ambitious goal, which is probably 10 years away&#8221;
</p></blockquote>
<p>Apparently it was first thought to use it for cleaning up orbital debris. But to control something so large is far beyond current technology. So it would seem that soon Star Trek will become a thing of fact, rather than fiction! (in terms of actually producing the technology involved in Star Trek).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalemooney.co.uk/2012/01/06/nasa-investigates-tractor-beams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selection &amp; Iteration as used in computer programming &#8211; IF statements</title>
		<link>http://www.dalemooney.co.uk/2011/12/30/selection-iteration-as-used-in-computer-programming-if-statements/</link>
		<comments>http://www.dalemooney.co.uk/2011/12/30/selection-iteration-as-used-in-computer-programming-if-statements/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 17:08:55 +0000</pubDate>
		<dc:creator>Dale Mooney</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Else]]></category>
		<category><![CDATA[Else if]]></category>
		<category><![CDATA[If]]></category>
		<category><![CDATA[Selection]]></category>

		<guid isPermaLink="false">http://www.dalemooney.co.uk/?p=512</guid>
		<description><![CDATA[<p>At some point in learning to program, you will have to have fun with IF statements or selection methods. This includes, but not limited to Switch, IF and so on. Understanding them is fundamental to learning to program.</p> <p>Understanding the IF</p> <p>At some point your program will need to make a choice to where it [...]]]></description>
			<content:encoded><![CDATA[<p>At some point in learning to program, you will have to have fun with IF statements or selection methods. This includes, but not limited to Switch, IF and so on. Understanding them is fundamental to learning to program.</p>
<p><strong>Understanding the IF</strong></p>
<p>At some point your program will need to make a choice to where it should go and what code to run depending on a condition. So we can create a small C++ program that uses a simple If statement.</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;iostream&gt;
using namespace std;

int main()
{
	int age = 23;

	if(age &lt; 18)
	{
		cout &lt;&lt; &quot;You're under age!&quot;;
	}

	system(&quot;PAUSE&quot;);
	return 0;
}
</pre>
<p>So we have created a simple condition. The condition used within the ( ) of the If statement is as follows:</p>
<blockquote><p> IF AGE IS LESS THAN 18 THEN SAY YOU&#8217;RE UNDER AGE </p></blockquote>
<p>It does help to try and visualize how IF statements look and one way to do that would be as shown below.</p>
<p><a href="http://www.dalemooney.co.uk/wp-content/uploads/2011/12/if.jpg"><img src="http://www.dalemooney.co.uk/wp-content/uploads/2011/12/if.jpg" alt="" title="if" width="373" height="236" class="aligncenter size-full wp-image-515" /></a></p>
<p>The diamond shape represents a decision that has to be made by the program, it can either go straight down or to the right. So the value stored in the variable age determines how the program will flow. Sometimes however, you want your program to make a choice between certain conditions. So say we wanted to display a website content depending on age. So if they are over a certain age, the website will display something different.</p>
<pre class="brush: cpp; title: ; notranslate">
int main()
{
	int age = 23;

	if(age &gt; 40)
	{
		//DISPLAY OVER 40 CONTENT
	}
	else
	{
		//DISPLAY CONTENT FOR ANYONE 40 OR UNDER
	}

	system(&quot;PAUSE&quot;);
	return 0;
}
</pre>
<p>So we have introduced the ELSE, this means that if the IF statement condition fails it will move down and run the else (the else does not have a condition, but only runs if all else fails).</p>
<p><a href="http://www.dalemooney.co.uk/wp-content/uploads/2011/12/ifelse.jpg"><img src="http://www.dalemooney.co.uk/wp-content/uploads/2011/12/ifelse.jpg" alt="" title="ifelse" width="426" height="283" class="aligncenter size-full wp-image-518" /></a></p>
<p>An if statement can be very long and you can also use something called else if as shown below.</p>
<pre class="brush: cpp; title: ; notranslate">
int main()
{
	int age = 23;

	if(age &gt; 40)
	{
		//DISPLAY OVER 40 CONTENT
	}
	else if(age &lt; 10)
	{
		//DISPLAY UNDER 10 CONTENT
	}
	else
	{
		//DISPLAY CONTENT FOR ANYONE 40 OR UNDER
	}

	system(&quot;PAUSE&quot;);
	return 0;
}
</pre>
<p>Now this Else if can be pictured as below:</p>
<p><a href="http://www.dalemooney.co.uk/wp-content/uploads/2011/12/ifelseif.jpg"><img src="http://www.dalemooney.co.uk/wp-content/uploads/2011/12/ifelseif.jpg" alt="" title="ifelseif" width="367" height="412" class="aligncenter size-full wp-image-521" /></a></p>
<p>So you can see that the else if will only be reached if the first IF is not true. If the first one is true, then the else if is not reached. However, if you where to get rid of the else from in front of the else if. Then we would have a different result. The two if statements could be considered separate, rather than one block of statements.</p>
<pre class="brush: cpp; title: ; notranslate">
int main()
{
	int age = 23;

	if(age &gt; 40)
	{
		//DISPLAY OVER 40 CONTENT
	}

	if(age &lt; 10)
	{
		//DISPLAY UNDER 10 CONTENT
	}
	else
	{
		//DISPLAY CONTENT FOR ANYONE 40 OR UNDER
	}

	system(&quot;PAUSE&quot;);
	return 0;
}
</pre>
<p><a href="http://www.dalemooney.co.uk/wp-content/uploads/2011/12/ifif.jpg"><img src="http://www.dalemooney.co.uk/wp-content/uploads/2011/12/ifif.jpg" alt="" title="ifif" width="322" height="410" class="aligncenter size-full wp-image-523" /></a></p>
<p>So the else belongs to the if(age < 10) block and not the if(age > 40). So we have two separate statement blocks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalemooney.co.uk/2011/12/30/selection-iteration-as-used-in-computer-programming-if-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kinect weighs astronauts just by looking at them</title>
		<link>http://www.dalemooney.co.uk/2011/12/30/kinect-weighs-astronauts-just-by-looking-at-them/</link>
		<comments>http://www.dalemooney.co.uk/2011/12/30/kinect-weighs-astronauts-just-by-looking-at-them/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 16:02:33 +0000</pubDate>
		<dc:creator>Dale Mooney</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Astronauts]]></category>
		<category><![CDATA[Kinect]]></category>

		<guid isPermaLink="false">http://www.dalemooney.co.uk/?p=505</guid>
		<description><![CDATA[<p>Although i never really liked the idea behind waving and jumping around my room in order to play a game, but the Kinect can have many other uses. So instead of being used to track idiots plodding around their rooms, it can actually do something useful.</p> <p>Because astronauts tend to lose body due to muscle [...]]]></description>
			<content:encoded><![CDATA[<p>Although i never really liked the idea behind waving and jumping around my room in order to play a game, but the Kinect can have many other uses. So instead of  being used to track idiots plodding around their rooms, it can actually do something useful.</p>
<p>Because astronauts tend to lose body due to muscle atrophy (lack of using muscles in space). So astronauts have to exercise 2 hours per day in order to prevent this. The current system to weigh them is cumbersome and uses precious resources.</p>
<p>So now the Kinect can be used to create a 3D model of an astronaut, then using calculations from a statistical model that links weight to body measurements from a database of 28,000 people. It is about 97% accurate, but some would suggest that the micro gravity shifts water around inside the body, which means their density may not match the assumptions.</p>
<p>The system has yet to be tested in space, but it does look good for the future of such devices. I hope to see such things in the future. Although of course without the people who like to jump around their living room with such a device, then i guess we wouldn&#8217;t have the connect in the first place.</p>
<p><a href="http://www.newscientist.com/article/mg21228443.700-kinect-weighs-astronauts-just-by-looking-at-them.html">Read More</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalemooney.co.uk/2011/12/30/kinect-weighs-astronauts-just-by-looking-at-them/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>God Is Not Great</title>
		<link>http://www.dalemooney.co.uk/2011/12/24/god-is-not-great/</link>
		<comments>http://www.dalemooney.co.uk/2011/12/24/god-is-not-great/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 22:41:57 +0000</pubDate>
		<dc:creator>Dale Mooney</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.dalemooney.co.uk/?p=494</guid>
		<description><![CDATA[<p>Another reason to make you an atheist would be to read the responses of the whole trend issue that arose after the death of Christopher Hitchens who died on 15 December 2011, after a two year fight against esophageal cancer. Of course not long after he passed away, a flurry of tweets and a new [...]]]></description>
			<content:encoded><![CDATA[<p>Another reason to make you an atheist would be to read the responses of the whole trend issue that arose after the death of Christopher Hitchens who died on 15 December 2011, after a two year fight against  esophageal cancer. Of course not long after he passed away, a flurry of tweets and a new trend appeared (<a href="http://www.twitter.com">#GodIsNotGreat</a>), you can guess that the religious nuts come out of the wood works and let rip their death threats and insults towards anyone who even agreed with said trend. </p>
<p>After a while the trend died down, but a lot of people thought it was because Twitter censored it, but that is not the case. They have nothing to do with trends and preventing them, they simply use an algorithm and because trends never last that long, so it was of course obvious that it would eventually die down. <a href="http://gizmodo.com/5868917/shutup-twitter-isnt-censoring-your-dumb-trends">You can read more here</a>.</p>
<p><strong>Some shameful reactions</strong></p>
<blockquote><p>WHAT THE FUCKING FUCK?, Whoever started #GodIsNotGreat needs the shit beat out of them! >:I HOW DARE YOU!</p></blockquote>
<blockquote><p>#GodIsNotGreat Gotta kill the person who said this..!</p></blockquote>
<blockquote><p>If you&#8217;re really comin up with reason why #GodIsNotGreat, kill yourself.</p></blockquote>
<p><strong>My favorite of course, which just proves my point about being glad to be an atheist.</strong></p>
<blockquote><p>#Whoever said #GodIsNotGreat shoot yourself! U sound real stupid. His the Greatest:*</p></blockquote>
<p>The educational system at its best there. I could more than likely make a safe bet that most of these comments are from the pleasant people of the USA, but that&#8217;s just a guess of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalemooney.co.uk/2011/12/24/god-is-not-great/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

