<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Latest Posts</title><link>http://bulkan-evcimen.com/</link><description>Latest posts on bulkan-evcimen.com</description><language>en-au</language><lastBuildDate>Fri, 22 Feb 2013 11:17:01 -0000</lastBuildDate><item><title>Export Test Cases From Quality Center Using Python</title><link>http://bulkan-evcimen.com/export_test_cases_quality_center_using_python</link><description>&lt;p&gt;Here is a Python script that will export out test cases in a &lt;em&gt;folder&lt;/em&gt; from Quality Center into a CSV file. &lt;/p&gt;
&lt;p&gt;The following script will not handle Attachments. Will work on that later when I have time. &lt;/p&gt;
&lt;script src="https://gist.github.com/963655.js?file=qc.py"&gt;&lt;/script&gt;
</description><guid>http://bulkan-evcimen.com/export_test_cases_quality_center_using_python</guid></item><item><title>Building a Twitter Filter With CherryPy, Redis, and tweetstream</title><link>http://bulkan-evcimen.com/building_twitter_filter_cherrypy_redis_tweetstream</link><description>&lt;h2&gt;Background&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;questions.com is currently down. My slicehost VPS has been blacklisted by Twitter because I misread the documentation for tweetstream&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;all the code is available at https://github.com/bulkan/queshuns&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Since reading &lt;a href="http://simonwillison.net/2009/Oct/22/redis/"&gt;this post by Simon Willison&lt;/a&gt; 
I've been interested in &lt;a href="http://code.google.com/p/redis"&gt;Redis&lt;/a&gt; and have been following 
its development. After having a quick play around with Redis I've been looking
for a project to work on that uses Redis as a data store. I then came across this &lt;a href="http://www.digitalhobbit.com/2009/11/08/building-a-twitter-filter-with-sinatra-redis-and-tweetstream/"&gt;blog post&lt;/a&gt; by Mirko Froehlich, in which he shows the steps and code
to create a Twitter filter using Redis as the datastore and Sinatra as the web app. 
This blog post will explain how I created &lt;a href="http://queshuns.com"&gt;queshuns.com&lt;/a&gt;
in Python and the various listed tools below.&lt;/p&gt;
&lt;h2&gt;Tools&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://pypi.python.org/pypi/tweetstream"&gt;tweetstream&lt;/a&gt; - provides the interface to the Twitter Streaming API&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.cherrypy.org/"&gt;CherryPy&lt;/a&gt; - used for handling the web app side, no need for an ORM&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jinja.pocoo.org/2/"&gt;Jinja2&lt;/a&gt; - HTML templating&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt; - for doing the AJAXy stuff and visual effects&lt;/li&gt;
&lt;li&gt;&lt;a href="http://github.com/andymccurdy/redis-py"&gt;redis-py&lt;/a&gt; - Python client for Redis&lt;/li&gt;
&lt;li&gt;&lt;a href="http://code.google.com/p/redis/"&gt;Redis&lt;/a&gt; - the "database", look here for the documenation on how to install it&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;

&lt;h2&gt;Retrieving tweets&lt;/h2&gt;
&lt;p&gt;The first thing we need to is retrieve tweets from the Twitter Streaming API. Thankfully there 
is already a Python module that provides a nice interface called &lt;em&gt;tweetstream&lt;/em&gt;. For more
information about tweetstream look at the Cheeseshop page for its usage guide. &lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;Here is the code for the &lt;em&gt;filter_daemon.py&lt;/em&gt;, which when executed as a script from the command-line
will start streaming tweets from Twitter that contain the words "why", "how", "when", "lol", "feeling"
and the tweet must end in a question mark.&lt;br /&gt;
&lt;/p&gt;
&lt;script src="http://gist.github.com/263158.js?file=filter_daemon.py"&gt;&lt;/script&gt;

&lt;p&gt;In this script I define a class, &lt;em&gt;FilterRedis&lt;/em&gt; which I use to abstract some methods that will
be used by both &lt;em&gt;filter_daemon.py&lt;/em&gt; and later by the web app itself.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;The important part of this class is the &lt;em&gt;push&lt;/em&gt; method, which will push &lt;em&gt;data&lt;/em&gt; onto the tail of a Redis
list. It also keeps a count of items and when it goes over the threshold of 100 items,
it will trim starting from the head and the first 20th elements (or the oldest tweets).&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;schema&lt;/em&gt; for the tweet data that gets pushed into the Redis list is a dictionary 
of values that gets jsonified (we can probably use then new Redis hash type);&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;{ 'id':"the tweet id",
  'text':"text of the tweet",
  'username':",
  'userid':"userid",
  'name': "name of the twitter user",
  'profile_image_url': "url to profile image",
  'received_at':time.time() }&lt;br /&gt;
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;'received_at' is important because we will be using that to find &lt;em&gt;new&lt;/em&gt; tweets to 
display in the web app.&lt;/p&gt;
&lt;h2&gt;Web App&lt;/h2&gt;
&lt;p&gt;I picked CherryPy to write the web application, because I wanted to learn it for the future
when I need to write a small web frontends that dont need an ORM. Also, CherryPy has a built-in
HTTP server that is &lt;em&gt;sufficient&lt;/em&gt; for websites with small loads, which I initially used to run 
&lt;a href="http://queshuns.com"&gt;queshuns.com&lt;/a&gt; it is now being run with mod_python. For templating, I used Jinja2 because its similair 
in syntax to the Django templating language that I am familiar with. &lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;The following is the code for &lt;em&gt;questions_app.py&lt;/em&gt; which is the CherryPy application.&lt;/p&gt;
&lt;script src="http://gist.github.com/263167.js?file=questions_app.py"&gt;&lt;/script&gt;

&lt;p&gt;The &lt;em&gt;index&lt;/em&gt; (method) of the web app will get the all the tweets from Redis. The other exposed&lt;br /&gt;
function is &lt;em&gt;latest&lt;/em&gt; which accepts an argument &lt;em&gt;since&lt;/em&gt; which is used to get
tweets that are newer (&lt;em&gt;since&lt;/em&gt; is the latest tweets received_at value). &lt;em&gt;nt&lt;/em&gt; is
used to create a different URL each time so that IE doesn't cache it. This method returns 
JSON at. &lt;/p&gt;
&lt;p&gt;The templates are located in a directory called &lt;em&gt;templates&lt;/em&gt; :) &lt;/p&gt;
&lt;p&gt;Here is the template for the root/index of the site; index.jinja&lt;br /&gt;
&lt;/p&gt;
&lt;script src="http://gist.github.com/263172.js?file=gistfile1.htm"&gt;&lt;/script&gt;

&lt;p&gt;This template will be used to render a list of tweets and also assign the first
tweets &lt;em&gt;recieved_at&lt;/em&gt; value to a variable on the &lt;em&gt;window&lt;/em&gt; object. This is used by 
the &lt;em&gt;refreshTweets&lt;/em&gt; function which will pass it on to /latest in a GET parameter. 
&lt;em&gt;refreshTweets&lt;/em&gt; will try to get new tweets and prepend it to the &lt;em&gt;content&lt;/em&gt; div
and then slide the &lt;em&gt;latest&lt;/em&gt; tweets. This is the template used to render the HTML
for the latest tweets;&lt;br /&gt;
&lt;/p&gt;
&lt;script src="http://gist.github.com/263175.js?file=gistfile1.htm"&gt;&lt;/script&gt;

&lt;p&gt;I explicitly set the the &lt;em&gt;latest&lt;/em&gt; div to "display: none" so that I can animate it.&lt;/p&gt;
&lt;p&gt;Now we should be able to run questions_daemon.py to start retrieving tweets then start
questions_app.py to look at the web app. On your browser go to http://localhost:8080/ 
and if everything went correctly you should see a list of tweets that update every 10 seconds.&lt;/p&gt;
&lt;p&gt;Thats it. Hope this was helpful.&lt;/p&gt;
</description><guid>http://bulkan-evcimen.com/building_twitter_filter_cherrypy_redis_tweetstream</guid></item><item><title>Baş Taksım - Bulkan Evcimen - (736 Şeb-i Arus - Avusturalya) </title><link>http://bulkan-evcimen.com/bas_taksim_bulkan_evcimen_736_sebi_arus</link><description>&lt;p&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/p97qTE9i6bA&amp;hl=en_US&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/p97qTE9i6bA&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/p&gt;
</description><guid>http://bulkan-evcimen.com/bas_taksim_bulkan_evcimen_736_sebi_arus</guid></item><item><title>jQuery.get and IE7</title><link>http://bulkan-evcimen.com/jquery_get_ie7</link><description>&lt;p&gt;I've been recently playing around with jQuery and some AJAXy stuff using jquery.get to request a piece of HTML. Like any sane web developer I use Firefox and Firebug and everything worked as expected. But then I decided to try Internet Explorer 7 (yeah i'm crazy like that). Well the AJAX call didn't work. Actuallyjquery.get was executed but the callback function didn't get &lt;em&gt;ehh&lt;/em&gt; called. I spent quite a few hours googling I didn't find anything directly to solve my problem.&lt;br /&gt;
&lt;a href="http://groups.google.com/group/jquery-en/browse_thread/thread/a020397793239c51/01c74f0b75dd3f49?lnk=gst&amp;amp;q=get+ie7+callback#01c74f0b75dd3f49"&gt;This Google Group post&lt;/a&gt; kind of helped. 
&lt;/p&gt;
&lt;p&gt;I read on the &lt;a href="http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype"&gt;jQuery docs&lt;/a&gt; that the callback to get will only execute if data is loaded. Don't know why data wasn't being loaded when IE7 issued the get (maybe because of &lt;a href="http://groups.google.com/group/jquery-en/browse_thread/thread/a40b6fb572232e3b/662932a169dd4e14?lnk=gst&amp;amp;q=%24.ajax%28%29+firefox+ie7#662932a169dd4e14"&gt;caching&lt;/a&gt; ). So I decided to change the back end code to return JSON instead and use jquery.getJSON. With this change IE7 getJSON successfully got data back from the server. 
&lt;/p&gt;
</description><guid>http://bulkan-evcimen.com/jquery_get_ie7</guid></item><item><title>Install Shield Silent Installs</title><link>http://bulkan-evcimen.com/installshield_silent_installs</link><description>&lt;p&gt;Install Shield has this nifty feature of being able to install packages in silent mode. This means that you can run &lt;em&gt;setup.exe&lt;/em&gt; from the command prompt and it will install in the background with no user interaction. This is very useful if you want to test your installation. If you use some sort of continuous integration system (and you should if you don't) then you could download the latest installer do a silent install and run some tests against the program that is installed, then silent uninstall it all automat(g)ically.
&lt;/p&gt;
&lt;p&gt;To be able to do silent installs/un-installs you first need to record a response file that contains all the choices for the install shield dialogs.
&lt;/p&gt;
&lt;p&gt;To record the response file;
&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;setup.exe -r
&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;This will be like a normal install done manually. Follow it through like you would in any normal installation. After the installer exits, the response file should be at &lt;code&gt;C:\Windows\setup.iss&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;Next time around you can do a silent install by running
&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;setup.exe -s -f1&lt;path to setup.iss&gt;
&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;I'm paranoid so I use the absolute path to the response file. There is no space between "-f1" and the path to setup.iss. Note that, when you run the 
   above command to silent install, the command will seem to exit immediately but if you check Task Manager you should see setup.exe (possibly 2 of them) running. 
&lt;/p&gt;
&lt;p&gt;Silent un-installation is pretty much the same. You need to create a response file first. To do this run the following;
&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;setup.exe -r -uninst -removeonly
&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;This will again create a &lt;em&gt;setup.iss&lt;/em&gt; file in &lt;code&gt;C:\Windows&lt;/code&gt; I usually rename the uninstall response file as &lt;em&gt;uninst.iss&lt;/em&gt;. Now you can do silent uninstallation by
   running;
&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;setup.exe -s -uninst -removeonly -f1&lt;path to response file&gt;
&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;Some installers might install the program under different GUID's each time you install it. If this is the case I have found that the above command for uninstallation doesn't work,
   as Install Shield doesn't know &lt;em&gt;what&lt;/em&gt; to uninstall. The solution is to work out the &lt;em&gt;UninstallString&lt;/em&gt; from the Registry (which is what Windows uses to uninstall the program via Add/Remove Software).
&lt;/p&gt;
&lt;p&gt;Here is a python script that uses the registry module (http://pypi.python.org/pypi/registry/) to find out the full UninstallString. You first need to manually find this string 
   in your registry by looking under &lt;code&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall&lt;/code&gt; so that you can pass into this function a unique
   string that is present in the UninstallString of your program
&lt;/p&gt;
&lt;p&gt;EDIT: the following script is quite ugly actually. I have a new version in which I use regobj it makes things easier.
&lt;/p&gt;
&lt;p&gt;&lt;script src="http://gist.github.com/245264.js?file=uninstall.py"&gt;&lt;/script&gt;
&lt;/p&gt;
</description><guid>http://bulkan-evcimen.com/installshield_silent_installs</guid></item><item><title> Hicaz Peşrev (Salim Bey), Son Yürük Semai ve Taksim</title><link>http://bulkan-evcimen.com/hicaz_pesrev_son_yuruk_taksim</link><description>&lt;p&gt;&lt;object width="320" height="240" &gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://www.facebook.com/v/202801218416" /&gt;&lt;embed src="http://www.facebook.com/v/202801218416" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="240"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/p&gt;
</description><guid>http://bulkan-evcimen.com/hicaz_pesrev_son_yuruk_taksim</guid></item><item><title>Running QTP tests using Python</title><link>http://bulkan-evcimen.com/running_qtp_test_using_python</link><description>&lt;p&gt;QTP provides an interface called the &lt;strong&gt;automation object model&lt;/strong&gt;. This &lt;strong&gt;model&lt;/strong&gt; is essentially a COM interface providing a bunch of objects that can be used to automate QTP. The full object list is available in the &lt;strong&gt;QuickTest Professional Automation&lt;/strong&gt; documentation.
&lt;/p&gt;
&lt;p&gt;Running QTP tests from the command line is useful for doing scheduled automatic testing. If you use a continuous integration system to do automatic builds of your software, you can run your QTP tests on the latest build. 
&lt;/p&gt;
&lt;p&gt;The following is a Python script that is able to run a test and print out &lt;em&gt;Passed&lt;/em&gt; or &lt;em&gt;Failed&lt;/em&gt;.  It is a direct port of example code in the documentation written in VBScript
&lt;/p&gt;
&lt;p&gt;&lt;script src="http://gist.github.com/188917.js"&gt;&lt;/script&gt;
&lt;/p&gt;
</description><guid>http://bulkan-evcimen.com/running_qtp_test_using_python</guid></item><item><title>Hicaz Taksim</title><link>http://bulkan-evcimen.com/hicaz_taksim</link><description>&lt;p&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/V0DZ-rcSn5M&amp;hl=en&amp;fs=1&amp;color1=0x234900&amp;color2=0x4e9e00"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/V0DZ-rcSn5M&amp;hl=en&amp;fs=1&amp;color1=0x234900&amp;color2=0x4e9e00" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/p&gt;
</description><guid>http://bulkan-evcimen.com/hicaz_taksim</guid></item><item><title>Evcara Saz Semai - Dilhayat Kalfa</title><link>http://bulkan-evcimen.com/evcara_ss_dilhayat_kalfa</link><description>&lt;p&gt;&lt;object width="320" height="240" &gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://www.facebook.com/v/156833758416" /&gt;&lt;embed src="http://www.facebook.com/v/156833758416" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="240"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/p&gt;
</description><guid>http://bulkan-evcimen.com/evcara_ss_dilhayat_kalfa</guid></item><item><title>Aşk-Efza Saz Eseri - Sadettin Arel</title><link>http://bulkan-evcimen.com/ask_efza_ss_sadettin_arel</link><description>&lt;object width="320" height="240" &gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://www.facebook.com/v/127628728416" /&gt;&lt;embed src="http://www.facebook.com/v/127628728416" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="240"&gt;&lt;/embed&gt;&lt;/object&gt;
</description><guid>http://bulkan-evcimen.com/ask_efza_ss_sadettin_arel</guid></item></channel></rss>