<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>aip solutions developer's blog</title>
	<atom:link href="http://blog.aip-solutions.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.aip-solutions.com</link>
	<description>aip solutions developer's blog</description>
	<pubDate>Thu, 10 Dec 2009 09:38:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>footer stick on bottom</title>
		<link>http://blog.aip-solutions.com/311/footer-stick-on-bottom-2/</link>
		<comments>http://blog.aip-solutions.com/311/footer-stick-on-bottom-2/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 10:27:14 +0000</pubDate>
		<dc:creator>mili</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[HTML & XHTML]]></category>

		<guid isPermaLink="false">http://blog.aip-solutions.com/?p=311</guid>
		<description><![CDATA[DOCTYPE:
&#60;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&#62;
&#60;html xmlns="http://www.w3.org/1999/xhtml"&#62;
CSS:
html,body    {min-height:100%;height:100%;}
.siteContent {position:relative;min-height:100%;_height:100%;}/*IE hack*/
.pageContent {padding:0 0 25px;}
.footer      {position:absolute;bottom:0;width:100%;height:25px;}
HTML:
&#60;html&#62;
&#60;body&#62;
    &#60;div class="siteContent"&#62;
        &#60;div class="pageContent"&#62;&#60;/div&#62;
        &#60;div class="footer"&#62;&#60;/div&#62;
    &#60;/div&#62;
&#60;/body&#62;
&#60;/html&#62;
BROWSERS:
IE6, IE7, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>DOCTYPE:</strong></p>
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;</pre>
<p><strong>CSS:</strong></p>
<pre>html,body    {min-height:100%;height:100%;}
.siteContent {position:relative;min-height:100%;_height:100%;}/*IE hack*/
.pageContent {padding:0 0 25px;}
.footer      {position:absolute;bottom:0;width:100%;height:25px;}</pre>
<p><strong>HTML:</strong></p>
<pre>&lt;html&gt;
&lt;body&gt;
    &lt;div class="siteContent"&gt;
        &lt;div class="pageContent"&gt;&lt;/div&gt;
        &lt;div class="footer"&gt;&lt;/div&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong>BROWSERS:</strong><br />
IE6, IE7, IE8, FF2, FF3</p>
<p><strong>FLOATS:</strong><br />
yes</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aip-solutions.com/311/footer-stick-on-bottom-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Round corners with css &#8230; only!</title>
		<link>http://blog.aip-solutions.com/242/round-corners-with-only-css/</link>
		<comments>http://blog.aip-solutions.com/242/round-corners-with-only-css/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 08:51:10 +0000</pubDate>
		<dc:creator>mili</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[HTML & XHTML]]></category>

		<guid isPermaLink="false">http://blog.aip-solutions.com/?p=242</guid>
		<description><![CDATA[One post inspired me to experiment with font-size and line-height. Here is the result of a few hours tests in IE6 and FF.
My result
Here is the CSS:
* 	{font-family:Arial,sans-serif;}

html,body{text-align:center;}

div	{position:relative;
         width:300px;
         margin:130px auto 0;padding:15px 0;
         background:black;
  [...]]]></description>
			<content:encoded><![CDATA[<p>One post inspired me to experiment with font-size and line-height. Here is the result of a few hours tests in IE6 and FF.</p>
<h2>My result</h2>
<p>Here is the CSS:</p>
<pre>* 	{font-family:Arial,sans-serif;}

html,body{text-align:center;}

div	{position:relative;
         width:300px;
         margin:130px auto 0;padding:15px 0;
         background:black;
        }

div p	{position:relative;
         min-height:22px;height:auto!important;height:22px;
         margin:0 -14px;padding:22px;
         border:solid 15px black;border-width:0 15px;
         background:white;
        }

em.absTL,
em.absTR,
em.absBL,
em.absBR {position:absolute;
          width:30px;height:30px;line-height:32px;
          padding:0;
          font-size:120px;
          text-indent:-6px;
          color:black;
          overflow:hidden;
         }
 em.absTL{top:0;left:-14px;}
 em.absTR{top:0;right:-14px;}
 em.absBL{bottom:0;left:-14px;}
 em.absBR{bottom:0;right:-14px;}</pre>
<p>And the HTML:</p>
<pre>&lt;div&gt;
	&lt;em class="absTL"&gt;&amp;bull;&lt;/em&gt;
	&lt;em class="absTR"&gt;&amp;bull;&lt;/em&gt;
	&lt;em class="absBL"&gt;&amp;bull;&lt;/em&gt;
	&lt;em class="absBR"&gt;&amp;bull;&lt;/em&gt;
 	&lt;p&gt;
 		Some dynamic content here &lt;br /&gt;
 		Some dynamic content here&lt;br /&gt;
 	&lt;/p&gt;
&lt;/div&gt;</pre>
<p>Preview:</p>
<p style="text-align: center;"><img class="size-full wp-image-270 aligncenter" src="http://blog.aip-solutions.com/wp-content/uploads/2009/08/roundcorners1.gif" alt="roundcorners1" width="365" height="157" /></p>
<h2>Specific notes</h2>
<p>1. div {<strong>vertical-align</strong>:top;} - IE6 don&#8217;t like it. The Internet Explorer 6 loses the em&#8217;s content;<br />
2. <strong>bold </strong>em-s - IE6 again don&#8217;t like it. The line-height is quite different from FF;<br />
3. other browsers - it works fine at least on IE6/7/8, FF3, Chrome, Opera, Safari.</p>
<h2>The post</h2>
<p>Thanks to Stu Nicholls and his post <a title="Curved Corners" href="http://www.cssplay.co.uk/boxes/curves.html" target="_blank">Curved Corners</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aip-solutions.com/242/round-corners-with-only-css/feed/</wfw:commentRss>
		</item>
		<item>
		<title>List of products - no tables, no floats</title>
		<link>http://blog.aip-solutions.com/238/list-of-products-no-tables-no-floats/</link>
		<comments>http://blog.aip-solutions.com/238/list-of-products-no-tables-no-floats/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 10:38:48 +0000</pubDate>
		<dc:creator>mili</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[HTML & XHTML]]></category>

		<guid isPermaLink="false">http://blog.aip-solutions.com/?p=238</guid>
		<description><![CDATA[Check this post for a nice solution with unordered list - http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/
]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Check this post for a nice solution with unordered list - <a href="http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/" target="_blank">http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aip-solutions.com/238/list-of-products-no-tables-no-floats/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Useful add-ons</title>
		<link>http://blog.aip-solutions.com/231/useful-add-ons/</link>
		<comments>http://blog.aip-solutions.com/231/useful-add-ons/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 06:56:47 +0000</pubDate>
		<dc:creator>mili</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[HTML & XHTML]]></category>

		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.aip-solutions.com/?p=231</guid>
		<description><![CDATA[This is a quick list of Add-ons in FF that I use:

Firebug - http://getfirebug.com/
IE Tab - https://addons.mozilla.org/en-US/firefox/addon/1419
MeasureIt -http://www.kevinfreitas.net/extensions/measureit/
ColorZilla - http://www.colorzilla.com/firefox/
Resizeable textarea - https://addons.mozilla.org/en-US/firefox/addon/3818
Web Developer - http://chrispederick.com/work/web-developer/
HTML Validator - http://users.skynet.be/mgueury/mozilla/
CSS Validator - http://www.nu22.com/firefox/cssvalidator/
Operator - http://www.kaply.com/weblog/operator/
Tails Export - https://addons.mozilla.org/en-US/firefox/addon/2240?id=2240
ShowIP - http://code.google.com/p/firefox-showip/
YSlow - http://developer.yahoo.com/yslow/

]]></description>
			<content:encoded><![CDATA[<p>This is a quick list of Add-ons in FF that I use:</p>
<ol>
<li><strong>Firebug </strong>- <a href="http://getfirebug.com/" target="_blank">http://getfirebug.com/</a></li>
<li><strong>IE Tab</strong> - <a href="https://addons.mozilla.org/en-US/firefox/addon/1419" target="_blank">https://addons.mozilla.org/en-US/firefox/addon/1419</a></li>
<li><strong>MeasureIt</strong> -<a href="http://www.kevinfreitas.net/extensions/measureit/" target="_blank">http://www.kevinfreitas.net/extensions/measureit/</a></li>
<li><strong>ColorZilla</strong> - <a href="http://www.colorzilla.com/firefox/" target="_blank">http://www.colorzilla.com/firefox/</a></li>
<li><strong>Resizeable textarea</strong> - <a href="https://addons.mozilla.org/en-US/firefox/addon/3818" target="_blank">https://addons.mozilla.org/en-US/firefox/addon/3818</a></li>
<li><strong>Web Developer</strong> - <a href="http://chrispederick.com/work/web-developer/" target="_blank">http://chrispederick.com/work/web-developer/</a></li>
<li><strong>HTML Validator</strong> - <a href="http://users.skynet.be/mgueury/mozilla/" target="_blank">http://users.skynet.be/mgueury/mozilla/</a></li>
<li><strong>CSS Validator</strong> - <a href="http://www.nu22.com/firefox/cssvalidator/" target="_blank">http://www.nu22.com/firefox/cssvalidator/</a></li>
<li><strong>Operator </strong>- <a href="http://www.kaply.com/weblog/operator/" target="_blank">http://www.kaply.com/weblog/operator/</a></li>
<li><strong>Tails Export</strong> - <a href="https://addons.mozilla.org/en-US/firefox/addon/2240?id=2240" target="_blank">https://addons.mozilla.org/en-US/firefox/addon/2240?id=2240</a></li>
<li><strong>ShowIP </strong>- <a href="http://code.google.com/p/firefox-showip/" target="_blank">http://code.google.com/p/firefox-showip/</a></li>
<li><strong>YSlow </strong>- <a href="http://developer.yahoo.com/yslow/" target="_blank">http://developer.yahoo.com/yslow/</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.aip-solutions.com/231/useful-add-ons/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Footer stick on bottom with css</title>
		<link>http://blog.aip-solutions.com/103/footer-stick-on-bottom/</link>
		<comments>http://blog.aip-solutions.com/103/footer-stick-on-bottom/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 09:47:58 +0000</pubDate>
		<dc:creator>mili</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[HTML & XHTML]]></category>

		<guid isPermaLink="false">http://blog.aip-solutions.com/?p=103</guid>
		<description><![CDATA[A few weeks ago I found in Internet two beautiful posts to footer stick - lucky accident considering the huge information in the web. And lucky me, if you can imagine how long I&#8217;ve been trying to find out how to avoid using tables for layout. Even if it is only to stick the footer [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I found in Internet two beautiful posts to footer stick - lucky accident considering the huge information in the web. And lucky me, if you can imagine how long I&#8217;ve been trying to find out how to avoid using tables for layout. Even if it is only to stick the footer on bottom of the page.</p>
<h2>Stop using tables!</h2>
<p>Except for table-data of course <img src='http://blog.aip-solutions.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>In the web you can find several ways to stick the footer without table (with height 100%). Some of them are based on JavaScript and often they are  quite complicate. Others used long and messy hacks or a lot of extra HTML markup and the solution is confusing.</p>
<p>Now I want to say &#8216;Thank you for the really simple and working methods!&#8217; to <a href="http://www.bobbyvandersluis.com/">Bobby van der Sluis</a> and to <a href="http://ryanfait.com">Ryan Fait</a>.</p>
<p>At first I thought that these methods work only in XHTML, but today I tested both solutions in different doctypes and they &#8230;</p>
<h2>Work fine in (X)HTML and IE6, IE7, FF, Opera, Safari &amp; Chrome</h2>
<p>Here is the list of doctypes tested in Internet Explorer 6,   Internet Explorer 7, Mozilla Firefox 3.0.6, Opera, Safari for Mac and Google Chrome:</p>
<ul>
<li>HTML 4.01 Transitional</li>
<li>HTML 4.01 Strict</li>
<li>HTML 4.01 Frameset</li>
<li>XHTML 1.0 Transitional</li>
<li>XHTML 1.0 Strict</li>
<li>XHTML 1.0 Frameset</li>
<li>XHTML 1.1</li>
</ul>
<h2>Resource 1: A List Apart</h2>
<p>Bobby van der Sluis has described the problem with the footer since 2004. In his article <a href="http://www.alistapart.com/articles/footers/">Exploring Footers</a> he represents the JavaScript solution because of IE5 bug.<br />
Although, his simple CSS method works in IE and FF, so here is the code:</p>
<pre>html, body { height:100%; }
#container { position:relative; min-height:100%; }
#footer    { position:absolute; bottom:0; }</pre>
<pre>&lt;div id="container"&gt;
    &lt;div id="content"&gt;...&lt;/div&gt;
    &lt;div id="footer"&gt;...&lt;/div&gt;
&lt;/div&gt;</pre>
<h2>Resource 2: Las Vegas Web Design</h2>
<p>The second nice post on this topic is <a href="http://ryanfait.com/resources/footer-stick-to-bottom-of-page/">Make the Footer Stick to the Bottom of a Page</a> by Ryan Fait. It is really short and understandable resource. Here  I have to mention that some times in Internet Explorer there is a little bug - it is possible to appear vertical scrollbar when you resize the browser&#8217;s window.<br />
Here is the code:</p>
<pre>* 	        { margin:0; }
html,body { height:100%; }
.wrapper  { min-height:100%; height:auto!important; height:100%; margin:0 auto -4em; }
.footer,
.push     { height: 4em; }</pre>
<pre>&lt;div <em>class="wrapper"</em>&gt;
    &lt;p&gt;Your website content here.&lt;/p&gt;
   &lt;div <em>class="push"</em>&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div <em>class="footer"</em>&gt;
    &lt;p&gt;Copyright (c) 2008&lt;/p&gt;
&lt;/div&gt;</pre>
<h2>Floating content problem</h2>
<p>Maybe it will be a problem using floating elements in the main content (before footer). So you can check for more information the site <a href="http://www.cssstickyfooter.com/using-sticky-footer-code.html">www.cssstickyfooter.com</a> and the post with many comments <a href="http://stever.ca/web-design/css-sticky-footer/">A CSS Sticky Footer that Works in 2009 (Chrome too)</a> - both by <a href="http://stever.ca/about/">Steve Hatcher</a>.</p>
<p>In my next web project I&#8217;ll test that and post here.</p>
<h2>Updates</h2>
<p>2009-09-28: I just added new post with my own solution for XHTML <a href="http://blog.aip-solutions.com/311/footer-stick-on-bottom-2/">http://blog.aip-solutions.com/311/footer-stick-on-bottom-2/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aip-solutions.com/103/footer-stick-on-bottom/feed/</wfw:commentRss>
		</item>
		<item>
		<title>First Law of Internet Communications</title>
		<link>http://blog.aip-solutions.com/101/first-law-of-internet-communications/</link>
		<comments>http://blog.aip-solutions.com/101/first-law-of-internet-communications/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 12:57:46 +0000</pubDate>
		<dc:creator>Peter Mihailov</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.aip-solutions.com/?p=101</guid>
		<description><![CDATA[Be liberal in what you accept,
and conservative in what you send.
Jon Postel
]]></description>
			<content:encoded><![CDATA[<p>Be liberal in what you accept,<br />
and conservative in what you send.<br />
<a href="http://en.wikipedia.org/wiki/Jon_Postel" target="_blank">Jon Postel</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aip-solutions.com/101/first-law-of-internet-communications/feed/</wfw:commentRss>
		</item>
		<item>
		<title>inside dl.swf</title>
		<link>http://blog.aip-solutions.com/49/inside-dlswf/</link>
		<comments>http://blog.aip-solutions.com/49/inside-dlswf/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 09:56:13 +0000</pubDate>
		<dc:creator>Peter Assenov</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[dl.swf]]></category>

		<category><![CDATA[dynlite]]></category>

		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://blog.aip-solutions.com/?p=49</guid>
		<description><![CDATA[I&#8217;ll try to describe the creation process of dl.swf- a small class for publishing flash in html page.
A great overview for the concepts and common solutions of this problem can be found at: Embed Flash or Die Trying
Btw, nice title too&#8230; I will start from there, so reading the above is a good idea. Also [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll try to describe the creation process of dl.swf- a small class for publishing flash in html page.</p>
<p>A great overview for the concepts and common solutions of this problem can be found at: <a title="Embed Flash or Die Trying" href="http://perishablepress.com/press/2007/04/17/embed-flash-or-die-trying/" target="_blank">Embed Flash or Die Trying</a><br />
Btw, nice title too&#8230; I will start from there, so reading the above is a good idea. Also my previos post on this topic can help /<a title="Include Flash content in HTML" href="http://blog.aip-solutions.com/11/include-flash-content-in-html-page/" target="_blank">Include flash content in html page</a>/.</p>
<p>So the task was: make simple, flexible, easy to use, easy to maintain and browser/platform compatible class for including flash into html page.  Not bad&#8230; Did I mention 2 days time-frame /1 research and 1 implementation/? Will be fun for sure&#8230;</p>
<p>Everything begins with the usability. We have 2 scenarios:<br />
1. Should be possible to include Flash at a certain point in the body. The code should be something  like:</p>
<pre><em>&lt;div&gt;<em>&lt;script type="text/javascript"&gt;</em></em>dl.swf()<em><em>&lt;/script&gt;</em>&lt;/div&gt;</em></pre>
<p>2. Sometimes is better to  replace the content of an element, so for example if there is no flash player alternate content will be present:</p>
<pre>&lt;div id="containerId"&gt;Alternate Content&lt;/div&gt;
<em>&lt;script type="text/javascript"&gt;</em>dl.swf("containerId")<em>&lt;/script&gt;</em></pre>
<p>Looks simple enough but in case we need multiple instances we should register them. If the instances are created by a Factory method, then the Id will be generated automatically, but when there is communication between JS and AS is better to set it up manually. So no escape- Id parameter is necessary- will be the first argument passed to the constructor.</p>
<p>The other thing that bothers me  is that all the logic is executed in the constructor- not much object oriented, eh&#8230; Frankly I don&#8217;t care /OOP was not part of the requirements :)/, the problem is that this approach, although simple, somehow shuts the door for future extension and in-between processing, so decided- the final replace will be done by a separate method- <code>write();</code> Let see what we have:</p>
<pre>&lt;div id="containerId"&gt;Alternate Content&lt;/div&gt;
<em>&lt;script type="text/javascript"&gt;</em>
var myObj=dl.swf("flashId")
myObj.write("containerId")
<em>&lt;/script&gt;</em></pre>
<p>In case the constructor returns the object/little nasty js trick/ will be much shorter:</p>
<pre>&lt;div id="containerId"&gt;Alternate Content&lt;/div&gt;
<em>&lt;script type="text/javascript"&gt;</em>
dl.swf("flashId").write("containerId")
<em>&lt;/script&gt;</em></pre>
<p>or flexibility when there are no multiple instances and you don&#8217;t replace content in another element, then the Id will be auto-generated and the writing method will not need a parameter.</p>
<pre>&lt;div&gt;<em>&lt;script type="text/javascript"&gt;</em>dl.swf().write()<em>&lt;/script&gt;</em>&lt;/div&gt;</pre>
<p>Still simple enough, yet much more flexible.</p>
<p>Then probably we need to adjust some parameters of the html object or pass variables to the .swf itself. Since it is not possible to predict the number of these parameters we can pass them as associate arrays. Unfortunately in Javascript there is no easy way to create associate arrays/they support Alpha calculus though ;)/- something like <code>[key1=&gt;val1,key2=&gt;val2]</code> would have been great, but we have to use objects <code>{key1:val1,key2:val2}</code> - at the end its the same.  Our example code should be like:</p>
<pre>&lt;div id="containerId"&gt;Alternate Content&lt;/div&gt;
<em>&lt;script type="text/javascript"&gt;</em>
dl.swf("flashId",{par1:val2,par2:val2},{swfvar1:val1,swfvar2:val2}).write("containerId")
<em>&lt;/script&gt;</em></pre>
<p>Most of the times there is no need for passing parameters to the .swf and I can preset the most common paratemeters of the html object, so the array parameters should not be required. Again we&#8217;re back to:</p>
<pre><em>&lt;script type="text/javascript"&gt;</em>dl.swf().write()<em>&lt;/script&gt;</em></pre>
<p>Not complex at all, but at the end of the day the class should be used primarily by designers. They seem to be scared of all these dots and brackets/not to mention anonymous objects as parameters/- so a simple function will be perfect for them. Let it be! Also they are used to pass certain parameters to it. No problem- I will take them from swfObject &#8230;</p>
<pre><em>&lt;script type="text/javascript"&gt;</em>dlswf("path/movie.swf","movie_id","333","333","7","#777")<em>&lt;/script&gt;
</em></pre>
<p>Enough for the usage. Next is the implementation&#8230;</p>
<p>peter.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aip-solutions.com/49/inside-dlswf/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Table abstraction with DList - part 1</title>
		<link>http://blog.aip-solutions.com/50/table-abstraction-with-dlist-patr-1/</link>
		<comments>http://blog.aip-solutions.com/50/table-abstraction-with-dlist-patr-1/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 17:21:52 +0000</pubDate>
		<dc:creator>Peter Mihailov</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[class]]></category>

		<category><![CDATA[database abstraction]]></category>

		<category><![CDATA[DList]]></category>

		<category><![CDATA[lib]]></category>

		<category><![CDATA[server-side]]></category>

		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://blog.aip-solutions.com/?p=50</guid>
		<description><![CDATA[It is well-known that programmers are lazy people. Thanks to this fact a lot of good stuff are written. The same is the story with DList. It starts on one sunny day near the old office of AIP Solutions. The server-side team of the company, represented by Me and Mr. Marin Todorov, decided to have [...]]]></description>
			<content:encoded><![CDATA[<p>It is well-known that programmers are lazy people. Thanks to this fact a lot of good stuff are written. The same is the story with DList. It starts on one sunny day near the old office of AIP Solutions. The server-side team of the company, represented by <a href="http://www.waynblog.com/" target="_blank">Me</a> and <a href="http://underplot.com/" target="_blank">Mr. Marin Todorov</a>, decided to have a lunch in the restaurant near the office. We was outside and the weather was so pleasant so we decided that it will be one very very long lunch. But we needed an excuse. Our idea was to say our colleagues that we had done some work. So we took a couple of napkins and started our software design work.</p>
<p>Ok I finished the introduction. So I&#8217;ll try to explain something about DList.</p>
<p>After we analysed our server-side programming work. We found that all the time we do the same. We add, edit and remove some items in database tables. Then we retrieve the content of those tables. So we decided to create a generic class which will implement all the stuff we need. It&#8217;s called DList (DataList). DList is an abstraction for list with items. The constructor of the class takes an object as an argument. The type of this object is &#8220;DListConf&#8221; (DList Configuration) or also known as DLC. The DLC object contains all the information DList needs to know about the table in database, which DList have to manage. After DList class is instantiated we have an object which implements so called DList interface. That means the object has this list of methods:</p>
<pre>DList|array static DList::Make('DLC Name [,DLC name1 ...]')
void  DList::setOrderMethod($orderString);
void  DList::setFilter($filterString);
void  DList::setPaging($pagingObject);
array DList::add($info)
void  DList::edit($Id, $info)
bool  DList::remove($Id)
array DList::getInfo($Id, $langId)
array DList::getList($langId)
array DList::getFullList($langId)
int   DList::getCount()</pre>
<p>When we have this methods we can do most ot our work without writing SQL queries. So this class provide some kind of database abstraction layer. It increases the level of predictability of the code written from any member of our team. And one very important thing, it saves time, a lot of time. Of course I&#8217;m not saying that everyting could be done with DList, but it does very good work in most of the cases.</p>
<p><strong>DList usage</strong></p>
<p>There are two ways for creating instance of DList. The classic approach with new keyword in PHP.</p>
<pre>$products = new DList($productsDLC);</pre>
<p>In this case $productsDLC is our DList Configuration  object and $products is the DList object.</p>
<p>If we need more DList objects, we can use the Make static method.</p>
<pre>list($products, $categories, $news) = DList::Make('productsDLC, categoriesDLC, newsDLC');</pre>
<p>In this example I use the Make method to create three DList objects at once. This method returns an array with DList objects inside. Make method has an other very useful feature, it automatically includes the files with DLC definitions. This files should be in <code>aip.conf</code> folder and its names should be like in this example: <code>productsDLC.php, categoriesDLC.php, newsDLC.php</code>.</p>
<p>Before I continue with DList features I&#8217;d like to write something more about DListConf or DLC. It is very important, because withour properly configured DLC you won&#8217;t have an operational DList object. DListConf is configuration container. Our convention is make DLC objects in files with the same name. For example:</p>
<pre>$productsDLC = DListConf('productsList');</pre>
<p>We create object called <code>$productsDLC</code> in a file called <code>productsDLC.php</code>. This is not required, but it makes things easy and clear and for the staff of AIP Solutions it is <strong>obligatory</strong>. Also this convention is required for static method <code>Make()</code>. The constructor of DListConf takes only one argument and it should be the name of the table in database, which Dlist should manage. This is an example of a real DLC file - <code>productsDLC.php</code>:</p>
<pre>$productsDLC = new DListConf('productsList'); 	<span>/* name of the table */</span>
$productsDLC-&gt;setLangCount(2);		 	<span>/* default:1 */</span>
$productsDLC-&gt;setTextKey('name'); 	  		<span>/* default:name */</span>
$productsDLC-&gt;setLangKey('langId');  	  	<span>/* default:langId, false for none */</span>
$productsDLC-&gt;setParentKey('parentId');  		<span>/* default:parentId, false for none */</span>
$productsDLC-&gt;setOrderMethod('orderId ASC'); 	<span>/* default:Id ASC */</span>

$productsDLC-&gt;addField('parentId', 'int');
$productsDLC-&gt;addField('imageId', 'int');
$productsDLC-&gt;addField('price', 'price');		<span>/* in DList we have standard datatype 'price' */</span>
$productsDLC-&gt;addField('descr', 'rtf');
$productsDLC-&gt;addField('abstract', 'rtf');
$productsDLC-&gt;addField('orderId', 'int');</pre>
<p>The first method in this example is <code>setLangCount(int $languageCount);</code>. We use this method to tell to DList that the data it will manage will be translated in 2 languages. In this case DList knows that for each item added to the table it has to make 2 records - one record for each language. In other words if you add 1 product into the database and you have <code>setLangCount(2);</code> in you <code>$productsDLC</code>, DList will insert 2 rows in <code>productsList</code> table.</p>
<p>The next method is <code>setTextKey(string $fieldName)</code>. This tells which field in the table can be defined as a &#8220;name&#8221; of the items saved in this table. In our case with <code>productsList</code> table we use the filed <code>name</code>, which is the name of the product. This parameter is used in <code>DList::getList()</code> method, which will be discussed later.</p>
<p>The other main method is <code>setLangKey(string fieldName)</code>. It shows which field in DB table should be used for storing the language ID of each record. So in our example this is <code>langId</code> field. Which means that if we add 1 product to the database DList will make 1 record with langId = 1 and 1 record with langId = 2.</p>
<p>The method <code>setParentKey(string fieldName)</code> also takes the name of a field in DB table as an argument. This field should be used when we need parent-child relation between two tables managed by DList. An example for this case is when we have products, which are grouped in different categories. So in products we make DB table field called <code>parentId</code> and use <code>setParentKey('parentId')</code>.Then when we have to add product we have to write its parent category ID in this field.</p>
<p>Method called <code>setOrderMethod(string $orderSqlString)</code> is used to set the default order of items recorded in the table. The parameter which method takes is the ORDER BY clause in SQL. But without ORDER BY at the begging. For example: <code>name ASC</code>. In this case when we retrieve a list of items from the table using <code>DList::getList()</code> or <code>DList::getFullList()</code> methods, the result will be ordered by product name in ascending sort.</p>
<p>The last method in our example is <code>addField(string $fieldName, string $dataType)</code>. We use this method for describing the fields in the table. Every field (well,there are some exceptions) in the DB table should be defined with this method. The first argument is the name of the field and the second argument is its data type. In fact we don&#8217;t use the standard data types in SQL. Dlist uses the following data types:<br />
<code>int, string, rtf, file, date, price, enum</code>. </p>
<p><code>int</code> type is for integer data - numbers</p>
<p><code>string</code> is used for strings. it is important that DList perform some operations on data defined as a string. It replaces the quotes and slashes with its HTML codes.</p>
<p><code>rtf</code> is like a string but DList doesn&#8217;t make any changes on the strings. It should be used for textareas with rich text formatted texts.</p>
<p><code>file</code> - this data type should be used when the information is file name.</p>
<p><code>date</code> - data type for storing dates.</p>
<p><code>price</code> - store decimal prices with this data type.</p>
<p><code>price</code> - it should be used for enum MySQL fields.</p>
<p>The fields that should not be defined with  <code>addField(string $fieldName, string $dataType)</code> method are fields defined as an <code>Text Key</code> and <code>Language Key</code> with <code>setTextKey()</code> and <code>setLangKey()</code> methods. In our example this are <code>name</code> and <code>langId</code> fields. In fact if some field is not defined in the DLC, Dlist will work well, but this field will stay &#8220;invisible&#8221; for the object. You will not be able to add, edit or even read the information in this field.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aip-solutions.com/50/table-abstraction-with-dlist-patr-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>coding- what&#8217;s that?</title>
		<link>http://blog.aip-solutions.com/36/coding-whats-that-part-1/</link>
		<comments>http://blog.aip-solutions.com/36/coding-whats-that-part-1/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 12:25:42 +0000</pubDate>
		<dc:creator>Peter Assenov</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.aip-solutions.com/?p=36</guid>
		<description><![CDATA[few thought of coding- what it means for me]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been coding for a while&#8230; scared to say it- a decade!</p>
<p>It&#8217;s not I&#8217;m too old, I just started early <img src='http://blog.aip-solutions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyway 20 years is a lot of time, especially in programming. Everything changes so fast, new technologies are coming, programming languages are born and the code quality concepts are totally different from what they were. I&#8217;m trying to find my place in all this- everything I&#8217;ve bee taught about the real values  in coding seems to be not important now and some bad practices I&#8217;ve studied are  cutting edge programing- am I an ancient thinking freak that needs to change his attitude to survive, or the current situation is just &#8220;a fashion&#8221; that will pass away. Lets try to find out&#8230;</p>
<p>I&#8217;m starting with some background&#8230;</p>
<p>I had the unique chance grow up with the PC. We&#8217;re on the same age and as it was changing, I was evolving as a programmer too- we&#8217;re like old friends.</p>
<p>The first PC I&#8217;ve coded on/and played games of course/ was Bulgarian analog of Apple II with 48kB of RAM and 255 KB of storage/on a 5.25&#8243; FDD/.</p>
<p><img class="aligncenter size-medium wp-image-37" title="Pravetz 82" src="http://blog.aip-solutions.com/wp-content/uploads/2009/02/photo-imko-2-1-300x300.jpg" alt="Pravetz 82" width="300" height="300" />It has built-in BASIC compiler and a possibility to make vector graphics! I was having fun composing music /by adjusting the frequency and duration of the bell/ or drawing figures on the screen- was amazing!.</p>
<p>Then in the high school I was coding in PASCAL - we had fun with off-school meetings and participating in programing tournaments, but we were actually getting valuable knowledge of the coding and programming algorithms. We&#8217;re talking about Binary Trees, Linked Queues,  Graphs, etc&#8230; I was helping the school teacher during my vacation to set-up the school network or clean-up viruses. At that time my old folk was also growing up. It was in average 80286 with 256KB RAM and 10MB HDD. For some time I was supporting the computers in my mother&#8217;s company and once I had the unique experience to see an ancient Mainframe system /<span class="boilerplate seealso"><em>IBM <a class="mw-redirect" title="System/360" href="http://en.wikipedia.org/wiki/System/360">System 360</a></em></span>/ in action. In the early 90&#8217;s I would not be surprised it to be the last working mainframe of this type in the world. It was so great that deserves another post. Just for the records my supporting career suddenly ended when my macro &#8220;a virus&#8221; slipped away from the testing environment and infected all documents in the company&#8230; /the name comes from the fact that it replaces all &#8220;e&#8221;, &#8220;i&#8221; and &#8220;o&#8221; characters in a word document with &#8220;a&#8221;, so you end up a beautiful document with strangely large number of &#8220;a&#8221;s and nothing wrong until you try to read something&#8230;  As you can suppose no automatic recovery possible- it does the replace on save :)/</p>
<p>Then came the Internet, BBS connection /later super fast modems/, Navigator 2.0, newsgroups, IRC channels, underground online magazines&#8230; Meantime I had my own $1200 costing 486DX5-133 with SVGA display! I was making a 3D animations with 3D Max 1.0 on it. This was amazing period in my life but &#8220;the net&#8221; put the coding &#8220;on hold&#8221;&#8230;</p>
<p>Until I went to the University. There a reached a whole new level in my programming career. I was using all my knowledge and upgrading it theoretically. I was lucky to learn from great people. If I could says I grow together with the PC- they grew with the computers in general. Many of them started coding in 60&#8217;s and in 80&#8217;s they develop a software for the Russian space station &#8220;MIR&#8221; or software that guided &#8220;cold war&#8221; nuclear missiles. Fighting with the bugs in nowadays software/windows crashed while I was writing this/ I remember one story- actually a true one.  Bulgarian engineers had developed a module for examining the effect of space environment on the human body called/Плевен-87/. The system software for it had to be carried in 3 disks. Unfortunately one of them was not taken to the space&#8230; and still they were able to conduct 83% of the planned tests! So imagine- you remove 1/3 of the installation files of Windows and it is not only operational but almost all features are there! It&#8217;s just unbelievable what they have done!</p>
<p>From them I understood the difference between a program and a WORKING program. I got the background for planning, coding and deploying a software system. Meantime I was coding the term&#8217;s assignments of my class-mates for fun/sometimes for money/. Apart for exercise this was a real-life lesson for working under pressure with strict deadlines. Since it was Assembler, C, C++ the code planning, structure, consistency, speed, resources, reusement rate, etc. were utterly important and they all have to be done manually- there was no language or compiler aids you can rely on. In the night at the campus we were stretching to its limit the Ethernet network architecture. Completely by ourselves we have designed, made the infrastructure and maintained a network of more than 150 PCs and of course with the least possible investments. The community was everything- we shared resources, thoughts, projects, played games and all this to happen we actually invented the moral principles  and personal responsibility for being part of a group. A group that worth more that just a sum of all individuals in it. The feeling was so great- same as the early years of Internet, but far more real- because its all done by you. I remember when I go out- I always leave a key from my room to a neighbor- because the router is here and if it stops you block the access to others- a thing far more important than someone may steal something from the room while you&#8217;re away&#8230;</p>
<p>I almost forgot my teenage partner- the PC.  At that time Pentium rules. Either PII under NT or PIII on 2K there was no match for it.</p>
<p>After the University I started by professional career as a programmer. I&#8217;ve gone thought almost everything: software for embedded devices /.Net CF/, desktop applications / .Net C#, Java/, web applications /HTML, CSS, JavaScript, VB Script, ASP, ASP .Net, PHP/, planning, design, deployment and maintenance of different softwares - from small websites to mid-size ERP systems. Here I faced the other side of the coin. The most important thing was how easy-to-maintain and modify the code is, what is the cost of development, the cost of maintenance. I have to make tough decisions about the quality vs budget, features vs development time&#8230; The expectations of my work changed, so was my attitude toward coding.  Nevertheless I really believe that the real values in programming are intransitive- they are not affected by technology or platform or fashion&#8230;</p>
<p>Unfortunately this introduction became much larger than I originally planed, so I will continue in the next post.</p>
<p>take care,</p>
<p>peter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aip-solutions.com/36/coding-whats-that-part-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Include flash content in html page</title>
		<link>http://blog.aip-solutions.com/11/include-flash-content-in-html-page/</link>
		<comments>http://blog.aip-solutions.com/11/include-flash-content-in-html-page/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 09:12:38 +0000</pubDate>
		<dc:creator>Peter Assenov</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[dl.swf]]></category>

		<category><![CDATA[dynlite]]></category>

		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://blog.aip-solutions.com/?p=11</guid>
		<description><![CDATA[Small and simple JavaScript class for dynamic include of Flash content in HTML page. Part of dynlite, but also can be used standalone.]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve made a small research and found many JavaScript classes that include dynamically flash in HTML pages. Most of them were easy to use and offered reasonable compatibility with different user agents and platforms. That&#8217;s great, but as a javascript developer I need to know also what&#8217;s behind the scene. How they work and how easy for modification and upgrade they are. When a client comes and say &#8220;I need this feature&#8221; or &#8220;can you support also this browser&#8230;&#8221;- he does not care what great-open-source-class I use- he just needs the thing done and I need to be able to make it.</p>
<p>Here comes the tricky part&#8230;</p>
<p>I took the uncompressed version of one popular class- swfobject 2.1 and I was surprised- it was 23KB! Well I know that these days 23K  are nothing for the web bandwidth but if you gonna maintain the code- they are a lot.  Isn&#8217;t it all about checking if there is Flash Player present and if yes just replace the innerHTML of some DIV- sounds  not so complex to require 700+ lines of code. I said- that&#8217;s ok the volume is not important if the code is simple and understandable. I scrolled down the code and I saw the file is ending with:</p>
<pre><span style="color: #0000ff;">                }
            }
        }
    };
}();

</span></pre>
<p><span style="color: #0000ff;"><span style="color: #000000;">Well, this simple complexity test just adds more concerns&#8230; what is this complex logic that requires such nesting? Besides what is the point you declare a function just to execute it on creation- can&#8217;t you just write the code, or if you want to be more structured- use static class for example.</span></span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;">And the final blow was the conditional parsing/line 88/ for detecting the OS in Internet explorer. Come on we&#8217;re not here to show how great programmers we are we just need to replace the innerHTML of a DIV.<br />
</span></span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;">Its not that I don&#8217;t appreciate the work done by the guys- they are great and I&#8217;d like to thank them for sharing it with others, but it&#8217;s just not my vision how it should be done.</span></span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;">So I thought to myself- there must be a simpler way&#8230; I don&#8217;t need complex event management, onDomContentLoaded handling or dynamic DOM elements manipulations- they are all out of scope of flash inclusion class and besides I already have them in the API&#8217;s core/I will introduce it in another post/.</span></span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;"> I created my own class nearly 9 times smaller and doing exactly what is needed- include flash content  into html page.</span></span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;">When I have time I will write some documentation but it is so simple that I think the usage examples should be enough. If not, one can always take a look at the code <img src='http://blog.aip-solutions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Here they are:</span></span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;">Usage: <a title="dl.swf usage" href="http://blog.aip-solutions.com/wp-content/uploads/2009/02/dl.swf.html" target="_blank">http://blog.aip-solutions.com/wp-content/uploads/2009/02/dl.swf.htm</a> Actually this was my class test page used in its creation,  so don&#8217;t take into account the visual. </span></span></p>
<p>Source: <a title="dl.swf source" href="http://blog.aip-solutions.com/wp-content/uploads/2009/02/dl.swf.js" target="_blank">http://blog.aip-solutions.com/wp-content/uploads/2009/02/dl.swf.js</a></p>
<p><span style="color: #0000ff;"><span style="color: #000000;">Hope will be useful to you&#8230;</span></span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;"> Cheers,</span></span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;">Peter<br />
</span></span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;"><br />
</span></span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;"><br />
</span></span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;"><br />
</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aip-solutions.com/11/include-flash-content-in-html-page/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
