Jekyll2017-10-31T11:54:42+00:00https://gjergjsheldija.github.io/Gjergj SheldijaBlog and website of Gjergj Sheldija, blogging mainly for tech. Opinions expressed are mine.user friendly selects in birt2017-08-29T00:00:00+00:002017-08-29T00:00:00+00:00https://gjergjsheldija.github.io/user-friendly-selects-in-birt<p>a very straightforward post on how to add the chosen plugin to select boxes in birt.
first download the chosen plugin from https://harvesthq.github.io/chosen/ and extract the files in webcontent/birt/js.
then edit webcontent/birt/pages/layout/FramesetFramgment.jsp and add</p>
<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt"><link</span> <span class="na">rel=</span><span class="s">"stylesheet"</span> <span class="na">href=</span><span class="s">"birt/js/chosen.min.css"</span><span class="nt">></span>
<span class="nt"><script </span><span class="na">src=</span><span class="s">"birt/js/jquery-1.9.1.min.js"</span> <span class="na">type=</span><span class="s">"text/javascript"</span><span class="nt">></script></span>
<span class="nt"><script </span><span class="na">src=</span><span class="s">"birt/js/chosen.jquery.min.js"</span> <span class="na">type=</span><span class="s">"text/javascript"</span><span class="nt">></script></span>
<span class="nt"><script></span>
<span class="kd">var</span> <span class="nx">$jQuery</span> <span class="o">=</span> <span class="nx">jQuery</span><span class="p">.</span><span class="nx">noConflict</span><span class="p">();</span>
<span class="nt"></script></span>
</code></pre></div></div>
<p>and webcontent/birt/pages/parameter/ComboBoxParameterFragment.jsp and add the following code at the end of the file</p>
<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o"><</span><span class="nx">script</span><span class="o">></span>
<span class="kd">var</span> <span class="nx">setInt</span><span class="p">;</span>
<span class="nx">$jQuery</span><span class="p">(</span><span class="s2">"#<%= encodedParameterName + "</span><span class="nx">_selection</span><span class="s2">"%>"</span><span class="p">)</span>
<span class="p">.</span><span class="nx">chosen</span><span class="p">({</span>
<span class="na">disable_search_threshold</span><span class="p">:</span> <span class="mi">10</span><span class="p">,</span>
<span class="na">width</span><span class="p">:</span> <span class="s2">"400px"</span>
<span class="p">})</span>
<span class="p">.</span><span class="nx">change</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="nx">birtParameterDialog</span><span class="p">.</span><span class="nx">__refresh_cascade_select</span><span class="p">(</span><span class="nx">$</span><span class="p">(</span><span class="s2">"<%= encodedParameterName + "</span><span class="nx">_selection</span><span class="s2">"%>"</span><span class="p">));</span>
<span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="nx">$jQuery</span><span class="p">(</span><span class="s1">'.birtviewer_parameter_dialog_Select'</span><span class="p">).</span><span class="nx">trigger</span><span class="p">(</span><span class="s1">'chosen:updated'</span><span class="p">);</span>
<span class="p">},</span> <span class="mi">100</span><span class="p">);</span>
<span class="p">});</span>
<span class="o"><</span><span class="sr">/script</span><span class="err">>
</span></code></pre></div></div>gjergj.sheldijaa very straightforward post on how to add the chosen plugin to select boxes in birt. first download the chosen plugin from https://harvesthq.github.io/chosen/ and extract the files in webcontent/birt/js. then edit webcontent/birt/pages/layout/FramesetFramgment.jsp and add <link rel="stylesheet" href="birt/js/chosen.min.css"> <script src="birt/js/jquery-1.9.1.min.js" type="text/javascript"></script> <script src="birt/js/chosen.jquery.min.js" type="text/javascript"></script> <script> var $jQuery = jQuery.noConflict(); </script>change charset for mysql2013-09-18T00:00:00+00:002013-09-18T00:00:00+00:00https://gjergjsheldija.github.io/change-charset-for-mysql<p>a quick stored procedure to get rid of the infamous : Error Code: 1267. Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation ‘=’</p>
<p>first of all i had to find those tables and databases, and to do so i used the following sql code</p>
<pre><code class="language-mysql">SELECT
table_schema,
TABLE_NAME,
column_name,
character_set_name,
collation_name
FROM
information_schema.COLUMNS
WHERE
collation_name = ‘latin1_swedish_ci’
AND
table_schema = ‘siis_qsut’
ORDER BY
table_schema,
TABLE_NAME,
ordinal_position
</code></pre>
<p>reaplce your_db_name with the name od the db you want to change the charset.</p>
<pre><code class="language-mysql">DELIMITER $$
CREATE PROCEDURE change_charset_and_collation_for_tables()
BEGIN
DECLARE TABLE_NAME VARCHAR(255);
DECLARE end_of_tables INT DEFAULT ;
DECLARE num_tables INT DEFAULT ;
DECLARE cur CURSOR FOR
SELECT
t.TABLE_NAME
FROM
information_schema.TABLES t
WHERE
t.table_schema = ‘your_db_name’
AND
t.table_type=‘BASE TABLE’;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET end_of_tables = 1;
OPEN cur;
tables_loop: LOOP
FETCH cur INTO TABLE_NAME;
IF end_of_tables = 1 THEN
LEAVE tables_loop;
END IF;
SET num_tables = num_tables + 1;
SET @s = CONCAT(‘ALTER TABLE ’ , TABLE_NAME , ’ CONVERT TO CHARACTER SET latin1 COLLATE latin1_general_ci’);
PREPARE stmt FROM @s;
EXECUTE stmt;
END LOOP;
CLOSE cur;
END $$
</code></pre>gjergj.sheldijaa quick stored procedure to get rid of the infamous : Error Code: 1267. Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation ‘=’mysql: updating multiple columns with select2013-03-09T00:00:00+00:002013-03-09T00:00:00+00:00https://gjergjsheldija.github.io/mysql-updating-multiple-columns-with-select<p>sometimes even the simples of the things becomes..hard.<br />
one of those things is updating multimple columns in mysql.<br />
the standard should be something as easy as :</p>
<pre><code class="language-mysql">UPDATE
table1
SET
table1.col1 = table2.x,
table1.col2 = table2.y
FROM
table1
INNER JOIN
table2
ON
table1.CommonColumn = table2.CommonColumn
</code></pre>
<p>instead mysql has a quirk that can be used, <a href="http://dev.mysql.com/doc/refman/5.0/en/join.html">USING()</a></a>.
so the whole thing becomes something like</p>
<pre><code class="language-mysql">UPDATE
table1 INNER JOIN table2 USING (CommonColumn)
SET
table1.col1 = table2.x,
table1.col2 = table2.y
</code></pre>gjergj.sheldijasometimes even the simples of the things becomes..hard. one of those things is updating multimple columns in mysql. the standard should be something as easy as :redmine : An error occurred while sending mail (hostname was not match with the server certificate)2013-02-17T00:00:00+00:002013-02-17T00:00:00+00:00https://gjergjsheldija.github.io/redmine-an-error-occurred-while-sending-mail-hostname-was-not-match-with-the-server-certificate<p>quick fix for a silly error i was having today with redmine not sending email anymore.
open config/environment.rb and add the following lines</p>
<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="no">ActionMailer</span><span class="o">::</span><span class="no">Base</span><span class="o">::</span><span class="n">raise_delivery_errors</span> <span class="o">=</span> <span class="kp">true</span>
<span class="no">ActionMailer</span><span class="o">::</span><span class="no">Base</span><span class="o">::</span><span class="n">smtp_settings</span><span class="p">[</span><span class="ss">:enable_starttls_auto</span><span class="p">]</span> <span class="o">=</span> <span class="kp">false</span>
</code></pre></div></div>
<p>it should solve the problem</p>gjergj.sheldijaquick fix for a silly error i was having today with redmine not sending email anymore. open config/environment.rb and add the following lines ActionMailer::Base::raise_delivery_errors = true ActionMailer::Base::smtp_settings[:enable_starttls_auto] = false it should solve the problemInstall VirtualBox 4.2.2 in Ubuntu 12.10 (Quantal Quetzal) | Liberian Geek2012-12-21T00:00:00+00:002012-12-21T00:00:00+00:00https://gjergjsheldija.github.io/install-virtualbox-4-2-2-in-ubuntu-12-10-quantal-quetzal-liberian-geek<table>
<tbody>
<tr>
<td>[Install VirtualBox 4.2.2 in Ubuntu 12.10 (Quantal Quetzal)</td>
<td>Liberian Geek]<a href="http://www.liberiangeek.net/2012/10/install-virtualbox-4-2-2-in-ubuntu-12-10-quantal-quetzal/">1</a>.</td>
</tr>
</tbody>
</table>gjergj.sheldija[Install VirtualBox 4.2.2 in Ubuntu 12.10 (Quantal Quetzal) Liberian Geek]1.Holmes – CSS based error detection, watson. – The Changelog – Open Source moves fast. Keep up.2012-12-20T00:00:00+00:002012-12-20T00:00:00+00:00https://gjergjsheldija.github.io/holmes-css-based-error-detection-watson-the-changelog-open-source-moves-fast-keep-up<p><a href="http://thechangelog.com/post/28427584549/holmes-css-based-error-detection-watson">Holmes – CSS based error detection, watson. – The Changelog – Open Source moves fast. Keep up.</a>.</p>gjergj.sheldijaHolmes – CSS based error detection, watson. – The Changelog – Open Source moves fast. Keep up..deploying code and db migration via phing2012-12-18T00:00:00+00:002012-12-18T00:00:00+00:00https://gjergjsheldija.github.io/deploying-code-and-db-migration-via-phing<p>working on a project hosted on a shared hosting, with limited resources, i had to find a way to update my working copy with the testing and the production server..and after some tinkering this is the result. hope it’s usefull</p>
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp"><?xml version="1.0"?></span>
<span class="nt"><project</span> <span class="na">name=</span><span class="s">"project_sync"</span> <span class="na">basedir=</span><span class="s">"."</span> <span class="na">default=</span><span class="s">"-init"</span><span class="nt">></span>
<span class="nt"><property</span> <span class="na">name=</span><span class="s">"version"</span> <span class="na">value=</span><span class="s">"4.0"</span><span class="nt">/></span>
<span class="c"><!-- Public targets --></span>
<span class="c"><!-- ============================================ --></span>
<span class="c"><!-- Target: sync:list --></span>
<span class="c"><!-- ============================================ --></span>
<span class="nt"><target</span> <span class="na">name=</span><span class="s">"sync:list"</span> <span class="na">description=</span><span class="s">"Public: List files to be synchronized facade"</span><span class="nt">></span>
<span class="nt"><phingcall</span> <span class="na">target=</span><span class="s">"-sync-execute-task"</span><span class="nt">></span>
<span class="nt"><property</span> <span class="na">name=</span><span class="s">"listonly"</span> <span class="na">value=</span><span class="s">"true"</span><span class="nt">/></span>
<span class="nt"></phingcall></span>
<span class="nt"></target></span>
<span class="c"><!-- ============================================ --></span>
<span class="c"><!-- Target: sync --></span>
<span class="c"><!-- ============================================ --></span>
<span class="nt"><target</span> <span class="na">name=</span><span class="s">"sync"</span> <span class="na">description=</span><span class="s">"Public: Synchronize task fasade"</span><span class="nt">></span>
<span class="nt"><phingcall</span> <span class="na">target=</span><span class="s">"-sync-execute-task"</span><span class="nt">></span>
<span class="nt"><property</span> <span class="na">name=</span><span class="s">"listonly"</span> <span class="na">value=</span><span class="s">"false"</span><span class="nt">/></span>
<span class="nt"></phingcall></span>
<span class="nt"></target></span>
<span class="c"><!-- ============================================ --></span>
<span class="c"><!-- Target: db-update --></span>
<span class="c"><!-- ============================================ --></span>
<span class="nt"><target</span> <span class="na">name=</span><span class="s">"db-update"</span> <span class="na">depends=</span><span class="s">"-list-applied-updates"</span> <span class="na">description=</span><span class="s">"Public: The db update facade "</span><span class="nt">></span>
<span class="nt"><php</span> <span class="na">expression=</span><span class="s">"eval('$list=glob("</span><span class="err">${sync.source.projectdir}/sql/*.sql");</span> <span class="err">natsort</span> <span class="err">($list);</span> <span class="err">return</span> <span class="err">implode(",",</span> <span class="err">$list);');"</span> <span class="na">returnProperty=</span><span class="s">"db.patchfiles"</span><span class="nt">/></span>
<span class="nt"><phingcall</span> <span class="na">target=</span><span class="s">"-list-applied-updates"</span><span class="nt">/></span>
<span class="nt"><echo</span> <span class="na">msg=</span><span class="s">"Searching for updates on : ${sync.source.projectdir}/sql"</span><span class="nt">/></span>
<span class="nt"><foreach</span> <span class="na">param=</span><span class="s">"filename"</span> <span class="na">target=</span><span class="s">"-apply-changelog"</span><span class="nt">></span>
<span class="nt"><fileset</span> <span class="na">dir=</span><span class="s">"${sync.source.projectdir}/sql"</span><span class="nt">></span>
<span class="nt"><include</span> <span class="na">name=</span><span class="s">"${db.patchfiles}"</span><span class="nt">/></span>
<span class="nt"><excludesfile</span> <span class="na">name=</span><span class="s">"${sync.source.projectdir}/build/results.txt"</span><span class="nt">/></span>
<span class="nt"></fileset></span>
<span class="nt"></foreach></span>
<span class="nt"><delete</span> <span class="na">file=</span><span class="s">"${sync.source.projectdir}/build/results.txt"</span><span class="nt">/></span>
<span class="nt"></target></span>
<span class="c"><!-- Private targets --></span>
<span class="c"><!-- ============================================ --></span>
<span class="c"><!-- Target: -init --></span>
<span class="c"><!-- ============================================ --></span>
<span class="nt"><target</span> <span class="na">name=</span><span class="s">"-init"</span> <span class="na">description=</span><span class="s">"Private: Load main settings and display main menu"</span><span class="nt">></span>
<span class="c"><!-- Main Menu --></span>
<span class="nt"><echo></span>Welcome to the site Update System<span class="nt"></echo></span>
<span class="nt"><echo></span>----------------------------------------<span class="nt"></echo></span>
<span class="nt"><echo></span>1) Development to Test<span class="nt"></echo></span>
<span class="nt"><echo></span>2) Test to Production<span class="nt"></echo></span>
<span class="nt"><echo></span>3) Apply db updates<span class="nt"></echo></span>
<span class="nt"><echo></span>x) Exit<span class="nt"></echo></span>
<span class="nt"><echo></span>----------------------------------------<span class="nt"></echo></span>
<span class="nt"><input</span> <span class="na">propertyName=</span><span class="s">"choice"</span> <span class="na">validargs=</span><span class="s">"1,2,3,x"</span><span class="nt">></span>Give the corresponding arg<span class="nt"></input></span>
<span class="nt"><if></span>
<span class="nt"><equals</span> <span class="na">arg1=</span><span class="s">"${choice}"</span> <span class="na">arg2=</span><span class="s">"1"</span><span class="nt">/></span>
<span class="nt"><then></span>
<span class="nt"><property</span> <span class="na">file=</span><span class="s">"test.properties"</span><span class="nt">/></span>
<span class="nt"><phingcall</span> <span class="na">target=</span><span class="s">"sync"</span><span class="nt">/></span>
<span class="nt"></then></span>
<span class="nt"><elseif></span>
<span class="nt"><equals</span> <span class="na">arg1=</span><span class="s">"${choice}"</span> <span class="na">arg2=</span><span class="s">"2"</span><span class="nt">/></span>
<span class="nt"><then></span>
<span class="nt"><property</span> <span class="na">file=</span><span class="s">"production.properties"</span><span class="nt">/></span>
<span class="nt"><phingcall</span> <span class="na">target=</span><span class="s">"sync"</span><span class="nt">/></span>
<span class="nt"></then></span>
<span class="nt"></elseif></span>
<span class="nt"><elseif></span>
<span class="nt"><equals</span> <span class="na">arg1=</span><span class="s">"${choice}"</span> <span class="na">arg2=</span><span class="s">"3"</span><span class="nt">/></span>
<span class="nt"><then></span>
<span class="nt"><property</span> <span class="na">file=</span><span class="s">"database.properties"</span><span class="nt">/></span>
<span class="nt"><phingcall</span> <span class="na">target=</span><span class="s">"db-update"</span><span class="nt">/></span>
<span class="nt"></then></span>
<span class="nt"></elseif></span>
<span class="nt"><elseif></span>
<span class="nt"><equals</span> <span class="na">arg1=</span><span class="s">"${choice}"</span> <span class="na">arg2=</span><span class="s">"x"</span><span class="nt">/></span>
<span class="nt"><then></span>
<span class="nt"><echo></span>bye bye!<span class="nt"></echo></span>
<span class="nt"><php</span> <span class="na">expression=</span><span class="s">"exit();"</span><span class="nt">/></span>
<span class="nt"></then></span>
<span class="nt"></elseif></span>
<span class="nt"></if></span>
<span class="nt"><tstamp/></span>
<span class="nt"></target></span>
<span class="c"><!-- ============================================ --></span>
<span class="c"><!-- Target: -update-changelog --></span>
<span class="c"><!-- ============================================ --></span>
<span class="nt"><target</span> <span class="na">name=</span><span class="s">"-update-changelog"</span> <span class="na">description=</span><span class="s">"Private: Updates the changelog table with the applied updates"</span><span class="nt">></span>
<span class="nt"><echo</span> <span class="na">msg=</span><span class="s">"Applying update : ${filename}"</span><span class="nt">/></span>
<span class="nt"><pdo</span> <span class="na">url=</span><span class="s">"${sync.database.type}:host=${sync.database.host};dbname=${sync.database.name}"</span> <span class="na">userid=</span><span class="s">"${sync.database.user}"</span> <span class="na">password=</span><span class="s">"${sync.database.password}"</span> <span class="na">onerror=</span><span class="s">"continue"</span><span class="nt">></span>INSERT INTO care_changelog( delta ) VALUES ( '${filename}'.sql );<span class="nt"></pdo></span>
<span class="nt"><echo</span> <span class="na">msg=</span><span class="s">"INSERT INTO care_changelog( delta ) VALUES ( '${filename}' );"</span><span class="nt">/></span>
<span class="nt"></target></span>
<span class="c"><!-- ============================================ --></span>
<span class="c"><!-- Target: -apply-changelog --></span>
<span class="c"><!-- ============================================ --></span>
<span class="nt"><target</span> <span class="na">name=</span><span class="s">"-apply-changelog"</span> <span class="na">description=</span><span class="s">"Private: Applies the sql changeset"</span><span class="nt">></span>
<span class="nt"><pdo</span> <span class="na">url=</span><span class="s">"${sync.database.type}:host=${sync.database.host};dbname=${sync.database.name}"</span> <span class="na">userid=</span><span class="s">"${sync.database.user}"</span> <span class="na">password=</span><span class="s">"${sync.database.password}"</span> <span class="na">onerror=</span><span class="s">"abort"</span><span class="nt">></span>
<span class="nt"><transaction</span> <span class="na">src=</span><span class="s">"${sync.source.projectdir}/sql/${filename}"</span><span class="nt">/></span>
<span class="nt"></pdo></span>
<span class="nt"><phingcall</span> <span class="na">target=</span><span class="s">"-update-changelog"</span><span class="nt">/></span>
<span class="nt"></target></span>
<span class="c"><!-- ============================================ --></span>
<span class="c"><!-- Target: -list-applied-updates --></span>
<span class="c"><!-- ============================================ --></span>
<span class="nt"><target</span> <span class="na">name=</span><span class="s">"-list-applied-updates"</span> <span class="na">description=</span><span class="s">"Private: Creates a list of available updates"</span><span class="nt">></span>
<span class="nt"><pdo</span> <span class="na">url=</span><span class="s">"${sync.database.type}:host=${sync.database.host};dbname=${sync.database.name}"</span> <span class="na">userid=</span><span class="s">"${sync.database.user}"</span> <span class="na">password=</span><span class="s">"${sync.database.password}"</span> <span class="na">onerror=</span><span class="s">"stop"</span><span class="nt">></span>
<span class="nt"><formatter</span> <span class="na">type=</span><span class="s">"plain"</span> <span class="na">usefile=</span><span class="s">"true"</span> <span class="na">showheaders=</span><span class="s">"false"</span> <span class="na">coldelim=</span><span class="s">""</span> <span class="na">outfile=</span><span class="s">"${sync.source.projectdir}/build/results.txt"</span><span class="nt">/></span>
SELECT delta FROM `care_changelog` ORDER BY CAST(replace( substring(delta,7,3) , '.' , '' ) AS UNSIGNED);
<span class="nt"></pdo></span>
<span class="nt"></target></span>
<span class="c"><!-- ============================================ --></span>
<span class="c"><!-- Target: -sync-execute-task --></span>
<span class="c"><!-- ============================================ --></span>
<span class="nt"><target</span> <span class="na">name=</span><span class="s">"-sync-execute-task"</span> <span class="na">description=</span><span class="s">"Private: Executes the synchronize task"</span><span class="nt">></span>
<span class="nt"><echo</span> <span class="na">msg=</span><span class="s">"Syncing files"</span><span class="nt">/></span>
<span class="c"><!-- <if>
<not>
<isset property="sync.verbose" />
</not>
<then>
<property name="sync.verbose" value="true" override="true" />
<echo message="The value of sync.verbose has been set to true" />
</then>
</if> --></span>
<span class="nt"><property</span> <span class="na">name=</span><span class="s">"sync.remote.auth"</span> <span class="na">value=</span><span class="s">"${sync.remote.user}@${sync.remote.host}"</span><span class="nt">/></span>
<span class="nt"><taskdef</span> <span class="na">name=</span><span class="s">"sync"</span> <span class="na">classname=</span><span class="s">"phing.tasks.ext.FileSyncTask"</span><span class="nt">/></span>
<span class="nt"><sync</span> <span class="na">sourcedir=</span><span class="s">"${sync.source.projectdir}"</span> <span class="na">destinationdir=</span><span class="s">"${sync.remote.auth}:${sync.destination.projectdir}"</span> <span class="na">excludefile=</span><span class="s">"${sync.exclude.file}"</span> <span class="na">listonly=</span><span class="s">"${listonly}"</span> <span class="na">verbose=</span><span class="s">"${sync.verbose}"</span><span class="nt">/></span>
<span class="nt"></target></span>
<span class="nt"></project></span>
</code></pre></div></div>
<p>the configuration files are as follows</p>
<p>```ini [database.properties]</p>
<h1 id="database-connection-properties">database connection properties</h1>
<h1 id="to-be-updated-on-a-server-basis">to be updated on a server basis</h1>
<p>sync.source.projectdir=/home/xxxx/www/website/
sync.database.type=mysql
sync.database.name=database_name
sync.database.host=localhost
sync.database.user=db_user
sync.database.password=db_password
production.properties</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
```ini [production.properties]
# production server properties
sync.source.projectdir=/var/www/website/
sync.destination.projectdir=/home/client/www/
sync.remote.host=hostname.com
sync.remote.user=remote_user
sync.destination.backupdir=hostname.com/website/backup
sync.exclude.file=/var/www/website/build/sync.exclude
sync.verbose=false
</code></pre></div></div>
<p>test.properties is identical to production.properties except for the values.</p>
<p>```bash [sync.exclude]
.*/
.buildpath
.project
.hgignore
cache
build
uploads</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
changesets.sql is the table containing the changesets
```sql [changesets.sql]
CREATE TABLE IF NOT EXISTS `changelog` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`delta` VARCHAR(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
</code></pre></div></div>gjergj.sheldijaworking on a project hosted on a shared hosting, with limited resources, i had to find a way to update my working copy with the testing and the production server..and after some tinkering this is the result. hope it’s usefullpostgres change column type from boolean to integer2012-12-03T00:00:00+00:002012-12-03T00:00:00+00:00https://gjergjsheldija.github.io/postgres-change-column-type-from-boolean-to-integer<p>postgres change column type from boolean to integer</p>
<div class="language-sql highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="k">table_name</span> <span class="k">ALTER</span> <span class="k">column_name</span> <span class="k">SET</span> <span class="k">DEFAULT</span> <span class="k">null</span><span class="p">;</span>
<span class="k">ALTER</span> <span class="k">TABLE</span> <span class="k">table_name</span>
<span class="k">ALTER</span> <span class="k">column_name</span> <span class="k">TYPE</span> <span class="n">INTEGER</span>
<span class="k">USING</span>
<span class="k">CASE</span>
<span class="k">WHEN</span> <span class="k">false</span> <span class="k">THEN</span> <span class="mi">0</span> <span class="k">ELSE</span> <span class="mi">1</span>
<span class="k">END</span><span class="p">;</span>
<span class="k">ALTER</span> <span class="k">TABLE</span> <span class="k">table_name</span> <span class="k">ALTER</span> <span class="k">column_name</span> <span class="k">SET</span> <span class="k">DEFAULT</span> <span class="mi">0</span><span class="p">;</span>
<span class="k">COMMIT</span><span class="p">;</span>
</code></pre></div></div>gjergj.sheldijapostgres change column type from boolean to integerHow to Move PostgreSql Tables to a Different Schema « Corey Coogan2012-11-06T00:00:00+00:002012-11-06T00:00:00+00:00https://gjergjsheldija.github.io/how-to-move-postgresql-tables-to-a-different-schema-corey-coogan<p><a href="http://blog.coreycoogan.com/2010/12/22/how-to-move-postgresql-tables-to-a-different-schema/">How to Move PostgreSql Tables to a Different Schema « Corey Coogan</a>.</p>gjergj.sheldijaHow to Move PostgreSql Tables to a Different Schema « Corey Coogan.fog with mikrotik as a dhcp server2012-11-05T00:00:00+00:002012-11-05T00:00:00+00:00https://gjergjsheldija.github.io/fog-with-mikrotik-as-a-dhcp-server<p>having mikrotik 3.x give the correct tftp ip to the client can be a bit of a pain.
after some hacking, googling and good luck, finally was able to do it.
and it was not what the manual or helps int he forums say.
you need to go to the terminal and issue the following commands :</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/ip dhcp-server network <span class="nb">set </span>0 boot-file-name<span class="o">=</span>undionly.kkpxe next-server<span class="o">=</span>10.10.0.2
</code></pre></div></div>
<p>and, they are not going to show in the network properties and neither the console..</p>gjergj.sheldijahaving mikrotik 3.x give the correct tftp ip to the client can be a bit of a pain. after some hacking, googling and good luck, finally was able to do it. and it was not what the manual or helps int he forums say. you need to go to the terminal and issue the following commands :