Breaking into the Asian Market - Is Twitter becoming the world's message board?

Unless you've been living under a rock for the past few years, you already know about the social media phenomena that is Twitter. Twitter has an advantage over any other news medium in the world because of the fact that its content streams directly from the public in real time, providing users the ability to see what others are “tweeting” about instantaneously. No editors, filters, or any of the like, just pure content straight from the source. Important events become trending topics within minutes and spread like wildfire all over the globe; there is no stopping the beast. Twitter users can post tweets several ways: directly via the web interface (twitter.com), mobile applications (twitterfon, etc.), and even via SMS from any standard cell phone. Users can upload tweets from almost anywhere at anytime.

Several weeks ago Twitter via SMS became available to users in India and even more recently to users in Japan. Although there are several Twitter-like applications already in use Japan, Twitter is making efforts to expand its presence in the Asian market. There are barriers facing Twitter's Asian expansion, most pronounced being the cultural attitudes towards micro-blogging and the threat of cyberstalking. Though these are serious issues which are present to all users globally, they should not hinder the social media giant from breaking ground in the east.  

 

Finland to make broadband internet access available to all citizens by 2016

Finland's Ministry of Transportation and Communications announced on Wednesday that they will now be providing 1 megabit broadband internet access for nearly all of its 5 million citizens. The internet today is where most people get their information, be it news, gossip, education, etc. It is a source abound by the voices of anyone willing and able to make themselves heard. Citizens of all ages can begin to explore the grandeur of the internet, filling themselves with knowledge for whatever it is that drives them.

Finland has always been a front runner when it comes to investments in technology amongst EU member states. The plan is to distribute this 1Mb connectivity all over the country, but unfortunately there are remote areas in the country where it will not be available; totaling to about 2,000 households. According to Harri Pursiainen, permanent secretary of the Ministry of Transport and Communications, the cost of building the fiber-optic cable network capable of delivering free connectivity to areas where it would not already be built commercially would be in excess of 200 million euros; the government could only pay a maximum of one-third that amount. By 2016, it is estimated that over 99 percent of households will have access to these networks.

Using Rack Applications Inside GWT Hosted Mode

Julio Capote:

This guide will show you how you can use JRuby to run any Rack application inside Google Web Toolkit’s (GWT) hosted mode server so your interface and your backend are of the Same Origin.

Background

GWT has two ways of interacting with a server: GWT Remote Procedure Call (RPC) and plain HTTP (XHR). GWT-RPC is a high level library designed for interacting with server-side Java code. GWT-RPC implements the GWT Remote Service interface allowing you to call those methods from the user interface. Essentially, GWT handles the dirty work for you. However, it only works on Java backends that can implement that interface. Since most of my backends are Sinatra/Rack applications, I’ll be using the plain HTTP library.

The problem

Due to the restriction of the Same Origin policy, the interface served out of GWT’s development, or Hosted Mode server can only make requests back to itself. If you were using real servlets or GWT’s RemoteService this wouldn’t be an issue; but since Rack applications listen on their own port, you cannot make requests from GWT to our application without resorting to something like JSONP or server-side proxying. This leaves you having to compile our interface to HTML/JS/CSS, which is lengthy process, and serve it from the origin of the Rack application to see our changes.

The solution

Since I wanted to develop using GWT’s development environment with a Rack backend, I devised a way to use jruby-rack to load arbitrary Rack applications alongside our interface.

First let’s setup our environment:

1. Download and unpack the latest GWT for your platform (mine being linux) and goto it:

tar -xvjpf gwt-linux-1.7.0.tar.bz2
cd gwt-linux-1.7.0

2 .Download the latest jruby-complete.jar:
wget http://repository.codehaus.org/org/jruby/jruby-complete/1.3.1/jruby-complete-1.3.1.jar
mv jruby-complete-1.3.1.jar jruby-complete.jar

3. Download the latest jruby-rack.jar

wget http://repository.codehaus.org/org/jruby/rack/jruby-rack/0.9.4/jruby-rack-0.9.4.jar
mv jruby-rack-0.9.4.jar jruby-rack.jar

Now let’s create our GWT application using an example Sinatra backend:

4. Create an app with webAppCreator:

./webAppCreator -out MySinatra com.example.MySinatra
cd MySinatra

5. In order for this to work you have to package any gem dependencies your backend needs (sinatra, in our case) as jars within your application. For Sinatra it looks like this:

 java -jar jruby-complete.jar -S gem install -i ./sinatra sinatra --no-rdoc --no-ri
jar cf sinatra.jar -C sinatra .

6. Add jruby-complete.jar, jruby-rack.jar, sinatra.jar (and any other jars you’ve created) to the libs target of your build.xml:

 <target name="libs" description="Copy libs to WEB-INF/lib">
<mkdir dir="war/WEB-INF/lib" />
<copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" />

<copy todir="war/WEB-INF/lib" file="${gwt.sdk}/jruby-complete.jar" />
<copy todir="war/WEB-INF/lib" file="${gwt.sdk}/jruby-rack.jar" />
<copy todir="war/WEB-INF/lib" file="${gwt.sdk}/sinatra.jar" />
</target>

7. Add these lines right after <web-app> in war/WEB-INF/web.xml:

 <context-param>
<param-name>rackup</param-name>
<param-value>
require 'rubygems'
require './lib/sinatra_app'
map '/api' do
run MyApp 
end
</param-value>
</context-param>

<filter>
<filter-name>RackFilter</filter-name>
<filter-class>org.jruby.rack.RackFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>RackFilter</filter-name>
<url-pattern>/api/*</url-pattern>
</filter-mapping>

<listener>
<listener-class>org.jruby.rack.RackServletContextListener</listener-class>
</listener>

Note: All you’re doing here is passing the contents of a config.ru file into the <param-value> element for the <context-param> (make sure this is HTML encoded!). This states that any request to /api is to be handled by your Sinatra application and not GWT’s Hosted mode servlet.

8. Create your Sinatra backend and place it in war/WEB-INF/lib/sinatra_app.rb

require 'sinatra'
require 'open-uri'
class MyApp < Sinatra::Base

get '/showpage' do
open('http://www.yahoo.com').read
end

get '/helloworld' do
'hello world'
end

end

9. Run your new awesome setup:

ant hosted

Now when navigate to http://localhost:8888/api/helloworld orhttp://localhost:8888/api/showpage you should see the Sinatra application being served via GWT.

 

 

 

 

 

 

 

Filed under  //   Business Tools   Google Web Toolkit   GWT   Protip   Protwip   Tip   Tools  
Posted by armandocanals 

Comments [0]

"Dell will buy Perot Systems for $3.9 billion..."

International computer giant Dell announced Monday that it will purchase Texas based Perot Systems founded by H. Ross Perot in 1988. While the merger is said to have efficiencies on both ends, the deal is structured to strategically expand Perot Systems to a much larger customer base. Dell is to take over all outstanding common stock of Perot Systems at $30.00 per/share in cash, which is a 65% premium over fridays closing price. Deal is set to close in Dell's November-January fiscal quarter.

Filed under  //   business   businessnews   news   tech   videos  
Posted by armandocanals 

Comments [0]

Kary Mullis Celebrates The Scientific Experiment

Kary Mullis speaks at TED and gives us some history on the scientific method. He also shares some interesting info on global warming. This man, who won the Nobel Prize in Chemistry for developing a way to copy a strand of DNA (His technique, called PCR, jump-started the 1990s' biorevolution.), is probably one of the brightest minds on the planet.

Filed under  //   videos  
Posted by armandocanals 

Comments [0]

Introducing the Nuklei.com Blog!

The pace of new applications and services either being released or improved everyday is staggering. As a web development firm that prides itself on the use of cutting edge technology and techniques, we feel it's our duty to keep up with all the new ways technology can improve the day to day operation of your business. It's almost every other week that we're informing a client about a new service or offering available that can save them some money or free up some time better spent doing something else. Through this blog, we will be posting these discoveries here so as to better inform you, the client when it comes to making decisions in a world with ever increasing choices. So look forward to tips and techniques that help run your business more efficiently using the internet.

Posted by Julio Capote 

Comments [0]