Konstantin A Lukin's Posts - TechHui2024-03-28T13:15:43ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukinhttp://storage.ning.com/topology/rest/1.0/file/get/353348683?profile=RESIZE_48X48&width=48&height=48&crop=1%3A1http://www.techhui.com/profiles/blog/feed?user=1uag81x0pm0t6&xn_auth=noOn Science and Buddhism, a world apart?tag:www.techhui.com,2010-04-05:1702911:BlogPost:589642010-04-05T18:00:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<img alt="" src="http://storage.ning.com/topology/rest/1.0/file/get/396594323?profile=original" style="float: right;"></img><br />
<div>
<a href="http://www.youtube.com/watch?v=-MbNN9jXTQA">Buddhist</a> teachings and<br />
<a href="http://en.wikipedia.org/wiki/S%C5%ABtra">sutras</a>. In this blog, I'd like to compare some of these similarities in order to gain a better understanding into how they are interrelated and/or are interchangeable.<br />
…</div>
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396594323?profile=original" alt="" style="float: right;"><br />
<div>
<Being interested in continuous discovery of true nature of things, I was always quite intrigued by the similarities between certain scientific explanations and <br />
<a href="http://www.youtube.com/watch?v=-MbNN9jXTQA">Buddhist</a> teachings and <br />
<a href="http://en.wikipedia.org/wiki/S%C5%ABtra">sutras</a>. In this blog, I'd like to compare some of these similarities in order to gain a better understanding into how they are interrelated and/or are interchangeable.<br />
</div>
<div>
<br>
</div>
<div>
<Even though some of these concepts can get quite complex, I'd like to stay within simplistic levels, enough to get the point across without diving into deeper details.<br />
</div>
<div>
<br>
<div>
<span class="Apple-style-span" style="font-size: large;"><u>On Quantum Field VS. Emptiness</u></span><br />
</div>
<div>
<u><br></u>
</div>
<div>
Science<br />
</div>
<div>
<a href="http://en.wikipedia.org/wiki/Quantum_field_theory">Quantum Field</a> - an electromagnetic field in which all matter arises from.<br />
</div>
<div>
<br>
</div>
<div>
Buddhism<br />
</div>
<div>
<a href="http://en.wikipedia.org/wiki/%C5%9A%C5%ABnyat%C4%81">Emptiness</a> - a field of potential from which every possibility arises from. (<br />
<a href="http://www.youtube.com/watch?v=qj_i7YqDwJA">see video</a>)<br />
</div>
<div>
<br>
</div>
<div>
<u><br></u>
</div>
<div>
<span class="Apple-style-span" style="font-size: large;"><u>On Quantum entanglement VS. Interconnectivity</u></span><br />
</div>
<div>
It's quite interesting how Quantum Entanglement sounds a lot like Buddhist's view of Interconnectedness. Here are the definitions:<br />
</div>
<div>
<br>
</div>
<div>
Science<br />
</div>
<div>
<a href="http://www.youtube.com/watch?v=Jh8uZUzuRhk">Quantum entanglement</a> - when two particles interact with each other, they become entangled, developing a special connected relationship with one another. Quantum entanglement seems to point to a true oneness within a Universe.<br />
</div>
<div>
<br>
</div>
<div>
Buddhism<br />
</div>
<div>
<a href="http://en.wikipedia.org/wiki/Prat%C4%ABtyasamutp%C4%81da">Interconnectivity</a> - everything in the Universe is intimately interconnected. The idea that we are separate entities, separate from the world around us is considered to be an illusion. The true nature of ourselves and reality is of a complete unification, or oneness.<br />
</div>
<div>
<br>
</div>
<div>
<u><br></u>
</div>
<div>
<span class="Apple-style-span" style="font-size: large;"><u>On Mind Intelligence</u></span><br />
</div>
<div>
This goes into scientific view of Mind and Intelligence compared to its Buddhist counterpart. Both views seem to be drawing a parallel between Mind and Matter, and how the two interact.<br />
</div>
<div>
<u><br></u>
</div>
<div>
Science<br />
</div>
<div>
All matter originates and exists only by virtue of a force. We must assume behind this force the existence of a conscious and intelligent <br />
<i>Mind</i>. This <br />
<i>Mind</i> is the matrix of all matter. - <br />
<a href="http://en.wikipedia.org/wiki/Max_Planck">Max Planck</a>, Founder of Quantum Physics.<br />
</div>
<div>
<div>
<br>
</div>
<div>
Buddhism<br />
</div>
<div>
All that we are is the result of what we have thought. The mind is everything. - <br />
<a href="http://www.brainyquote.com/quotes/authors/b/buddha.html">Buddha</a><br />
</div>
</div>
<div>
<br>
</div>
<div>
<br>
</div>
<div>
<u><span class="Apple-style-span" style="font-size: large;">On Observation VS. Participation</span></u><br />
</div>
<div>
This one is also quite interesting. It goes into the 'Observation' problem. Some scientific experiments have demonstrated that the observer changes the outcome of the experiment simply by the act of observation. This closely relates to the Buddhist view, which states that reality is the projection of the observing mind.<br />
</div>
<div>
<br>
</div>
<div>
Science<br />
</div>
<div>
What we observe is not nature itself, but nature exposed to our nature of questioning. - Werner Karl Heisenberg (<br />
<a href="http://www.youtube.com/watch?v=KT7xJ0tjB4A">The Uncertainty Principle</a>)<br />
</div>
<div>
<br>
</div>
<div>
<a href="http://www.youtube.com/watch?v=DfPeprQ7oGc">Double Slit Experiment</a> - behavior of particles was dependent on whether or not they were being observed. Reality does not exist without the Mind that's defining it. Without Mind reality exists only as Infinite potential. Reality is defined by the mind that is observing it.<br />
</div>
<div>
<div>
<br>
</div>
</div>
<div>
Buddhism<br />
</div>
<div>
Reality is a projection of the mind.<br />
</div>
<div>
<br>
</div>
<div>
<u><br></u>
</div>
<div>
<u><span class="Apple-style-span" style="font-size: large;">On Awakening</span></u><br />
</div>
<div>
There are some scholars, such as <br />
<a href="http://www.youtube.com/watch?v=AjM9JhzlXR0">Greg Braden</a>, that dive further into connections between Science and Spirituality, and how that has the power to cure desease, redefine aging, and change reality by embracing the focused power of emotion, the quantum language of change.<br />
</div>
<div>
<br>
</div>
<div>
<a href="http://en.wikipedia.org/wiki/Alex_Grey">Alex Grey</a>, an artist and a Buddhist practitioner, has come up with some amazing collection of <br />
<a href="http://www.youtube.com/watch?v=_f5905BuE4c&feature=related">paintings</a> that mostly demonstrate how beings interact with energy fields that surround them.<br />
</div>
<div>
<br>
</div>
<div>
What's interesting is that these scholars talk about awakening the mind to its fullest potential, something that is widely practiced in the Buddhist tradition.<br />
</div>
<div>
<br>
</div>
<div>
I hope you find this information useful for your own quests and discoveries.<br />
</div>
<div>
<br>
</div>
<div>
Thank you for reading!<br />
</div>
<div>
<br>
</div>
<div>
References:<br />
</div>
<div>
<ul>
<li><a href="http://www.youtube.com/watch?v=qj_i7YqDwJA">Where Science and Buddhism Meet PART 1</a></li>
<li><a href="http://www.youtube.com/watch?v=Jh8uZUzuRhk">Entanglement Dr. Quantum</a></li>
<li><a href="http://www.youtube.com/watch?v=DfPeprQ7oGc">Dr. Quantum - Double Slit Experiment</a></li>
<li><a href="http://www.youtube.com/watch?v=-MbNN9jXTQA">Alan Watts On Buddhism</a></li>
<li><a href="http://www.youtube.com/watch?v=couVqpuX9CU">Quantum Physics - Welcome to The Matrix</a></li>
</ul>
<div>
<br>
</div>
<div>
Further material:<br />
</div>
<div>
<ul>
<li><a href="http://www.youtube.com/watch?v=yXBnrLPVTVY&feature=related">Greg Braden - The Holographic Nature of The Universe</a></li>
<li><a href="http://www.youtube.com/watch?v=AjM9JhzlXR0">Greg Braden - The Divine Matrix</a></li>
<li><a href="http://www.youtube.com/watch?v=BWyTxCsIXE4">Dr. Quantum - Flatland</a></li>
</ul>
</div>
</div>
</div>Giga Fiber = Giga Apps?tag:www.techhui.com,2010-03-24:1702911:BlogPost:585162010-03-24T04:00:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<img alt="" src="http://storage.ning.com/topology/rest/1.0/file/get/396592614?profile=original" style="float: right;"></img> Lately a lot of us have been actively following Google's Giga initiative. What can be better than speeds 100x faster then what we already have, especially if it is offered for free? All this sounds good, but what's the catch?<br />
…<div><br></br>
</div>
<div>
</div>
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396592614?profile=original" alt="" style="float: right;">Lately a lot of us have been actively following Google's Giga initiative. What can be better than speeds 100x faster then what we already have, especially if it is offered for free? All this sounds good, but what's the catch?<br />
<div>
<br>
</div>
<div>
<First of all, how does Google benefit from all this? Well, for one thing, faster connections mean more Internet traffic, hence more ad revenue. (which is great for Google since most of its revenue comes from ads)<br />
</div>
<div>
<br>
</div>
<div>
<Secondly, this is great PR for Google, so it also becomes an effective long-term marketing strategy.<br />
</div>
<div>
<br>
</div>
<div>
<Now, what does this mean for us, Internet users? At first glance, this is very exciting - web surfing will be faster. But then I ask myself this question - how can we really use Giga speeds? What applications are currently out there for such high throughputs?<br />
</div>
<div>
<br>
</div>
<div>
<On one side, fiber optics could be used for medical visualizations, gaming, media, etc.. But there is also another side to the high speed story. Everything that we <br />
<i>do not</i> like about the Internet will also be magnified 100x fold. In other words, if web surfing is compared to driving, a lot of online users are still 'student' drivers. Giga fiber will put <br />
<u>everyone</u> at the wheel of a really fast sports car. Is the information super highway ready for drivers @100x speeds?<br />
</div>
<div>
<br>
</div>
<div>
<No doubt, high speeds have always been associated with 'coolness' and 'excitement'. But should we not also concentrate on getting well prepared for these changes? For example, let's take a look at the current education system. Is it really preparing students for increasing information exchange? What about morality and family values.. are kids getting enough 'family education' to become <br />
<i>civil</i> online citizens? Is it possible that current education/morality levels are actually somehow <br />
<i>indirectly</i> proportional to technological progress?<br />
</div>
<div>
<br>
</div>
<div>
<Anyway, given collectively where we are today, where do you think these high-speeds will take us?<br />
</div>
<div>
<br>
</div>
<div>
<Should we pay special attention to sustainability and environmental impact in order to leverage/balance increasing technology innovations?<br />
</div>
<div>
<br>
</div>
<div>
<Any thoughts welcome.<br />
</div>
<div>
<br>
</div>
<div>
<Konstantin<br />
</div>
<div>
<br>
</div>
<div>
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • Mobile<br />
</div>Nexus One, a brief hands-on overview.tag:www.techhui.com,2010-03-19:1702911:BlogPost:582702010-03-19T17:30:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<a class="noborder" href="http://storage.ning.com/topology/rest/1.0/file/get/396575018?profile=original" target="_blank"><img alt="" src="http://storage.ning.com/topology/rest/1.0/file/get/396575018?profile=RESIZE_320x320" style="float: right;" width="250"></img></a> Being a tech-savvy customer, I was quite psyched about Google's release of Nexus One smartphone device. Not waiting for too long, I had to see for myself what other Android developers are chatting about. This blog is an attempt to give a decent overview of the device from it's usability perspective.<br />
…<div><br></br>
</div>
<a class="noborder" href="http://storage.ning.com/topology/rest/1.0/file/get/396575018?profile=original" target="_blank"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396575018?profile=RESIZE_320x320" alt="" style="float: right;" width="250"></a>Being a tech-savvy customer, I was quite psyched about Google's release of Nexus One smartphone device. Not waiting for too long, I had to see for myself what other Android developers are chatting about. This blog is an attempt to give a decent overview of the device from it's usability perspective.<br />
<div>
<br>
</div>
<div>
<Nexus One arrived by FedEx in a couple of days. It came in a white box that simply had 'Nexus One' and 'Google' written on it, which I thought was a nice conservation of ink :). Activation was very simple, just type in your Gmail credentials and you are in. It takes a bit of time for initial activation to complete, so patience is a virtue.<br />
</div>
<div>
<br>
</div>
<div>
<div>
At the time of purchase, it is possible to engrave the phone with 2 lines of text. I find it quite a cool way to personalize your device. It also comes with a black neoprene pocket that fits the phone nicely. Pocket has an Android logo on it, which makes it a bit more fun.<br />
</div>
<div>
<br>
</div>
<div>
Now for a more detailed overview of the device itself.<br />
</div>
<div>
<br>
</div>
<div>
<b>Home screen</b><br />
</div>
<div>
<ul>
<li>supports live wallpapers. My favorite is the spinning galaxy :). Background motion makes a big difference when it comes to aesthetics. Makes device feel more <i>lively</i>.</li>
<li>supports 5 home screens. Given growing amount of apps, this comes in very handy, since 1 screen can only fit a 3x4.</li>
<li>app selector has a pretty cool Star Wars theme roller effect.</li>
<li>has search box built right into it, with voice capabilities.</li>
<li>top header is a pull down, which is a very effective use of space. It displays all updates along with common usability icons. Very nice :)</li>
<li>can add a shortcut, widget, folder or wallpaper, which basically provides for mini-desktop functionality.</li>
</ul>
<div>
<br>
</div>
<div>
<b>Multi-tasking</b><br />
</div>
<div>
<ul>
<li>Yes! Holding a home button will popup a list of currently running applications. This comes super handy when browsing Internet, reading news, emails, and listening to music, etc.. since it keeps all state, such as scrolling, selections, etc..</li>
<li>'Back' button acts as a universal history tracker. Say, for example, you are reading email and click on a link, which open a browser. You can press 'Back' to return to your email :)</li>
<li>I could not find an easy way to view task manager, but found a neat free app to do the job nicely. It is called 'Advanced Task Manager', which provides for most task manager capabilities.</li>
</ul>
<div>
<b><br></b>
</div>
<div>
<b>Multi-touch</b><br />
</div>
<div>
<ul>
<li>Not sure how it will play out legally, but multi-touch is definitely what a mobile device should have.</li>
<li>Pinch to zoom works nicely as well as tapping.</li>
<li>Scroll gestures, swipe to unlock and all very intuitive.</li>
</ul>
</div>
<div>
<br>
</div>
<div>
<b>Flash</b><br />
</div>
<div>
<ul>
<li>From what I've heard, <a href="http://www.techhui.com/video/flash-player-101-on-googles">supports Flash</a>, though I am yet to experiment with this feature.</li>
</ul>
</div>
<div>
<b><br></b>
</div>
<div>
<b>Sync</b><br />
</div>
<div>
<ul>
<li>Now this is simply awesome. All you need is a Gmail account. All sync happens automatically over the 'air'. No need to 'connect' the phone to your computer.</li>
<li>All software updates are notified & downloaded over the air.</li>
<li>Change contacts in your Gmail account and they are automatically synced with your phone.</li>
<li>Basically a hassle free sync environment. Very nice!</li>
</ul>
<div>
<br>
</div>
<div>
<b>Hardware</b><br />
</div>
<div>
<ul>
<li>Display 800x480px, vivid colors, touchscreen.</li>
<li>Overall sleek design. Nicely fits in a hand.</li>
<li>Sports a 5MP camera and a video camera capability, which comes in super handy. Camera has 2X digital zoom and LED Flash. To switch between camera and video is a simple toggle.</li>
<li>It is fast, sporting a 1GHz Qualcomm processor.</li>
<li>Has GPS, accelerometer, digital compass, bluetooth, Wi-Fi.</li>
<li>512 MB RAM, 4GB SD Card which so far is enough for my needs.</li>
<li>Desktop dock comes separately for $45. Is nice to have, since it charges your phone, activates a clock screensaver, and keeps the phone handy while at work.</li>
<li>Comes with nice black microphone-enabled headphones with a little Android logo on right ear :)</li>
</ul>
<div>
<b><br></b>
</div>
<div>
<b>USB</b><br />
</div>
<div>
<ul>
<li>Comes with USB cable</li>
<li>When connected, prompts to 'mount' SD card</li>
<li>Once mounted, acts like an external hard drive</li>
<li>Allows user to manage folders, files, etc..</li>
<li>Simple to sync music MP3s, pictures, or any other docs or files.</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<br>
</div>
<div>
<b>App Market</b><br />
</div>
<div>
<ul>
<li>Already has enough apps to get a good start.</li>
<li>Groups apps by categories, paid, free, just-in.</li>
<li>Provides star rating, rating count, user comments, number of downloads - all are useful for making an educated decision whether to download a particular app or not.</li>
<li>Allows users to mark apps as 'inappropriate'.</li>
<li>Download/install is very simple, update notifications are automatic.</li>
<li>All networking is over the air.</li>
<li>Unlike some of its rivals, has an <i>uncensored</i> feel to it :)</li>
</ul>
<div>
<br>
</div>
<div>
<b>Google Voice</b><br />
</div>
<div>
<ul>
<li>Capable to connect a Google Voice account</li>
<li>Get an email for every voice mail</li>
<li>Provides an option to make phone calls over Google Voice</li>
</ul>
<div>
<br>
</div>
<div>
<b>MP3 Store</b><br />
</div>
<div>
<ul>
<li>Connects to Amazon MP3 store</li>
<li>Easily transfer purchased music from your phone</li>
<li>Commonly used MP3 format</li>
</ul>
<div>
<b><br></b>
</div>
<div>
<b>Built-in Apps</b><br />
</div>
<div>
<ul>
<li>Music, Clock, Calendar, Calculator, Gallery</li>
<li>YouTube, Maps, Browser, News, Camera</li>
<li>Market, Email, Phone, Messaging, Contacts</li>
</ul>
</div>
<div>
<br>
</div>
<div>
<b>Useful 3rd party Apps</b><br />
</div>
<div>
<ul>
<li><i>Pandora</i> - listen to stream of music</li>
<li><i>Google Sky</i> - a nicely named view of night sky</li>
<li><i>Compass</i> - very cool looking digital compass</li>
<li><i>Movies</i> - movies theaters, showtimes, trailers, etc..</li>
<li><i>AndFTP</i> - simple FTP client</li>
<li><i>ASTRO</i> - robust file manager utility</li>
<li><i>Dolphin Browser</i> - an alternative browser app (simply cool to know that it is possible to have an alternative browser :)</li>
<li><i>gStrings</i> - useful for tuning a guitar or other music instrument.</li>
<li><i>MyTracks</i> - records tracks using GPS capability. Very useful for exploring uninhabited areas ;)</li>
<li><i>Quote Pro</i> - a descent stock quote app, with Yahoo Charts and News.</li>
<li><i>Places Directory</i> - a useful list of local city amenities/attractions, with built-in Maps and Dial capabilities.</li>
<li><i>Advanced Task Manager</i> - manage running apps, services, uninstalls, etc..</li>
<li><i>Google Earth</i> - needs no introductions</li>
<li><i>Amazon</i> - shop Amazon.com</li>
<li><i>Photoshop</i> - Adobe Photoshop port for Android.</li>
</ul>
<div>
<br>
</div>
<div>
<b>Photo Gallery</b><br />
</div>
<div>
<ul>
<li>I was amazed by the integration of local photos with those uploaded to Picasa. On startup, Gallery displays all photos. Those in the cloud are distinguished by a small Picasa logo. You can browse through your Picasa photos just like local ones. Very nice!</li>
<li>Uploading to Picasa is also nicely integrated right into the Gallery. No more need to sort through piles of accumulated photos on your PC. Simply manage them directly from your mobile device.</li>
</ul>
</div>
<div>
<br>
</div>
<div>
<b>Suggestions for improvement</b><br />
</div>
<div>
<ul>
<li>Screen difficult to see in bright day-light. This goes for reading emails, news, taking pictures, etc.. Somehow these apps have dark background which makes it an effort, plus screen glare adds to the picture.</li>
<li>Sometimes bottom buttons do not react well when pressed. An improvement for these would be nice.</li>
<li>Could come with a pair of protective screen covers to save the trouble.</li>
<li>Could be made of sturdier material. After all, it gets tossed around quite a bit (needs to with-stand wear & tear well)</li>
<li>Locally it is on T-mobile/Edge network. Speed wise not that bad. Sometimes has connection lapses where I am. Works very well (and fast) over Wi-Fi.</li>
<li>Scrolling is not bad, but could be smoother. Currently there is a slight jerk on initial motion, which makes it a bit difficult to keep focused on the paragraph.</li>
</ul>
<div>
<br>
</div>
<div>
Overall, leaving legal battles aside, I'd say this is a fun attempt at 'Web meets Phone' version 1.0. Surely there is room for improvement, which is no problem, since it is pretty exciting to be witnessing progress of mobile web integration first hand. Seamless over-the-air sync and updates are awesome. Mobile cloud integration is still in it's infancy, but is already showing signs of potential. It has a pleasant appearance, nice choice of live wallpapers, colors. App Market already has a good amount of free and usable apps to have decent functionality at your fingertips. There is room for improvement, but overall Nexus One makes for fun & open mobile platform. If you are a curious techie, I'd highly recommend it :)<br />
</div>
<div>
<br>
</div>
<div>
Thank you for reading.<br />
</div>
<div>
<br>
</div>
<div>
Konstantin<br />
</div>
<div>
<br>
</div>
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • Mobile<br />
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>AppEngine Datastore Overview (based on Java SDK)tag:www.techhui.com,2010-01-17:1702911:BlogPost:551282010-01-17T15:30:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<img src="http://www.veryicon.com/icon/128/Business/Business%20V2/key.png" style="float:right;"></img><br />
<br></br> In this post, I'd like to share some of my development experience with AppEngine's data storage facility called
<a href="http://en.wikipedia.org/wiki/BigTable" target="_blank">BigTable</a>. As you might already know, BigTable is different from a widely known relational persistence (RDBMS) in a way that it deals with Entities and Keys as opposed to tables and rows. It might not seem too obvious at first, but object-oriented persistence is radically different from its relational…
<img style="float:right;" src="http://www.veryicon.com/icon/128/Business/Business%20V2/key.png"><br />
<br> In this post, I'd like to share some of my development experience with AppEngine's data storage facility called
<a href="http://en.wikipedia.org/wiki/BigTable" target="_blank">BigTable</a>. As you might already know, BigTable is different from a widely known relational persistence (RDBMS) in a way that it deals with Entities and Keys as opposed to tables and rows. It might not seem too obvious at first, but object-oriented persistence is radically different from its relational counterpart. Here I would like to point out some of more notable features that I encountered during my 6 months development exercise.<br />
<br>
<br>
<h3>High-level API (provided by DataNucleus)</h3> AppEngine supports two high-level mechanisms for persistence,
<a href="http://java.sun.com/jdo/" target="_blank">JDO</a> and <br />
<a href="http://en.wikipedia.org/wiki/Java_Persistence_API" target="_blank">JPA</a>. Both mechanisms facilitate object manipulation and provide storage mappings. For example, here is a way to save an object using JDO:<br />
<br>
<samp><br> DBAccount dba = new DBAccount("user")<br> PersistenceManager pm = PMFactory.getPersistenceManager()<br> try { pm.makePersistent(dba) }<br> finally { pm.close() }<br> </samp>
<br> This approach also supports object graphs. When persisting an object graph, it is recommended to do so within a
<a href="http://code.google.com/appengine/docs/java/datastore/transactions.html" target="_blank">transaction</a>, which will make sure whole object graph is persisted atomically. Without a transaction, you might end up having orphan objects in your datastore. Here is an example of a transactional write using object nesting:<br />
<br>
<samp><br> DBAccount dba = new DBAccount("user")<br> dba.addProject(new DBProject("My Project"))<br> Transaction tx = pm.currentTransaction()<br> try {<br> tx.begin()<br> pm.makePersistent(dba)<br> tx.commit()<br> } catch(...) { if(tx.isAlive()) tx.rollback() }<br> finally { pm.close() }<br> </samp>
<br> For more in-depth overview, check out DataNucleus
<a href="http://www.datanucleus.org/" target="_blank">website</a>. Also, if you are curious about other forms of SaaS Persistence and how your application data can be ported to other platforms, take a look at DataNucleus product <br />
<a href="http://www.techhui.com/group/saaspersistence">diagram</a>.<br />
<br>
<br>
<h3>Low-level API (Provided by AppEngine Datastore)</h3> AppEngine also provides a low-level API to manipulate data. It is mostly based on the concept of
<a href="http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/DatastoreService.html" target="_blank">DatastoreService</a>, <br />
<a href="http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Entity.html" target="_blank">Entity</a> and <br />
<a href="http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Key.html" target="_blank">Key</a>. Here is a brief JavaDoc excerpt:<br />
<br>
<blockquote>
<The DatastoreService provides access to a schema-less data storage system. The fundamental unit of data in this system is the Entity, which has an immutable identity (represented by a Key) and zero of more mutable properties. Entity objects can be created, updated, deleted, retrieved by identifier, and queried via a combination of properties. The DatastoreService can be used transactionally and supports the notion of a "current" transaction.<br />
</blockquote> To tie all these together, here is a simple way to fetch an Entity:
<br>
<samp><br> DatastoreService ds = DatastoreServiceFactory.getDatastoreService();<br> Key key = KeyFactory.createKey(DBAccount.class.getSimpleName(), customerEmail)<br> Entity entity = ds.get(key);<br> entity.getProperty("name");<br> </samp>
<br> Notice how we get a handle to
<samp>DatastoreService</samp>, create <br />
<samp>Key</samp> using simple class name and customer email, and use this to fetch an <br />
<samp>Entity</samp> object.<br />
<br>
<h3>Keys and Entities</h3> As demonstrated in above example, Low-level API provides a Key generation facility.
<u>Understanding how to properly use Keys and Entities is fundamental to operating datastore correctly</u>.<br />
<br> Keys mostly require three things:
<br>
<ul>
<li>Ancestor Key</li>
<li>Entity Kind</li>
<li>Key Name</li>
</ul>
<i>Ancestor Key</i> is only used by child Entities. <br />
<i>Entity Kind</i> is a unique Entity identifier, logically related to simple Java class name. <br />
<i>Key Name</i> is the last bit of information used to identify a particular entity. For top-level Entities, Key Name must be unique for all Entities of a given Kind. For child Entities, <br />
<i>Key Name</i> in combination with <br />
<i>Ancestor Key</i> must be unique for all Entities of a given Kind.<br />
<br>
<br> To demonstrate, here is how to create Keys both top-level and child Entities:
<br>
<samp><br> Key accountKey = KeyFactory.createKey(DBAccount.class.getSimpleName(), customerEmail);<br> Key projectKey = KeyFactory.createKey(accountKey, DBProject.class.getSimpleName(), projectId)<br> </samp>
<br> Notice how
<samp>accountKey</samp> uses only 2 pieces of information. (It is assumed that <br />
<samp>customerEmail</samp> is unique across all accounts.) Also notice how <br />
<samp>projectKey</samp> is using <br />
<samp>accountKey</samp>, simple class name, and <br />
<samp>projectId</samp>. Given <br />
<samp>accountKey</samp> and <br />
<samp>projectId</samp> it should be logically possible to find single Entity of DBProject Kind.<br />
<br>
<br>
<h3>Key Builder</h3> When dealing with multiple level object trees, Key creation could get quite laborious. There is a
<a href="http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/KeyFactory.Builder.html" target="_blank">KeyBuilder</a> utility class to assist the process. Here is what using a KeyBuilder looks like:<br />
<br>
<samp><br> KeyFactory.Builder kb = new KeyFactory.Builder(DBAccount.class.getSimpleName(), customerEmail);<br> kb.addChild(DBProject.class.getSimpleName(), projectId);<br> Key projectKey = kb.getKey()<br> </samp>
<br> Printing
<samp>projectKey</samp> should give output somewhat like this:<br />
<br>
<samp><br> DBAccount('customer@email.com')/DBProject('someUniqueProjectId')<br> </samp>
<br> which gives a bit of an insight into how keys are actually represented :)
<br>
<br>
<h3>1000 get, 500 put/delete limit</h3> One of the most notable rules of the AppEngine is that there is a limit on number of entities manipulated by a Datastore call. I believe 'get' is set to 1000 and 'put/delete' to 500. Here is how one can delete 500 or less Entities using low-level API:
<br>
<samp><br> DatastoreService ds = DatastoreServiceFactory.getDatastoreService();<br> Query query = new Query(DBProject.class.getSimpleName());<br> query.setKeysOnly();<br> Set keys = new HashSet();<br> for (Entity entity : ds.prepare(query).asList(FetchOptions.Builder.withLimit(500))) {<br> keys.add(entity.getKey());<br> }<br> ds.delete(keys);<br> </samp>
<br> Notice
<samp>query.setKeysOnly()</samp>, which speeds up results by fetching keys only. Also notice that <br />
<samp>ds.delete(keys)</samp> takes a Collection, which is a faster way to delete data. (Here is a <br />
<a href="http://appengine-cookbook.appspot.com/recipe/bypass-500-putdelete-and-1000-get-limit/" target="_blank">link</a> to clever example how to get around 1000/500 limit)<br />
<br>
<br>
<h3>Annotated Data Models</h3> DataNucleus provides API to 'annotate' classes so that they can be 'enhanced' with datastore related code. An
<a href="http://www.datanucleus.org/products/datanucleus/enhancer.html" target="_blank">enhancer tool</a> comes with AppEngine Eclipse plugin and is executed after classes are compiled into bytecode. Here is what a possible declaration looks like using <br />
<a href="http://groovy.codehaus.org/" target="_blank">Groovy</a> and javax.jdo.annotations.*:<br />
<br>
<samp><br> @PersistenceCapable(identityType = IdentityType.APPLICATION)<br> class <b>DBAccount</b> implements Serializable {<br> @PrimaryKey<br> Key key;<br> <br> @Persistent<br> String email;<br> <br> @Persistent<br> Integer age;<br> <br> @Persistent<br> Set[DBProject] projects = new HashSet[DBProject]()<br> }<br> <br> @PersistenceCapable(identityType = IdentityType.APPLICATION)<br> class <b>DBProject</b> implements Serializable {<br> @PrimaryKey<br> Key key;<br> <br> @Persistent<br> String projectId;<br> <br> @Persistent<br> Date createdOn;<br> <br> //some more data here..<br> }<br> </samp>
<br> I like using Groovy because it provides all getters and setters automatically, which facilitates a clean data model design :)
<br>
<br>
<h3>Object Access by Key</h3> A particular DBProject class can be accessed in a number of ways. First, you might want to retrieve DBAccount along with all of its projects:
<br>
<samp><br> DBAccount dba = pm.getObjectById(DBAccount.class, customerEmail)<br> dba.getProjects()<br> </samp>
<br> Note that this particular example uses lazy fetch, so second line 'touches' projects in order for them to be fetched. There is a way to annotate a class to specify a fetch mechanism explicitly.
<br> Another way would be to fetch a desired DBProject instance directly, like this
<br>
<samp><br> Key projectKey = KeyFactory.createKey(accountKey, "DBProject", projectId)<br> DBProject dbp = pm.getObjectById(DBProject.class, projectKey)<br> </samp>
<br> Note, that if you just want to change some attributes of this object and persist that, you can simply do the following:
<br>
<samp><br> DBProject dbp = new DBProject("some new data here")<br> dbp.setKey(projectKey)<br> pm.makePersistent(dbp)<br> </samp>
<br> If DBProject already exists with the given key, your object will be updated with new data. Otherwise new instance is created.
<br>
<br>
<h3>Object Access by Query</h3> In order to get a list of objects that satisfy a given requirement, one can issue a
<a href="http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html" target="_blank">Query</a>. Both DataNucleus and low-level API provide a way to query objects. DataNucleus supports a variety of mechanisms, including <br />
<a href="http://www.datanucleus.org/products/accessplatform_2_0/jdo/jdoql.html" target="_blank">JDOQL</a>, SQL, and JPQL.<br />
<br> Here is an example:
<br>
<samp><br> Query q = pm.newQuery(DBProject.class, "createdOn > monthAgo");<br> q.declareParameters("java.util.Date monthAgo");<br> List list = (List) q.execute(monthAgo);<br> </samp>
<br> This should return a list of all projects that were created less than a month ago.
<br>
<br>
<h3>Briefly about Indexes</h3> Datastore also provides
<a href="http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html#Introducing_Indexes" target="_blank">indexing</a> capabilities. Some indexes are provided automatically while others must be explicitly <br />
<a href="http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html#Defining_Indexes_With_Configuration" target="_blank">configured</a>. <br />
<u>Your query will not return any results unless properties in question are indexed one way or the other.</u><br />
<br>
<br> Here is an example of an index:
<br>
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396574486?profile=original" alt=""></p> Note, that
<samp>autoGenerate</samp> specifies whether manual index should overwrite an automatically generated index configuration. The <br />
<samp>ancestor</samp> attribute is set to <br />
<samp>true</samp> if the index supports a query that filters Entities by the Entity group parent, <br />
<samp>false</samp> otherwise.<br />
<br>
<br>
<h3>Misc Tips</h3> There is a lot more detail to using AppEngine's Datastore to manage data, most of which can be found
<a href="http://code.google.com/appengine/docs/java/datastore/" target="_blank">here</a>. It's also quite useful to have DataNucleus <br />
<a href="http://www.datanucleus.org/products/accessplatform_2_0/index.html" target="_blank">documentation</a> handy, which provides even more fine-grained detail.<br />
<br>
<br> One thing to remember is that AppEngine implements only a
<u>subset</u> of DataNucleus API. It is important to go over <br />
<a href="http://code.google.com/appengine/docs/java/datastore/usingjdo.html#Unsupported_Features_of_JDO" target="_blank">unsupported</a> features before making big architectural decisions.<br />
<br>
<br>
<h3>Summary</h3> Overall, AppEngine's datastore is a fun and simple way to persist data, however it takes a bit of getting used to. Certain concepts and limitations might seem alien at first, until one acquires a deeper understanding of underlying technologies and best practices, which takes a bit of time and effort :)
<br>
<br> Thanks for reading and Aloha!
<br>
<br> Konstantin
<br>
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • Mobile<br />
<br>
<br> Resources:
<br>
<ul>
<li><a href="http://gae-java-persistence.blogspot.com/" target="_blank">GOOGLE APP ENGINE JAVA PERSISTENCE BLOG</a></li>
<li><a href="http://code.google.com/appengine/docs/java/overview.html" target="_blank">Official Google AppEngine for Java Docs</a></li>
<li><a href="http://www.amazon.com/Programming-Google-Engine-Animal-Guide/dp/059652272X/ref=sr_1_2?ie=UTF8&s=books&qid=1263100643&sr=8-2" target="_blank">Programming Google App Engine (Animal Guide)</a></li>
<li><a href="http://appengine-cookbook.appspot.com/" target="_blank">AppEngine Cookbook</a></li>
<li><a href="http://www.techhui.com/group/saaspersistence">TechHui SaaS Persistence</a></li>
<li><a href="http://www.techhui.com/group/googleappenginedevelopers">TechHui Google AppEngine Developers</a></li>
<li><a href="http://groups.google.com/group/google-appengine-java" target="_blank">Google Groups AppEngine for Java</a></li>
</ul> (Key image courtesy of
<a href="http://www.freeiconsweb.com/" target="_blank">Freeiconsweb</a>)Howto manage Cron Jobs and Task Queues using Google AppEnginetag:www.techhui.com,2009-10-27:1702911:BlogPost:522332009-10-27T03:00:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<div><img alt="" src="http://storage.ning.com/topology/rest/1.0/file/get/396567714?profile=RESIZE_320x320" style="float: right;" width="200"></img>
</div>
In the process of discovering Google AppEngine's list of available features, I recently came across Cron Jobs and Task Queues. During my fairly extensive web development carrier, these terms always seemed like far away concepts that will not likely be a part of my average web development toolkit. At first, seeing these in AppEngine reminded me of those old mainframe systems that you read about in computer science manuals. One day I had some time to actually look into…
<div>
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396567714?profile=RESIZE_320x320" alt="" style="float: right;" width="200"><br />
</div> In the process of discovering Google AppEngine's list of available features, I recently came across Cron Jobs and Task Queues. During my fairly extensive web development carrier, these terms always seemed like far away concepts that will not likely be a part of my average web development toolkit. At first, seeing these in AppEngine reminded me of those old mainframe systems that you read about in computer science manuals. One day I had some time to actually look into it, and was surprised and inspired by simplicity and usability of these nifty features.
<br>
<br> In short,
<a href="http://en.wikipedia.org/wiki/Cron" target="_blank">Cron</a> is a time-based job scheduler. For web development, it could have variety of uses. For example:<br />
<br> - collecting data from a remote source and caching it locally
<br> - processing local data to derive an intensive computation
<br> - processing some data and sending email confirmations upon completion
<br> etc... or basically anything that can facilitate app's performance that can run as a background process.
<br>
<br> In AppEngine, it is very simple to declare a
<a href="http://code.google.com/appengine/docs/java/config/cron.html" target="_blank">Cron Job</a>. First, there is a cron.xml that specifies how you'd like to execute your jobs, for example:<br />
<br>
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396570054?profile=original" alt=""></p> saving it into /war/WEB-INF/cron.xml on Java SDK should do the trick. Notice url that points to web handler, time schedule that specifies how often this cron is run, a description of this cron, and a timezone. Cron jobs use
<a href="http://www.techhui.com/video/web-hooks-and-the-programmable" target="_blank">Web Hooks</a> to call a specified url at specified intervals. Sounds simple enough.. now we'll just have to define a handler for this request at /weather/storeData<br />
<br>
<br> Here is what AppEngine's dashboard looks like once a cron job is defined:
<br>
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396570187?profile=original" alt=""></p>
<br> AppEngine SDK also provides a separate command to upload cron file:
<br>
<code>appcfg update_cron war</code><br />
<br>
<br> Now, imagine that your cron job needs to spawn a number of processes to handle the request. This could be easily done using
<a href="http://code.google.com/appengine/docs/java/taskqueue/overview.html" target="_blank">Tasks API</a>. Here is an example queuing a task and passing a parameter to it:<br />
<br>
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396570934?profile=original" alt=""></p>
<br> A task handler could be any program/script that accepts HTTP requests. It would fetch passed parameters using familiar
<code>request.parameter('stationName')</code>. The rest is up to the task :)<br />
<br>
<br> Notice that, in this case, we are calling a
<i>default</i> queue. It is also possible to define a number of custom queues or change default queue, like this:<br />
<br>
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396571026?profile=original" alt=""></p>
<br> Here is what task dashboard looks like when tasks are executed:
<br>
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396573299?profile=original" alt=""></p>
<br> Here is what regularly scheduled task executions look like using Request/Second Dashboard interface:
<br>
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396574208?profile=original" alt=""></p>
<br> Finally, using both Cron Jobs and Task Queues adds a good bit to the overall collection of available tools. Using these tools appropriately significantly improves application's performance and simplifies overall code structure. Not to mention, it also looks very cool when browsing app's performance using AppEngine's dashboard interface :)
<br>
<br> Thank you for reading and Aloha!
<br>
<br>
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • MobileOptimizing CSS with a simple Groovy script and CssTidytag:www.techhui.com,2009-10-16:1702911:BlogPost:514712009-10-16T00:00:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
Recently I've been working on a web project that requires quite an extensive CSS markup. Keeping it all in one file became unmanageable pretty quickly, so we've designed a way to split our styles into logical subdirectories with import statements, which is quite easily done with a css<br />
<a href="http://www.w3.org/TR/CSS2/cascade.html#at-import" target="_blank">@import</a> tag. Here is an example of what a main file might look like:<br />
<code>@import 'common.css'; @import 'base.css'; @import…</code>
Recently I've been working on a web project that requires quite an extensive CSS markup. Keeping it all in one file became unmanageable pretty quickly, so we've designed a way to split our styles into logical subdirectories with import statements, which is quite easily done with a css <br />
<a href="http://www.w3.org/TR/CSS2/cascade.html#at-import" target="_blank">@import</a> tag. Here is an example of what a main file might look like: <br />
<code> @import 'common.css'; @import 'base.css'; @import 'reset.css'; @import 'widgets/buttons.css'; @import 'widgets/windows.css'; etc... </code> The problem is, that now browser needs to fetch a number of Css files, which considerably slows down startup performance and impacts bandwidth/quota restrictions. Given this, we were inspired to find a viable way to compact our css rules into one highly-optimized file without loosing any of its integrity. We found a number of css optimizers available on online that will compact a stylesheet using a number of options. However, we could not find any that will inline nested css files into one master copy (maybe you know of any, in which case please post a link :) After a short research, we finally picked <br />
<a href="http://csstidy.sourceforge.net/" target="_blank">CssTidy</a> as the optimizer. It's been around for years, built in C++, has a number of handy options, and has a nice <br />
<a href="http://floele.flyspray.org/csstidy//css_optimiser.php" target="_blank">online interface</a>. The only problem was that it does not <br />
<i>inline</i> css files. To solve inlining problem, we've built a simple Groovy script that handles this task very nicely. It takes a root css file, traverses into all import statements, inlines contents and outputs it all into another file. Then, using some Groovy magic, we take that file and execute CssTidy on it, finally producing desired effect of having one optimized css file. Here is a sample Groovy script that recursively traverses css tree appending contents into a StringBuilder <br />
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396566646?profile=original" alt=""></p> Here is how one can use Groovy AntBuilder to execute CssTidy on the inlined result
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396567659?profile=original" alt=""></p> This simple technique has helped us manage our css hierarchy, saving web server quota and bandwidth for more useful and exciting applications :) Complete source code is
<a href="http://storage.ning.com/topology/rest/1.0/file/get/396568458?profile=original">attached</a> for your consideration. Thank you for reading and Aloha! <br />
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • MobileAn Overview of Google Web Toolkit (GWT)tag:www.techhui.com,2009-09-12:1702911:BlogPost:494722009-09-12T21:00:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<div style="font-size:14px; font-family:tahoma,arial,verdana;color#333;"><img alt="" src="http://storage.ning.com/topology/rest/1.0/file/get/396573316?profile=original" style="float: right;"></img> Aloha TechHuians! If you have been hearing about
<a href="http://code.google.com/webtoolkit/" target="_blank">GWT</a> lately, but don't have the time to get into it, maybe this post sheds some light on more notable features that GWT offers, so you can make an educated decision about picking the right web technology for your next project. Google Web Toolkit is a Google product that aims to ease the pain of…</div>
<div style="font-size:14px; font-family:tahoma,arial,verdana;color#333;">
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396573316?profile=original" alt="" style="float: right;">Aloha TechHuians! If you have been hearing about <br />
<a href="http://code.google.com/webtoolkit/" target="_blank">GWT</a> lately, but don't have the time to get into it, maybe this post sheds some light on more notable features that GWT offers, so you can make an educated decision about picking the right web technology for your next project. Google Web Toolkit is a Google product that aims to ease the pain of developing Rich Internet Applications by allowing developers to code in Java programming language and compile that into cross-browser highly optimized JavaScript. If you already have experience with cross-browser development, especially for highly AJAXed interactions, you probably will appreciate what GWT has to offer. In a nutshell, here is a list of main features: <br />
<ul>
<li>Write AJAX apps in Java, compile to highly optimized cross-browser JavaScript</li>
<li>Optimize JavaScript downloads based on client profile (Ex. Firefox in English, Opera in French, etc..)</li>
<li>Optimize image/css downloads with built-in Resource Bundle</li>
<li>Easily add Internationalization (I18N) support to your app</li>
<li>Use other JavaScript libraries and native JavaScript code (Ex. Prototype, JQuery, ExtJs, etc...)</li>
<li>Step through live AJAX code with a Java Debugger</li>
<li>View code changes immediately without re-compiling</li>
<li>Reuse UI components across projects</li>
<li>Test with JUnit</li>
</ul> If you are wondering whether this technology is mature enough for serious development, take a look at existing projects that are being implemented in GWT:
<ul>
<li><a href="http://wave.google.com/" target="_blank">Google Wave</a></li>
<li><a href="http://googlewebtoolkit.blogspot.com/2009/08/seesmic-duplicates-their-adobe-air.html" target="_blank">Seesmic</a></li>
</ul> Google has been working on a series of new features that make GWT even more attractive. Here is a list of more notable ones:
<ul>
<li>Native support for GWT in <a href="http://www.techhui.com/profiles/blogs/an-overview-of-google-app" target="_blank">Google App Engine</a> (GAE)</li>
<li><a href="http://code.google.com/eclipse/" target="_blank">Google Eclipse Plugin</a> which allows to create/compile/deploy GWT apps in a fully featured IDE</li>
<li>A growing number of third-party modules easing development pains (mostly hosted on <a href="http://code.google.com/" target="_blank">Google Code</a>)</li>
</ul> If you do decide to give it a try, there is plenty of material on the web to get started. Here is a list of some useful sites:
<ul>
<li><a href="http://googlewebtoolkit.blogspot.com/" target="_blank">Google Web Toolkit Blog</a> covers most notable new features.</li>
<li><a href="http://groups.google.com/group/Google-Web-Toolkit" target="_blank">GWT Forum</a> hosted by Google Groups, with almost 20,000 members and 90,000 discussions, is a great place to get answers.</li>
</ul> As for printed books,
<a href="http://www.manning.com/hanson/" target="_blank">GWT in Action</a> and <br />
<a href="http://www.manning.com/cooper/" target="_blank">GWT in Practice</a> probably cover most of GWT development grounds. Here is a link to original presentation slides used for TechHui conference GWT panel <br />
<a href="http://storage.ning.com/topology/rest/1.0/file/get/396574285?profile=original">GWT Presentation PDF</a> Thank you for reading and Aloha! <br />
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • Mobile <br />
</div>An Overview of Google App Engine (GAE)tag:www.techhui.com,2009-08-25:1702911:BlogPost:483442009-08-25T06:30:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<img alt="" height="109" src="http://storage.ning.com/topology/rest/1.0/file/get/396570969?profile=original" style="float: right;" width="142"></img> These days, web developers are faced with a lot of difficult choices. One of them is which technology to pick for the next app, another is which hosting to use. It takes time and experience to make winning choices, especially when dealing with time sensitive deliverables. Back in the days developers had to do it all: configure a server, set up database access, get a static ip, etc... Configuring and supporting such a system could probably be a full time job in itself. Hence another…
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396570969?profile=original" alt="" width="142" height="109" style="float: right;"> These days, web developers are faced with a lot of difficult choices. One of them is which technology to pick for the next app, another is which hosting to use. It takes time and experience to make winning choices, especially when dealing with time sensitive deliverables. Back in the days developers had to do it all: configure a server, set up database access, get a static ip, etc... Configuring and supporting such a system could probably be a full time job in itself. Hence another (more attractive) alternative was to have a 'hosting' company do it for you. The question was, which hosting do you pick? Which one provides more configuration options? Which supports the right set of technologies? Which is more stable? Which one is more robust/responsive? Does it provide easy deployment? Monitoring? Logging? Versioning? Collaboration? Since web applications are evolving, so do hosting companies. Using a local hosting company usually provides higher accessibility to your app, which is important for a number of reasons, even if it supports a lesser variety of features than a more global one. Recently big players started entering hosting arena with their all-in-one solutions. One of these players is <br />
<a href="http://code.google.com/appengine/" target="_blank">Google App Engine (GAE)</a>, which I'd like to talk about in this post. If you are in tune with other Google technologies, Google App Engine is a great edition to the Google web app family. Currently it supports two languages, <br />
<a href="http://code.google.com/appengine/docs/python/overview.html" target="_blank">Python</a> and <br />
<a href="http://code.google.com/appengine/docs/java/overview.html" target="_blank">Java</a>. At this moment, Python support is probably a bit more mature, especially when it comes to managing data. Java is a recent addition, but does support enough features to kick-start your next app, and is evolving quickly. <br />
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396571076?profile=RESIZE_180x180" alt="" width="120" height="119" style="float: left;">It is possible to mix both technologies together using different app versions, which comes in handy when trying to accomplish different aspects of functionality. Python is great for getting a site up and running quickly, streamlined by support for <br />
<a href="http://www.djangoproject.com/" target="_blank">Django</a> framework. One can have a basic content management site up in no time with minimal configuration. Uploading your app is a breeze, as well as setting up local development environment. With a <br />
<a href="http://en.wikipedia.org/wiki/Google_App_Engine#Free_quotas" target="_blank">free version</a>, Gae comes with enough goodies to get one started. It supports sending email, lots of bandwidth and CPU time, over 1 million request per day and up to 1GB of stored data. It also comes with certain limitations, not necessarily being a bad thing, since most of them shield one's web-app from improper usage. (see <br />
<a href="http://en.wikipedia.org/wiki/Google_App_Engine#Restrictions" target="_blank">Restrictions</a>) <br />
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396573340?profile=RESIZE_180x180" alt="" width="150" style="float: right;">On the Java side, Gae supports a number of commonly used features. It tightly integrates with <br />
<a href="http://code.google.com/eclipse/" target="_blank">Eclipse</a> to create, compile and deploy projects quickly. Gae Java comes with native support for <br />
<a href="http://code.google.com/webtoolkit/" target="_blank">GWT</a>, which gives ability to build robust and highly interactive RIA AJAX web applications. Data aware objects are decorated with either JDO or JPA annotations. It supports JSP pages and Servlets, with standard war directory structure, web.xml configurations, logging, etc.. (One can even write in Groovy, here is an article that explains <br />
<a href="http://blog.springsource.com/2009/04/07/write-your-google-app-engine-applications-in-groovy/" target="_blank">how</a>) Out of the box you get Caching API, URL Fetch services, email support, server-side image manipulation, and integration with Google Accounts. Time wise, an experienced developer could probably have a simple GWT app (from scratch) with an RPC call and DB access deployed to Gae within 1-2 hours. Eclipse plugin project creator tool handles all necessary dependencies. Deployment is as easy as pressing 'Deploy' button. A word about Gae datastore. <br />
<i>Gae uses a schemaless object datastore, with a query engine and atomic transactions. It is designed with web applications in mind, having an emphasis on read and query performance. All queries are pre-indexed, capable of handling results over very large data sets. Datastore supports transactional updates, using entity groupings defined by the application as the unit of transactionality in the distributed data network</i>. (see <br />
<a href="http://code.google.com/appengine/docs/java/datastore/overview.html" target="_blank">Datastore Overview</a>) On the admin side, developers have access to a feature-rich dashboard (see bellow). Here one can monitor app's health/performance using various views. GAE Admin supports usage charts, detailed breakdown of quota details, log viewer, data viewer, app version manager, billing, etc.. Like most Google apps, admin site is simple and responsive, packed with enough functionality to get a good handle on what your app is doing on daily basis. You can get started with your very own GAE account <br />
<a href="https://appengine.google.com/" target="_blank">here</a>. (It gives ability to have up to 10 apps and share your apps with other developers) <br />
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396574532?profile=original" alt="" width="952" height="537"> <img src="http://code.google.com/appengine/images/appengine-noborder-120x30.gif" style="float:right;"></p> Thank you for reading and good luck on choosing the right hosting for your web application needs!
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • MobileHow to use GMail as a handy personal databasetag:www.techhui.com,2009-08-03:1702911:BlogPost:474152009-08-03T20:00:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<img alt="" height="117" src="http://storage.ning.com/topology/rest/1.0/file/get/396574223?profile=RESIZE_180x180" style="float: right;" width="120"></img><br />
<a href="http://mail.google.com" target="_blank">GMail</a> has been my email of choice for some time, but only recently that I've learned about some of its 'lesser known features', and especially their potential applicability. In this blog I'd like to describe how some of such features can be used to turn GMail into a handy personal database. For example, quite often I need to store information, such as scriptlets of code, notes, blog ideas, etc.. Before this recent discovery, most…
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396574223?profile=RESIZE_180x180" alt="" width="120" height="117" style="float: right;"><br />
<a href="http://mail.google.com" target="_blank">GMail</a> has been my email of choice for some time, but only recently that I've learned about some of its 'lesser known features', and especially their potential applicability. In this blog I'd like to describe how some of such features can be used to turn GMail into a handy personal database. For example, quite often I need to store information, such as scriptlets of code, notes, blog ideas, etc.. Before this recent discovery, most of this stuff just floated around in my head or kept piling up as a collection of sticky notes. I kept forgetting good ideas, spent time searching for previously available/discovered information, etc.. This extended even further when I started paying attention to catchy quotes, recording movie names, music tracks, etc... Then it occurred to me how some of already available and known features, such as <br />
<a href="http://mail.google.com/support/bin/answer.py?hl=en&answer=12096" target="_blank">address aliasing</a>, <br />
<a href="http://mail.google.com/support/bin/answer.py?hl=en&answer=118708" target="_blank">labels</a> and <br />
<a href="http://mail.google.com/support/bin/answer.py?hl=en&answer=6579" target="_blank">filters</a> can turn GMail into a pretty simple and cool personal database. For example, I just had an idea for a blog, but don't have the time nor ability to record it properly. So I pick up my <br />
<i>favorite mobile device</i> and send an email to mymail+blog@gmail.com containing basic ideas and title for my new blog. GMail supports address aliasing, such as adding any word combination after '+'. This becomes very handy in combination with 'labels' and 'filters', since then one can create a 'filter' to assign a 'label' to all emails with 'To' field = 'mymail+something@gmail.com'. Here is an example list of aliases that could be pretty useful: mymail+blog@gmail.com mymail+code@gmail.com mymail+notes@gmail.com mymail+movies@gmail.com mymail+quotes@gmail.com etc... On GMail side, setting up following filters will assign labels to selected mail: To: mymail+blog@gmail.com -> Blogs To: mymail+code@gmail.com -> Code/Scriptlets To: mymail+notes@gmail.com -> Notes To: mymail+movies@gmail.com -> Movies To: mymail+quotes@gmail.com -> Quotes Other possible items could be Ideas, Recipes, Howto's, Todos/Tasks, Stocklist, Wishlist, Shopping list, etc... This seems like a simple enough task, but adds a very handy ability to easily record information that previously was just floating around. Then one can use <br />
<a href="http://mail.google.com/support/bin/answer.py?hl=en&answer=7190" target="_blank">advanced search</a> to find desired results. For example: label:blogs [search phrase] to find [search phrase] in label 'blogs'. For me, this type of usage transformed GMail into a handy personal storage tool, with ability to record, group and search for information. Other very useful GMail Tips & Tricks can be found <br />
<a href="http://www.google.com/mail/help/tips.html" target="_blank">here</a>. And if you are a bit programmer savvy, like me, and would like to extract this information, just use any of available mail client API's to tap into GMail, and get your results, possibly for use in other applications or widgets. We hope you find this post useful. Thanks for reading and Aloha! <br />
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • MobileGoogle Chrome OS and the 'Web of Tomorrow'tag:www.techhui.com,2009-07-10:1702911:BlogPost:460322009-07-10T02:00:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<img alt="" height="143" src="http://storage.ning.com/topology/rest/1.0/file/get/396573394?profile=RESIZE_320x320" style="float: right;" width="220"></img> IT ALL STARTED WITH A SEARCH ENGINE. Back in the days, Google Search has taken over the web by its simplicity, light-weight, and precision of returned results.<br />
<a class="noborder" href="http://storage.ning.com/topology/rest/1.0/file/get/396574312?profile=original" target="_blank"><img alt="" height="94" src="http://storage.ning.com/topology/rest/1.0/file/get/396574312?profile=RESIZE_180x180" style="float: left;" width="100"></img></a> Then Google slowly expanded into GMail, Calendar, Google Docs, etc.. in an attempt to replace desktop office with web-based alternatives. More features were being added constantly, making…
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396573394?profile=RESIZE_320x320" alt="" width="220" height="143" style="float: right;"> IT ALL STARTED WITH A SEARCH ENGINE. Back in the days, Google Search has taken over the web by its simplicity, light-weight, and precision of returned results. <br />
<a class="noborder" href="http://storage.ning.com/topology/rest/1.0/file/get/396574312?profile=original" target="_blank"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396574312?profile=RESIZE_180x180" alt="" width="100" height="94" style="float: left;"></a> Then Google slowly expanded into GMail, Calendar, Google Docs, etc.. in an attempt to replace desktop office with web-based alternatives. More features were being added constantly, making their apps more and more attractive to average users. <br />
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396575231?profile=RESIZE_180x180" alt="" width="100" height="85" style="float: right;"> Then there was 'Google Maps' and 'Google Earth', usefulness and simplicity of which introduced lots of exciting new possibilities. Now Google Maps is easily supported by mobile devices, such as iPhone. <br />
<a class="noborder" href="http://storage.ning.com/topology/rest/1.0/file/get/396577118?profile=original" target="_blank"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396577118?profile=RESIZE_180x180" alt="" width="90" height="100" style="float: left;"></a> Shortly after iPhone debut, Google released its own version of a mobile OS, called Android, installed on a 'G1 Phone', which arguably claims 'top 3' spot in mobile devices. <br />
<a class="noborder" href="http://storage.ning.com/topology/rest/1.0/file/get/396578001?profile=original" target="_blank"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396578001?profile=RESIZE_180x180" alt="" width="100" height="71" style="float: right;"></a> Not to stop there, Google Chrome, being a direct competitor to most popular web browsers, is climbing its way up. Its main selling point is stability, gained by creating a separate process for each 'browsing tab'. This feature is quite useful for frequent web surfers, especially those who like Rich Internet Apps (RIA), due to RIA frequent instability and often experimental functionality. <br />
<a class="noborder" href="http://storage.ning.com/topology/rest/1.0/file/get/396580407?profile=original" target="_blank"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396580407?profile=RESIZE_180x180" alt="" width="100" height="90" style="float: left;"></a> Interestingly enough, now Google is slowly entering into OS competition. Acer has announced plans to ship <br />
<a href="http://www.engadget.com/2009/06/05/first-acer-android-netbook-will-dual-boot-windows/" target="_blank">first dual-boot Windows/Android netbooks</a> by 2009 Q3. HP is already <br />
<a href="http://www.businessinsider.com/hp-may-use-google-android-for-netbooks-2009-3" target="_blank">testing Android</a> on their hardware. <br />
<a class="noborder" href="http://storage.ning.com/topology/rest/1.0/file/get/396580460?profile=original" target="_blank"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396580460?profile=RESIZE_180x180" alt="" width="150" height="74" style="float: right;"></a> Now Google is going even further to announce <br />
<a href="http://googleblog.blogspot.com/2009/07/introducing-google-chrome-os.html" target="_blank">Google Chrome OS</a>. According to the blog, Chrome OS will run a new windowing system on top of Linux kernel. As a web developer, I find following excerpt particularly interesting: <br />
<i>For application developers, the web is the platform. All web-based applications will automatically work and new applications can be written using your favorite web technologies. And of course, these apps will run not only on Google Chrome OS, but on any standards-based browser on Windows, Mac and Linux thereby giving developers the largest user base of any platform.</i> <br />
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396581205?profile=original" alt="" width="152" height="114" style="float: right;"> Seems like Google has been planning this all along. They already have support for <br />
<a href="http://code.google.com/apis/gadgets/" target="_blank">Gadgets</a>, <br />
<a href="http://desktop.google.com/en/" target="_blank">Google Desktop</a>, <br />
<a href="http://gears.google.com/" target="_blank">Google Gears</a>, and a growing <br />
<a href="http://desktop.google.com/plugins/" target="_blank">Gadget library</a>. It is interesting how Google is finding a viable business model where giants like Apple and Microsoft have been dominating for years. I think Google's success so far is mostly attributed to 'riding web evolution wave', which is quickly capturing minds of web users and developers alike all around the globe. <br />
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396582974?profile=original" alt="" width="168" height="60" style="float: right;">A word about <br />
<a href="http://gears.google.com" target="_blank">Google Gears</a>. It lets web apps interact naturally with desktop, store data locally in a full-search database, and have asynchronous JavaScript processes running in background. This is pretty much what an average desktop application needs to function. Gears is merging boundaries between web and desktop, again towards 'web is the platform'. <br />
<a class="noborder" href="http://storage.ning.com/topology/rest/1.0/file/get/396583068?profile=original" target="_blank"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396583068?profile=RESIZE_320x320" alt="" width="300" height="75" style="float: left;"></a> Now, a word about web development. As a developer, Google has helped me in a number of ways. GWT took away cross-browser pains. Google Code gave free source code hosting to software projects. Now Google App Engine (GAE) is being offered as a platform for running web applications. Given all these technologies, it is my opinion that Google simplifies web development and opens up doors to new frontiers which, before, were only imaginable. Given this 'simplicity', more developers are willing to adopt 'Google technology stack', thus, 'collectively' creating software to power the 'Web of Tomorrow'. On a side note, a college buddy of mine used to work for Google in NYC office. He invited me once for a short tour. I really liked the atmosphere, as it was relaxed and focused. Using StarTrek analogy, it felt like being in the 'Engine Room'! Thank you for reading and Aloha! <br />
<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/S_Vn1C7eUzA&hl=en&fs=1&"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="never"><embed src="http://www.youtube.com/v/S_Vn1C7eUzA&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="never" width="560" height="340"></object>GWT + Flex = GXT?tag:www.techhui.com,2009-07-07:1702911:BlogPost:457992009-07-07T21:30:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<a class="noborder" href="http://storage.ning.com/topology/rest/1.0/file/get/396573312?profile=original" target="_blank"><img alt="" height="151" src="http://storage.ning.com/topology/rest/1.0/file/get/396573312?profile=RESIZE_320x320" style="float: right;" width="300"></img></a> For all RIA fans out there who are deciding whether to go with GWT or Flex for your next project, I highly recommend to consider the following initiative. It is called<br />
<a href="http://extjs.com/products/gxt/" target="_blank">Ext GWT</a>. It packages a well known<br />
<a href="http://extjs.com/" target="_blank">Ext JS</a> Javascript library into GWT accessible Java…
<a class="noborder" href="http://storage.ning.com/topology/rest/1.0/file/get/396573312?profile=original" target="_blank"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396573312?profile=RESIZE_320x320" alt="" width="300" height="151" style="float: right;"></a>For all RIA fans out there who are deciding whether to go with GWT or Flex for your next project, I highly recommend to consider the following initiative. It is called <br />
<a href="http://extjs.com/products/gxt/" target="_blank">Ext GWT</a>. It packages a well known <br />
<a href="http://extjs.com/" target="_blank">Ext JS</a> Javascript library into GWT accessible Java classes. Gxt team just released a new demo suite, that contains a combination of GWT and embedded Flex components. <br />
<a href="http://extjs.com/examples/explorer.html#overview" target="_blank">Ext GWT Explorer Demo</a> Both technologies have something to offer. GWT is great because it leverages the power of Java and takes away cross-browser development pains, but is still plain old HTML/CSS. Flex is great because it packs tons of eye-candy functionality rendered in a Flash Player plug-in that is still pretty light weight. GXT combines both technologies together by wrapping selected Flex components into Java/GWT libraries, creating somewhat like a hybrid between two technologies. As an active GWT developer, I would say that this combination is very attractive. I can still write all my layouts, forms, validations, AJAX interactions in GWT/Java, which it does pretty well, and have selected Flex components handle the rest of RIA functionality. As of now, GXT supports Flex components for Charting. It would be great to see that expanded into Sound, Video, Maps, etc.. support in the near future. If this happens, GWT/Flex combination would be a very productive tool in developing RIA websites quickly and effectively. Another piece of the puzzle is increasingly popular Rails/Grails streamline development. I have not yet tried GWT/Flex/Rails integration, but imagine it is possible. If anyone has successfully engaged it, any input is highly appreciated. Thank you and Aloha! <br />
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • MobileHOWTO: Turn Google Calendar into a useful Time Keeping Tooltag:www.techhui.com,2009-07-05:1702911:BlogPost:457122009-07-05T00:00:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<img alt="" height="148" src="http://storage.ning.com/topology/rest/1.0/file/get/396570922?profile=original" style="float: right;" width="211"></img> Average software developer often juggles multiple projects at a time. One of common challenges is keeping track of time properly, especially when 'context switching' from one project to another. A quite useful tool for time tracking is<br />
<a href="http://calendar.google.com" target="_blank">Google Calendar</a>. Here is a list of most notable features: - Free and available with GMail acount - Syncs with CalDAV enabled clients (Apple iCal or Mozilla Sunbird) - Syncs with Windows Mobile,…
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396570922?profile=original" alt="" width="211" height="148" style="float: right;"> Average software developer often juggles multiple projects at a time. One of common challenges is keeping track of time properly, especially when 'context switching' from one project to another. A quite useful tool for time tracking is <br />
<a href="http://calendar.google.com" target="_blank">Google Calendar</a>. Here is a list of most notable features: - Free and available with GMail acount - Syncs with CalDAV enabled clients (Apple iCal or Mozilla Sunbird) - Syncs with Windows Mobile, iPhone, BlackBerry - Supports multiple calendars, calendar sharing, public/private - Embeddable as a widget into other websites - Supports Email, SMS notifications - Served via HTTPS, which keeps information protected When working on multiple projects, I try to have Google Calendar page open at all times to make sure my time is properly logged. Each project has its own calendar assigned to it, usually with a different background color, which provides helpful visual aid in getting a quick overview of project hours break-down. Daily, Weekly, Monthly views also help to visualize things a little better, even though I found Weekly view to be most useful for time keeping. The only problem is that once my time is logged, there is no easy way to extract it. Usually I need to report my hours on weekly basis, preferably broken down by project, I am also required to give detailed description for hours worked by date, number of hours, tasks performed, etc.. Originally I had to manually re-enter my weekly hours, which was very time consuming and error prone. Then I came across <br />
<a href="http://code.google.com/apis/calendar/" target="_blank">Google Calendar API</a>. After brainstorming a bit on the idea of creating my own simple custom calendar consumer, it quickly occurred to me that investing some time into this task right now will save manual time entry headaches later. After a couple of hours worth of playing around with API, I was able to have a simple version of a calendar event printer. Once again, thanks to Google, their API is well written and full of examples, it was a joy using it. Attached is a Java sample, that goes through all user calendars, then lists, by project, basic task related information in the following format: <br />
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396571036?profile=original" alt="" width="324" height="124"></p> For my current time keeping purposes, this is just what I needed. This approach leverages freely available calendar tool and provides desired output in automated fashion. Now it can easily be modified to output comma separated excel format, saved to a file, or even further extended to a web-based presentation. Hope this post helps you with your project time-management needs. Thank you for reading and Aloha! Take a look at example source code:
<a href="http://storage.ning.com/topology/rest/1.0/file/get/396571173?profile=original">MyTimesheet.java</a> Also, check out <br />
<a href="https://ikayzo-time.appspot.com/">Ikayzo Time App</a> to get your timesheet. <br />
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • MobileHOWTO: Consume a Groovy Web Service with Flextag:www.techhui.com,2009-06-16:1702911:BlogPost:445382009-06-16T07:30:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<img alt="" height="156" src="http://storage.ning.com/topology/rest/1.0/file/get/396566722?profile=original" style="float: right;" width="336"></img> Recently, I've been faced with the fact that Flex is quite popular as a web presentation layer. Given my Java background, at first I was quite reluctant to recognize this, until new projects paved the way to learn more about this RIA technology. Since I already have a considerable amount of server-side code in Java, I was wondering if it is possible to connect Java and Flex to get the best of both worlds. Hence this article gives a walk through on how to consume a Groovy Web Service…
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396566722?profile=original" alt="" width="336" height="156" style="float: right;"> Recently, I've been faced with the fact that Flex is quite popular as a web presentation layer. Given my Java background, at first I was quite reluctant to recognize this, until new projects paved the way to learn more about this RIA technology. Since I already have a considerable amount of server-side code in Java, I was wondering if it is possible to connect Java and Flex to get the best of both worlds. Hence this article gives a walk through on how to consume a Groovy Web Service with Flex. Let's start with a simple Groovy service class, which might look something like this <br />
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396566784?profile=original" alt="" width="475" height="127"></p> Then, let's create a
<a href="http://groovy.codehaus.org/GroovyWS">Groovy Web Service</a> <br />
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396567600?profile=original" alt="" width="630" height="174"></p> Running WSPublisher will start up an instance of Jetty and publish your newly created web service. To check that everything is running smoothly, try accessing WSDL
<pre>http://localhost:6980/SimpleService?WSDL</pre> You should get back an XML document. Now, once your simple web service is running, let's create a simple Flex consumer. Assuming you already have a Flex project setup, let's start by declaring a web service
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396567775?profile=original" alt="" width="868" height="57"></p> Notice WSDL url parameter and operation 'name' tag, which point to Java 'getMsg' method. The rest of attributes define web service id and respective callback functions, declared like this
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396567923?profile=original" alt="" width="463" height="328"></p> Last step is to create a simple button that would trigger the call
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396570098?profile=original" alt="" width="764" height="27"></p> Now, run your Flex project and you should see a single button on the screen.
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396570967?profile=original" alt="" width="151" height="44"></p> If you've done everything correctly, pressing the button will fetch "Hello World from Flex/Java communication!" string and display it in a pop up window
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396573370?profile=original" alt="" width="320" height="130"></p> That is it! Now you can use your existing Java server code and still have a slick Flex based user interface. Here is a
<a href="http://www.javaworld.com/javaworld/jw-01-2009/jw-01-javaee-flex-1.html">JavaWorld article</a> that goes further into Java EE/Flex combination. Hope you find this post useful. Happy Flexing! <br />
<a href="http://storage.ning.com/topology/rest/1.0/file/get/396574161?profile=original">SimpleService.groovy</a> <br />
<a href="http://storage.ning.com/topology/rest/1.0/file/get/396575283?profile=original">WSPublisher.groovy</a> <br />
<a href="http://storage.ning.com/topology/rest/1.0/file/get/396575227?profile=original">WSTest.mxml</a> <br />
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • MobileHOWTO: Get started with LDAPtag:www.techhui.com,2009-05-22:1702911:BlogPost:431762009-05-22T02:30:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<img alt="" height="254" src="http://storage.ning.com/topology/rest/1.0/file/get/396574150?profile=RESIZE_320x320" style="float: right;" width="300"></img> I've heard many times about LDAP (Lightweight Directory Access Protocol), yet never had the time to experiment with this technology. Somehow I always thought it was for those 'cool' developers, who actually had the opportunity to spend extra hours researching this topic. Well, the time has also come for me to enter the 'cool' club :)<br />
<a href="http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol">Wikipedia</a> was a good place to start, though it only gave me general…
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396574150?profile=RESIZE_320x320" alt="" width="300" height="254" style="float: right;"> I've heard many times about LDAP (Lightweight Directory Access Protocol), yet never had the time to experiment with this technology. Somehow I always thought it was for those 'cool' developers, who actually had the opportunity to spend extra hours researching this topic. Well, the time has also come for me to enter the 'cool' club :) <br />
<a href="http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol">Wikipedia</a> was a good place to start, though it only gave me general theoretical knowledge. My next step was to check with Amazon, to see if there are any outstanding books on the subject. (I like Amazon, because one can easily pin-point good reads by looking at reviews). <br />
<a href="http://www.safaribooksonline.com/Corporate/Index/index.php">Safari bookshelf</a> was my next bet. They are great when looking for information, I just don't like the 'bookshelf' feature. As a programmer, sometimes I need to scan a number of sources before finding my answers, so '10 at a time approach for a month' does not exactly work, and upgrades are pricey :( Anyway, since I run <br />
<a href="http://www.ubuntu.com/">Ubuntu</a>, their help docs was the next logical place to start. Ubuntu supports <br />
<a href="http://www.openldap.org/">OpenLDAP</a>, which is an open source LDAP implementation. I love Ubuntu mainly because of their documentation, since getting something to work on linux could be a real pain. In this case, their <br />
<a href="https://help.ubuntu.com/8.10/serverguide/C/openldap-server.html">OpenLDAP</a> page is where you'll probably spend most of your time. Getting comfortable with LDAP 'mind-set' could take some time getting used to. After going through some readings, I was convinced that it actually brings something unique to the programmer's table. Once I was comfortable with my install, I needed some program that could help me manage LDAP entries. After a brief search, <br />
<a href="http://directory.apache.org/studio/">Apache Directory Studio</a> was a clear winner! Eclipse plugin install went smoothly, and, in no time, I was able to browse my newly created LDAP directory, create entries, add attributes, etc.. clearly a 'must have' for an LDAP newbie like me :) In my case, I needed a PHP script that fetches user information. Php does not come with LDAP module, so it needs to be installed separately, like this: <br />
<pre>sudo apt-get install php5-ldap</pre> Once that was done, I had to write a simple php script that tests my connection.
<a href="http://us.php.net/manual/en/function.ldap-bind.php">Php help docs</a> had plenty of useful code examples to get started. Note, that your php ldap_bind code will not work without this line: <br />
<pre>ldap_set_option($ldapLink,LDAP_OPT_PROTOCOL_VERSION,3)</pre> I probably spent a couple of hours trying to figure this out :) Finally my code worked and I saw LDAP entries printed out with my newly created php module. Cool! Now is the time to go back to books and theory, to check all these cool ways of organizing information using a directory structure. Wishing everyone a cool summer and happy coding! Source code:
<a href="http://storage.ning.com/topology/rest/1.0/file/get/396575190?profile=original">ldap.php.txt</a> (image posted from OpenLDAP.org) <br />
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • MobileHOWTO: Create a simple Groovlettag:www.techhui.com,2009-04-22:1702911:BlogPost:404442009-04-22T03:30:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
<img alt="" height="100" src="http://storage.ning.com/topology/rest/1.0/file/get/396577170?profile=original" style="float: right;" width="203"></img> This post is for those who've heard about Serlvets and Groovy, but just don't have the time to put them together. Being no guru, I've developed a number of JSPs and Servlets in my professional carrier. Every time it is the same thing.. remembering method signatures, xml descriptors, etc.. It gets even worse if you want a Servlet to print out HTML content. Let's just put it this way - Java is not designed for simple Web development. There is always the JSP approach, which is still…
<img src="http://storage.ning.com/topology/rest/1.0/file/get/396577170?profile=original" alt="" width="203" height="100" style="float: right;">This post is for those who've heard about Serlvets and Groovy, but just don't have the time to put them together. Being no guru, I've developed a number of JSPs and Servlets in my professional carrier. Every time it is the same thing.. remembering method signatures, xml descriptors, etc.. It gets even worse if you want a Servlet to print out HTML content. Let's just put it this way - Java is not designed for simple Web development. There is always the JSP approach, which is still pretty cumbersome, having to remember proper syntax to separate JSP code from HTML. At the end, every time I have to face Servlet development, I can't help but wonder if there is a better way. Now there is! I've heard about Groovy, but who has the time to actually learn a new language these days.. I had the same philosophy until faced with Servlets once again. This time, my Servlet had to produce a lot of dynamic HTML content. Without spending too much time on Java punctuation, I switched my attention to <br />
<a href="http://groovy.codehaus.org/">Groovy</a>. Then, wondering, if I can apply Groovy's simplicity to Servlets, <br />
<a href="http://groovy.codehaus.org/Groovlets">Groovlet</a> emerged :) So what are the advantages of Groovlets vs Servlets. There are few. First of all, Groovlets are easier to setup. Include the following into your web.xml and its good enough for all your Groovlets in a project. <br />
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396578263?profile=original" alt="" width="487" height="158"></p> Then drop groovy-all.jar into your WEB-INF/lib directory. Secondly, printing dynamic HTML content is much simpler. Just do the following to print a simple Hello response:
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396578523?profile=original" alt="" width="413" height="165"></p> Notice how easy it is to use dynamic content, just wrap your variables in ${..} and you are done. Now save your new Groovlet in web project root folder with .groovy extension. Assuming you are running on localhost, deployed your project as '/groovy' and named your Groovlet 'hello.groovy', use the following URL to access it:
<pre>http://localhost:8080/groovy/hello.groovy</pre> Wow.. That was simple! Now most of the fun starts here. Basically you can use almost any Java feature available out there with Groovy syntax and Groovlet simplicity, plus use Groovy specific features to further minimize coding efforts. If you are new to Groovy, here are some more examples to wet your appetite: Declaring a variable
<pre>def myVar = "Some content here"</pre> Print a list of cookies stored in request object
<pre>request.cookies.each() { println it.name }</pre> Writing 'Hello World' to a file
<pre>new File(filename).write('Hello World\n')</pre> Printing contents of a file
<pre>new File(path).eachLine { println it }</pre> Listing a directory
<pre>new File("." ).eachFile{ file -> println file }</pre> Connecting to a database
<pre>def sql = Sql.newInstance("jdbc:mysql://localhost:3306/mydb", "user", "pswd", "com.mysql.jdbc.Driver")</pre> Looping through rows
<pre>sql.eachRow("select * from attrs where type=${groovy}") { println "Groovy is ${it.name}" }</pre> Groovy also provides simplified support for XML manipulation, quite handy for developing RSS, WebServices, etc.. Here is one way to parse an RSS feed
<pre>new XmlSlurper().parseText(rssFeed).channel.item.each{ println it.title } </pre> The good thing is that I can still re-use all my existing Java code. Servlets that used to take lines and lines of code get minimized to few paragraphs. Code becomes more legible and easier to manage. In short, Groovlet approach has significantly cut down my development time, not to mention, I am, once again, in love.. with Groovlets! :) Happy Grooving!
<a href="http://storage.ning.com/topology/rest/1.0/file/get/396580280?profile=original">hello.groovy</a> <br />
<a href="http://storage.ning.com/topology/rest/1.0/file/get/396580377?profile=original">web.xml</a>Supermarkets of the Futuretag:www.techhui.com,2009-03-24:1702911:BlogPost:360272009-03-24T12:23:40.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
Have you ever wondered what supermarkets of the future would look like? Did you ever consider an online alternative to getting your groceries?<br />
<br />
I am a surfer. I like to surf in the mornings. Then, sometimes, I do my grocery shopping. Once inside a supermarket, it is always the same thing. Looking for favorite brands, hunting for good prices, standing in lines, etc.. On average, a supermarket trip takes about 1 hour door to door. Does it have to be this way? Is there an alternative?<br />
<br />
Well, there…
Have you ever wondered what supermarkets of the future would look like? Did you ever consider an online alternative to getting your groceries?<br />
<br />
I am a surfer. I like to surf in the mornings. Then, sometimes, I do my grocery shopping. Once inside a supermarket, it is always the same thing. Looking for favorite brands, hunting for good prices, standing in lines, etc.. On average, a supermarket trip takes about 1 hour door to door. Does it have to be this way? Is there an alternative?<br />
<br />
Well, there could be. I own an iPhone. Why can't I open an iPhone app, log into my virtual store account, and order items that I want, delivered to me within a reasonable time frame, from 20 min to 1 hour. This app can have a history of my previous orders, a list of my favorite items and brands, a list of most frequently bought items, etc.. anything to streamline my shopping experience. Would something like this be useful? Could this actually substitute a physical trip to the supermarket? If this saves me 1 hour a day and removes supermarket headaches, I am ready for change.<br />
<br />
How could something like this actually be implemented? Well, let's go back to good old warehouse approach. Dry food can be stored in clean and secure compounds. There could be special sections for frozen items, items in bulk, produce, cold cuts, prepared foods, bakery, etc.. Such warehouses could be automated to stock, fetch, and package desired items. Deliveries could be made by a fleet of specially designed delivery trucks. Each warehouse will be responsible for an allocated area and will have a number of delivery trucks assigned to it based on population density.<br />
<br />
What are the benefits of this approach? Well, for me, I get to go home after surfing and have my food waiting at the door. For food distributors, this is probably something to think about. Here is a list of possible benefits:<br />
<br />
1. Higher availability of favorite brands<br />
2. Easier inventory management<br />
3. Reduced city traffic<br />
4. Reduced need for large parking lots<br />
5. Energy savings<br />
6. Increased general public productivity<br />
7. Cheaper prices<br />
...<br />
<br />
So the big question is, are we ready for online food shopping experience?HOWTO: Create your own Slide Show Gadget using WebAlbums and iGoogle APItag:www.techhui.com,2009-03-09:1702911:BlogPost:344472009-03-09T06:00:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
Besides programming all day, I also like to take pictures. One problem, is that after taking cool pictures, I tend to forget about them.. Recently I had some time on my hands to dig into Google technologies, especially their GData and Gadget API. Since I am already using things like iGoogle, Picasa, and WebAlbums, I wondered how difficult is it to put these technologies together to create a simple Slide Show Gadget. So in this post, I would like to discuss how to create your own Slide Show…
Besides programming all day, I also like to take pictures. One problem, is that after taking cool pictures, I tend to forget about them.. Recently I had some time on my hands to dig into Google technologies, especially their GData and Gadget API. Since I am already using things like iGoogle, Picasa, and WebAlbums, I wondered how difficult is it to put these technologies together to create a simple Slide Show Gadget. So in this post, I would like to discuss how to create your own Slide Show Gadget using WebAlbums and iGoogle API. First things first, Google provides excellent documentation on how to get <br />
<a href="http://code.google.com/apis/gadgets/docs/legacy/dev_guide.html">started</a>. A good place to experiment is <br />
<a href="http://code.google.com/apis/gadgets/docs/legacy/gs.html#GGE">Google Gadget Editor</a> or GGE, since it gives the ability to manage gadgets and publish them to iGoogle. It also has plenty of code samples to get you on your way. The only drawback is that GGE only supports legacy API. For developing gadgets using new API there is the <br />
<a href="http://www.google.com/ig/sandbox">Google Developer Sandbox</a>. It comes with some helpful tools including an option to turn off gadget caching. It is still in development mode, so not all gadget features are available. In this example we are going to use legacy API, because it supports most of the features discussed in this post. Secondly, you need to get your WebAlbums RSS feed. Login to WebAlbums, click on the album you'd like to syndicate, and click RSS link on the right. It looks somewhat like this: http://picasaweb.google.com/data/feed/base/user/YOUR_USERNAME/albumid/5297576827018401553?alt=rss&kind=photo&hl=en_US Once all is set up, you need to fetch your image data. <br />
<a href="http://code.google.com/apis/gadgets/docs/legacy/remote-content.html#Fetch_JSON">Working with Feeds</a> explains how to do this in greater detail. Here is an example <br />
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396574612?profile=original" alt="" width="528" height="132"></p> Once data is loaded, you need to parse it, which could look something like this:
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396574818?profile=original" alt="" width="535" height="116"></p> You can also use your favorite JavaScript library to make things a bit simpler. For example, to use
<a href="http://www.jquery.com">JQuery</a>, include the following: <br />
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396577114?profile=original" alt="" width="875" height="21"></p> Now, once you have extracted a list of image urls, how do you compile them into a slide show? And a bit more involved question is, how do you create fade in/out effect on image change? Here is one possible solution that works out pretty well..
<br> Create html with two image divs
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396578085?profile=original" alt="" width="637" height="72"></p> Add it to the container
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396578182?profile=original" alt="" width="320" height="24"></p> Use absolute positioning to lay divs on top of each other
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396580292?profile=original" alt="" width="263" height="179"></p> On change, fade-in one div as you fade-out the other
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396580456?profile=original" alt="" width="216" height="40"></p> To take care of animation, we need a way to get next image and a timer. We can use Math.random to randomize our photos or just continuously loop through image array. In this example we are going to use Math.random. To implement timer, we can use setTimeout(callback, millis), which executes callback function after specified 'millis' have elapsed. Here is the code. Notice how we are setting 'showSlide' function as the callback for 'setTimeout'
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396581239?profile=original" alt="" width="610" height="289"></p> Last step is to make sure that your request code is called on gadget load.
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396582976?profile=original" alt="" width="332" height="23"></p> That's it. Now you have your very own picture Slide Show Gadget! The coolest part is that now you can keep uploading pictures to your WebAlbums account and seeing them in your newly created gadget.. A word of advice is in order.. as you develop your gadgets, make sure to use gradual approach, as one single mistake can render your gadget unusable. Here are some possible improvements we can make to our gadget's functionality: - cache images (pre-load) - expose animation parameters via user preferences - provide a link to original image
<a href="http://groups.google.com/group/Google-Gadgets-API">iGoogle Developer Forum</a> is helpful in case you encounter any problems. End result looks something like this <br />
<p style="text-align: left;"><img src="http://storage.ning.com/topology/rest/1.0/file/get/396584052?profile=original" alt="" width="370" height="275"></p> Once your gadget is in iGoogle, you can view source by following these steps: - click on top arrow (in gadget header) - select 'About this gadget' - once on 'About' page, click on 'View source' located on the right Or you can also find source code
<a href="http://www.alohacruzonline.com/gadgets/aloha-cruz-feed/aloha-cruz-photo-gge.xml">here</a> :) One cool thing about Google Gadgets is that they are embeddable. Follow these steps to get embeddable script: - click on top arrow (in gadget header) - select 'About this gadget' - click on 'Embed this gadget' located on the right Feel free to use source code for this gadget for your development needs. Good luck with your gadget developments and Happy coding! <br />
<a href="http://ikayzo.com"><b>Ikayzo</b></a> - Design • Build • Localize | Web • Desktop • MobileIs Direct RIA the next Big Thing in Web development?tag:www.techhui.com,2009-03-01:1702911:BlogPost:337872009-03-01T03:30:00.000ZKonstantin A Lukinhttp://www.techhui.com/profile/KonstantinLukin
Being an open source web developer for the last 10 years, I have probably tried most of open source web related technologies out there in some flavor. It all started with good old HTML. To make a long story short, now web arena is populated with things like JSP, JSTL, JSF, etc.. and notably GWT. Even though JSP is still going to stick around, GWT revolutionized my development toolbox by introducing pure Java to the world of JavaScript. Some also like to call it JavaScript hell. It is true,…
Being an open source web developer for the last 10 years, I have probably tried most of open source web related technologies out there in some flavor. It all started with good old HTML. To make a long story short, now web arena is populated with things like JSP, JSTL, JSF, etc.. and notably GWT. Even though JSP is still going to stick around, GWT revolutionized my development toolbox by introducing pure Java to the world of JavaScript. Some also like to call it JavaScript hell. It is true, large projects that utilize a lot of JavaScript tend to get lost in a jungle of code. JavaScript with all of its frameworks out there tries to solve programming problems that UI developers faced for years. Laying out UI components on a screen and communicating with some flavor of data services. Up till now, GWT was a big winner in my book for large scale projects. Its power to code in Java was unbeatable when it came to structured UI approach. Its AJAX support, where programmers can send across Java objects, beats all others.<br />
<br />
So what could be even better? Well, GWT is client centric. This means that you write in Java, it gets compiled to JavaScript and eventually deployed on the client. What about a server centric approach? Can one still write in Java, possibly mix it with some flavor of UI tags for describing layouts, and have that compiled into a web application, say, by a servlet? What are the advantages? Well, with server centric approach AJAX becomes transparent. There is no longer a need to code a Service layer, since your UI classes are already visible on the server from the start. In fact, one can simply inject Spring or Hibernate into UI code without much problems..<br />
<br />
The reason for this post is because recently I came across a new framework for web developers, called <a href="http://www.zkoss.org/">ZK</a>. As I was reading in disbelief their sales pitch, it suddenly dawned on me what they are actually trying to accomplish. Direct RIA. Is it the next Big Thing in Web Development? Things are changing very quickly in web world, but I am surely going to give this one a try.<br />
<br />
For GWT gurus, highly encourage you to take a closer look at their <a href="http://www.zkoss.org/smalltalks/gwtZk/">GWT vs. ZK</a> page.<br />
<br />
For ExtJs disbelievers, they also have a pretty comprehensive <a href="http://www.zkoss.org/zkdemo/userguide/#f1">widget library</a>.<br />
<br />
ZK framework also supports <a href="http://www.zkoss.org/product/zkmobile.dsp">mobile</a> development on latest handset devices.<br />
<br />
Good luck on choosing the right framework for your next project and Happy coding!<br />
<br />
<p style="text-align:left"><img src="http://www.zkoss.org/img/ZK-main_pic.jpg"/></p>