Thursday, February 11, 2010

_thisthread.sleep( 3Months)

Yesterday I completed my 2nd semester MS exams.. So I thought to blog a post which I want to do from few days back. ( sorry for the long wait to post )

The first one is web map connector…Its really cool I got a chance to play with it. infact I played with the whole Friday night in the office without going home. Thanks to Alfred Sawatzky and Brad Sileo for providing license.

I really like the application showing Bing maps on smallworld. But why only Bing why not Google, yahoo, open street map, Maps-For-Free, etc not integrated in to the web map connector..?? I don’t know..

I tried putting every thing in to one application and did an investigation and found interesting stuff to put these web maps as a service in to one application..



Bing maps
Google maps
Yahoo Maps

It’s a quite difficult to use Bing maps service in java environment. But using the managed c-acp code to develop in .net environment..

I will try to post the complete developed application in my next post

Friday, January 1, 2010

Smallworld Clouds

Clouds??... What is it..?? Clouds refer to Cloud Computing.

If you are very new to cloud computing then, this is the correct place to know cloud computing

I am studying about cloud computing from quite sometime back.. Last week I got a chance to attend a work shop conducted by IEEE on Clouds in Hyderabad. I am studying some terms like Saas, Paas, Iaas.

What is there in it for smallworld?? before going to find what is there in clouds.. lets see few problems In a Agile way... (Are these really problems.. ???..!!)

As a Electrical energy distributor i am more interested in maintaining and managing my electric network rather than maintaining lot of licenses and computers.

As a Gas Distributor I am more interested to find the critical customers if any gas lines fails rather than finding effecting users/engineers if any computer fails.

As a network operator i am more interested to invest more money to my network rater than buying licenses/computers

and many more

As a Smallworld developer what i can do for the above problems..??

I will provide services to the consumers on demand.(pay for what you used)

I don't want to maintain tens and hundreds of servers with lots of IMAGES in it.. so, i will use infrastructure as a service(Iaas). All the servers are located some where around the world and forget about marinating the servers and just use the images.

I am small electricity distributor, I don't need complete smallworld application.. but I need few application for few hours a week. I use Saas and get required software for few hours and pay for those hours..

These are the few attempts how we can use clouds..

There are many cloud computing applications available, few of them are google apps, Microsoft Azure, Amazon cloud front and ZOHO.

Windows for all is the perfect example for infrastructure as a sevice. you can try it. requires silver light plugin and takes some times to load.
its a Windows operating system in your browser. :)

Can we consider GSS as a step towards Cloud Computing??

All the above are just my imagination those are not related to GE Smallworld or any other company

Looking for comments.. :))

Friday, December 18, 2009

How do I OLE?

I saw a perfect example of using OLE objects in Magik session In Alferd's sworldwatch for regular expression validator (http://sworldwatch.blogspot.com/2009/12/regular-expressions-in-magik.html)
But finding the ole component is not a simple task, if we are looking for something new. It takes good amount of time for searching the ole components like vbscript.regexp.

So we need a tool which lists all the available ole components.

Visual studio comes with Ole Viewer Tool shows list of COM objects and its properties. Which will make life easier to find the objects, What if we don’t have VS.net ..??
Here is the solution (http://support.microsoft.com/default.aspx?scid=kb;en-us;122244)

Download ole2view this application lists all the available COM components in WINDOWS.

Wednesday, December 2, 2009

SW Media Player

sw media player is a simple media player(only audio)
This again works using ole_automation by geting handle on windows media player activex component. ( so becomes platform dependent )




I added lot of actions but couldn't implement all...
it has the basic functionality like play, stop, ff, fr, pause.
Time seek will show the current position of the audio file but it doesn't update if we drag it.

It will work from emacs with three lines of code

.player << ole_client.create_object("wmplayer.ocx")
.control << .player.controls
.player.url << "C:\WINDOWS\Media\Windows XP Logon Sound.wav"

Serves as online radio if URL is replaced with some live radio for eg: live365.com

Download sw mdia player form here

control.stop will stop playing audio file. similarly play, pause etc are available on control class.

I tried to add play list to the tree item with add and remove functionality but finally did nothing

If found any new ideas please add to comments

Sunday, November 8, 2009

Add behavior to Tree Item

I am a big fan of tree_item and Tree_item is one of the most powerful controls provided by magik language. I can't imagine many Office applications with out a tree_item (very few without a tree_item)


From few days I am trying to develop a Yahoo messenger kind of application in magik using tcp/ip communication.

One of my requirements is to show details on mouse over on the list available. But I think the tree_item doesn’t have mouse over functionality added (at least in my scope of knowledge). I spend couple of minutes to provide a customized behavior like mouse over action to tree_item

Here is the way to add the mouse over behavior to tree_item:
(These changes are to tree_agent.magik didnt tried subclassing it)
1. add a pseudo slot say mouse_over_func and define the slot access to writeable
2. add the mouse_over_func to exported_notifiers and notifier_for_action
3. initilise the handler in init() of agent as below
.mouse_over_func << handler.new(_self, :default_mouse_over|()|)
4. enable the events for the tree in window.enable_event(:move)
5. in default_handle_event(), notify to the desired method as below
_if l_id _is :move
_then

_return _self.notify(:mouse_over_func, l_row, l_row_index, p_event)

_endif
6.
_pragma(classify_level=advanced)
_private _method tree_agent.mouse_over_func << p_new
##
##


.mouse_over_func << handler.new(_self, :default_mouse_over|()|)
>> .mouse_over_func
_endmethod
$

7.
method tree_agent.default_mouse_over(p_tree, l_row_index, p_event)
##
##
#write(p_tree, l_row_index, p_event)

_local l_sel_column << _self.column_at(p_event.x)
#do some thing
write(l_sel_column)
_if l_sel_column _is _unset
_then
_return

_endif


_endmethod
$

I just tried this code and I haven’t tested fully… but this is working. I added my custom method in the class as we do for select notifier or double click notifier.. it is working with few tracebacks.. Those are to be handled in tree_agent. default_mouse_over()

Friday, November 6, 2009

sw_narrator

“SW Narrator” is a simple application which reads any action performed on smallworld application. it is as simple as Narrator provided by default in windows operating system. This is developed in magik by using SAPI.

Interestingly heart of the application is only 2 lines

MagikSF> v << ole_client.create_object("sapi.spvoice")
$

MagikSF> v.Speak("smallworld")

Sw narrator gets every action performed by application by add_filter_event to :interaction_mode_event. This will give handle to action and there it retrieves the UI value.

Code written in click_monitor in development tool serves the purpose.

Looking for some online drive to upload the module… I will update once I shared the module.

Thursday, November 5, 2009

Draw 3D pie diagram in Excel from magik


This piece of code will help to draw a 3d pie diagram in excel sheet from magik..


_block

e << OLE_Client.Create_Object("Excel.Application")
w << e.Workbooks()

w.add()
s << e.Sheets("Sheet1")
s.Name << "bhimu"
_for i _over range (1,10)
_loop
Cell << S.Range ("A"+i.print_string)
Cell.Value << i
Cell.Release_Object ()
Cell << S.Range ("B"+i.print_string)
Cell.Value << "=A"+i.print_string+"*"+"A"+i.print_string
Cell.Release_Object ()
_endloop


s.range("A1:B10").select
c << e.charts.add
c.ChartType << :|xl3DPieExploded|
e.ActiveChart.Location(:|xlLocationAsObject|, "bhimu")
e.Visible << _True

_endblock



if location is not specified, then the chart is added to a new sheet.

init()

I started this blog from the inspiration I gained from sworldwatch, thanks to Alfred Sawatzky.

I have almost 3 years of experience in magik. I tried different applications in magik. Still i am in learning phase, but liked to post some intresing stuff I found while learing.



I am starting my first post with GIS/Geospatial Industry Worldwide and their positions. Smallworld is in 3rd position with around 8% GIS market share and around 24% Utilities share. (data collected from daratech)

http://daratech.com/press/releases/2009/091908.html