tag:blogger.com,1999:blog-19356118300083278942024-03-04T22:49:03.877-08:00West Coast LabsAnonymoushttp://www.blogger.com/profile/15796785534148560276noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-1935611830008327894.post-9212270311863572842014-09-10T08:02:00.000-07:002014-10-07T07:40:23.147-07:00Quick WiFi v1.0<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCKLRt43fBU17p8L06T8mFAx0DmJq1H3phAE-4KFBURZ18J-h67qcWRmL-baWT4tTsq9aeKPN8M16cghx7hIPcTqcC0WKOUXfC-7d9t2kbjLOQPPp6kMNqWZ-kllaaJ3_h6Xx2OPnTPPY/s1600/readmelogo.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCKLRt43fBU17p8L06T8mFAx0DmJq1H3phAE-4KFBURZ18J-h67qcWRmL-baWT4tTsq9aeKPN8M16cghx7hIPcTqcC0WKOUXfC-7d9t2kbjLOQPPp6kMNqWZ-kllaaJ3_h6Xx2OPnTPPY/s1600/readmelogo.png" /></a><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">QuickWiFi aims to make connecting to a WiFi AP easier, especially when WiFi keys (WEP or WPA2) are usually annoyingly long random alphanumeric strings.</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></span>
<br />
<div style="font-family: 'Times New Roman';">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;">Using OCR</span><span style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"> </span><span style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;">(Optical Character Recognition)</span><span style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"> Quick WiFi parses in the SSID and Key of a WiFi network from an image, and connects to the network automatically. The whole process (when it works), can take much less time than it takes to read and type in a long password on the back of a WiFi router.</span></span></div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"></span><br />
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"><br /></span></span></div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">
I started this project back at the start of summer. It is intended as a novelty use of the <a href="https://github.com/rmtheis/tess-two" target="_blank">Tesseract</a> OCR system, compiled for android. With some more work the app could in theory become useful for real world application, but at the moment it only performs well under "controlled conditions".</span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><b>How it works</b></span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"></span><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">1. Quick WiFi uses the android camera library to create it's own camera instance </span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">2. The user takes a photo </span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">3. The user crops the photo to try and include just the SSID and Key text, using the <a href="https://github.com/jdamcd/android-crop" target="_blank">android-crop</a> library, in order to improve the accuracy of OCR reading (removal of extraneous text) </span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">4. Quick WiFi then calls <a href="https://github.com/rmtheis/tess-two" target="_blank">Tesseract</a> to extract the text from the cropped image </span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">5. Then the SSID and the Key is extracted from the text </span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">6. Quick WiFi calculates the hamming distance of the SSID against the SSID of each currently available WiFi connection (This allows space for error in the SSID but not in the key) </span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">7. It then connects the network with the shortest hamming distance using the acquired key.</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8BdJ0-T4vkzUqAsVacZsuJ72-3rbmhBuO3XWrx3HC4VFhVEEGbJlhXSguyPHLqGxdAwHb122Ac-6QGUK-9GbueYYaYzqRYnOar1OLqWoT2Gv2tviuLjk3eX35oyruyFC0KI3Hq7tySzc/s1600/wireless-details.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8BdJ0-T4vkzUqAsVacZsuJ72-3rbmhBuO3XWrx3HC4VFhVEEGbJlhXSguyPHLqGxdAwHb122Ac-6QGUK-9GbueYYaYzqRYnOar1OLqWoT2Gv2tviuLjk3eX35oyruyFC0KI3Hq7tySzc/s1600/wireless-details.jpg" /></a><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><b>Ideal conditions</b></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">On my travels I noticed that in the places I stay in (ranging from hostels to B&Bs to hotels) most places opt for the WiFi network name and password written on a piece of paper on the wall in the lobby or in your room. For Quick WiFi, these conditions are ideal as the text is normally large and clear. However when it comes to the back of a router, the text is normally very small and Quick WiFi can struggle to produce accurate results.</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><b>Further Work </b></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">The reliability of OCR results on Quick WiFi are only as accurate as the Tesseract library will produce. OCR is still an ongoing research area in Computer Science.</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">The Parsing of SSID and Password in Quick WiFi is still very primitive, and It matches on only a few key words and arrangements of this information. NLP techniques could be implemented in it's place but it could also be overkill for such a small amount of text. A slightly </span><span style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;">more</span><span style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"> sophisticated algorithm would suffice.</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><b>Download</b></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">You have the following options;<br />- Clone <a href="https://github.com/philleonard/Quick-Wifi" target="_blank">GitHub</a> repository and compile using gradle<br />- <a href="https://dl.dropboxusercontent.com/s/gqxf060x4z9q4su/quickWifi-debug.apk?dl=1" target="_blank">Bleeding edge download </a><br />- <a href="https://dl.dropboxusercontent.com/s/guaxjn7gnbk45ho/QuickWifi.apk?dl=1" target="_blank">Version 1.0 download </a></span><br />
<br />
<pre></pre>
<pre><span style="font-family: Arial, Helvetica, sans-serif;"><b>Screenshots</b></span><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihIJ4qgKnN8cmmuj0_C7yJYHCT0QITLLQygbVLcUwV5dfKsxEKKJJY_mvRXilxLPlN_tEabBusrs0dzvmEz5IyuRLUgS1SECpwM0GexMYWgebLXZP6WQbGRTOyB5vporloLglOy306y6M/s1600/photo.png" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihIJ4qgKnN8cmmuj0_C7yJYHCT0QITLLQygbVLcUwV5dfKsxEKKJJY_mvRXilxLPlN_tEabBusrs0dzvmEz5IyuRLUgS1SECpwM0GexMYWgebLXZP6WQbGRTOyB5vporloLglOy306y6M/s1600/photo.png" height="224" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Capturing</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjebJE-0khWr6nxjtnyjYw5El7Ztchw4KQ0GuMC9uRQfJ4usca9o63M0tO6KArBmqaB5HY8t-0HEOW3_TT2TRVhomDnlqpK-QLwLjsBtzaLOOLT2IYQZzoQDsYlQOjPncIMrEmB3zRJwag/s1600/crop.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjebJE-0khWr6nxjtnyjYw5El7Ztchw4KQ0GuMC9uRQfJ4usca9o63M0tO6KArBmqaB5HY8t-0HEOW3_TT2TRVhomDnlqpK-QLwLjsBtzaLOOLT2IYQZzoQDsYlQOjPncIMrEmB3zRJwag/s1600/crop.png" height="225" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Cropping</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoIf2a56JNOQuRf5mNjVPMY7mRu38rkRYPfReHCXz5AWe9Oh5GxiLcYCcnbkewrbu1Hum9ebbVvYr9JC2yMGymxB_ohNTaC1wZymV8XmJBoQBxMpI74nklliFORNa2s0w-qezxDBdakfk/s1600/connect.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoIf2a56JNOQuRf5mNjVPMY7mRu38rkRYPfReHCXz5AWe9Oh5GxiLcYCcnbkewrbu1Hum9ebbVvYr9JC2yMGymxB_ohNTaC1wZymV8XmJBoQBxMpI74nklliFORNa2s0w-qezxDBdakfk/s1600/connect.png" height="225" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Connecting</td></tr>
</tbody></table>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">
</span></div>
<div>
<pre></pre>
</div>
</pre>
Anonymoushttp://www.blogger.com/profile/15796785534148560276noreply@blogger.com0tag:blogger.com,1999:blog-1935611830008327894.post-21169421565119469442014-04-14T05:19:00.000-07:002014-05-01T05:17:39.650-07:00I'm Home is Open!<span style="font-family: inherit;">Just a quick one today. To recap, I'm Home is an Android Application from West Coast Labs which automatically starts up your computer when you arrive at home or work, and runs quietly and efficiently in the background of your Android device. I have used it pretty much everyday since I made it.</span><br />
<span style="font-family: inherit;"><span style="background-color: white;"><span style="line-height: 18.200000762939453px;"><br /></span></span></span>
<span style="font-family: inherit;"><span style="background-color: white;"><span style="line-height: 18.200000762939453px;">I first published it to the app store back in September and I haven't given it much attention since due to final year university work. </span></span></span><span style="background-color: white; line-height: 18.200000762939453px;">For that reason really I'm making it open source now, In the hope that I can see it put to use and for it to flourish elsewhere. So please, if you want to take it and adapt into something new or collaborate on the actual app itself so that it can be published to the play store (with credit to you of course) then feel free to do so. Cheers!</span><br />
<span style="background-color: white; line-height: 18.200000762939453px;"><br /></span>
<br />
<div style="text-align: center;">
<span style="background-color: white; line-height: 18.200000762939453px;"><a href="https://github.com/philleonard/Im-Home" target="_blank">GitHub Repo.</a></span></div>
<div style="text-align: center;">
<a href="https://play.google.com/store/apps/details?id=com.westcoastlabs.imhome&hl=en_GB" target="_blank">Play Store Page.</a></div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3Rb8fao9lHUxUDOqAjNPjAK3TNw9WQaGOQ0Y1GM9-AN6r6jt6oCrd1t53UmsCyAY1lgYtoLXHTNGXqbW9rWYNFfgeaXJuST9lOTjmlHkpA-RZz1MKiBmQI1miR_Z79sXGFW8h3HVX_dY/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3Rb8fao9lHUxUDOqAjNPjAK3TNw9WQaGOQ0Y1GM9-AN6r6jt6oCrd1t53UmsCyAY1lgYtoLXHTNGXqbW9rWYNFfgeaXJuST9lOTjmlHkpA-RZz1MKiBmQI1miR_Z79sXGFW8h3HVX_dY/s1600/Untitled.png" height="640" width="596" /></a></div>
Anonymoushttp://www.blogger.com/profile/15796785534148560276noreply@blogger.com0tag:blogger.com,1999:blog-1935611830008327894.post-90340016668720315152014-02-05T09:52:00.000-08:002014-02-06T04:30:07.085-08:00Android Battery Widget v2.0 and + Version!<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1QzMOmNlLIdMT2BNVnCJJ2ceCRitWW6-Z3xmUs9VvelrMYAnXvdkDDVdLnxh_dl4Mc1X1k5IEhUIbbRDEhlt8nzp7IAddFdGBseAYj8BYJZJJTeUNcR6mQMbgywYUhAmsW8vCQQ7RH60/s1600/megares.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1QzMOmNlLIdMT2BNVnCJJ2ceCRitWW6-Z3xmUs9VvelrMYAnXvdkDDVdLnxh_dl4Mc1X1k5IEhUIbbRDEhlt8nzp7IAddFdGBseAYj8BYJZJJTeUNcR6mQMbgywYUhAmsW8vCQQ7RH60/s1600/megares.png" height="330" width="665" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<b style="text-align: justify;"><br /></b></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0YBQppRUE9W_0LcVUgNyKRrZqM4tBCE9FHaRysuYnuxTFgKwlcissZAR9r9Pvq0s3A3bZBX5neZpowoHUI1QGdpkafK58qnuiJkqYVzvVqzDfba3pt-v56IYpRZAK2jotBYPtOEumPkU/s1600/qrcode+(1).png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0YBQppRUE9W_0LcVUgNyKRrZqM4tBCE9FHaRysuYnuxTFgKwlcissZAR9r9Pvq0s3A3bZBX5neZpowoHUI1QGdpkafK58qnuiJkqYVzvVqzDfba3pt-v56IYpRZAK2jotBYPtOEumPkU/s1600/qrcode+(1).png" height="200" width="200" /></a><span style="font-family: inherit;"><b style="text-align: justify;"></b></span><br />
<span style="font-family: inherit;"><b style="text-align: justify;"><span style="font-family: inherit;"><b style="text-align: justify;"><br /></b></span></b></span><span style="font-family: inherit;"><b style="text-align: justify;"><span style="font-family: inherit;"><b style="text-align: justify;"><br /></b></span></b></span>
<span style="font-family: inherit;"><b style="text-align: justify;">Android Battery Widget</b><span style="text-align: justify;"> has been updated to version 2.0! Still for free, it's has had a complete overhaul from the old outdated looking widget, in order to give you a new higher resolution more aesthetically pleasing experience. And it's completely Ad free!</span></span><br />
<a href="https://play.google.com/store/apps/details?id=com.exercise.AndroidBatteryWidget" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank"><img alt="Get it on Google Play" border="0" src="https://developer.android.com/images/brand/en_generic_rgb_wo_60.png" /></a><span style="font-family: inherit; text-align: justify;"><br /></span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><br /></span>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWPsuwUNntT_hoDSXPVOWHM-H54NGK4TVyWGc-eR38AljwnMfaYgiyl15ihyhc4ArRl2oDkkmkL2xEqa_eyxLVc3OERLEWbcsStvpfZm6f7m2C_Ppu5yjks4YfgqyDE_3ORSTKub5_Law/s1600/qrcode+(2).png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWPsuwUNntT_hoDSXPVOWHM-H54NGK4TVyWGc-eR38AljwnMfaYgiyl15ihyhc4ArRl2oDkkmkL2xEqa_eyxLVc3OERLEWbcsStvpfZm6f7m2C_Ppu5yjks4YfgqyDE_3ORSTKub5_Law/s1600/qrcode+(2).png" height="200" width="200" /></a><br />
<br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">We have also created <b>Android Battery Widget Plus</b>, where for £0.69 (about $1.12 (USD), €0.83) you get 5 different coloured widgets in two different sizes (1x1 and 2x2 cell dimension). Also when you click the widget, it brings up some useful information about your battery!</span><br />
<a href="https://play.google.com/store/apps/details?id=com.westcoastlabs.androidbatterywidgetplus" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;" target="_blank"><img alt="Get it on Google Play" border="0" src="https://developer.android.com/images/brand/en_generic_rgb_wo_60.png" /></a><br />
<br />
<br />
<br />
<br />
<br />
<br />
<table><tbody>
<tr><td><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZb2jYyswMjHKPCPfrFzVoMNiv-o6mEWcfUpommznQF-VfipK0DeXaL87EobBuGCZvYgYzSq-8cmg6JuGlIj_zhzKbETEec3hHCGmqa8e4YPoHhRT08estBxih4-DE0G04rAq1phy-ofI/s1600/Screenshot_2014-02-02-23-30-12.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZb2jYyswMjHKPCPfrFzVoMNiv-o6mEWcfUpommznQF-VfipK0DeXaL87EobBuGCZvYgYzSq-8cmg6JuGlIj_zhzKbETEec3hHCGmqa8e4YPoHhRT08estBxih4-DE0G04rAq1phy-ofI/s1600/Screenshot_2014-02-02-23-30-12.png" height="320" width="180" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Plus</td></tr>
</tbody></table>
</td><td><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3AfnnZ5HXo-dsMHpmzOKFmbjNUtvasJWJ6t7caHm7c-QZZSdUdNhgfNpqz1n91i2ZNMeYqLqCJoFXy_IJi9pdXOHrfvDt1P5oDe4nUSd4FuNr1dawk0SczALUfNhtvKGIgF6NzharOy8/s1600/Screenshot_2014-02-02-23-52-03.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3AfnnZ5HXo-dsMHpmzOKFmbjNUtvasJWJ6t7caHm7c-QZZSdUdNhgfNpqz1n91i2ZNMeYqLqCJoFXy_IJi9pdXOHrfvDt1P5oDe4nUSd4FuNr1dawk0SczALUfNhtvKGIgF6NzharOy8/s1600/Screenshot_2014-02-02-23-52-03.png" height="320" width="180" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Plus</td></tr>
</tbody></table>
</td><td><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNjG1Hw4Wv9y4FUY71wMxgt14Jtm3JEK46GwJ2YHuawd4wuX6FHd7TrHfaH-bNqoLCFQFUbrdd7SQUplSvwIOkFSl9HtmWeuqe8SnZQRDSB9iMeUTRBPHL-cnl0GTZPRIo2x_krSCi8Tc/s1600/Screenshot_2014-02-02-23-52-12.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNjG1Hw4Wv9y4FUY71wMxgt14Jtm3JEK46GwJ2YHuawd4wuX6FHd7TrHfaH-bNqoLCFQFUbrdd7SQUplSvwIOkFSl9HtmWeuqe8SnZQRDSB9iMeUTRBPHL-cnl0GTZPRIo2x_krSCi8Tc/s1600/Screenshot_2014-02-02-23-52-12.png" height="320" width="180" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Plus</td></tr>
</tbody></table>
</td></tr>
</tbody></table>
<table><tbody>
<tr><td><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVBSudp4N-qXBnnea09mUyCzKFzl676_JiekSKT3Y0NDyeJFlPQKCDTdfoz4MgGEd2tdlW1QKKyqdQM6rHkwobfPexCuE6J2MSI9Nbb4BtktCXQtNe-ZsmtBYzxA0UwAOxrQ9NXmswN6E/s1600/Screenshot_2014-01-31-16-58-47.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVBSudp4N-qXBnnea09mUyCzKFzl676_JiekSKT3Y0NDyeJFlPQKCDTdfoz4MgGEd2tdlW1QKKyqdQM6rHkwobfPexCuE6J2MSI9Nbb4BtktCXQtNe-ZsmtBYzxA0UwAOxrQ9NXmswN6E/s1600/Screenshot_2014-01-31-16-58-47.png" height="320" width="180" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Plus</td></tr>
</tbody></table>
</td><td><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidqao3-yPeuzG5_JwWGNnv37rQ8OqTUeie2ziw1aUQVkXnTRUz12Vl1VCWV9dx1RchUukU3iUWK090B5iJkhrD-hF8wzxa0M3XYsZF6SfOEcxcmQB55gp0F-zlDB0fV8-gjMAYbNfWE3o/s1600/Screenshot_2014-02-02-23-31-07.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidqao3-yPeuzG5_JwWGNnv37rQ8OqTUeie2ziw1aUQVkXnTRUz12Vl1VCWV9dx1RchUukU3iUWK090B5iJkhrD-hF8wzxa0M3XYsZF6SfOEcxcmQB55gp0F-zlDB0fV8-gjMAYbNfWE3o/s1600/Screenshot_2014-02-02-23-31-07.png" height="320" width="180" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Plus</td></tr>
</tbody></table>
</td><td><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq_wcUoWBRiHirg6F6Cnm42hnClbjUvHCRQscDiS8NaOQekiIbBjHbZUuYscCb5WC4XkBpUIMe7nI-SIq5aCIg7AnqSHMxf98eog4MEIWo4tfeJEsRs2ZQItkcUfG-cQ0AO-cCEaM6ktQ/s1600/Screenshot_2014-02-04-17-56-19.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq_wcUoWBRiHirg6F6Cnm42hnClbjUvHCRQscDiS8NaOQekiIbBjHbZUuYscCb5WC4XkBpUIMe7nI-SIq5aCIg7AnqSHMxf98eog4MEIWo4tfeJEsRs2ZQItkcUfG-cQ0AO-cCEaM6ktQ/s1600/Screenshot_2014-02-04-17-56-19.png" height="320" width="180" /></a></div>
</td></tr>
<tr><td class="tr-caption" style="text-align: center;">Free</td></tr>
</tbody></table>
</td></tr>
</tbody></table>
<br />
<span id="goog_791214926"></span><span id="goog_791214927"></span><br />Anonymoushttp://www.blogger.com/profile/15796785534148560276noreply@blogger.com0tag:blogger.com,1999:blog-1935611830008327894.post-23871863506985651252013-12-03T17:30:00.000-08:002013-12-05T13:17:05.424-08:00Evolution of Pseudo Randomness<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: left;">
<span style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 20px;"><i> "Anyone who attempts to generate random numbers by </i></span></div>
<div style="text-align: left;">
<span style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 20px;"><i> deterministic means is, of course, living in a state of sin." </i></span><span style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 20px;"><i> </i></span></div>
<div style="text-align: left;">
<span style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 20px;"><i> John Von </i></span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 20px;"><i>Neumann</i></span></span></div>
<div style="text-align: left;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 20px;"><i><br /></i></span></span></div>
<div style="text-align: left;">
The GIF below shows the evolving outputs of Pseudo Random Number Generators (PRNGs) produced by the Genetic Program I implemented in C.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpDakwRGreG7MlxjX8SG203FvXH-v2Y2HFRZFqMGoNnui8BaLojqJWRXRr9oAxAtV3PD5MDjBnIdkI-OlKQLEvPvBfy4MD_QDHI2mV_dRKgF-1CgIHpxjBbDHwYHBmi7RS5MpH7dUPCks/s1600/anigif.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="448" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpDakwRGreG7MlxjX8SG203FvXH-v2Y2HFRZFqMGoNnui8BaLojqJWRXRr9oAxAtV3PD5MDjBnIdkI-OlKQLEvPvBfy4MD_QDHI2mV_dRKgF-1CgIHpxjBbDHwYHBmi7RS5MpH7dUPCks/s640/anigif.gif" width="640" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="text-align: left;">See the Wiki pages on </span><a href="http://en.wikipedia.org/wiki/Genetic_algorithm" style="text-align: left;" target="_blank">Genetic Algorithms</a><span style="text-align: left;"> & </span><a href="http://en.wikipedia.org/wiki/Genetic_programming" style="text-align: left;" target="_blank">Programming</a><span style="text-align: left;">, </span><a href="http://en.wikipedia.org/wiki/Entropy_(information_theory)" style="text-align: left;" target="_blank">Entropy</a> and Koza's paper [1]<span style="text-align: left;"> for supporting information to this post.</span></div>
<div style="text-align: justify;">
<span style="text-align: left;"><br /></span></div>
<div style="text-align: justify;">
Each PRNG in the population outputs 16384 "random" bits / 2048 bytes. Fitness (or "randomness") of a PRNG is measured using the Shannon Entropy equation for binary sub sequences of size $h$ from $1 \to N_{max} = 8$, across the 2Kb output. For each sub sequence of size $h$; </div>
<br />
<div style="text-align: center;">
$E_{h} = - \sum_{j} P_{(hj)}\ \log_2\ P_{(hj)}$<br />
<br />
<div style="text-align: left;">
therefore the total entropy of a PRNG output for binary sub sequences of size $h$ from $1 \to N_{max} = 8$;</div>
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
$E_{total} = \sum_{h = 1}^{N_{max}} \left[ - \sum_{j} P_{(hj)}\ \log_2\ P_{(hj)} \right]$<br />
<br /></div>
Therefore in order to achieve maximum entropy for $E_h$, all probabilities for all $2^h$ binary sub sequences of length $h$ must be equal to $\frac{1}{2^h}$.<br />
<br />
The maximum achievable entropy for sub seqences of sizes $1 \to 8$ can be calculated as;<br />
<br />
<div style="text-align: center;">
$E_{max} = \sum_{i = 1}^{8} i = \frac{8 \cdot (8 + 1)}{2} = 36$</div>
<br />
For this run the population is evolved over 39 Generations. The entropy is evolved rapidly to begin with and then fluctuates around 97~99%* until on the 39th generation it reaches the terminating entropy of 99.93% (or 35.97386 bits of entropy out of a maximum 36 bits). Each frame in the GIF shows the output of the fittest PRNG in the population at that generation.<br />
<br />
May the lord have mercy on my soul!<br />
<div style="text-align: center;">
<br /></div>
* The implementation isn't driven by hill climbing.<br />
<br />
[1] John R. Koza, <i>Evolving a Computer Program to Generate Random Numbers Using the Genetic Programming Paradigm.</i> Stanford University, 1991.Anonymoushttp://www.blogger.com/profile/15796785534148560276noreply@blogger.com0tag:blogger.com,1999:blog-1935611830008327894.post-86915202520936381082013-09-03T09:30:00.000-07:002013-11-09T07:26:08.650-08:00I'm Home v1.0.1 Android Application<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1weSvo3KMmOltzL08-lIHLBAdoFSW9hUVjIDYawCtOEhFSp898v6xSvHwWfFlcoX8OvzF8BXx8X5IIy4u3kNFi3SPibM-bgcPoIKN4SLU6ZcQKfza8QOJEpK7j4JIOz48r8Sqo9UzQLk/s1600/ic_launcher.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1weSvo3KMmOltzL08-lIHLBAdoFSW9hUVjIDYawCtOEhFSp898v6xSvHwWfFlcoX8OvzF8BXx8X5IIy4u3kNFi3SPibM-bgcPoIKN4SLU6ZcQKfza8QOJEpK7j4JIOz48r8Sqo9UzQLk/s1600/ic_launcher.png" /></a></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1weSvo3KMmOltzL08-lIHLBAdoFSW9hUVjIDYawCtOEhFSp898v6xSvHwWfFlcoX8OvzF8BXx8X5IIy4u3kNFi3SPibM-bgcPoIKN4SLU6ZcQKfza8QOJEpK7j4JIOz48r8Sqo9UzQLk/s1600/ic_launcher.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><span style="font-family: inherit;"></span></a><span style="font-family: inherit;">I'm Home is a new Android Application from West Coast Labs which automatically starts up your computer when you arrive at home or work, and runs quietly and efficiently in the background of your Android device.</span><br />
<span style="font-family: inherit;"><br />
If you are someone who likes their PC to be on constantly so that you don't have to spend time waiting for you PC to turn on. Then this app is a smart alternative which will help you save on energy bills and do a little extra for the environment!</span><br />
<span style="font-family: inherit;"><br />
Alternately if you are someone who shuts their computer down when you leave your home/work and turn it back on when you return, then this app will help reduce the time in your day spent staring at loading screens, and you don't even need to take your phone out!</span><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxMCL7g0rU1PTzn0cxU_EGJnbSYIXNebMw8jGdXf9jXHnImGE1BkQS4TNQfxnOSIQ0Jd1ZXj-OUSD04VG_voOVGMgokmcjafgJklRhkalCyvTNkxjGSkkyt7NCNNBTSjGwLhNhTViICgU/s1600/code+(1).png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxMCL7g0rU1PTzn0cxU_EGJnbSYIXNebMw8jGdXf9jXHnImGE1BkQS4TNQfxnOSIQ0Jd1ZXj-OUSD04VG_voOVGMgokmcjafgJklRhkalCyvTNkxjGSkkyt7NCNNBTSjGwLhNhTViICgU/s200/code+(1).png" width="200" /></a><span style="font-family: inherit;"><br />
It works by using the Wake On Lan service built into almost all motherboards, and by sending magic packets to your computer when your android phone joins your WiFi network. Wake On Lan is only provided by ethernet adaptors so your PC will have to be connected to the router via ethernet. (This app will work on WiFi only to wake the PCs in sleep mode (i.e. when the WiFi card is still on)).</span><br />
<br />
<div style="text-align: center;">
<br />
<span style="font-family: Verdana, sans-serif;"><b>How To</b></span><br />
<span style="font-family: Verdana, sans-serif;"><b><br /></b></span></div>
<span style="color: #cc0000; font-family: inherit;">Step 1)</span><span style="font-family: inherit;"> Simply configure your Windows PC/Mac/Linux machine using the tutorial in </span><a href="http://lifehacker.com/348197/access-your-computer-anytime-and-save-energy-with-wake+on+lan" style="font-family: inherit;" target="_blank">this link</a><span style="font-family: inherit;">. The most important part is to ensure that Wake On Lan is enabled in your BIOS (usually that's all that's needed).</span><br />
<span style="font-family: inherit;"><span style="color: #cc0000;">Step 2)</span> Download the application on the <a href="https://play.google.com/store/apps/details?id=com.westcoastlabs.imhome&hl=en_GB" target="_blank">Play Store here</a> or using the QR code above.</span><br />
<span style="font-family: inherit;"><span style="color: #cc0000;">Step 3)</span> Configure the application as follows;</span><br />
<span style="font-family: inherit;"><br />
</span><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9wyNujLxrmZVUOZhdfMwC8_bBbpNptQpILbJ5B6D6ELJ8e43JVYLNqLOlXno0zXOWpDjrQp2avt5epn9Rzo88mL9a_gkYCf-ilCZgk2pycnuGTA61ZvprEEXBVLhM_CMjzjhJ5Yx28uE/s1600/device-2013-09-03-162358.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: inherit;"></span></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3drCOy9RI9qJXj5RzPqD-CRUOWls0UWCJ8SofeXpPs3gYCJ13UNvJHEK_5NSJ3GvEyICY50YDTbQKBctljldbjrofoKtvpE9K_kHnhkiakr6oo8sIhlEnu-EwJXpFm-QVEQLc-6Q3VUM/s1600/device-2013-09-12-174354.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3drCOy9RI9qJXj5RzPqD-CRUOWls0UWCJ8SofeXpPs3gYCJ13UNvJHEK_5NSJ3GvEyICY50YDTbQKBctljldbjrofoKtvpE9K_kHnhkiakr6oo8sIhlEnu-EwJXpFm-QVEQLc-6Q3VUM/s400/device-2013-09-12-174354.png" width="225" /></a></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9wyNujLxrmZVUOZhdfMwC8_bBbpNptQpILbJ5B6D6ELJ8e43JVYLNqLOlXno0zXOWpDjrQp2avt5epn9Rzo88mL9a_gkYCf-ilCZgk2pycnuGTA61ZvprEEXBVLhM_CMjzjhJ5Yx28uE/s1600/device-2013-09-03-162358.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><span style="font-family: inherit;"><span style="color: #cc0000;">PC IP or Broadcast IP</span>: This is the broadcast IP of your router or the specific IP of the PC. Note that putting the broadcast IP of the router is more reliable than the specific IP address especially if IP addresses are allocated dynamically on your router. As it says in the app, typically your Broadcast IP will be one of the following; 255.255.255.255, 192.168.0.255 or 255.255.255.0.</span><br />
<span style="font-family: inherit;"><br /><span style="color: #cc0000;">
MAC</span>: The MAC address of your computer. To find out, in Windows type "ipconfig /all" into a command prompt and look for "physical address" under your Ethernet Adaptor.</span><br />
<span style="font-family: inherit;">In Mac or Linux type "ifconfig" and look for "HWaddr" under your eth device.</span><br />
<span style="font-family: inherit;"><br /><span style="color: #cc0000;">
Port</span>: This is important for when the PC is in sleep mode instead of being completely turned off. (Must be filled out anyway, it will either be 9/7)</span><br />
<span style="font-family: inherit;"><br /><span style="color: #cc0000;">
SSID</span>: This is the name of the router to which your phone and computer are connected or connect to. You can use the button to auto fill this box with your current WiFi network's SSID.</span><br />
<span style="font-family: inherit;"><br />
The <span style="color: #cc0000;">time slider</span> is used to stop the application from sending packets for a certain amount of time after the last disconnect. This is useful if you briefly come back but don't want your computer started. Also I noticed that Android phones have a habit of quickly disconnecting and reconnecting from WiFi even when they are in range, in the middle of the night! So this feature also prevents your computer being started when your asleep.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">The <span style="color: #cc0000;">first checkbox</span> stops your PC from waking up when you start your phone and connect to WiFi straight away. The second checkbox explains itself.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">The <span style="color: #cc0000;">disable from</span> checkbox allows you to setup a time frame in which the app will be disabled and your PC will not be woken.</span><br />
<span style="font-family: inherit;"><br />
All the forms must be filled out when saving and the IP and MAC must be in the correct syntax.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">The <span style="color: #cc0000;">send test</span> button sends magic packets using the configuration on the screen (so it doesn't need to be saved).</span><br />
<span style="font-family: inherit;"><br />
Cancel closes the configuration. The PC wakeup part of the app is started when the device connects to the SSID in the configuration.</span><br />
<span style="font-family: inherit;"><br />
Note: On some machines Wake On Lan only works after a clean shutdown. If you turn the power off and on at the switch or at the PSU then the ethernet adapter might not be turned back on again until you start the computer manually.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Edit 13/09/2013 - Version 1.0.1</span>Anonymoushttp://www.blogger.com/profile/15796785534148560276noreply@blogger.com6tag:blogger.com,1999:blog-1935611830008327894.post-36495732941901532802012-12-04T01:25:00.000-08:002013-10-17T17:06:30.035-07:00Lego NXT & LeJOS Table Mapping & Navigation So I did this mini project over the summer but it has been collecting e-dust ever since, and I thought a nice way to finish it off would be to write a small blog post.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEJV1QU5pd3eLu16DUPcJBnJAvI4ufulaDadenQewwx42up8jEJAUJnGLf3OHvSsUbAknPtBUD4ytNqt6pFEgGYwb1tjNwIJUPOezvs4BBm78FKLIFALwbbRDJ9nnPeDzk4_zGDpTVBi4/s1600/IMAG1659.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEJV1QU5pd3eLu16DUPcJBnJAvI4ufulaDadenQewwx42up8jEJAUJnGLf3OHvSsUbAknPtBUD4ytNqt6pFEgGYwb1tjNwIJUPOezvs4BBm78FKLIFALwbbRDJ9nnPeDzk4_zGDpTVBi4/s320/IMAG1659.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
The idea is that I wanted to make my NXT map and navigate a quadrilateral table after being placed at any point and angle on the table. I won't delve to deeply into details as the <a href="https://github.com/philleonard/LeJOS-NXT-Mindstorm-Navigation/blob/master/manual.pdf?raw=true" target="_blank">PDF</a> covers the technical side and the code speaks for itself, but long story short it works quite nicely, and theoretically perfectly... But as is the way with the NXT and its various bendy Lego Meccano pieces, things are calibrated for an infinitesimally small time frame. In fact I probably spent at least just as long calibrating the NXT as I did programming and writing the PDF! The idea is that by following the PDF and using the different programs in the Git repo, it can be repeated on any NXT using only the light sensor. <br />
<br />
The GitHub repository; <a href="https://github.com/philleonard/LeJOS-NXT-Mindstorm-Navigation.git" target="_blank">https://github.com/philleonard/LeJOS-NXT-Mindstorm-Navigation.git</a><br />
The PDF can be <a href="https://github.com/philleonard/LeJOS-NXT-Mindstorm-Navigation/blob/master/manual.pdf?raw=true" target="_blank">downloaded here</a> if you find the PDF viewer below a little small.<br />
<br />
Cheers!<br />
Phil<br />
<br /><center>
<iframe frameborder="0" src="http://docs.google.com/gview?url=https://github.com/philleonard/LeJOS-NXT-Mindstorm-Navigation/blob/master/manual.pdf?raw=true&embedded=true" style="height: 500px; width: 550px;"></iframe> </center>Anonymoushttp://www.blogger.com/profile/15796785534148560276noreply@blogger.com0tag:blogger.com,1999:blog-1935611830008327894.post-69983065150053417222012-06-18T17:25:00.000-07:002014-05-06T03:41:14.035-07:00Parallel Processing on the Pi (Bramble)<span style="font-family: Verdana, sans-serif;">Parallel processing on the Raspberry
Pi is possible, thanks to the portable MPICH2 (Message Passing
Interface). I was keen to try this out as soon as I managed to get hold of two
of these brilliant little computers. Here I'm going to
show you how I managed to get it all working, and I will also show you the results I obtained. (Bramble was a name an ingenious Raspberry Pi forum
member made up, not myself!)</span><br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">There are three ways which you can install MPICH2 (in case one of them doesn't seem to work for you). Compiling and installing from source, using my .deb
package then following the rest of the tutorial, or using the Python scripts I wrote. Installing from source takes a while on the little Pi when not cross
compiling.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><b><u>Install - Choose Method 1, 2 or 3</u></b><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><b>1)</b> Simply download the script;</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">wget </span><span style="color: red;">https://github.com/downloads/philleonard/MPICH2-Armel-Raspberry-Pi/install.py</span></span><br />
<span style="color: red; font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">and then run it as root with the command;</span><br />
<span style="color: red; font-family: Verdana, sans-serif;">sudo python install.py</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Follow the instructions on the screen entering all of the necessary info. The script will do a full install and configuration like the steps in the tutorial below. Do this for every node on your Bramble.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">I have also written an RSA key script which sets up a secure public and private key between the master and all of the worker nodes. This means that you don't have to enter the password into SSH every time, but still maintaining a secure connection;</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">wget </span><span style="color: red;">https://github.com/downloads/philleonard/MPICH2-Armel-Raspberry-Pi/rsa.py</span></span><br />
<span style="background-color: white; color: red; font-family: Verdana, sans-serif;"><br /></span>
<span color:="" courier="" font-family:="" monospace="" new="" ourier="" red="" style="color: red; font-family: Verdana, sans-serif;">python rsa.py</span><br />
<span color:="" courier="" font-family:="" monospace="" new="" ourier="" red="" style="color: red; font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">If you want to set it up for the root user, you can run as root, and enter the username "root" for the other worker(s).</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Finally you can join onto the Testing phase of the tutorial if you want to, otherwise you are all set!</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Please let me know of any problems with the scripts and I will fix it. Thanks!</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><b>2)</b> From .deb package<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">First, download the .deb package;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">wget https://github.com/downloads/philleonard/MPICH2-Armel-Raspberry-Pi/mpich2_1.4.1p1-1_armel.deb</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">De-package and install;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">sudo dpkg -i
mpich2_1.4.1p1-1_armel.deb </span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Now proceed to the setup phase of this tutorial.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><b>3) </b>From source;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">First, download the source tar ball:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">wget http://www.mcs.anl.gov/research/projects/mpich2/downloads/tarballs/1.4.1p1/mpich2-1.4.1p1.tar.gz</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Now extract the files;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">tar
zxfv mpich2-1.4.1p1.tar.gz</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Go into the source folder;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">cd mpich2-1.4.1p1</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Now we must run ./configure to configure the files
ready for compilation;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">sudo ./configure
--disable-f77 --disable-fc</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">If you have a FORTRAN compiler then you can run it
without "--disable-f77" and "--disable-fc".<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">If you do not, and you don't want to run
FORTRAN programs on your cluster then make sure you do configure with
them disabled as the error occurs a good 20 mins in and you have to
start all over again.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Now that you have configured without error, compile
then install the compiled program;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif;">sudo make<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">sudo make install</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Now proceed to the setup phase of this tutorial below.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><b><u>Setup</u></b><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Now you should have MPICH2 installed on both (all) of your Raspberry
Pis. On your Bramble, you are going to need one node and the rest are
worker nodes.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">First create this file in both the pi and root user home
directories, <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif;">touch
~/.rhosts<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">sudo touch
/root/.rhosts</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">add the following
lines to the normal user file (pi is the default username for both of my
nodes);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif;">Master
pi<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif;">Slave pi</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">For the root user;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif;">Master root<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">Slave root</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Do this for every Pi/node on the Bramble.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Now edit the /etc/hosts file to
contain the IP of each node and the master node like so;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif;">192.168.0.14 Master<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif;">192.168.0.11 Slave<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Edit /etc/hosts.allow to contain just
"ALL+", or each IP address of the other nodes.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">(To find out the IP on each node, type ifconfig)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Now edit /etc/securetty
to contain the line to allow root access;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">rsh, rlogin, rexec,
pts/0, pts/1</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Create the file /etc/pam.d/rsh
if it is not there already and put the following in;</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif; font-size: x-small;">
auth sufficient
/lib/security/pam_nologin.so</span><br />
<br />
<span style="font-family: Verdana, sans-serif;"><span style="color: red; font-size: x-small;">
auth optional
/lib/security/pam_securetty.so</span><span style="color: red; font-size: x-small;">
auth sufficient
/lib/security/pam_env.so</span><span style="color: red; font-size: x-small;">
auth sufficient
/lib/security/pam_rhosts_auth.so</span><span style="color: red; font-size: x-small;">
account sufficient /lib/security/pam_stack.so
service=system-auth</span><span style="color: red; font-size: x-small;">
session sufficient /lib/security/pam_stack.so
service=system-auth</span></span><br />
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><b><u>SSH Public Key Authentication -
Optional</u></b><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">This section is optional but advised! The use of a public and private key for SSH
will mean you won't have to type in the SSH password between the master and the
worker every time you want to run a program.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Use the Python script I have written;</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">wget </span><span style="color: red;">https://github.com/downloads/philleonard/MPICH2-Armel-Raspberry-Pi/rsa.py</span></span><br />
<span style="color: red; font-family: Verdana, sans-serif;"><br /></span>
<span style="color: red; font-family: Verdana, sans-serif;">python rsa.py</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Or if it does not work properly, follow the instructions at this link: <a href="http://steve.dynedge.co.uk/2012/05/30/logging-into-a-rasberry-pi-using-publicprivate-keys/"><span style="color: blue;">http://steve.dynedge.co.uk/2012/05/30/logging-into-a-rasberry-pi-using-publicprivate-keys/</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Thanks to <b>Steve Smith</b> who wrote the tutorial!<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"></span><br /><span style="font-family: Verdana, sans-serif;"></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><b><u>Testing</u></b><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Now you should be ready to rock and roll! Lets test the cluster out.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">If you installed from source, you will have this file to test in the
~/mpich2-1.4.1p1/examples directory (you will need to compile it). If you
installed from the .deb package then download this test file to the <b>same directory in</b> <b>each of
the nodes </b>(or even better
a centralised dir, perhaps with NFS);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">wget https://github.com/downloads/philleonard/MPICH2-Armel-Raspberry-Pi/cpi_test.tar.gz</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Extract the tar ball and make sure the permissions
are set;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif;">tar zxfv
cp_test.tar.gz<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">sudo chmod -R 777 cpi_test</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Enter the cpi_test directory. This cpi program is a
little program written in C which outputs Pi to 16 decimal places and outputs
run time. I think this program is quite apt given what is running it.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Now we have to set up a "machinefile".
This tells MPICH2 where to delegate the processes to. Yes, more IP addresses to
come! Create the machine file on the Master node;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">touch machinefile</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Now edit the file to contain the IP addresses of
the node and a colon followed by the number process to follow. For example my
machine file looks like this;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif;">192.168.0.14<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif;">192.168.0.11:2<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">This tells MPICH2 to pass the first process to my
master node at 192.168.0.14 and the next (second) process to my only worker node at 192.168.0.11. There is no process number
after the first IP because empty is the same to the first. (i.e. 192.168.0.14 is the same as 192.168.0.14:1).<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">It's easier command wise if the machinefile and the
program you are executing are in the same folder to reduce the length of the
next command.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Now it's finally time to run our
first program! Se sure that you are in the cpi_test folder and that the same
folder is located in the same place in all the other nodes on the Bramble.
Execute the following line;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif;">mpiexec
-f machinefile -n 100 ./cpi<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">-f shows mpiexec where the machinefile is. -n is
the number of times to repeat the process. This is set at 100 to execute cpi
100 times so that we can see the difference in power easier. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">If it gives you an error about file not found,
again make sure all the cpi files are in the same location on each node.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">If the command executes successfully then you should get a record of the processes
running and an output like;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red; font-family: Verdana, sans-serif;">pi
is approximately 3.1415926544231274, Error is 0.0000000008333343<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">wall
clock time = 0.728116</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">You can remove the worker IPs from the machinefile
to compare running this program on just the Master node. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><b><u>My Results</u></b><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">I ran the previous command 10 times, with both
nodes enables and again with just the Master and took an average both times.
The average I got from both nodes was; 0.731
Seconds – with a minimum of around 0.6 and a limit of 0.8. The average I got
from one node enabled was; 1.418 Seconds –with a minimum of 0.85 and a limit of 5.0. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><b><u>Finish </u></b><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">You should now have your Bramble
up and running!<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">I just compiled and created a deb file, and found
the best way to set the program up for the Pi, all thanks go to the team who
created the awesome and portable MPICH2, and any sources I used to make the
tutorial.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"></span><br /><span style="font-family: Verdana, sans-serif;"></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Further reading: <a href="http://www.mcs.anl.gov/research/projects/mpich2/documentation/files/mpich2-1.4.1-installguide.pdf">http://www.mcs.anl.gov/research/projects/mpich2/documentation/files/mpich2-1.4.1-installguide.pdf</a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">This shows a lot of other useful applications of MPICH2 including compiling
across your Bramble, it would be nice to have a compiler farm made of Pis.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"></span><br /><span style="font-family: Verdana, sans-serif;"></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Thanks for reading! Don't hesitate to ask for help below!<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;"></span><br /><span style="font-family: Verdana, sans-serif;"></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Verdana, sans-serif;">Phil</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3483tSv-AV53OYBEdzQE7qs0m0ocRvNQyReJfnzrbOj8ADSCi1iLcFwZTTp3ohiRWuUKJZPfdbkwOT-0sEj5V_w1JZreGgkCmj9va0ZKkBvcDobVlD2_EkjQSSb1pOPqY5t0PdctREq8/s1600/2012-06-18+21.02.12.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><span style="font-family: Verdana, sans-serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3483tSv-AV53OYBEdzQE7qs0m0ocRvNQyReJfnzrbOj8ADSCi1iLcFwZTTp3ohiRWuUKJZPfdbkwOT-0sEj5V_w1JZreGgkCmj9va0ZKkBvcDobVlD2_EkjQSSb1pOPqY5t0PdctREq8/s400/2012-06-18+21.02.12.jpg" height="400" width="225" /></span></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Verdana, sans-serif;">MPICH2 on the RPi</span></td></tr>
</tbody></table>
<span style="font-family: 'Times New Roman', serif;"><br /></span>
<span style="font-family: 'Times New Roman', serif;"></span><br /><span style="font-family: 'Times New Roman', serif;"></span></div>
Anonymoushttp://www.blogger.com/profile/15796785534148560276noreply@blogger.com33tag:blogger.com,1999:blog-1935611830008327894.post-62681190681789516172012-06-15T18:35:00.001-07:002013-12-22T15:25:39.437-08:00MPI on the Pi<br />
Understandably, configuring and compiling large C programs on the Raspberry Pi is a process which requires a fair amount of patience. Especially when after 30 minutes ./configure (ing), you get this error:<br />
<br />
<span style="color: #9fc5e8;"><span style="font-family: 'Courier New', Courier, monospace;">configure: error: No Fortran 77 compiler found. If you don't need to
build any Fortran programs, you can disable Fortran support using
--disable-f77 and --disable-fc. If you do want to build Fortran
programs, you need to install a Fortran compiler such as gfortran
or ifort before you can proceed</span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">.
</span></span><br />
<br />
So inevitably;<br />
<br />
<span style="color: #9fc5e8; font-family: 'Courier New', Courier, monospace;">pi@raspberrypi:~$ sudo ./configure --disable-f77 --disable-fc
</span><br />
<br />
I'm sorry Fortran. I do plan to revisit you some day, but attempting to compile and install an MPI on two Raspberry Pi's* is on the agenda today :)<br />
<br />
*unnecessary apostrophe, but it looks more attractive than without it...<br />
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/15796785534148560276noreply@blogger.com1tag:blogger.com,1999:blog-1935611830008327894.post-44525253299855911562012-06-03T17:17:00.000-07:002013-10-21T10:40:12.335-07:00NXT FibonacciI have just received my Lego NXT Mindstorm! I immediatley flashed LeJOS on the brick, and before I got to work on some AI, I decided to create a little program which represented the Fibonacci sequence terms as bursts of the motors.
<pre class="brush:java">import lejos.nxt.*;
public class fib {
public static void main (String[] args) {
//Limit the sequence.
int fib[] = new int[100];
//First two terms in sequence are 1
fib[0] = fib[1] = 1;
for (int i = 2; i < fib.length; i++) {
//Calculate, and print next value in Fibonacci sequence
fib[i] = fib[i - 1] + fib[i - 2];
LCD.clear();
LCD.drawInt(fib[i], 6, 4);
//Move forward for the length of the Fibonacci number
Motor.C.forward();
Motor.A.forward();
try{
Thread.sleep(fib[i]);
} catch (Exception e) {}
//Sleep for a tenth of a second.
Motor.C.stop();
Motor.A.stop();
try{
Thread.sleep(100);
} catch (Exception e) {}
}
}
}
</pre>Anonymoushttp://www.blogger.com/profile/15796785534148560276noreply@blogger.com0