<?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>OFFICIALLY Shahab ... &#187; Shahab</title>
	<atom:link href="http://www.shahabfm.com/archives/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shahabfm.com</link>
	<description>Somewhere for me to express myself &#38; my works ...</description>
	<lastBuildDate>Wed, 31 Aug 2011 07:58:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Computer based instrumentation and micro controllers, FYS4240 / FYS3240</title>
		<link>http://www.shahabfm.com/archives/2011/08/computer-based-instrumentation-and-micro-controllers-fys4240-fys3240/</link>
		<comments>http://www.shahabfm.com/archives/2011/08/computer-based-instrumentation-and-micro-controllers-fys4240-fys3240/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 06:54:27 +0000</pubDate>
		<dc:creator>Shahab</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[My Studies]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rapid Prototyping]]></category>
		<category><![CDATA[Robotics]]></category>
		<category><![CDATA[Shahab]]></category>
		<category><![CDATA[UiO]]></category>
		<category><![CDATA[VC++]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[Micro-Controller]]></category>
		<category><![CDATA[University of Oslo]]></category>

		<guid isPermaLink="false">http://www.shahabfm.com/?p=981</guid>
		<description><![CDATA[FYS4240 / FYS3240, is all about how Micro-controllers, PC Processors and busses are made and gives you a very wide perspective in choice of connection technologies and micro controllers. Topics from internal structure of micro controllers to interfaces on it and parallel programming on multi core / multi processor machines. It also includes LABView and C programming for AVR micro controllers &#8230; <a href="http://www.shahabfm.com/archives/2011/08/computer-based-instrumentation-and-micro-controllers-fys4240-fys3240/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="FYS4240" href="http://www.uio.no/studier/emner/matnat/fys/FYS3240/index-eng.xml#vurdering-og-eksamen" target="_blank">FYS4240 / FYS3240</a>, is all about how Micro-controllers, PC Processors and busses are made and gives you a very wide perspective in choice of connection technologies and micro controllers. Topics from internal structure of micro controllers to interfaces on it and parallel programming on multi core / multi processor machines. It also includes LABView and C programming for AVR micro controllers in the lab assignments. This course is recommended to take by all electronics, Robotics students and I would have a much wider point of view if I had taken this course in the beginning of my studies (something that did not happen because of lack of communication between physics department and departments of informatic). Here you can download the <a title="FYS3240 / FYS4240 Exam paper" href="http://www.shahabfm.com/_assignments/uio/fys3240/fys4240_fys3240.pdf" target="_blank">exam paper</a> for spring 2011.<span id="more-981"></span></p>
<blockquote><p><em>Lerning Objectives: Students should be able to</em></p>
<ul>
<li><em>describe the main functional units in a PC and be able to explain how they interact. They should know different bus types, and on this basis be able to account for different generations of PCs.</em></li>
</ul>
<ul>
<li><em>explain what an operating system is and be able to explain important concepts such as multitasking, privilege levels and drivers.</em></li>
<li><em>describe the main functional units of a microcontroller and be familiar with typical applications for a microcontroller. They should also have a basic understanding of how a microprocessor is built up and be able to explain concepts such as interrupts and interrupt handling both on a microcontroller and a microprocessor.</em></li>
<li><em>solve simple instrumentation tasks using both PC and microcontroller. They should also master programming in C and LabVIEW on a level that enables them to solve such tasks.</em></li>
<li><em>master basic troubleshooting of both software and hardware.</em></li>
</ul>
</blockquote>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.shahabfm.com/archives/2011/08/computer-based-instrumentation-and-micro-controllers-fys4240-fys3240/&via=shahabfm&text=Computer based instrumentation and micro controllers, FYS4240 / FYS3240&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.shahabfm.com/archives/2011/08/computer-based-instrumentation-and-micro-controllers-fys4240-fys3240/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaMail, sending emails from your Java application</title>
		<link>http://www.shahabfm.com/archives/2011/08/javamail-sending-emails-from-your-java-se-application/</link>
		<comments>http://www.shahabfm.com/archives/2011/08/javamail-sending-emails-from-your-java-se-application/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 23:09:42 +0000</pubDate>
		<dc:creator>Shahab</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shahab]]></category>
		<category><![CDATA[Email]]></category>

		<guid isPermaLink="false">http://www.shahabfm.com/?p=973</guid>
		<description><![CDATA[The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications. The JavaMail API is available as an optional package for use with Java SE platform and is also included in the Java EE platform. Download JavaMail jar files from here. Full JavaMail API. For a full example with source code &#8230; <a href="http://www.shahabfm.com/archives/2011/08/javamail-sending-emails-from-your-java-se-application/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications. The JavaMail API is available as an optional package for use with Java SE platform and is also included in the Java EE platform. <a title="Java Mail" href="http://www.oracle.com/technetwork/java/javamail/index-138643.html" target="_blank">Download JavaMail jar files from here</a>. <a title="JavaMail API" href="http://javamail.kenai.com/nonav/javadocs/index.html" target="_blank">Full JavaMail API</a>. For a full example with source code of JavaMail, click on &#8220;more&#8221; link down here.<span id="more-973"></span></p>
<pre class="brush: java; title: ; notranslate">
package mailSender;

import javax.activation.*;
import javax.mail.*;
import javax.mail.internet.*;

//import SendMailUsingAuthentication.SMTPAuthenticator;

import java.util.*;
import java.io.*;

public class Sender {

	private static final String SMTP_HOST_NAME = &quot;mail.yourservername.com&quot;;
	private static final String SMTP_AUTH_USER = &quot;username&quot;;
	private static final String SMTP_AUTH_PWD = &quot;PaSsWoRd&quot;;

	private static final String emailMsgTxt = &quot;Message sent by JavaMail&quot;;
	private static final String emailSubjectTxt = &quot;Sent email by JavaMail&quot;;
	private static final String emailFromAddress = &quot;your_email@your_website.com&quot;;

	// Add List of Email address to who email needs to be sent to
	private static final String[] emailList = { &quot;some_email1@some_website.com&quot;,
			&quot;some_email2@some_website.com&quot;, &quot;some_email3@some_website.com&quot; };

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Sender smtpMailSender = new Sender();

		// Attempt #1, sending email without attachment
		try {
			smtpMailSender.sendEmail(emailList, emailSubjectTxt, emailMsgTxt,
					emailFromAddress);
		} catch (MessagingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		// Attempt #2, sending email with attachment
		try {
			smtpMailSender.sendEmailWithAttachment(emailList, emailSubjectTxt,
					emailMsgTxt, emailFromAddress,
					&quot;Logg utskiftning av deler 0B.xlsx&quot;);
		} catch (MessagingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}// end of main()

	public void sendEmail(String recipients[], String subject, String message,
			String from) throws MessagingException {
		boolean debug = false;

		// Host SMTP address
		Properties props = new Properties();
		props.put(&quot;mail.smtp.host&quot;, SMTP_HOST_NAME);
		// setting up authentication
		props.put(&quot;mail.smtp.auth&quot;, &quot;true&quot;);
		Authenticator auth = new SMTPAuthenticator();
		Session session = Session.getDefaultInstance(props, auth);

		// Session
		session.setDebug(debug);

		// create a message
		Message msg = new MimeMessage(session);

		// From Addresses
		InternetAddress addressFrom = new InternetAddress(from);
		msg.setFrom(addressFrom);

		// Making an array for multiple addresses
		InternetAddress[] addressTo = new InternetAddress[recipients.length];
		for (int i = 0; i &lt; recipients.length; i++) {
			addressTo[i] = new InternetAddress(recipients[i]);
		}
		msg.setRecipients(Message.RecipientType.TO, addressTo);

		// Subject
		msg.setSubject(subject);

		// Setting msg content, here text/plain
		msg.setContent(message, &quot;text/plain&quot;);

		// sending msg
		Transport.send(msg);
	}

	public void sendEmailWithAttachment(String recipients[], String subject,
			String messageText, String from, String fileAddress)
			throws MessagingException {

		// Get system properties
		Properties props = System.getProperties();

		// SMTP address
		props.put(&quot;mail.smtp.host&quot;, SMTP_HOST_NAME);

		//Session and authentication
		props.put(&quot;mail.smtp.auth&quot;, &quot;true&quot;);
		Authenticator auth = new SMTPAuthenticator();
		Session session = Session.getDefaultInstance(props, auth);

		// Defining message
		MimeMessage msg = new MimeMessage(session);

		// To address
		InternetAddress addressFrom = new InternetAddress(from);
		msg.setFrom(addressFrom);

		// Recipients list, Array of to addresses
		InternetAddress[] addressTo = new InternetAddress[recipients.length];
		for (int i = 0; i &lt; recipients.length; i++) {
			addressTo[i] = new InternetAddress(recipients[i]);
		}
		msg.setRecipients(Message.RecipientType.TO, addressTo);

		// setting subjct
		msg.setSubject(subject); // &quot;Hello JavaMail with Attachment&quot;

		// create the message part
		MimeBodyPart messageBodyPart = new MimeBodyPart();

		// Setting message text
		messageBodyPart.setText(messageText);

		Multipart multipart = new MimeMultipart();
		multipart.addBodyPart(messageBodyPart);

		// Attachment
		messageBodyPart = new MimeBodyPart();
		DataSource source = new FileDataSource(fileAddress);
		messageBodyPart.setDataHandler(new DataHandler(source));
		messageBodyPart.setFileName(fileAddress);
		multipart.addBodyPart(messageBodyPart);

		// Put parts in message
		msg.setContent(multipart);

		// Send the message
		Transport.send(msg);
	}

	private class SMTPAuthenticator extends javax.mail.Authenticator {

		public PasswordAuthentication getPasswordAuthentication() {
			String username = SMTP_AUTH_USER;
			String password = SMTP_AUTH_PWD;
			return new PasswordAuthentication(username, password);
		}
	}

}
</pre>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.shahabfm.com/archives/2011/08/javamail-sending-emails-from-your-java-se-application/&via=shahabfm&text=JavaMail, sending emails from your Java application&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.shahabfm.com/archives/2011/08/javamail-sending-emails-from-your-java-se-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RxTx / Serial Communication on Windows</title>
		<link>http://www.shahabfm.com/archives/2011/08/rxtx-serial-communication-on-windows/</link>
		<comments>http://www.shahabfm.com/archives/2011/08/rxtx-serial-communication-on-windows/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 14:40:32 +0000</pubDate>
		<dc:creator>Shahab</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shahab]]></category>
		<category><![CDATA[COM ports]]></category>
		<category><![CDATA[RxTx]]></category>
		<category><![CDATA[Serial Communication]]></category>

		<guid isPermaLink="false">http://www.shahabfm.com/?p=968</guid>
		<description><![CDATA[Serial communication through COM ports are very common both in prototyping and industry. To be able to read / listen to COM ports on Java, Arudino or Processing you need to install the RxTx library. Follow the instruction to install Serial and Parallel communication installed on your Windows.

unzip rxtx-*-win32.zip
copy rxtxSerial.dll / rxtxParallel.dll to %JAVA_HOME%\bin
(e.g. c:\Program &#8230; <a href="http://www.shahabfm.com/archives/2011/08/rxtx-serial-communication-on-windows/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div>Serial communication through COM ports are very common both in prototyping and industry. To be able to read / listen to COM ports on Java, Arudino or Processing you need to install the RxTx library. Follow the instruction to install Serial and Parallel communication installed on your Windows.</div>
<ol>
<li>unzip rxtx-*-win32.zip</li>
<li>copy <strong>rxtxSerial.dll / rxtxParallel.dll</strong> to %JAVA_HOME%<strong>\bin<br />
</strong>(e.g. c:\Program Files\Java\j2re1.4.1_01)</li>
<li>copy <strong>RXTXcomm.jar</strong> to %JAVA_HOME%<strong>\lib\ext</strong></li>
</ol>
<p><strong><a title="Download RxTx" href="http://www.jcontrol.org/download/rxtx_en.html" target="_blank">Download RxTx</a></strong></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.shahabfm.com/archives/2011/08/rxtx-serial-communication-on-windows/&via=shahabfm&text=RxTx / Serial Communication on Windows&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.shahabfm.com/archives/2011/08/rxtx-serial-communication-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenCV installation Tutorial, MS Visual C++ 2008</title>
		<link>http://www.shahabfm.com/archives/2011/05/opencv-installation-tutorial-ms-visual-c-2008/</link>
		<comments>http://www.shahabfm.com/archives/2011/05/opencv-installation-tutorial-ms-visual-c-2008/#comments</comments>
		<pubDate>Tue, 31 May 2011 12:27:05 +0000</pubDate>
		<dc:creator>Shahab</dc:creator>
				<category><![CDATA[Image Processing]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shahab]]></category>
		<category><![CDATA[VC++]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[image processing]]></category>
		<category><![CDATA[OpenCV]]></category>
		<category><![CDATA[Programming Tricks]]></category>

		<guid isPermaLink="false">http://www.shahabfm.com/?p=949</guid>
		<description><![CDATA[Installing OpenCV might sound very easy when you read it on some forums/websites, but there are some small changes in most of these tutorials that prevent the connection between OpenCV and MS Visual C++. In this tutorial we(my dear friend Puya Afsharian and I) try to guide you through the installation of these two products &#8230; <a href="http://www.shahabfm.com/archives/2011/05/opencv-installation-tutorial-ms-visual-c-2008/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Installing OpenCV might sound very easy when you read it on some forums/websites, but there are some small changes in most of these tutorials that prevent the connection between OpenCV and MS Visual C++. In this tutorial we(my dear friend Puya Afsharian and I) try to guide you through the installation of these two products and the right way to make them talk with each other.</p>
<p>Although people say it is easy to make OpenCV 2.2 to work with MS Visual C++ 2010, but we did not get it to work properly while it seems that MS visual c++ 2008 works perfect with OpenCV 2.1. Here are the download links for both products :</p>
<p>OpenCV 2.1 : <a href="http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.1/">http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.1/</a><br />
This file is modified to work with MS Visual C++ 2008 and therefore there is no need to install <a href="http://www.cmake.org/cmake/resources/software.html">CMake </a>again.</p>
<p>MS Visual C++ 2008(Free of charge) : <a href="http://www.microsoft.com/downloads/en/details.aspx?familyid=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&amp;displaylang=en">http://www.microsoft.com/downloads/en/details.aspx?familyid=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&amp;displaylang=en</a></p>
<p>Click More down here to read the rest of the tutorial &#8230;</p>
<p><span id="more-949"></span></p>
<h2>1 &#8211; Installing OpenCV</h2>
<p>After downloading OpenCV 2.1, you need to install the program. This is done by just running the EXE file which pops up the installation wizard. There you need to choose an installation path. I usually let it install to C:\OpenCV2.1. We refer to this path as ~ after this. DON’T FORGET to add the path for all users.</p>
<h2><a href="http://www.shahabfm.com/wp-content/uploads/2011/05/opencv_install.png"><img class="aligncenter size-medium wp-image-950" title="opencv_install" src="http://www.shahabfm.com/wp-content/uploads/2011/05/opencv_install-300x234.png" alt="" width="300" height="234" /></a>2- Installing MS Visual C++ 2008</h2>
<p>After downloading MS VC++ 2008, you need to install the program. This is done by just running the installation wizard which downloads the necessary files.</p>
<p><a href="http://www.shahabfm.com/wp-content/uploads/2011/05/vc++.png"><img class="aligncenter size-medium wp-image-952" title="vc++" src="http://www.shahabfm.com/wp-content/uploads/2011/05/vc++-300x177.png" alt="" width="300" height="177" /></a></p>
<h2><strong>3- Link OpenCV and VC++ together</strong></h2>
<p><strong> </strong>Open VC++. Then navigate to <strong>Tools &gt; Options &gt; Projects and Solutions &gt; VC++ Directories</strong>.</p>
<p>On &#8220;Show directories for, choose :<strong> Include Files</strong></p>
<p>Add the following : <strong>&#8220;~\include\opencv&#8221;</strong></p>
<p>On &#8220;Show directories for, choose : <span style="text-decoration: underline;"><strong>Library Files</strong></span></p>
<p>Add the following : <strong>&#8220;~\lib&#8221;</strong></p>
<p>Choose &#8220;Show directories for: <span style="text-decoration: underline;"><strong>Source Files</strong></span></p>
<p>Add the following :</p>
<p><em><strong>&#8220;~\src\cv&#8221;</strong></em><br />
<em><strong>&#8220;~\src\cvaux&#8221;</strong></em><br />
<em><strong>&#8220;~\src\cxcore&#8221;</strong></em><br />
<em><strong>&#8220;~\src\highgui”</strong></em></p>
<p>Now we are done configuring VC++, but still we need some small changes in our project to be able to use OpenCV libraries</p>
<p><a href="http://www.shahabfm.com/wp-content/uploads/2011/05/vc++directiories.png"><img class="aligncenter size-medium wp-image-953" title="vc++directiories" src="http://www.shahabfm.com/wp-content/uploads/2011/05/vc++directiories-300x192.png" alt="" width="300" height="192" /></a></p>
<h2>4- Project Configuration :</h2>
<p>After creating the project, the OpenCV dependencies should be added.<br />
Navigate to Open Project Properties: Project &#8211; %projectName% Properties<br />
Open Linker Input properties: Configuration Properties &gt; Linker &gt; Input<br />
Open the &#8220;&#8230;&#8221; window to edit &#8220;Additional Dependencies&#8221; and on each line put:</p>
<p><em><strong>&#8220;cv210.lib&#8221;</strong></em><br />
<em><strong>&#8220;cxcore210.lib&#8221;</strong></em><br />
<em><strong>&#8220;highgui210.lib&#8221;</strong></em></p>
<p>And any other lib file necessary for your project<br />
Your project should now build. If you get any errors try restarting Visual Studio and then doing a clean Rebuild.</p>
<p><a href="http://www.shahabfm.com/wp-content/uploads/2011/05/properties_project_config.png"><img class="aligncenter size-medium wp-image-951" title="properties_project_config" src="http://www.shahabfm.com/wp-content/uploads/2011/05/properties_project_config-300x164.png" alt="" width="300" height="164" /></a></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.shahabfm.com/archives/2011/05/opencv-installation-tutorial-ms-visual-c-2008/&via=shahabfm&text=OpenCV installation Tutorial, MS Visual C++ 2008&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.shahabfm.com/archives/2011/05/opencv-installation-tutorial-ms-visual-c-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CourseApp Final Report</title>
		<link>http://www.shahabfm.com/archives/2011/05/courseapp_final_report/</link>
		<comments>http://www.shahabfm.com/archives/2011/05/courseapp_final_report/#comments</comments>
		<pubDate>Mon, 30 May 2011 12:43:29 +0000</pubDate>
		<dc:creator>Shahab</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[My Projects]]></category>
		<category><![CDATA[My Studies]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rapid Prototyping]]></category>
		<category><![CDATA[Shahab]]></category>
		<category><![CDATA[UiO]]></category>
		<category><![CDATA[Android GUI]]></category>
		<category><![CDATA[Catlog]]></category>
		<category><![CDATA[courseApp]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.shahabfm.com/?p=959</guid>
		<description><![CDATA[What is CourseApp ?
CourseApp Final Presentation :

CourseApp Final Report :
http://www.uio.no/studier/emner/matnat/ifi/INF5261/v11/studentprojects/android/FinalReport_INF5261.pdf
Tweet]]></description>
			<content:encoded><![CDATA[<p>What is <strong><a href="http://www.uio.no/studier/emner/matnat/ifi/INF5261/v11/studentprojects/android/">CourseApp</a></strong> ?<br />
<strong>CourseApp Final Presentation</strong> :<br />
<center><iframe src="https://docs.google.com/present/embed?id=ddv9bbz2_209hs2drpcw" frameborder="0" width="410" height="342"></iframe></center><br />
<strong>CourseApp Final Report</strong> :<br />
<a href="http://www.uio.no/studier/emner/matnat/ifi/INF5261/v11/studentprojects/android/FinalReport_INF5261.pdf">http://www.uio.no/studier/emner/matnat/ifi/INF5261/v11/studentprojects/android/FinalReport_INF5261.pdf</a></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.shahabfm.com/archives/2011/05/courseapp_final_report/&via=shahabfm&text=CourseApp Final Report&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.shahabfm.com/archives/2011/05/courseapp_final_report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Ethernet shield problem when on External Power</title>
		<link>http://www.shahabfm.com/archives/2011/05/943/</link>
		<comments>http://www.shahabfm.com/archives/2011/05/943/#comments</comments>
		<pubDate>Mon, 23 May 2011 13:15:21 +0000</pubDate>
		<dc:creator>Shahab</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Shahab]]></category>
		<category><![CDATA[Arduino Ethernet]]></category>
		<category><![CDATA[Ethernet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.shahabfm.com/?p=943</guid>
		<description><![CDATA[When Arduino/ethernet shield is connected with an external voltage source I have to press reset button to make it work. But when I use it with the USB source everything works fine. This code is not exactly pretty, but it solves the problem of the need to restart on Ethernet shield startup. Open relay and hooked the coil &#8230; <a href="http://www.shahabfm.com/archives/2011/05/943/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When Arduino/ethernet shield is connected with an <strong><em>external voltage source</em></strong> I have to <span style="color: #ff0000;"><em><strong>press reset button to make it work</strong></em></span>. But when I use it with the USB source everything works fine. This code is not exactly pretty, but it solves the problem of the need to restart on Ethernet shield startup. Open relay and hooked the coil pins to ground and digital pin 02, and the switched pins to ground and the reset pin. The trick is to before initializing the Ethernet library, check an address in EEPROM. If the flag is 0, we set it to 1 and then trigger the relay, and the unit resets. If the flag is 1, we assume that we just did a warm reset and set the flag back to 0, for next time we power up.</p>
<pre class="brush: java; title: ; notranslate">
&lt;pre&gt;int relayPin = 02;
int addr = 128;

void eepThang() {
  eep_value = EEPROM.read(addr);
  if (eep_value == 1) {
    Serial.println(&quot;already reset. writing 0&quot;);
    EEPROM.write(addr, 0);
  }
  else {
    Serial.println(&quot;not reset.. writing 1, restarting&quot;);
    Serial.println(eep_value);
    EEPROM.write(addr, 1);
    Serial.println(&quot;done wrote... here we go&quot;);
    digitalWrite(relayPin, HIGH);
    delay(1000);
  }
}&lt;/pre&gt;
</pre>
<p>source : <a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225354009/15">http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225354009/15</a></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.shahabfm.com/archives/2011/05/943/&via=shahabfm&text=Arduino Ethernet shield problem when on External Power&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.shahabfm.com/archives/2011/05/943/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Processing, the key for Arduino board independent programming</title>
		<link>http://www.shahabfm.com/archives/2011/05/processing-the-key-for-arduino-board-independent-programming/</link>
		<comments>http://www.shahabfm.com/archives/2011/05/processing-the-key-for-arduino-board-independent-programming/#comments</comments>
		<pubDate>Mon, 23 May 2011 12:48:04 +0000</pubDate>
		<dc:creator>Shahab</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Robotics]]></category>
		<category><![CDATA[Shahab]]></category>
		<category><![CDATA[Hardware Software Interfacing]]></category>
		<category><![CDATA[Java programing]]></category>

		<guid isPermaLink="false">http://www.shahabfm.com/?p=897</guid>
		<description><![CDATA[When it comes to Arduino, there are several ways to do things. Using simple Arduino IDE to communicate with the board through serial port. Write a Java program to do it, or maybe do send orders to Arduino through your program that is not uploaded on Arduino card and can be changed anytime without even &#8230; <a href="http://www.shahabfm.com/archives/2011/05/processing-the-key-for-arduino-board-independent-programming/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When it comes to Arduino, there are several ways to do things. Using simple Arduino IDE to communicate with the board through serial port. Write a Java program to do it, or maybe do send orders to Arduino through your program that is not uploaded on Arduino card and can be changed anytime <span style="text-decoration: underline;"><strong><em>without even updating the pde file on the board</em></strong></span>. The tool that gives you  the power to do this is called <a href="http://processing.org/" target="_blank">Processing</a> &amp; the library used exactly for Arduino is called <a href="http://www.arduino.cc/playground/Interfacing/Processing" target="_blank">StandardFirmdata</a>. The very good thing about Processing is that it is based on Java and all Java codes works right out of the box on it. You can also import processing libraries into your Java framwork and enjoy the power of processing right in the middle of your Java project(in Eclipse).</p>
<p>The instruction to get Processing &amp; Arduino talk together :</p>
<ol>
<li>Download <a href="http://arduino.cc/playground/uploads/Interfacing/processing-arduino.zip" target="_blank">this file</a>.</li>
<li>Unzip the library and copy the &#8220;arduino&#8221; folder into the &#8220;libraries&#8221; sub-folder of your Processing Sketchbook. (You can find the location of your Sketchbook by opening the Processing Preferences. If you haven&#8217;t made a &#8220;libraries&#8221; sub-folder, create one.)</li>
<li>Run Arduino, open the <em><strong>Examples &gt; Firmata &gt; StandardFirmata</strong></em> sketch, and upload it to the Arduino board.</li>
<li>Configure Processing for serial:<a rel="nofollow" href="http://processing.org/reference/libraries/serial/">http://processing.org/reference/libraries/serial/</a></li>
<li>In Processing, open one of the examples that comes with with the Arduino library(in the same folder that we just unzipped).</li>
<li>Edit the example code to select the correct serial port.</li>
<li>Run the example.</li>
</ol>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.shahabfm.com/archives/2011/05/processing-the-key-for-arduino-board-independent-programming/&via=shahabfm&text=Processing, the key for Arduino board independent programming&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.shahabfm.com/archives/2011/05/processing-the-key-for-arduino-board-independent-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Processing Serial communication in Eclipse</title>
		<link>http://www.shahabfm.com/archives/2011/05/processing-serial-communication-in-eclipse/</link>
		<comments>http://www.shahabfm.com/archives/2011/05/processing-serial-communication-in-eclipse/#comments</comments>
		<pubDate>Sat, 21 May 2011 13:04:37 +0000</pubDate>
		<dc:creator>Shahab</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shahab]]></category>
		<category><![CDATA[Programming Tricks]]></category>

		<guid isPermaLink="false">http://www.shahabfm.com/?p=941</guid>
		<description><![CDATA[If you are combining Java &#38; Processing using Eclipse, probably you would have problems using Serial library in Processing with just importing Processing Core jar file. You do need to import the Serial jar file from following path :
Path&#8230;/Library/Java/Extensions
This should be added as an external Jar file in properties of your project at Eclipse.
Tweet]]></description>
			<content:encoded><![CDATA[<p>If you are combining Java &amp; Processing using Eclipse, probably you would have problems using Serial library in Processing with just importing Processing Core jar file. You do need to import the Serial jar file from following path :</p>
<p style="padding-left: 30px;"><em>Path&#8230;/Library/Java/Extensions</em></p>
<p>This should be added as an external Jar file in properties of your project at Eclipse.</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.shahabfm.com/archives/2011/05/processing-serial-communication-in-eclipse/&via=shahabfm&text=Processing Serial communication in Eclipse&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.shahabfm.com/archives/2011/05/processing-serial-communication-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android development tricks</title>
		<link>http://www.shahabfm.com/archives/2011/05/courseapp-android-development-tricks/</link>
		<comments>http://www.shahabfm.com/archives/2011/05/courseapp-android-development-tricks/#comments</comments>
		<pubDate>Thu, 19 May 2011 10:53:56 +0000</pubDate>
		<dc:creator>Shahab</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[My Projects]]></category>
		<category><![CDATA[My Studies]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shahab]]></category>
		<category><![CDATA[UiO]]></category>
		<category><![CDATA[courseApp]]></category>
		<category><![CDATA[IFI]]></category>
		<category><![CDATA[Mobile application]]></category>
		<category><![CDATA[Mobile Programming]]></category>
		<category><![CDATA[Norway]]></category>
		<category><![CDATA[Programming Tricks]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[University of Oslo]]></category>

		<guid isPermaLink="false">http://www.shahabfm.com/?p=884</guid>
		<description><![CDATA[This is a summay of the tricks I have learned making an application called courseApp project.  This application was developed in the Mobile Information Systems that I took at University of Oslo. Eclipse is a very good tool to use for Android development. To start with you need to download Andriod SDK. After installing both &#8230; <a href="http://www.shahabfm.com/archives/2011/05/courseapp-android-development-tricks/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a summay of the tricks I have learned making an application called <a title="courseApp" href="http://www.uio.no/studier/emner/matnat/ifi/INF5261/v11/studentprojects/android/" target="_blank">courseApp project</a>.  This application was developed in the Mobile Information Systems that I took at University of Oslo. <a href="http://www.eclipse.org/downloads/" target="_blank">Eclipse </a>is a very good tool to use for Android development. To start with you need to download A<a title="Android SDK" href="http://developer.android.com/sdk/index.html" target="_blank">ndriod SDK</a>. After installing both of these(and ofcourse Java Development Kit, JDK which is a pre-requirement for both of these), you need to make Eclipse and Android SDK talk together. This is done by a plugin called &#8220;<a href="http://developer.android.com/sdk/eclipse-adt.html" target="_blank">ADT plugin for Eclipse</a>&#8221; from Google. You can read more about how to install this plugin by <a href="http://developer.android.com/sdk/eclipse-adt.html" target="_blank">clicking here</a>. <strong>In case of Android SDK installation(the exe file) doesn&#8217;t recognize JDK </strong>on your computer, you can simply download the <strong>zip </strong>file and <strong>extract </strong>it. Don&#8217;t forget <strong>appending that folder to the %PATH% environment variable</strong>. Now some more tips follows :</p>
<p><strong>background color for your layout :<br />
</strong>add the following code to your layout XML code(#ff32cf is the color code)<br />
<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre;"> </span></p>
<pre class="brush: java; title: ; notranslate">android:background=&quot;#ff23cf&quot;</pre>
<p>Background Image for your layout :<br />
1- Add the image you want to the layout folder of your project.<br />
2- Add the following code to your layout XML code<br />
<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre;"> </span></p>
<pre class="brush: java; title: ; notranslate">android:background=&quot;@drawable/bbg&quot;</pre>
<p><strong>EditText features :</strong><br />
one of the features I want to talk about is <strong><em>android:singleLine </em></strong>which is very useful. If you want to get some info from the user, this text box is a good tool to use, but make sure you set the SingleLine variable to true. If not if they paste a 20 lines of text by mistake your whole GUI gets out of shape. Also if you want to use this for example to write an email text, then this should be set to false as you want it to contain several lines. The good thing about several lines EditText is that they do have scrolling function.<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace;"><span style="font-size: 12px; line-height: 18px; white-space: pre;"><br />
</span></span></p>
<pre class="brush: java; title: ; notranslate">&lt;EditText ... android:singleLine=&quot;true&quot;&gt;//Single Line box for getting email address
&lt;/span&gt;&lt;span style=&quot;font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre;&quot;&gt;&lt;EditText ... android:singleLine=&quot;false&quot;&gt;//Multi Line box for getting email text</pre>
<p>in case you want<strong> limit the number of lines</strong> of an EditText:</p>
<pre class="brush: java; title: ; notranslate">&lt;span style=&quot;font-family: monospace; font-size: 12px; line-height: 18px; white-space: pre;&quot;&gt;&lt;EditText android:layout_width=&quot;fill_parent&quot;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;            android:layout_height=&quot;wrap_content&quot; android:gravity=&quot;center&quot;
android:singleLine=&quot;false&quot; android:lines=&quot;5&quot;
android:layout_marginLeft=&quot;10dip&quot; android:layout_marginRight=&quot;10dip&quot;
/&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px; white-space: normal;&quot;&gt;</pre>
<p>&nbsp;</p>
<p><strong>Simple Item List :<br />
</strong>Setting up a simple Item list with an already filled Arrayadapter.</p>
<pre class="brush: java; title: ; notranslate">

static final String[] COUNTRIES = new String[] {&quot;Afghanistan&quot;, &quot;Albania&quot;, &quot;Algeria&quot;, &quot;American Samoa&quot;, &quot;Andorra&quot;,&quot;Angola&quot;, &quot;...&quot;}
&lt;pre&gt;setListAdapter(new ArrayAdapter&lt;String&gt;(this,
android.R.layout.simple_list_item_1, COUNTRIES));
getListView().setTextFilterEnabled(true);&lt;/pre&gt;
</pre>
<p><strong>Drop Down List :<br />
</strong>In Android drop down list is a little bit complicated to give value to. You first need to add one Spinner to your layout and then connect it to</p>
<pre class="brush: java; title: ; notranslate"> String[] Countries = { &quot;India&quot;, &quot;France&quot;, &quot;Japan&quot;, &quot;China&quot;, &quot;U.S&quot; };

// //////////////////Countries Spinner/////////////////////////////////
SpinnerCountries = (Spinner) findViewById(R.id.Spinner01);

// //////////////////////////////////////////////////////////////
// create an arrayAdapter an assign it to the spinner
AdapterCountries = new ArrayAdapter&lt;CharSequence&gt;(this,
android.R.layout.simple_spinner_item);
AdapterCountries
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
SpinnerCountries.setAdapter(AdapterCountries);

int lenCountries = Countries.length;

for (int i = 0; i &lt; lenCountries; i++) {
// test += Areas[i] + &quot;\n&quot;;
AdapterCountries.add(Countries[i]);
}</pre>
<p><a title="Spinner &amp; drop down list in Android" href="http://www.dotnetexpertsforum.com/dropdownlist-or-combobox-or-spinner-in-android-t1352.html" target="_blank">source</a></p>
<p><a title="Spinner &amp; drop down list in Android" href="http://www.dotnetexpertsforum.com/dropdownlist-or-combobox-or-spinner-in-android-t1352.html" target="_blank"></a><strong>Disabling the Landscape Mode :</strong><br />
You have two ways to do this, either in the code, or in the XML layout file :</p>
<p>XML :<br />
<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre;"> </span></p>
<pre class="brush: java; title: ; notranslate">&lt;/span&gt;&lt;span style=&quot;font-family: monospace; font-size: 12px; line-height: 18px; white-space: pre;&quot;&gt;&lt;activity android:name=&quot;.SomeActivity&quot;&lt;/span&gt;
&lt;pre&gt;
&lt;pre&gt;&lt;code&gt;              android:label=&quot;@string/app_name&quot;
android:screenOrientation=&quot;portrait&quot;&gt;&lt;/code&gt;</pre>
<p>OR in the code :</p>
<p>[/java]</p>
<p><span style="font-family: monospace;">setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);     //  Fixed Portrait orientation[</span>/java]</p>
<p><strong>Layouts in Android : </strong><br />
<strong>LinearLayout </strong>:<br />
<code><a href="http://developer.android.com/reference/android/widget/LinearLayout.html">LinearLayout</a></code> aligns all children in a single direction — vertically or horizontally, depending on how you define the <code>orientation</code> attribute. All children are stacked one after the other, so a vertical list will only have one child per row, no matter how wide they are, and a horizontal list will only be one row high (the height of the tallest child, plus padding). A <code><a href="http://developer.android.com/reference/android/widget/LinearLayout.html">LinearLayout</a></code> respects <em>margin</em>s between children and the <em>gravity</em> (right, center, or left alignment) of each child.</p>
<p><strong>TableLayout :<br />
</strong><code><a href="http://developer.android.com/reference/android/widget/TableLayout.html">TableLayout</a></code> positions its children into rows and columns. TableLayout containers do not display border lines for their rows, columns, or cells. The table will have as many columns as the row with the most cells. A table can leave cells empty, but cells cannot span columns, as they can in HTML.</p>
<p><strong>RelativeLayout<br />
</strong><code><a href="http://developer.android.com/reference/android/widget/RelativeLayout.html">RelativeLayout</a></code> lets child views specify their position relative to the parent view or to each other (specified by ID). So you can align two elements by right border, or make one below another, centered in the screen, centered left, and so on. Elements are rendered in the order given, so if the first element is centered in the screen, other elements aligning themselves to that element will be aligned relative to screen center. Also, because of this ordering, if using XML to specify this layout, the element that you will reference (in order to position other view objects) must be listed in the XML file before you refer to it from the other views via its reference ID.</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.shahabfm.com/archives/2011/05/courseapp-android-development-tricks/&via=shahabfm&text=Android development tricks&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.shahabfm.com/archives/2011/05/courseapp-android-development-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenCV, Tutorials based on my experience coming soon</title>
		<link>http://www.shahabfm.com/archives/2011/05/opencv-tutorials-based-on-my-experience-coming-soon/</link>
		<comments>http://www.shahabfm.com/archives/2011/05/opencv-tutorials-based-on-my-experience-coming-soon/#comments</comments>
		<pubDate>Tue, 10 May 2011 02:08:34 +0000</pubDate>
		<dc:creator>Shahab</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shahab]]></category>
		<category><![CDATA[VC++]]></category>
		<category><![CDATA[image processing]]></category>
		<category><![CDATA[OpenCV]]></category>

		<guid isPermaLink="false">http://www.shahabfm.com/?p=878</guid>
		<description><![CDATA[OpenCV is a rich computer vision library compatible with many programming languages opening doors for lots of opportunities &#8230; Soon I will write a tutorial here about it &#8230;

update : 
Here is my tutorial on how to install OpenCV and make it work with VC++ 2008
Tweet]]></description>
			<content:encoded><![CDATA[<p>OpenCV is a rich computer vision library compatible with many programming languages opening doors for lots of opportunities &#8230; Soon I will write a tutorial here about it &#8230;<br />
<a href="http://www.shahabfm.com/wp-content/uploads/2011/05/opencv.png"><img src="http://www.shahabfm.com/wp-content/uploads/2011/05/opencv-300x241.png" alt="" title="opencv" width="300" height="241" class="aligncenter size-medium wp-image-880" /></a></p>
<p><em><strong>update : </strong></em><br />
Here is my <a href="http://www.shahabfm.com/archives/2011/05/opencv-installation-tutorial-ms-visual-c-2008/">tutorial on how to install OpenCV and make it work with VC++ 2008</a></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.shahabfm.com/archives/2011/05/opencv-tutorials-based-on-my-experience-coming-soon/&via=shahabfm&text=OpenCV, Tutorials based on my experience coming soon&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.shahabfm.com/archives/2011/05/opencv-tutorials-based-on-my-experience-coming-soon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

