<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Webscriptz.be &#187; development</title>
	<atom:link href="http://webscriptz.be/tags/development/feed" rel="self" type="application/rss+xml" />
	<link>http://webscriptz.be</link>
	<description></description>
	<lastBuildDate>Sat, 17 Apr 2010 12:45:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>YII framework configuration</title>
		<link>http://webscriptz.be/2009/12/20/yii-framework-configuration/253</link>
		<comments>http://webscriptz.be/2009/12/20/yii-framework-configuration/253#comments</comments>
		<pubDate>Sun, 20 Dec 2009 22:47:49 +0000</pubDate>
		<dc:creator>webscriptz</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[yii]]></category>
		<category><![CDATA[yii framework]]></category>

		<guid isPermaLink="false">http://webscriptz.be/?p=253</guid>
		<description><![CDATA[I&#8217;m toying with the Yii Framework for some time now and even if i cost me a lot of anger and frustration in the beginning I&#8217;m starting to like it more and more, alas I do have to say that the documentation isn&#8217;t always that clear and for someone who begins or who&#8217;ll write some [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m toying with the Yii Framework for some time now and even if i cost me a lot of anger and frustration in the beginning I&#8217;m starting to like it more and more, alas I do have to say that the documentation isn&#8217;t always that clear and for someone who begins or who&#8217;ll write some large applications the configuration file can be a hassle so here&#8217;s my solution:</p>
<blockquote><p>Brake down the configuration file in multiple files, this will give you some speed disadvantage and some will  saying that I&#8217;m raping Yii framework purpose for speed but at least to me it seems more clear</p></blockquote>
<p>This is the protected.config/main.php</p>
<pre class="brush:[php]">
dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=&gt;'WEBSITENAME',
'modules'=&gt;array(
'users'=&gt;array(
//sub modules in the module users
'modules'=&gt;array(
'messaging',
'profile',
'dashboard',
)
),
'about',
'forums',
),
// preloading 'log' component active loading
'preload'=&gt;array('log'),

// autoloading model and component classes lazy loading
// I make the difference between CformModel and CActiveRecord
'import'=&gt;array(
'application.models.*',
'application.models.forms.*',
'application.models.database.*',
),

// application components
'components'=&gt;array(
// enable cookie-based authentication
'user'=&gt;array('allowAutoLogin'=&gt;true),

// data relinquished to database.php
// for easy access and usability as also for the future
// installation procedure, it's less to write to a file
'db'=&gt;include(dirname(__FILE__).'/database.php'),

// for a better overview we exculded url routes to a seperate file
'urlManager'=&gt;include(dirname(__FILE__).'/routes.php'),

//authentication component needs data from db for CdbConnection
'authManager'=&gt;array(
'class'=&gt;'CDbAuthManager',
'connectionID'=&gt;'db',
'defaultRoles'=&gt;array('authenticated', 'guest'),
),

//security measures
'request'=&gt;array(
'enableCsrfValidation'=&gt;true,
'enableCookieValidation'=&gt;true,
),
),

// application-level parameters that can be accessed
// using Yii::app()-&gt;params['paramName']
// uncomment the following if you want static params in the application
//'params'=&gt;array(include(dirname(__FILE__).'/params.php'))
);</pre>
<p>database.php</p>
<pre class="brush:[php]">
'CDbConnection',
'connectionString'=&gt;'mysql:host=localhost;dbname=mysql',
//'connectionString'=&gt;'pgsql:host=localhost;port=5432;dbname=mysql',
'username' =&gt; 'root',
'password' =&gt; '',
);
?&gt;
</pre>
<p>routes.php</p>
<pre class="brush:[php]">
'path', // path or get
'urlSuffix' =&gt; '', //.html .whateverextentionyouwant
'showScriptName' =&gt; true,
'rules'=&gt;array(
'users/recovery/perimeterSecurity/'=&gt;'users/recovery/perimeterSecurity',
),
);
?&gt;
</pre>
<p>param.php</p>
<pre class="brush:[php]">//nothing in it at the moment</pre>
]]></content:encoded>
			<wfw:commentRss>http://webscriptz.be/2009/12/20/yii-framework-configuration/253/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A freepascal clock</title>
		<link>http://webscriptz.be/2008/08/30/a-freepascal-clock/114</link>
		<comments>http://webscriptz.be/2008/08/30/a-freepascal-clock/114#comments</comments>
		<pubDate>Fri, 29 Aug 2008 22:47:43 +0000</pubDate>
		<dc:creator>webscriptz</dc:creator>
				<category><![CDATA[source code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fpc]]></category>
		<category><![CDATA[freepascal]]></category>

		<guid isPermaLink="false">http://webscriptz.be/?p=114</guid>
		<description><![CDATA[A basical console clock written in freepascal by me, even if it&#8217;s an old language, I have to practice on it for school. Here you got the code, I&#8217;ve added little comments but it isn&#8217;t a lot. hh = hour mm = minutes ss= seconds program clock; uses crt; var hh, mm, ss :integer; BEGIN [...]]]></description>
			<content:encoded><![CDATA[<p>A basical console clock written in freepascal by me, even if it&#8217;s an old language, I have to practice on it for school.</p>
<p>Here you got the code, I&#8217;ve added little comments but it isn&#8217;t a lot. hh = hour mm = minutes ss= seconds</p>
<p><span id="more-114"></span></p>
<blockquote><p><code lang="pascal">program clock;</code></p>
<p>uses crt;</p>
<p>var hh, mm, ss :integer;</p>
<p>BEGIN<br />
ss:=0;<br />
mm:=0;<br />
hh:=0;</p>
<p>writeln(&#8216;Donne le heure: &#8216;);<br />
readln(hh);<br />
writeln(&#8216;donnez les minutes&#8217;);<br />
readln(mm);<br />
clrscr;</p>
<p>while ss&lt;60 do //59 seconds because on 60 mm+1<br />
begin<br />
ss:= ss + 1;  //count the seconds</p>
<p>writeln(hh,&#8217; : &#8216;, mm,&#8217; : &#8216;, ss);</p>
<p>delay(1);<br />
clrscr;</p>
<p>if ss=59 then  //if 59 then mm + 1<br />
begin<br />
mm:= mm + 1;<br />
ss:=0;</p>
<p>if mm=59 then  // 60 minutes but 59 minutes and 59 sec =&gt; hh+1<br />
begin<br />
hh:=  hh + 1;<br />
mm:=0;<br />
ss:=0;</p>
<p>if hh=23 then //24 hr, i don&#8217;t do days<br />
begin<br />
hh:=0;<br />
end;<br />
end;</p>
<p>end;<br />
end<br />
END.</p></blockquote>
<p><ins datetime="2008-12-25T18:49:02+00:00"></ins></p>
]]></content:encoded>
			<wfw:commentRss>http://webscriptz.be/2008/08/30/a-freepascal-clock/114/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C &amp; FPC</title>
		<link>http://webscriptz.be/2008/08/29/c-fpc/108</link>
		<comments>http://webscriptz.be/2008/08/29/c-fpc/108#comments</comments>
		<pubDate>Fri, 29 Aug 2008 20:04:21 +0000</pubDate>
		<dc:creator>webscriptz</dc:creator>
				<category><![CDATA[source code]]></category>
		<category><![CDATA[Dev C]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fpc]]></category>

		<guid isPermaLink="false">http://webscriptz.be/?p=108</guid>
		<description><![CDATA[C programming and pascal, that&#8217;s what I&#8217;m doing for the moment, I have an exam in 5 days, man I hate it. Just finished a clock in C: you give the time for tomorrow and he&#8217;ll count it down. But it&#8217;s basic: #include #include int main(int argc, char *argv[]) { long hh, mm,th, tm, ts; [...]]]></description>
			<content:encoded><![CDATA[<p>C programming and pascal, that&#8217;s what I&#8217;m doing for the moment, I have an exam in 5 days, man I hate it.</p>
<p>Just finished a clock in C: you give the time for tomorrow and he&#8217;ll count it down. But it&#8217;s basic:</p>
<blockquote><p><code lang="c">#include<br />
#include<br />
</code></p>
<p>int main(int argc, char *argv[])<br />
{<br />
long hh, mm,th, tm, ts;</p>
<p>printf(&#8220;Reveil a quelle heure(24) minutes? \t&#8221;);<br />
scanf(&#8220;%ld&#8221;, &amp;hh);<br />
scanf(&#8220;%ld&#8221;, &amp;mm);</p>
<p>th= hh+24; //ceci pr une journee<br />
tm = 60 &#8211; mm;<br />
ts=0;<br />
while(th&gt;=hh)<br />
{<br />
if(ts&gt;0){ts-=1; sleep(1000);}<br />
else if(tm&gt;0){ts=60; tm&#8211;;}<br />
else if (th&gt;hh){ts=60; tm=60; th&#8211;;}<br />
else if (th=hh){if(ts&gt;0){ts&#8211;;}}<br />
system(&#8220;cls&#8221;);<br />
printf(&#8220;%ld : %ld : %ld&#8221;, th, tm, ts);</p>
<p>}</p>
<p>system(&#8220;PAUSE&#8221;);<br />
return 0;<br />
}</p>
<p><span style="text-decoration: line-through;">I&#8217;m more or less pleased but still the infinite refreshments aren&#8217;t what I wanted and sorry about the comment but in exercises I don&#8217;t use them</span><span id="more-108"></span></p>
<p>Here&#8217;s the correction of the whole shebang:</p>
<p><code lang="c">#include<br />
#include </code></p>
<p>int main(int argc, char *argv[])<br />
{<br />
long hh, mm,th, tm, ts;</p>
<p>printf(&#8220;Reveil a quelle heure(24) minutes? \t&#8221;);<br />
scanf(&#8220;%ld&#8221;, &amp;hh);<br />
scanf(&#8220;%ld&#8221;, &amp;mm);</p>
<p>th= hh+1; //ceci pr une journee<br />
tm = mm;<br />
ts=0;</p>
<p>while(th&gt;=hh)<br />
{<br />
if(th&gt;hh){<br />
if(ts&gt;0){ts-=1; sleep(1000);}<br />
else if(tm&gt;0){ts=60; tm&#8211;;}<br />
else if (th&gt;hh){ts=60; tm=60; th&#8211;;}<br />
}<br />
else if(th==hh){<br />
if(ts&gt;0){ts-=0; sleep(1000);}<br />
else if(tm&gt;mm){ts=60; tm&#8211;;}<br />
else {printf(&#8220;\n\n\n Reveille toi !!!!&#8221;); system(&#8220;PAUSE&#8221;); return 0;}<br />
}</p>
<p>system(&#8220;CLS&#8221;);</p>
<p>printf(&#8220;%ld : %ld : %ld&#8221;, th, tm, ts);</p>
<p>}</p>
<p>system(&#8220;PAUSE&#8221;);<br />
return 0;<br />
}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://webscriptz.be/2008/08/29/c-fpc/108/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
