<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-36227597</id><updated>2011-11-28T03:25:17.277+04:00</updated><category term='images'/><category term='mobile'/><category term='xml'/><category term='knowledge'/><category term='idea'/><category term='proxy'/><category term='web'/><category term='php'/><category term='hypertext'/><category term='l10n'/><category term='open source'/><category term='IDE'/><category term='Test Automation'/><category term='SOAP'/><category term='print'/><category term='wikipedia'/><category term='social networks'/><category term='cgi'/><category term='git'/><category term='clr'/><category term='generics'/><category term='RoR'/><category term='.net'/><category term='SSL'/><category term='version control'/><category term='machine learning'/><title type='text'>Margin is too small to contain this</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-36227597.post-6750841069060799554</id><published>2009-02-16T18:50:00.003+03:00</published><updated>2009-02-18T19:00:01.323+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='idea'/><category scheme='http://www.blogger.com/atom/ns#' term='version control'/><category scheme='http://www.blogger.com/atom/ns#' term='git'/><title type='text'>Method history - time dimension of code repositories</title><content type='html'>Recently I've been looking into various aspects of integration between various version control systems and &lt;a href="http://www.jetbrains.com/idea/"&gt;Itellij IDEA - one of the best Java IDEs around&lt;/a&gt;. Although they did a great job with their new version in terms of performance and feature set, but I feel that VCS is conceptually on the same level where VisualStudio with MS SCC API was decade ago. Yes, JetBrains have added integration of changes between SVN branches, but frankly speaking, do you really need this is your IDE or external tool will work for you?&lt;br /&gt;I feel that we need more fresh ideas in this space. Something that you typically don't expect, out of version control like &lt;a href="http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html"&gt;git-bisect&lt;/a&gt;. For instance, it would be much more interesting if I will be able to view revision history on the level of individual methods in Java code, rather than on the file itself. This way I would be quickly answering questions like "who and why wrote this piece of s..t?". This question very often comes to me even if I'm hacking in my own code, not only someone else :) &lt;a href="http://www.kernel.org/pub/software/scm/git/docs/git-blame.html"&gt;Git-blame&lt;/a&gt; is similar, but it does not understand the programming language (which IDEA does very well), so it is operating on the level of lines, rather than meaningful pieces of code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-6750841069060799554?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/6750841069060799554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=6750841069060799554' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/6750841069060799554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/6750841069060799554'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2009/02/method-history-time-dimension-of-code.html' title='Method history - time dimension of code repositories'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-6529561123836757059</id><published>2009-02-16T16:24:00.002+03:00</published><updated>2009-02-16T16:28:07.669+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wikipedia'/><category scheme='http://www.blogger.com/atom/ns#' term='knowledge'/><category scheme='http://www.blogger.com/atom/ns#' term='hypertext'/><title type='text'>Telescopic text – a form of lightweight hypertext</title><content type='html'>I don’t like helps and software documentation. I’m only looking there if there is no other choice. And I’m getting really frustrated reading it, because typically the assumption that every technical writer is doing about reader’s knowledge is wrong when it’s applied to me (bad luck?). I’m either know too little (so the text is cryptic) or they are trying to explain me everything from the first grade of elementary school so I’m spending ages scrolling down dozens of pages in order to find what I’m looking for.&lt;br /&gt;Wouldn’t it be nice to have a system, which shows you condensed high-level description, and if you don’t know something, you drilling down there? Sounds like a hyper-text and &lt;a href="http://wikipedia.org/"&gt;Wikipedia&lt;/a&gt; is doing that for ages? Not exactly, when you are clicking on some term, you are leaving the page that you are reading at the moment. Typically reader wants to stay on the same page, but get more details here, right in the text. Recently I found an example of such approach called &lt;a href="http://www.telescopictext.com/"&gt;telescopic text&lt;/a&gt;, where you can click on the piece of text and "expand" it. So the technical writer would be creating a text with maximum details assuming that the reader is an idiot. After that one can markup some pieces of it into "collapsible" chunks. Well, it is probably not that simple, because we need normal text on any level, so some form of morphoanalysis might be involved, but it should be doable at least for English. System should be able to identify correlation between "expand" behavior and act proactively – if someone doesn’t what is the "database", we can automatically expand "first normal form" as well. Ideally the system should be able to learn user's level of knowledge in the specific area and present text in the form most conveniently suitable for her (e.g. minimum amount of expand/collapse needed).&lt;br /&gt;Learning might finally get more fun. :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-6529561123836757059?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/6529561123836757059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=6529561123836757059' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/6529561123836757059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/6529561123836757059'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2009/02/telescopic-text-form-of-lightweight.html' title='Telescopic text – a form of lightweight hypertext'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-1350029929344489076</id><published>2008-08-09T13:49:00.008+04:00</published><updated>2008-08-11T10:05:55.170+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><category scheme='http://www.blogger.com/atom/ns#' term='RoR'/><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='idea'/><category scheme='http://www.blogger.com/atom/ns#' term='web'/><title type='text'>Web-based IDE for Ruby on Rails</title><content type='html'>I was following a couple of web-based IDEs like &lt;a href="http://codeide.com/"&gt;CodeIDE&lt;/a&gt; or &lt;a href="http://ecco.sourceforge.net/"&gt;ECCO&lt;/a&gt;. All of them seem to be more toys rather then actually useful tools. My understanding is that this is partially because of modest project goals and partially - limitations of technology. Let me expand why I believe it can work.&lt;br /&gt;The advantage of web-based IDE is obvious – anyone, who is doing software development for a living knows how many you need to do before start coding. The idea of having web access to already configured environment where you can contribute anytime you want from any browser looks attractive. But the limitations are obvious as well. Do you think it will work in C/++ world? I really doubt that. Even with modern web-based sharing solutions like WebEx that does not sound realistic. Will it work for huge JavaEE project? Well, easy processing of large text amounts in &lt;a href="http://docs.google.com/"&gt;Google Docs&lt;/a&gt; or &lt;a href="https://buzzword.acrobat.com/"&gt;Adobe Buzzword&lt;/a&gt; still not comfortable (yet :). We need a technology that produces output, viewable in browser and does not require megabytes of coding. It looks like Ruby on Rails sounds like an ideal choice (especially taking in mind that good RoR IDE is still missing).&lt;br /&gt;Imaging being able to issue all rails commands with nice and clean UI, have a nice refactoring code editor in flash and even ability to debug RoR application. Of cause UI is the most trickiest part – it will not be possible to mimic standalone IDE, we need to do the same tweak that GMail creators did when they were re-thinking classical email client folder tree. But this certainly doable and it would minimize threshold for contribution in open source projects.&lt;br /&gt;It is also very important to provide seamless integration with version control. In fact, the whole development process can be built around tasks, and task descriptions can act as a descriptions for check-ins (and thus provide meaningfull history of changes).&lt;br /&gt;Also I assumes that this would broaden the audience of developers, so we need to make sure that only quality pieces of code gets to the repository. We need to have good automatic checks built-in the system, that prevents check-in of bad code (similair to FxCop in TFS) and we need to provide a possibility to manually review check-ins before integrating them into main branch (that's why &lt;a href="http://git.or.cz"&gt;git&lt;/a&gt; might have advantage over svn)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-1350029929344489076?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/1350029929344489076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=1350029929344489076' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/1350029929344489076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/1350029929344489076'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2008/08/web-based-ide-for-ruby-on-rails.html' title='Web-based IDE for Ruby on Rails'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-3469772939852153249</id><published>2008-05-25T13:08:00.019+04:00</published><updated>2008-08-10T21:36:32.859+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='machine learning'/><title type='text'>Feature elimination in RapidMiner</title><content type='html'>Recently I've discovered &lt;a href="http://rapid-i.com/content/blogcategory/10/69/lang,en/"&gt;RapidMiner - data mining application&lt;/a&gt;. It has quite good, but huge tutorial, where you can read section 3 and 4 to get the impression of what this tool can do for you. Essentially, as input it gets sample data, where each instance is described as a vector of features (e.g. size, weight, color) and indication to which class this instance belongs to. The processing typically consists of pre-processing (converting of feature values in more appropriate format, eliminating features, that does not bring any additional information, etc.), machine learning (it has &lt;a href="http://rapid-i.com/content/view/12/33/lang,en/"&gt;quite a few algorithms&lt;/a&gt;) and post-processing. In the software, you have something similar to IDE, where you can visually construct process from the existing building blocks. Typical problem with this approach is how to map outputs of previous block to inputs of the succeeding one. They seem to choose the most simplest solution, assuming that all outputs has certain type, and there can be only one input/output of certain type. Obviously they were targeting on data mining specialists, so user should not worry about such details.&lt;br /&gt;I was trying to apply it to my task, which essentially is a subset of the whole process. I have a vector of features and I know for sure the way to classify them - take maximum value among features (which is either -1, 0 or 1) and use it as class. I need to get smallest possible subset of features that still get 100% match with initial classification. It appears that there are 2 ways of doing that in RapidMiner:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Directly alter Model file saved on disk - extremely difficult because model file is just a serialized xml-dump of java class, so even the smallest one is 70K&lt;/li&gt;&lt;li&gt;Use ability to generate new attributes based on existing set as a model&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;And here I faced the problem, which is typical for all WYSIWYG editors, that helps you to build your program from building blocks. As long as you are doing samples - everything work fine. If you need to do one step off-road, you are in dust. I can create a new attribute, but it will have type &lt;i&gt;regular&lt;/i&gt;, but all validators expects to see labels which has type &lt;i&gt;predicted(label)&lt;/i&gt;. And user is not intended to change types of attributes, because it is dangerous.&lt;br /&gt;I'm apologizing if there is a simple way of solving my task, but I think it is a very good illustration of how programming works. If you are constructing a new development environment, and even if you are targeting on non-developers, you need to make sure that there is "advanced" way, where you have no constraints. No one can predict all the cases how your system will be used. Just hide a candy deep enough so only geeks can find it.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-3469772939852153249?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/3469772939852153249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=3469772939852153249' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/3469772939852153249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/3469772939852153249'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2008/05/feature-elimination-in-rapidminer.html' title='Feature elimination in RapidMiner'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-5102658296875615347</id><published>2008-04-06T13:14:00.005+04:00</published><updated>2008-08-11T10:06:56.446+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><category scheme='http://www.blogger.com/atom/ns#' term='idea'/><category scheme='http://www.blogger.com/atom/ns#' term='l10n'/><category scheme='http://www.blogger.com/atom/ns#' term='web'/><title type='text'>Simplify localization contribution for open source projects</title><content type='html'>Recently I've been played a bit with &lt;a href="http://www.videolan.org/vlc"&gt;VLC player&lt;/a&gt; (mostly fixing bugs in ftp and avi modules). Their idea of localization is that someone has to request corresponding .po-file in mailing list and load it in &lt;a href="http://www.poedit.net/"&gt;poEdit&lt;/a&gt;. I think this is a wrong idea for open source projects. Here you suppose to welcome and simplify contribution of the people, maintaining reasonable level of quality at the same time. A lot of people is willing to donate some of their time for localization on their native language, if setup is not complicated. Aiming to use those, who is willing to spent 15+ minutes can make a real difference in timeline for getting localized versions.&lt;br /&gt;So, first of all, the solution should be web-based (like &lt;a href="https://launchpad.net/rosetta"&gt;Rosetta&lt;/a&gt;). Second, it should be as simple in setting up/login as possible (username/password/captcha). Third - show one resource-string to be translated at the time. poEdit and other professional translating tools are showing the whole table of "language pairs" - correspondence between phrases on the source and target language. And this make sense if you are targeting on professional translator, not occasional one. Here the whole concept of UI should be build around this "one phrase" translation. In addition to source phrase you can show google translation (using their &lt;a href="http://googlified.com/2006unofficial-google-translate-api/"&gt;unofficial api&lt;/a&gt;), and translation of phrases, that has some specific terms for the application (to ensure consitent vocabulary across all translation). User should be able to skip this translation and proceed to the next one, or save one's translation, if it passes certain verification rules (such as presents of %d, %s in translated text, which is corresponding to source one, etc)&lt;br /&gt;Ability to perform translation on the level of individual phrases makes it easy to perform simultaneous translation of one file by several people (does not have to merge changes afterwards)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-5102658296875615347?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/5102658296875615347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=5102658296875615347' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/5102658296875615347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/5102658296875615347'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2008/04/idea-simplify-localization-contribution.html' title='Simplify localization contribution for open source projects'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-7163108738234013972</id><published>2008-03-16T12:02:00.013+03:00</published><updated>2008-08-11T10:07:08.880+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='idea'/><category scheme='http://www.blogger.com/atom/ns#' term='social networks'/><title type='text'>Syncronization of your contact pictures</title><content type='html'>Almost any review of the mobile phone features photo of incoming call, where you can see nice and clean picture of the caller. This looks really good, but I've never seen anyone, who is succesfully using this feature. And the reason is very simple - even with the cameraphone it is extremely difficult to maintain a database of quality pictures for your contacts. Especially if you are changing your phone once a year :)&lt;br /&gt;I think this situation opens a niche for the nice piece of software. Someone forwarded me a linke to &lt;a href="http://www.spokeo.com/"&gt;Spokeo&lt;/a&gt; - agregator over multiple on-line services, which is able to present you what are your friends doing in your favourites social networks and services like Picasa. I was amazed how easily this service retrives various information (including pictures) about my buddies from my google address book and social network friend lists. What if someone will create a service, that will be able to update your mobile phone address book with pictures, retrived from &lt;a href="http://www.linkedin.com/"&gt;LinkedIn&lt;/a&gt;, &lt;a href="http://www.facebook.com/"&gt;Facebook&lt;/a&gt; or &lt;a href="http://www.vkontakte.ru/"&gt;VKontakte&lt;/a&gt;? &lt;p&gt;&lt;/p&gt;&lt;p&gt;It should be able to operate via &lt;a href="http://code.google.com/apis/opensocial/"&gt;OpenSocial API&lt;/a&gt; or custom html parsing, shows you a screen where one can manually match your friends and contacts in your address book (of cause system should attempt to do as much automatic matches as possible) and update your phone contact list.&lt;/p&gt;&lt;p&gt;Basically there are 2 possible ways how this can reach user. It can be mobile application, which user can buy for the fixed price and use it on one's phone as many time as possible. This probably will not going to work on j2me, but sounds like ideal case for iPhone (with its centralized software store). Technologically it can be implemented as Windows Mobile application as well, but it will be less appealing for the user&lt;/p&gt;&lt;p&gt;The other option would be to create on-line service with &lt;a href="http://silverlight.net/"&gt;Silverlight&lt;/a&gt; front-end. This front-end should be able to communicate with ActiveSync, iTunes, Nokia suite or whatever sync software is installed. There will be no problems with delivering updates for the users. The only reliable way to monetize this service will be paid SMS, because the target audience is 15-25 years old, and they will unlikely visit site frequently (so ads will not work).&lt;br /&gt;&lt;br /&gt;Update: Did not do my homework properly: &lt;a href="http://www.melsam.com/outsync/"&gt;Outsync&lt;/a&gt; performs photo-sync between Facebook and Outlook (so it can get to your WindowsMobile afterwards). Fortunately it is .NET based, so someone might adopt it to your favorite social network as well :)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-7163108738234013972?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/7163108738234013972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=7163108738234013972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/7163108738234013972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/7163108738234013972'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2008/03/idea-syncronization-of-your-contact.html' title='Syncronization of your contact pictures'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-6314965897800715655</id><published>2007-11-09T12:20:00.003+03:00</published><updated>2008-08-11T10:01:23.376+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='web'/><category scheme='http://www.blogger.com/atom/ns#' term='cgi'/><title type='text'>Setup PHP on Xitami</title><content type='html'>Recently I had a nessecity to quickly setup PHP development environment. I've read a couple of HOW-TO articles, and since it was not so easy to install IIS on my laptop, I decided to download and install &lt;em&gt;Xitami&lt;/em&gt; 2.5 web-server. PHP 5.20 installer claims that it will configure this server automatically, but apparently it does not (I suspect that it was because I've installed everything to &lt;em&gt;%Program Files%&lt;/em&gt;). Ok, there was a manual step-by-step instruction, but it also doesn't work very well. At the end of the day, I found the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If you specify &lt;em&gt;php-cgi.exe&lt;/em&gt; as a filter for &lt;em&gt;.php&lt;/em&gt;-extension, it will not work with aliases, only with real directories under your web-root&lt;/li&gt;&lt;li&gt;If you use &lt;em&gt;php.exe&lt;/em&gt;, it will work with your aliases, but it &lt;em&gt;$_GET&lt;/em&gt; and &lt;em&gt;$_POST&lt;/em&gt; will always be empty&lt;/li&gt;&lt;/ul&gt;So the solution is to use php-cgi together with symlinks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-6314965897800715655?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/6314965897800715655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=6314965897800715655' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/6314965897800715655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/6314965897800715655'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2007/11/setup-php-on-xitami.html' title='Setup PHP on Xitami'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-2300836602335271298</id><published>2007-09-06T16:46:00.003+04:00</published><updated>2008-08-10T21:40:14.951+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOAP'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><title type='text'>Fun with web-services and unqualified elementFormDefault</title><content type='html'>Recently I was participating in writing client for document-style binding web-service. This is the first time I saw such wsdl in the field, so I immediately wrote a small test application in VS.NET 2005. Although invoke appears to be working normally, I got null response instead of some actual data. I spent a whole week blaming authors of the web service, but they convince me that the problem was on the client side. It was quite difficult to intercept soap messages, because they were using https, but I found an interesting &lt;a href="http://ilvyanyatka.spaces.live.com/blog/cns%21EA0C02AB2E2FCFAC%21115.entry"&gt;post&lt;/a&gt; how you can get them from &lt;span style="FONT-STYLE: italic"&gt;SoapHttpClientProtocol&lt;/span&gt;. Using this small hack, I was able to observe the resulting envelope, that did contains response, which looks legitimate. But at the end in the corresponding C# object I still got nulls. The wsdl begins with the following declaration:&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:110;"&gt;&amp;lt;wsdl:definitions name="testservice"&lt;br /&gt;     targetNamespace="http://www.testservice.com"&gt;&lt;br /&gt;&amp;lt;wsdl:types&gt;&lt;br /&gt; &amp;lt;xsd:schema elementFormDefault="unqualified"&lt;br /&gt;      targetNamespace="http://www.testservice.com/test"&gt;&lt;br /&gt;   &amp;lt;xsd:element name="response"&gt;&lt;br /&gt;     &amp;lt;xsd:complextype&gt;&lt;br /&gt;       &amp;lt;xsd:sequence&gt;&lt;br /&gt;         &amp;lt;xsd:element name="ident" type="xsd:string"&gt;&lt;br /&gt;         &amp;lt;xsd:element name="number" type="xsd:string"&gt;&lt;br /&gt;       &amp;lt;/xsd:sequence&gt;&lt;br /&gt;     &amp;lt;/xsd:complextype&gt;&lt;br /&gt;....&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;Visual Studio generate me a corresponding class called &lt;span style="FONT-STYLE: italic"&gt;response &lt;/span&gt;with 2 properties, that has &lt;span style="FONT-STYLE: italic"&gt;Unqualified &lt;span style="FONT-STYLE: italic"&gt;&lt;/span&gt;System.Xml.Serialization.XmlTypeAttribute&lt;/span&gt;. Apparently, Axis on the server side was sending me a message, where both &lt;span style="FONT-STYLE: italic"&gt;ident &lt;/span&gt;and &lt;span style="FONT-STYLE: italic"&gt;number &lt;/span&gt;was in &lt;span style="FONT-STYLE: italic"&gt;http://www.testservice.com/test&lt;/span&gt; namespace, which contradicts with the schema definition above. This was the reason why deserialization from XML does produce nulls. At least this time Microsoft proofs to support standards better than Apache Foundation :)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-2300836602335271298?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/2300836602335271298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=2300836602335271298' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/2300836602335271298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/2300836602335271298'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2007/09/fun-with-web-services-and-unqualified.html' title='Fun with web-services and unqualified elementFormDefault'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-6627896241224664589</id><published>2007-08-14T13:32:00.002+04:00</published><updated>2008-08-11T09:59:30.144+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='clr'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><title type='text'>Surviving after StackOverflowException</title><content type='html'>In one of my pet projects, there is a necessity to continue execution after &lt;span style="FONT-STYLE: italic"&gt;StackOverflowException&lt;/span&gt; occurs in separate &lt;span style="FONT-STYLE: italic"&gt;AppDomain&lt;/span&gt;. After quick scanning MSDN, I found out that I need to obtain &lt;span style="FONT-STYLE: italic"&gt;CLRRuntimeHost&lt;/span&gt;, get &lt;span style="FONT-STYLE: italic"&gt;CLRControl &lt;/span&gt;after that &lt;span style="FONT-STYLE: italic"&gt;CLRPolicyManager &lt;/span&gt;and finally apply appropriate policy. Of cause you cannot do this trick, when you are inside managed code, so you have to write you own non-CLR c++ module, that apply corresponding policy and run you managed code. It was not clear, how to do this, but I found a good book with variety of samples: &lt;a href="http://www.amazon.com/Customizing-Microsoft-Framework-Language-Runtime/dp/0735619883"&gt;"Customizing the Microsoft® .NET Framework Common Language Runtime"&lt;/a&gt; by Steven Pratschner. Unfortunately neither of the sources address my particular case with &lt;span style="FONT-STYLE: italic"&gt;StackOverflowException&lt;/span&gt;. I've tried to use &lt;span style="FONT-STYLE: italic"&gt;SetActionOnFailure()&lt;/span&gt; with all documented &lt;span style="FONT-STYLE: italic"&gt;EClrFailure &lt;/span&gt;values, but as soon as &lt;span style="FONT-STYLE: italic"&gt;StackOverflowException &lt;/span&gt;was thrown, the whole process was killed. During my research I found sources of the Common Language Infrastructure (published by Microsoft under Shared Source license), and discovered that there is another undocumented value of &lt;span style="FONT-STYLE: italic"&gt;EClrFailure &lt;/span&gt;called &lt;span style="FONT-STYLE: italic"&gt;FAIL_StackOverflow&lt;/span&gt;. Based on the comment in file &lt;span style="FONT-STYLE: italic"&gt;eepolicy.cpp&lt;/span&gt; in method &lt;span style="FONT-STYLE: italic"&gt;EEPolicy::HandleStackOverflow()&lt;/span&gt; it appears that:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The only possible actions for &lt;span style="FONT-STYLE: italic"&gt;FAIL_StackOverflow&lt;/span&gt; are &lt;span style="FONT-STYLE: italic"&gt;eRudeUnloadAppDomain &lt;/span&gt;and &lt;span style="FONT-STYLE: italic"&gt;eRudeExitProcess&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="FONT-STYLE: italic"&gt;eRudeUnloadAppDomain&lt;/span&gt; will be executed only if domain to be unloaded is non-default&lt;/li&gt;&lt;/ul&gt;After that everything works like a charm. Usually &lt;span style="FONT-STYLE: italic"&gt;AppDomainUnloadedException &lt;/span&gt;is thrown to the calling code. Below is a snapshot of very simple CLRHost, that specifies action on failure and run specific method in assembly:&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:110;"&gt;&lt;br /&gt;int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR szCmd, int nCmd){&lt;br /&gt;  ICLRRuntimeHost *runtime;&lt;br /&gt;&lt;br /&gt;  HRESULT hr = CorBindToRuntimeEx(&lt;br /&gt;                  L"v2.0.50727",&lt;br /&gt;                  L"wks",&lt;br /&gt;                  STARTUP_LOADER_OPTIMIZATION_SINGLE_DOMAIN,&lt;br /&gt;                  CLSID_CLRRuntimeHost,&lt;br /&gt;                  IID_ICLRRuntimeHost,&lt;br /&gt;                  (void **)&amp;amp;runtime);&lt;br /&gt;&lt;br /&gt;  ICLRControl *pCLRControl = NULL;&lt;br /&gt;  runtime-&gt;GetCLRControl(&amp;amp;pCLRControl);&lt;br /&gt;&lt;br /&gt;  ICLRPolicyManager* pCLRPolicyManager = NULL;&lt;br /&gt;  hr = pCLRControl-&gt;GetCLRManager(IID_ICLRPolicyManager,&lt;br /&gt;                                 (PVOID*)&amp;amp;pCLRPolicyManager);&lt;br /&gt;&lt;br /&gt;  hr = pCLRPolicyManager-&gt;SetActionOnFailure(FAIL_StackOverflow,&lt;br /&gt;                          eRudeUnloadAppDomain);&lt;br /&gt;&lt;br /&gt;  runtime-&gt;Start();&lt;br /&gt;&lt;br /&gt;  DWORD retVal = 0;&lt;br /&gt;  runtime-&gt;ExecuteInDefaultAppDomain(L"Test.exe",&lt;br /&gt;                                     L"Test.Program",&lt;br /&gt;                                     L"Start",&lt;br /&gt;                                     NULL,&lt;br /&gt;                                     &amp;amp;retVal);&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-6627896241224664589?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/6627896241224664589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=6627896241224664589' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/6627896241224664589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/6627896241224664589'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2007/08/surviving-after-stackoverflowexception.html' title='Surviving after StackOverflowException'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-2874155532447953984</id><published>2007-04-06T16:52:00.002+04:00</published><updated>2008-08-11T10:00:23.816+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Test Automation'/><category scheme='http://www.blogger.com/atom/ns#' term='web'/><title type='text'>GUI test automation of web applications</title><content type='html'>In course of my past projects, I've multiple times tried to establish effective GUI test automation and for some reasons my attempts always failed. It does not mean that automation was not created at all, but very low effectiveness for significant effort. One of the interesting side effect, that I've seen was that complex GUI test automation usually require someone's attention - you cannot just add it into task scheduler at 2 o'clock in the night, and get result in the morning.&lt;br /&gt;I've tried it with the different people (sometime I even assign good developers into it), but still they encountered enormous amount of technical problems. So I've realized that its not the fault of the people, but rather fault of software. No matter whenever you are using cheap AutomatedQA TestComplete or expensive Mercury WinRunner/QTP, the tools are huge, pretend to do everything and but actually did each task with significant limitations. The worst thing about this is that if you encounter a problem, neither google nor support usually cannot help you.&lt;br /&gt;Recently I was thinking about problem of automated periodic posting of some information on various web-sites. We've tried to automate it using TestComplete, but stability and speed was far from perfect. In fact it refuses to work through TaskScheduler at all, and you will need someone, who will manually run corresponding .bat file from time to time. In order to change this situation, I've start thinking about tools like &lt;a href="http://nunitasp.sourceforge.net/"&gt;NUnitASP&lt;/a&gt;. It looks lightweight and cool, but does not suite my needs, because of the nature of my task. Usually such type of sites are not really happy when someone is using robot to post data there, so they actively resisting it. I need an ability to click on links and fill fields in the actual browser.&lt;br /&gt;So I was thinking - if I need a real browser to automate this task - why cannot I incorporate one in my C# program? Quick search shows me one good sample on &lt;a href="http://www.codeproject.com/csharp/mshtml_automation.asp"&gt;codeproject&lt;/a&gt;. I've downloaded it and tweaked according to my needs and it works! I've running this on task scheduler completely unattended, and just getting results from there.&lt;br /&gt;I'm going to post technical details and some point of time later, when I will polish them, but the idea of this post is very simple: &lt;span style="FONT-WEIGHT: bold"&gt;if you need GUI test automation - consider writing your own tool for this&lt;/span&gt;. Of cause it is not free, and you will have to fight with non-trivial MS implementation of DOM, but this is the only thing you will have to fight - your own automation code will be very small and lightweight (mine is less than 300 lines now :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-2874155532447953984?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/2874155532447953984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=2874155532447953984' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/2874155532447953984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/2874155532447953984'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2007/04/gui-test-automation-of-web-applications.html' title='GUI test automation of web applications'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-2820896792894992123</id><published>2007-04-03T18:38:00.001+04:00</published><updated>2008-08-10T21:38:39.783+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Test Automation'/><title type='text'>FindWindowEx() does not always return child window controls</title><content type='html'>There was a task to control separate application via button clicks. We've created a small prototype, that can identify top-level window, and after that found necessary control inside this window using &lt;span style="FONT-STYLE: italic"&gt;FindWindowEx&lt;/span&gt;. To my surprise it was not always working as I expected. Sometimes I was getting &lt;span style="FONT-STYLE: italic"&gt;null &lt;/span&gt;instead of handle to the corresponding window. So I decided to create my own version of that method:&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:110;"&gt;&lt;br /&gt;private static IntPtr WaitChild(IntPtr parent, string windowClass,&lt;br /&gt;                                string windowCaption) {&lt;br /&gt; IntPtr result = IntPtr.Zero;&lt;br /&gt; do {&lt;br /&gt;     Thread.Sleep(10);&lt;br /&gt;     EnumChildWindows(parent, delegate(IntPtr hWnd, IntPtr lParam) {&lt;br /&gt;                              StringBuilder className = new StringBuilder(200);&lt;br /&gt;                              GetClassName(hWnd, className, 200);&lt;br /&gt;                              StringBuilder caption = new StringBuilder(200);&lt;br /&gt;                              GetWindowText(hWnd, caption, 200);&lt;br /&gt;                              if (className.ToString() == windowClass &amp;amp;&amp;amp;&lt;br /&gt;                                  caption.ToString() == windowCaption)&lt;br /&gt;                                  result = hWnd;&lt;br /&gt;                              return true;&lt;br /&gt;                          }, IntPtr.Zero);&lt;br /&gt; } while (result == IntPtr.Zero);&lt;br /&gt; return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[DllImport("user32.dll")]&lt;br /&gt;private static extern bool EnumChildWindows(IntPtr hwndParent,&lt;br /&gt;                           EnumWindowsProc lpEnumFunc, IntPtr lParam);&lt;br /&gt;&lt;br /&gt;private delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);&lt;br /&gt;&lt;br /&gt;[DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)]&lt;br /&gt;private static extern int GetWindowText(IntPtr hWnd,&lt;br /&gt;                       [Out] StringBuilder lpString, int nMaxCount);&lt;br /&gt;&lt;br /&gt;[DllImport("user32.dll", CharSet=CharSet.Auto)]&lt;br /&gt;private static extern int GetClassName(IntPtr hWnd,&lt;br /&gt;                       StringBuilder lpClassName, int nMaxCount);&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Sometimes it takes one or two loops while the window is finally appears on the screen, but it works pretty stable now&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-2820896792894992123?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/2820896792894992123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=2820896792894992123' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/2820896792894992123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/2820896792894992123'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2007/04/findwindowex-does-not-always-return.html' title='FindWindowEx() does not always return child window controls'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-5028110371112851099</id><published>2007-03-12T15:34:00.001+03:00</published><updated>2008-08-10T21:39:52.168+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='SOAP'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><title type='text'>Accessing web services over https using own-made certificate</title><content type='html'>In most of our products we are extensively using web-services. Some of them are relaying on SSL to encrypt data streams. It works pretty good from the .NET Framework client if corresponding server certificate is issued by certification authority known by Windows, but if you want some $$ in your budget, you probably will generate the certificate by yourself. When you are trying to access such service from C# program, you will get &lt;span style="FONT-STYLE: italic"&gt;"The underlying connection was closed: could not establish trust relationship for SSL/TLS secure channel"&lt;/span&gt;. There is a good &lt;a href="http://weblogs.asp.net/jan/archive/2003/12/04/41154.aspx"&gt;post&lt;/a&gt; about how to make it work by Jan Tielens, but for .NET Framework 2.0 there is even simpler solution - put the line below somewhere during initialization of your application&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:110;"&gt;&lt;br /&gt;System.Net.ServicePointManager.ServerCertificateValidationCallback +=&lt;br /&gt;                               delegate { return true; };&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-5028110371112851099?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/5028110371112851099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=5028110371112851099' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/5028110371112851099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/5028110371112851099'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2007/03/accessing-web-services-over-https-using.html' title='Accessing web services over https using own-made certificate'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-6239552164577378766</id><published>2007-02-15T11:59:00.002+03:00</published><updated>2008-08-11T09:59:07.750+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='print'/><title type='text'>How to print multiple copies of page if PrinterSettings.MaximumCopies==1</title><content type='html'>I've encountered problem that with all my printers I cannot print several copies of pages using &lt;span style="FONT-STYLE: italic"&gt;PrinterSettings.Copies=2&lt;/span&gt;. .NET Framework just ignore it, and MSDN state why:&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:times new roman;"&gt;You can use the &lt;span style="FONT-STYLE: italic"&gt;MaximumCopies &lt;/span&gt;property to determine the maximum number of copies the printer supports. If the number of copies is set higher than the maximum copies supported by the printer, it will be ignored, not causing an exception.&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;The problem is that I've never seen the case when &lt;span style="FONT-STYLE: italic"&gt;MaximumCopies &lt;/span&gt;is different than 1. Since this is just a wrapper around GDI &lt;span style="FONT-STYLE: italic"&gt;DeviceCapabilities(DC_COPIES)&lt;/span&gt;, I've tried to access it manually via PInvoke, and still get 1&lt;br /&gt;Ok, so how to print multiple copies of the page on the printer, that does not support it? Quite simple:&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:110;"&gt;PrintDocument doc = new PrintDocument();&lt;br /&gt;int remainingPages = &lt;span style="COLOR: rgb(51,204,0)"&gt;/* Number of copies */&lt;/span&gt;;&lt;br /&gt;doc.PrintPage += delegate(object sender, PrintPageEventArgs e) {&lt;br /&gt;  e.Graphics.DrawImage(&lt;span style="COLOR: rgb(51,204,0)"&gt;/* Print your page here*/&lt;/span&gt;);&lt;br /&gt;  e.HasMorePages = (--remainingPages &gt; 0);&lt;br /&gt;};&lt;br /&gt;doc.Print();&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-6239552164577378766?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/6239552164577378766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=6239552164577378766' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/6239552164577378766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/6239552164577378766'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2007/02/how-to-print-multiple-copies-of-page-if.html' title='How to print multiple copies of page if PrinterSettings.MaximumCopies==1'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-711862609303623582</id><published>2007-02-07T14:46:00.001+03:00</published><updated>2008-08-11T09:56:58.201+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='images'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><title type='text'>ArgumentException while Saving TIFF as JPEG</title><content type='html'>In one of project I'm involving, we are doing some kind of picture processing. If picture comes from the digital camera as .tiff-file, we are doing rotation (if this specified in exif-header) and saving it as high-quality jpeg to conserve disk space. We've discovered that for some pictures we were getting &lt;span style="FONT-STYLE: italic"&gt;ArgumentException &lt;/span&gt;while doing &lt;span style="FONT-STYLE: italic"&gt;Image.Save(string, ImageCodecInfo, EncoderParameters)&lt;/span&gt; MSDN does not mention anything about that, but since the whole image class is just a wrapper around GDI+, we are basically getting error from the corresponding WinAPI function. Funny enough I was able to save exactly this image as bmp, but of cause it does not help us to minimize space usage.&lt;br /&gt;So I started to trace what else we are doing with the image. I found out that we are also stripping all exif information via &lt;span style="FONT-STYLE: italic"&gt;Image.RemovePropertyItem() &lt;/span&gt;because sometimes thumbnails which are stored there can be quite large. And it appears that if we are preserving certain items in exif (namely &lt;a href="http://www.awaresystems.be/imaging/tiff/tifftags/exififd.html"&gt;TIFFTAG_EXIFIFD&lt;/a&gt; and &lt;a href="http://www.awaresystems.be/imaging/tiff/tifftags/photoshop.html"&gt;TIFFTAG_PHOTOSHOP&lt;/a&gt;), image can be saved without any problems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-711862609303623582?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/711862609303623582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=711862609303623582' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/711862609303623582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/711862609303623582'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2007/02/saving-tiff-as-jpeg.html' title='ArgumentException while Saving TIFF as JPEG'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-8089494207443817853</id><published>2007-01-10T20:40:00.001+03:00</published><updated>2008-08-10T21:35:46.289+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOAP'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='proxy'/><title type='text'>Be careful when you are specifying hosts in defaultProxy/bypasslist</title><content type='html'>In our company all http traffic comes through &lt;em&gt;squid&lt;/em&gt;. It is well known that squid has own opinion what is right and what is wrong in http. One good example is that all requests, originated from squid has “HTTP1.0” in header even if originally it was 1.1 Also squid hates DIME, so if you want to use external web-service that utilize DIME, you have to bypass &lt;em&gt;squid&lt;/em&gt;. .NET Framework has quite good facilities in specifying proxy settings for the application. In fact when you are specifying hosts in &lt;&lt;em&gt;bypasslist&gt;&lt;/em&gt;, you can use regular expressions. I was really surprised when once it doesn’t work in my application. I spent a couple of hours trying to track down what is wrong with the program, and finally discovered that my DIME requests was not bypassing proxy as intended. It appears that I was using ip address in &lt;&lt;em&gt;bypasslist&gt;&lt;/em&gt; and domain name in the url of web service. So when .NET framework is trying to much them, it does not perform dns-lookup. Be aware of this!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-8089494207443817853?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/8089494207443817853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=8089494207443817853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/8089494207443817853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/8089494207443817853'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2007/01/be-careful-when-you-are-specifying.html' title='Be careful when you are specifying hosts in defaultProxy/bypasslist'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36227597.post-116117170600315087</id><published>2006-10-18T15:32:00.001+04:00</published><updated>2008-08-11T09:57:57.367+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='generics'/><title type='text'>Awkward behavior of System.Collections.Generic.List.BinarySearch</title><content type='html'>I was trying to build my own morphoanalyzer for Russian language. First step is to search through the list of word radicals – prefixes which will remain constant in all word forms like "&lt;strong&gt;wom&lt;/strong&gt;" for "&lt;strong&gt;wom&lt;/strong&gt;an"/"&lt;strong&gt;wom&lt;/strong&gt;en". In Russian I get more 100K+ radicals, so search efficiency is definitely an issue. Since my initial list is presorted, but can contain duplicate radicals, I decided to choose .NET 2.0 Generic &lt;span style="FONT-STYLE: italic"&gt;List &lt;/span&gt;over &lt;span style="FONT-STYLE: italic"&gt;SortedList/Dictionary&lt;/span&gt; and use &lt;span style="FONT-STYLE: italic"&gt;BinarySearch&lt;/span&gt;. One of the surprising results I've got is that &lt;span style="FONT-STYLE: italic"&gt;BinarySearch (Int32, Int32, T, Generic IComparer)&lt;/span&gt; does not always return first occurrence of item, if there are duplicates. I realize this is caused by nature of binary search algorithm. After some time I even found corresponding note in MSDN, but I cannot come up with any reasons why someone might want behavior like that. Combination of &lt;span style="FONT-STYLE: italic"&gt;List &lt;/span&gt;and &lt;span style="FONT-STYLE: italic"&gt;BinarySearch &lt;/span&gt;is the only container that accepts duplicate items, and it is quite obvious that most of the people will use &lt;span style="FONT-STYLE: italic"&gt;BinarySearch &lt;/span&gt;to find all occurrences of items, not the random one. I do realize that it will hurt performance insignificantly, but it will become right-out-of-the-box usable solution. I created my wrapper around &lt;span style="FONT-STYLE: italic"&gt;BinarySearch&lt;/span&gt;, which produce correct results. The assumption is that number of duplicate items is significantly less than total number of items in the collection:&lt;pre&gt;&lt;span style="font-size:110;"&gt;&lt;br /&gt;public static int TrueBinarySearch(string prefix, int startIdx) {&lt;br /&gt;  int idx = List.BinarySearch(startIdx + 1, List.Count - startIdx - 1,&lt;br /&gt;                              prefix, null);&lt;br /&gt;&lt;br /&gt;  if (idx &gt;= 0) {&lt;br /&gt;    while (idx &gt; startIdx &amp;amp;&amp;amp; List[idx].Key == prefix) {&lt;br /&gt;      idx--;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return ++idx;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36227597-116117170600315087?l=ghuron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ghuron.blogspot.com/feeds/116117170600315087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36227597&amp;postID=116117170600315087' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/116117170600315087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36227597/posts/default/116117170600315087'/><link rel='alternate' type='text/html' href='http://ghuron.blogspot.com/2006/10/awkward-behavior-of.html' title='Awkward behavior of System.Collections.Generic.List.BinarySearch'/><author><name>Andrew Zaikin</name><uri>http://www.blogger.com/profile/14410946383928311093</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.technorati.com/progimages/photo.jpg?uid=394065'/></author><thr:total>0</thr:total></entry></feed>
