Posts

Hello World using OpenCL

I've recently acquired a new laptop with an API Radeon GPU. I'm always interested in HPC and how it is used in various industries and research areas. I had experience with MPI/OpenMP earlier but not got a chance to look into GPU style frameworks such as CUDA or OpenCL. I've a lot of free time these days, so I studied some online tutorials and got a little bit familiar with OpenCL and it's very interesting to me. I'm using AMD's APP SDK 2.9 for my work, my first OpenCL code as below, it can be compiled using gcc with -lOpenCL #include <stdio.h> #include <string.h> #include <CL/cl.h> const char source[] = " \ __kernel void hello( __global char* buf, __global char* buf2 ){ \ int x = get_global_id(0); \ buf2[x] = buf[x]; \ }"; int main() { char buf[]="Hello, World!"; char build_c[4096]; size_t srcsize, worksize=strlen(buf); cl_platform_id platform; cl_d...

Quick Start Apache Stratos from EC2 images

Image
In this blog post I focus on deploying the pre-built EC2 image of Apache Stratos. Note : This blog post is based on "Stratos Quick Start Guide",  Starting the Apache Stratos demo image Spawning the Apache Stratos instance Configuring the Apache Stratos instance Registering a tenant and configuring Cartridges Starting the Apache Stratos demo image Common Prerequisites The following are the recommended prerequisites when running the Apache Stratos demo setup in a single node. Please note that for production deployment the prerequisites will vary based on the scalability requirements.  System Requirements Processor : 2.8GHz CPU Memory : At least 8GB memory. However, 16GB is recommended. Disk : 40G hard disk space The following are the memory allocations for Amazon EC2 instance types that you may require: m1.large = 7.5 GB m1.xlarge =15 GB m3.xlarge= 15 GB Software Requirements Git Facter Java (JDK1.6.x) ZIP MySQL Serv...

How to automate the installation of Eclipse plugins with ant task

In this blog post I suggest a simple way to automate the installation of Eclipse plugins with ant task and maven-antrun-plugin. ${project.basedir}/target/eclipse = eclipse dir (extract using maven dependency plugin) ${project.basedir}/target/p2-repo = p2 dir of plugins  (extract using maven dependency plugin) sample1.feature.group, sample2.feature.group,.... = sample feature group names a snippet of my code follows. <plugin>  <artifactid>maven-antrun-plugin</artifactid>          <executions>      <execution>      <id>install-eclipse</id>      <phase>package</phase>      <goals>       <goal>run</goal>      </goals>      <configuration>      <tasks>       <java classname="org.eclipse.equino...

How to change the mouse icon/feedback when we drag a node to the canvas from the tool palette in a GEF/GMF based editor

In this blog post I suggest a simple way to change the drag icon/feedback to indicate to the user that it is to drop or illegal to drop what they are dragging at the current location in a GEF or GMF based editor. You can do it simply by implementing custom DragDropEditPolicy and installing to your EditPart. a snippet of my code follows. import java.awt.MouseInfo; import java.awt.Point; import org.eclipse.draw2d.FigureCanvas; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.ImageFigure; import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.gef.Request; import org.eclipse.gef.commands.Command; import org.eclipse.gef.requests.ChangeBoundsRequest; import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart; import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Control; import...

How to develop CXF based JAX-WS with WSO2 Developer Studio

Image
This blog post shows the basics of using the WSO2 Developer Studio to develop a JAX-WS. After creating the web service, you can write web services clients that use the web service on a network. Java API for XML-Based Web Services (JAX-WS) , which is also known as JSR-224, is the next generation Web services programming model that extends the foundation provided by the Java API for XML-based RPC (JAX-RPC) programming model. Using JAX-WS, developing Web services and clients is simplified with greater platform independence for Java applications by the use of dynamic proxies and Java annotations. Apache CXF is an open source web service framework that provides an easy to use, standard-based programming model for developing web services. Web services can be implemented using different application protocols like SOAP, XML, JSON, RESTful HTTP, and support various transport protocols like HTTP or JMS. WSO2 Developer Studio (formerly named WSO2 Carbon Studio) is a complete Eclipse-based ...

How to register an eclipse editor by file content

Sometimes you may want to register an eclipse editor by reading file content. As an example if we need to open Maven POM file with specificity packing type with your editor or if you need to use different files without file extension, so we have to write a custom ContentDescriber to handle it.  We can write custom ContentDescriber by extending or implementing following classes/ interfaces. ITextContentDescriber XMLContentDescriber IContentDescriber BinarySignatureDescriber   So let's write a custom ContentDescriber by extending XMLContentDescriber package org.my.editor.describer; import java.io.IOException; import java.io.InputStream; import org.eclipse.core.runtime.content.IContentDescription; import org.eclipse.core.runtime.content.XMLContentDescriber; public class MyDescriber extends XMLContentDescriber { public int describe(InputStream input, IContentDescription description) throws IOException { /** Implement logics to validate content by reading input ...

Pictures of Joplin Missouri Tornado - May 2011

Image