<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1825595997804782966</id><updated>2024-11-08T07:37:31.506-08:00</updated><category term="Design Patterns"/><category term="Strategy Pattern"/><category term="Strategy Pattern Sample with C++"/><title type='text'>මොරේමඩගේ සටහන්....</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://imoremada.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://imoremada.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Indunil Moremada</name><uri>http://www.blogger.com/profile/02085015197844785759</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1825595997804782966.post-3166395530197387070</id><published>2012-07-13T23:11:00.001-07:00</published><updated>2012-07-14T03:41:56.878-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Design Patterns"/><category scheme="http://www.blogger.com/atom/ns#" term="Strategy Pattern"/><category scheme="http://www.blogger.com/atom/ns#" term="Strategy Pattern Sample with C++"/><title type='text'>Strategy Pattern</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Most of the time after the has been developed. We will be asked for adding new features for the existing software. In such cases, we have to spend more time to change the previously written codes and to change some logic as well. This will be a more time consuming process rather than designing a new software. We all know that object oriented designs are re-usable. But when we are designing something we have to put more concentration. Because our design should capable of catering newly coming requirements as well. If there is a possibility to &lt;b&gt;change&lt;/b&gt; the &lt;b&gt;behaviors&lt;/b&gt; &lt;b&gt;at run-time&lt;/b&gt; we can use &lt;b&gt;strategy pattern&lt;/b&gt;. &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: magenta;&quot;&gt;An example for Strategy Pattern&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Lets say, we have a vehicle factory which produces different types of vehicles. Company is currently producing cars with patrol engine behavior and diesel engine behavior. Imagine they are looking forward to produce cars with some other engine behaviors as well. Let&#39;s say they need to produce the same type of a car with some other engine. This will be a huge problem if the behavior of engine is bound to the vehicle itself as an abstract function.  Solution is as follows,&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Vehicle.h&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
#ifndef VEHICLE_H&lt;br /&gt;
#define VEHICLE_H&lt;br /&gt;
#include &quot;Engine.h&quot;&lt;br /&gt;
&lt;br /&gt;
class Vehicle&lt;br /&gt;
{&amp;nbsp; &lt;br /&gt;
public:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; enum Type&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; CAR,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; VAN,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; UNDEFINED&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; };&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Vehicle();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; virtual ~Vehicle();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Engine* getEngine() const;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; virtual void setEngine(Engine* val);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; void startEngine();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; virtual Type getType();&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Type type_;&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Engine* engine_;&lt;br /&gt;
};&lt;br /&gt;
#endif //VEHICLE_H &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Vehicle.cpp&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
#include &quot;Vehicle.h&quot;&lt;br /&gt;
#include &lt;stdio.h&gt;&lt;br /&gt;#include &lt;crtdbg.h&gt;&lt;br /&gt;&lt;br /&gt;Vehicle::Vehicle() : type_(UNDEFINED), engine_(NULL)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Engine* Vehicle::getEngine() const&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return engine_;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Vehicle::~Vehicle()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete engine_;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void Vehicle::setEngine( Engine* val )&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; engine_ = val;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void Vehicle::startEngine()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _ASSERT(engine_ != NULL);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; engine_-&amp;gt;start();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Vehicle::Type Vehicle::getType()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return type_;&lt;br /&gt;} &lt;/crtdbg.h&gt;&lt;/stdio.h&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Car.h&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
#ifndef CAR_H&lt;br /&gt;
#define CAR_H&lt;br /&gt;
&lt;br /&gt;
#include &quot;Vehicle.h&quot;&lt;br /&gt;
&lt;br /&gt;
class Car : public Vehicle&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Car();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; virtual ~Car();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Vehicle::Type getType();&lt;br /&gt;
private:&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif //CAR_H&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Car.cpp&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
#include &quot;Car.h&quot;&lt;br /&gt;
&lt;br /&gt;
Car::Car()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; type_ = Vehicle::CAR;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Car::~Car()&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Vehicle::Type Car::getType()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return type_;&lt;br /&gt;
}&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Engine.h&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
#ifndef ENGINE_H&lt;br /&gt;
#define ENGINE_H&lt;br /&gt;
&lt;br /&gt;
class Engine&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Engine(){}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; virtual void start()=0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; virtual ~Engine(){}&lt;br /&gt;
private:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
};&lt;br /&gt;
#endif //ENGINE_H&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
DieselEngine.h&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
#ifndef DIESEL_ENGINE_H&lt;br /&gt;
#define DIESEL_ENGINE_H&lt;br /&gt;
&lt;br /&gt;
#include &quot;Engine.h&quot;&lt;br /&gt;
&lt;br /&gt;
class DieselEngine : public Engine&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DieselEngine();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ~DieselEngine();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; void start();&lt;br /&gt;
};&lt;br /&gt;
#endif //DIESEL_ENGINE_H&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
DieselEngine.cpp&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
#include &quot;DieselEngine.h&quot;&lt;br /&gt;
#include &amp;lt;&amp;lt; iostream &amp;gt;&amp;gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
DieselEngine::DieselEngine()&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
DieselEngine::~DieselEngine()&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void DieselEngine::start()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; std::cout&amp;lt;&amp;lt;&quot;Starting Diesel engine ....&quot;;&lt;br /&gt;
}&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
PatrolEngine.h&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
#ifndef PATROL_ENGINE_H&lt;br /&gt;
#define PATROL_ENGINE_H&lt;br /&gt;
&lt;br /&gt;
#include &quot;Engine.h&quot;&lt;br /&gt;
&lt;br /&gt;
class PatrolEngine : public Engine&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; PatrolEngine();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; virtual ~PatrolEngine();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; void start();&lt;br /&gt;
};&lt;br /&gt;
#endif //PATROL_ENGINE_H&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
PatrolEngine.cpp&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
#include &quot;PatrolEngine.h&quot;&lt;br /&gt;
#include &amp;lt;&amp;lt; iostream &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PatrolEngine::PatrolEngine()&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
PatrolEngine::~PatrolEngine()&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void PatrolEngine::start()&lt;br /&gt;
{&lt;br /&gt;
std::cout&amp;lt;&amp;lt;&quot;Starting Patrol engine ....&quot;;&lt;br /&gt;
}&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
main.cpp&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Vehicle* v1 = new Car();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; v1-&amp;gt;setEngine(new DieselEngine());&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; v1-&amp;gt;startEngine();&amp;nbsp; &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Vehicle* v2 = new Car();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; v2-&amp;gt;setEngine(new PatrolEngine());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; v2-&amp;gt;startEngine();&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Output&amp;nbsp; :&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;Starting Diesel engine .... &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;Starting Patrol engine ....&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Download Visual Studio 2008 Solution :&amp;nbsp; &lt;a href=&quot;http://www.4shared.com/rar/7H_dMWWX/StrategyPatternSample.html&quot;&gt;Strategy Pattern Sample in C++&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoremada.blogspot.com/feeds/3166395530197387070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoremada.blogspot.com/2012/07/strategy-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/3166395530197387070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/3166395530197387070'/><link rel='alternate' type='text/html' href='http://imoremada.blogspot.com/2012/07/strategy-pattern.html' title='Strategy Pattern'/><author><name>Indunil Moremada</name><uri>http://www.blogger.com/profile/02085015197844785759</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1825595997804782966.post-4709341417621521199</id><published>2011-05-13T19:06:00.000-07:00</published><updated>2011-05-13T19:08:16.067-07:00</updated><title type='text'>Dynamic code generation in java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Following code helps to generate a particular java class dynamically from our code.&lt;br /&gt;
&lt;br /&gt;
First create an Interface called &quot;Base&quot; which is as follows,&lt;br /&gt;
&lt;br /&gt;
public interface Base{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void run();&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Next step is creating the implementation class of the Base interface from our code which is named as &quot;C&quot;.&lt;br /&gt;
&lt;br /&gt;
import java.io.*;&lt;br /&gt;
&lt;br /&gt;
public class Invoker {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; public static void main(String[] argv) throws Exception {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String code = &quot;public class C implements Base {\n&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + &quot;&amp;nbsp;&amp;nbsp; public void run() {\n&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + &quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(\&quot;I am the new class\&quot;);\n&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + &quot;&amp;nbsp;&amp;nbsp; }}&quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; createClass(code,&quot;C.java&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Class classB = Class.forName(&quot;C&quot;); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Base b = (Base)classB.newInstance();&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; b.run();&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
public static void createClass(String code,String file) throws Exception {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OutputStream os = &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new FileOutputStream(new File(file));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.write(code.getBytes());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.close();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Process p = Runtime.getRuntime().&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exec(&quot;javac -classpath . &quot;+file);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p.waitFor();&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoremada.blogspot.com/feeds/4709341417621521199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoremada.blogspot.com/2011/05/dynamic-code-generation-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/4709341417621521199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/4709341417621521199'/><link rel='alternate' type='text/html' href='http://imoremada.blogspot.com/2011/05/dynamic-code-generation-in-java.html' title='Dynamic code generation in java'/><author><name>Indunil Moremada</name><uri>http://www.blogger.com/profile/02085015197844785759</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1825595997804782966.post-6949916887127079777</id><published>2010-12-01T17:47:00.000-08:00</published><updated>2010-12-01T17:47:56.917-08:00</updated><title type='text'>Recovering accidentaly removed PATH environment variable in ubuntu</title><content type='html'>By using following instructions you can overcome if you accidentally removed PATH environment variable from /etc/bash.bashrc file&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;first step:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Open a terminal and type following command&lt;br /&gt;
&lt;br /&gt;
export PATH=&quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;second step: &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Remove accidentally added thing from the bash.bashrc file.</content><link rel='replies' type='application/atom+xml' href='http://imoremada.blogspot.com/feeds/6949916887127079777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoremada.blogspot.com/2010/12/recovering-accidentaly-removed-path.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/6949916887127079777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/6949916887127079777'/><link rel='alternate' type='text/html' href='http://imoremada.blogspot.com/2010/12/recovering-accidentaly-removed-path.html' title='Recovering accidentaly removed PATH environment variable in ubuntu'/><author><name>Indunil Moremada</name><uri>http://www.blogger.com/profile/02085015197844785759</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1825595997804782966.post-4554440926582538831</id><published>2010-08-29T02:31:00.000-07:00</published><updated>2010-08-29T02:36:39.019-07:00</updated><title type='text'>Struts 2 Mapping a bulk of entries in a JSP to an array in an Action Class</title><content type='html'>To pass selected multiple entries which are in a JSP to the action in order to process all of them rather than processing one by one following sample codes can be used.&lt;br /&gt;
&lt;br /&gt;
In the JSP code following has to be kept. Here it is having only the  required fields to handle the this thing. Additional stuff has to be added by  yourselves :&lt;br /&gt;
fileldValue : value in this will be mapped to a particular index in a  &quot;bulk&quot; array which is in the action class here &quot;key&quot; is a long value in a request.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;s:checkbox name=&quot;bulk&quot; value=&quot;%{#bulk}&quot; fieldValue=&quot;{#key}&quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the action class there should have an array to map the selected entries in the JSP.&lt;br /&gt;
&lt;br /&gt;
public class BulkHandler extends ActionSupport {&lt;br /&gt;
&lt;br /&gt;
private long[] bulk;&lt;br /&gt;
&lt;br /&gt;
public long[] getBulk() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return bulk;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
public void setBulk(long[] bulk) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.bulk = bulk;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* @return String which desides the next page&lt;br /&gt;
*/&lt;br /&gt;
public String ProcessBulk(){&lt;br /&gt;
&lt;br /&gt;
/* here you can process the bulk array which is having the long parameter values of every entries&amp;nbsp; which were selected and sent to the action from the jsp */&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; return&amp;nbsp; SUCCESS;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://imoremada.blogspot.com/feeds/4554440926582538831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoremada.blogspot.com/2010/08/struts-2-mapping-bulk-of-entries-in-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/4554440926582538831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/4554440926582538831'/><link rel='alternate' type='text/html' href='http://imoremada.blogspot.com/2010/08/struts-2-mapping-bulk-of-entries-in-jsp.html' title='Struts 2 Mapping a bulk of entries in a JSP to an array in an Action Class'/><author><name>Indunil Moremada</name><uri>http://www.blogger.com/profile/02085015197844785759</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1825595997804782966.post-375769209931649619</id><published>2009-08-20T20:05:00.000-07:00</published><updated>2009-08-20T20:08:14.754-07:00</updated><title type='text'>Crazy Microsoft</title><content type='html'>This is just a simple article. Here I am trying to give some kind of bugs which are not already being solved by the Microsoft developers. It is  they are pretty cool. Just try them out by yourself.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0); font-weight: bold;&quot;&gt;Unbelievable.........&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An Indian discovered that nobody can create a folder anywhere on the computer with the name of &quot;CON&quot;. This is something pretty cool ...and unbelievable... At Microsoft the whole Team, couldn&#39;t answer why this happened!&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;HURRY UP TRY IT OUT NOW ,IT WILL NOT CREATE &quot; CON &quot; FOLDER&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 0, 0);&quot;&gt;Magic goes here........&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. Open the note pad&lt;br /&gt;2. Simply type &quot;Bush hid the facts&quot; without quotes&lt;br /&gt;3. Save it as what ever you wish&lt;br /&gt;4. Just close it and re-open it&lt;br /&gt;&lt;br /&gt;Hope you enjoyed with the article.</content><link rel='replies' type='application/atom+xml' href='http://imoremada.blogspot.com/feeds/375769209931649619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoremada.blogspot.com/2009/08/crazy-microsoft.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/375769209931649619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/375769209931649619'/><link rel='alternate' type='text/html' href='http://imoremada.blogspot.com/2009/08/crazy-microsoft.html' title='Crazy Microsoft'/><author><name>Indunil Moremada</name><uri>http://www.blogger.com/profile/02085015197844785759</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1825595997804782966.post-745164532846825683</id><published>2009-08-19T20:22:00.000-07:00</published><updated>2009-08-25T23:51:37.136-07:00</updated><title type='text'>Shell Scripting</title><content type='html'>&lt;span style=&quot;font-size:85%;&quot;&gt;Here I am trying to give kind of a basic idea for people who are interested in shell scripting. Today in computer world Linux is the most famous topic therefor I thought of writing something which is very helpful for Linux users.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What do you need to write Shell Scripts?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Simply you need only the Linux OS and it&#39;s bash shell (Available with almost all Linux Distributions. By default bash is default shell for Red Hat Linux Distribution).&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is Linux Shell?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Computer understand the language of 0&#39;s and 1&#39;s and this is called binary language. Shell is a user program which helps user to interact with the kernel. Simply it takes user&#39;s commands in English and if it is a valid command it is passed to the kernel. Commands which were mentioned above are Linux Commands.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is a Shell Script?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Shell script is a series of commands which are written in a plain text file. Shell script something similar to MS-DOS batch file but it is more powerful than the MS-DOS batch file.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;How to write your first Shell Script?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1. Use any editor like &#39;vim&#39; to write the shell script.&lt;br /&gt;2. After writing the script set the execute permit ion to your&lt;br /&gt;shell script as follows,&lt;br /&gt;&lt;br /&gt;chmod 755 your_shell_script_name&lt;br /&gt;&lt;br /&gt;Note: This will set read write execute (7) permit ion to owner and for group and other permition is read and execute(5).&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;3. Here we go...Now the script can be run by using one of following three ways,&lt;br /&gt;&lt;br /&gt;Assume your shell script name is &quot;myFirstScript&quot;&lt;br /&gt;1)./myFirstScript&lt;br /&gt;2)bash myFirstScript&lt;br /&gt;3)sh myFirstScript&lt;br /&gt;&lt;br /&gt;following are some examples for shell scripts.&lt;br /&gt;example 1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt; prints &quot;Hello World&quot; on the screen.&lt;br /&gt;--------------------&lt;br /&gt;clear&lt;br /&gt;echo &quot;Hello World&quot;&lt;br /&gt;--------------------&lt;br /&gt;example 2&lt;br /&gt;Script to print user information who currently login,current date&amp;amp; time&lt;br /&gt;--------------------&lt;br /&gt;clear&lt;br /&gt;echo &quot;Hello $USER&quot;&lt;br /&gt;echo &quot;Today is &quot;;date&lt;br /&gt;echo &quot;Number of user login :&quot;;who | wc -l&lt;br /&gt;echo &quot;Calender&quot;&lt;br /&gt;cal&lt;br /&gt;exit 0&lt;br /&gt;#end of script&lt;br /&gt;---------------------&lt;br /&gt;example 3&lt;br /&gt;This read your name from the key board and print it.&lt;br /&gt;---------------------&lt;br /&gt;echo &quot;Your name please :&quot;&lt;br /&gt;read name&lt;br /&gt;echo &quot;Hello $name, lets be friend!&quot;&lt;br /&gt;---------------------&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;If else in Shell Scripting&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;if condition&lt;br /&gt;then&lt;br /&gt;         condition is zero (true - 0)&lt;br /&gt;         execute all commands up to else statement&lt;br /&gt;else&lt;br /&gt;         if condition is not true then&lt;br /&gt;         execute all commands up to fi&lt;br /&gt;fi&lt;br /&gt;example 4&lt;br /&gt;---------------------&lt;br /&gt;if [ $# -eq 0 ]&lt;br /&gt;then&lt;br /&gt;echo &quot;$0 : You must type one integer&quot;&lt;br /&gt;exit 1&lt;br /&gt;fi&lt;br /&gt;if test $1 -gt 0&lt;br /&gt;then&lt;br /&gt;echo &quot;$1 is a positive number&quot;&lt;br /&gt;else&lt;br /&gt;echo &quot;$1 is a negative number&quot;&lt;br /&gt;fi&lt;br /&gt;------------------------&lt;br /&gt;Run the above script as follows,&lt;br /&gt;./script_name integer_number&lt;br /&gt;&lt;br /&gt;assuming sript name is &quot;test&quot;&lt;br /&gt;./test 10&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;output is as follows,&lt;/span&gt;&lt;br /&gt;10 is a positive number&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Detailed explanation&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;First script checks whether command line argument is given or not, if not given then it print error message as &quot;./test : You must type one integer&quot;. if statement checks whether number of argument ($#) passed to script is not equal (-eq) to 0, if we passed any argument to script then this if statement is false and if no command line argument is given then this if statement is true.&lt;br /&gt;&lt;br /&gt;                                                       Those are few examples for you to get an idea what shell script is. Hope you would enjoy with note. Finally there are lot more about Shell Scripts. Here hoped to give you a brief introducion.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoremada.blogspot.com/feeds/745164532846825683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoremada.blogspot.com/2009/08/shell-scripting-here-i-am-trying-to.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/745164532846825683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/745164532846825683'/><link rel='alternate' type='text/html' href='http://imoremada.blogspot.com/2009/08/shell-scripting-here-i-am-trying-to.html' title='Shell Scripting'/><author><name>Indunil Moremada</name><uri>http://www.blogger.com/profile/02085015197844785759</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1825595997804782966.post-7046853579710163495</id><published>2009-08-16T22:06:00.000-07:00</published><updated>2009-08-16T22:11:17.583-07:00</updated><title type='text'>Who is responsible for this?</title><content type='html'>It was a bright sunny day. I got up early in the morning with heaps of hopes. It was my 5th birth day. I thought my father was there to wish me but... it was hopeless he was not there in my room and even in my home. I searched for some thing under my pillow,under my bed and on top of my cup board, for my birth day gift. But it was also hopeless because I could not find anything. Even though it was a bright sunny day . I felt that I was alone. I could remember that my father told me i would bring you a bicycle for your birth day. I don&#39;t want a bicycle dad please come to visit us. After few days there was a ceremony in our home and there was a huge black box in our veranda. There were lot of people in our place lot of them ware crying. I could see my mother was also crying near that box. I did not want to cry but.... I had to cry just because others were crying. Then after two days that black box was taken away from my home to a place called cemetery. Since I could not understand what was really happening there I asked from my mother  &quot;mother what was going on&quot; so she said me that &quot;your dad left all of us. he never come Just say good bye! to your dad &quot; but I wonder what she was telling. And I didn&#39;t say good bye! because I knew for sure If my dad was there definitely he would talk to me. He never wanted hide from me. After four years time I really could understood what was happened to my dad.  It&#39;s the war who took my father away. It&#39;s the war who is responsible for thousand of lives. It&#39;s the war who is  responsible for millions of refugees. It&#39;s the war who took my father away.&lt;br /&gt;  This is based on a real story. As Sri Lankans we were lucky to defeat the war. Today all of us breathing freely under one a flag but there are thousands of people who are still suffering because of cruel war. Let&#39;s stand against war.</content><link rel='replies' type='application/atom+xml' href='http://imoremada.blogspot.com/feeds/7046853579710163495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoremada.blogspot.com/2009/08/who-is-responsible-for-this.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/7046853579710163495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1825595997804782966/posts/default/7046853579710163495'/><link rel='alternate' type='text/html' href='http://imoremada.blogspot.com/2009/08/who-is-responsible-for-this.html' title='Who is responsible for this?'/><author><name>Indunil Moremada</name><uri>http://www.blogger.com/profile/02085015197844785759</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>