tag:blogger.com,1999:blog-32503943205667331792024-03-13T23:20:59.312-04:00comrade developerA blog about development, development tools, IT industry and everything related.Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-3250394320566733179.post-34298066076105601512012-09-13T08:28:00.001-04:002012-09-14T00:33:08.552-04:00iPhone<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-J0F-YYF9qto/UFHQttHbOVI/AAAAAAAAAIA/Z0_sZ00zXmc/s1600/5e723352ee256e8934fe513d6117808f_view.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="http://1.bp.blogspot.com/-J0F-YYF9qto/UFHQttHbOVI/AAAAAAAAAIA/Z0_sZ00zXmc/s320/5e723352ee256e8934fe513d6117808f_view.jpg" width="188" /></a></div>
Once again, I realized that there is nothing better (at least currently) rather than HTC/Samsung and Android-based devices.<br />
<br />
Anyway, want to see iPhone 6, 7, 8, 9, 10+?<br />
Visit: <a href="http://www.future-iphone.com/">www.future-iphone.com</a>Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.com2tag:blogger.com,1999:blog-3250394320566733179.post-846329487079666232012-09-06T12:37:00.002-04:002012-09-06T12:37:50.286-04:00Mac Book AirIs the Mac Book Air (13") is so cool looking, works real fast and is a very light/thin device?<br />
<a name='more'></a>
<br />
<b>Yes, it is.</b>Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.com0tag:blogger.com,1999:blog-3250394320566733179.post-3766396195731518692012-09-06T10:00:00.000-04:002012-09-06T10:00:02.827-04:00...direction: rtlWhen you output a lot of text information in HTML pages you may need to truncate some words. A smart thing to do is to use CSS3 text-overflow property. For example: to get text truncated like "Here is a long te..." you would code:<br />
<br />
<b>HTML
</b><br />
<div class="code">
<span class="truncate">Here is a long text information.</span></div>
<br />
<b>CSS</b><br />
<div class="code">
<pre>SPAN.truncate {
width: 100px;
overflow: hidden;
white-space: nowrap;
text-align: left;
}</pre>
</div>
<br />
Sometimes you may need to cut text from left side to get something like "...a long text information". This is easy to do using the "direction: rtl" CSS property. Add another class which will define alternate truncation side:<br />
<br />
<b>CSS</b><br />
<div class="code">
<pre>SPAN.truncate.left {
direction: rtl;
}</pre>
</div>
<br />
Usage for the above CSS class:
<br />
<div class="code">
<span class="truncate left">Here is a long text information.</span></div>
Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.com0tag:blogger.com,1999:blog-3250394320566733179.post-57958870007675156912012-09-06T04:04:00.000-04:002012-09-06T04:20:29.901-04:00Fighting with old code<div><img border="0" src="http://3.bp.blogspot.com/-QMs4_DMwSl8/UEhcRZ4NtjI/AAAAAAAAAHs/fje5whX6fn0/s1600/fp.jpg" style="float:left" />
Some people prefer to use old outdated scripts even if there are good modern alternatives are available. Such code <strike>can be</strike> is very dangerous from security standpoint. Nevertheless, reasonable sense does not work for them. Today we had to fix issue with the MultiCart (<a href="http://www.iscripts.com/multicart/" rel="nofollow">http://www.iscripts.com/multicart/</a>) script which uses <a href="http://php.net/manual/en/function.session-register.php">session_register()</a> function to work with sessions. The problem is that this function is not available in PHP 5.4.</div>
<a name='more'></a>Here is a quick fix to this problem (the code below should be inserted into the module with common functions which is loaded by all other scripts).<br />
<br />
<div class="code">
<pre>if(!function_exists('session_is_registered')){
function session_is_registered($varname)
{
return isset($_SESSION[$varname]);
}
}
if(!function_exists('session_unregister')){
function session_unregister($varname)
{
if(session_is_registered($varname])){
unset($_SESSION[$varname];
}
}
}
if(!function_exists('session_register')) {
function session_register() {
$arguments = funct_get_args();
if(empty($arguments)){
return false;
}
foreach($arguments as $varname){
if(isset($GLOBALS[$varname])){
$_SESSION[$varname] = $GLOBALS[$varname];
}
}
return false;
}
}
</pre>
</div>Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.com0tag:blogger.com,1999:blog-3250394320566733179.post-32427475037851037492012-08-27T13:00:00.000-04:002012-08-27T13:28:22.541-04:00Midnight Commander and other linux stuff on Mac OSI recently started using Mac as my secondary laptop but after a few days of being a "mac user" I was really missing the mc (Midnight Commander) command-line utility. Here is a quick guide how to install it in Mac OS (tested under Mac OS version 10.8.1).<br />
<a href="http://1.bp.blogspot.com/-2jqBZdRuTfA/UDuZyksfyjI/AAAAAAAAAHY/0d09gFCF5Og/s1600/mc-macos.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-2jqBZdRuTfA/UDuZyksfyjI/AAAAAAAAAHY/0d09gFCF5Og/s1600/mc-macos.png" /></a><br />
<a name='more'></a><br />
First of all you need to install <a href="http://code.google.com/p/rudix/">Rudix</a> collection of Unix software packages for OS X. To do this you need to:<br />
<ul>
<li>Open Terminal.app</li>
<li>Paste and execute the following code:</li>
</ul>
<div class="code">
curl http://rudix.googlecode.com/hg/Ports/rudix/rudix.py | sudo python - install rudix
</div>
<ul>
<li>Enter administrator's password.</li>
</ul>
<div>
After this <a href="http://code.google.com/p/rudix/wiki/mc">download</a> and install Midnight Commander's package. That's it. Now you will be able to run 'mc' from your terminal on OS X.</div>
<div>
<br /></div>
<div>
<a href="http://code.google.com/p/rudix/w/list">Click here</a> to view list of all available packages you can install with Rudix.</div>
Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.com2tag:blogger.com,1999:blog-3250394320566733179.post-27117647830650484092012-08-25T08:00:00.000-04:002012-08-25T08:00:01.543-04:00BugZilla<br />
<h3>
BugZilla</h3>
I am continuing to share my experience with bug tracking systems started <a href="http://comradedeveloper.blogspot.com/2012/08/bug-tracking-system-of-dream.html">here</a>. The second BT in my list — BugZilla. This is a free and open source product written in Perl. it's a very popular system used by big guys (Mozilla, Gnome, Apache, etc.)<br />
<a name='more'></a>And I am not really sure why. First of all this is the most slowest web script (not only considering bugtracking systems) I have ever seen. You create a bug record and wait.. You filter results and wait.. you clickanythingthere and wait. This really disappoints because overall the product is decent, default UI theme is clean but I would not like this system if not the <a href="http://almworks.com/deskzilla/overview.html" rel="nofollow">DeskZilla</a> tool.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://almworks.com/screenshots/deskzilla_overview.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="496" src="http://almworks.com/screenshots/deskzilla_overview.gif" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">DeskZilla UI</td></tr>
</tbody></table>
<br />
The tool changes everything, first of all you can hide it to system tray, you can paste screenshots, create your custom filters. It's just awesome... We used it for almost a year but at the end the slow speed of BugZilla made me to look for a different solution.Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.com0tag:blogger.com,1999:blog-3250394320566733179.post-53309705819446167632012-08-22T07:00:00.000-04:002012-08-22T07:00:16.634-04:00World's Smallest Web Server<div class="separator" style="clear: both; text-align: center;">
<a href="http://d116.com/ace/images/ACE-match-topview.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://d116.com/ace/images/ACE-match-topview.jpg" /></a></div>
<br />
webACE is the smallest web server in the world. Isn't this awesome?<br />
<br />
More info about webACE here: <a href="http://d116.com/ace/">http://d116.com/ace/</a>Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.com0tag:blogger.com,1999:blog-3250394320566733179.post-22478151926755484492012-08-21T17:00:00.000-04:002012-08-21T17:00:04.243-04:00Le ChefDuring last years I haven't seen a good comedy, a good French comedy, sorry, until I watched the "Le Chef" by Daniel Cohen. It's a light movie I highly recommend for family watching.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='630' height='524' src='https://www.youtube.com/embed/cf2Nk3Ld8Og?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<a href="http://www.imdb.com/title/tt1911553/" rel="nofollow" target="">The movie on IMDb </a>Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.com0tag:blogger.com,1999:blog-3250394320566733179.post-47140679781066905302012-08-21T11:00:00.000-04:002012-08-21T12:48:19.177-04:00Bug Tracking System of a DreamThis is obvious that the main purpose of any bug tracking system is to keep list of defects in software, app or a website. Any BT does this of course but what is really needed for a small group of developers and what is currently available?<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-baMkNmq0TxU/UDM7JDQ2fYI/AAAAAAAAAGc/siHRL3fd0W8/s1600/Untitled-2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-baMkNmq0TxU/UDM7JDQ2fYI/AAAAAAAAAGc/siHRL3fd0W8/s1600/Untitled-2.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a name='more'></a>First of all I hate when to submit a new bug you have to go through million steps and fill various parameters you have to fill regardless you need them or not. In the ideal world, submitter should paste a screenshot, enter a title, enter tag(s), optionally add a description (just in case info to recreate the issue is required) and that's it. Ok, but let me dream a little more.. it should have a nice looking customizable UI, work fast and finally it should be free.<br />
<br />
As with any key choice I usually review all available options, install, try them for a few weeks (at least) on real projects and see if they correspond to my expectations or not. Said that, I don't really have an answer, URL, name, brand.. (i.e. I have not found a very good bug tracking system which would fit all those requirements) but within these posts I just want to share my experience and opinion on the bug tracking systems I have used.<br />
<br />
One more thing for the preamble. I really appreciate work of developers, especially those who develop open-source and free products, and I realize that "you shouldn't look a gift horse in the mouth".<br />
<br />
<h3>
Mantis</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://upload.wikimedia.org/wikipedia/en/0/00/Mantis_logo.gif" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://upload.wikimedia.org/wikipedia/en/0/00/Mantis_logo.gif" /></a></div>
<br />
<br />
Well, this was the first bug tracking system we used in my company for a very long time. It's free and seems a very popular one but every time I needed to tie its UI to look custom (like to match company's or project's website) this became a real pain. The problem is that guys started developing this project in ~2002 and the code is so outdated, very hard to customize (i.e. no MVC, strange looking CSS, etc).<br />
<br />
If you use <a href="http://www.eclipse.org/" rel="nofollow" target="_blank">Eclipse IDE</a> you may consider trying a <a href="http://sourceforge.net/projects/mylyn-mantis/" rel="nofollow">connector for Mantis</a> which helps to add and view issues directly from the development environment. Other good things about this product is that they have changelog and roadmap functionality which worked good for us.<br />
<br />
Using this BT you get a stable system to track your bugs, but you may forget about AJAX & nice UI.Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.com1tag:blogger.com,1999:blog-3250394320566733179.post-87290045169844249562012-08-21T08:00:00.000-04:002012-08-21T08:40:33.175-04:00Twitter Bootstrap Got Updated to Version 2.1<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-qTLxYpjwx4w/UDNCg1APExI/AAAAAAAAAGs/YWfNBhLX34c/s1600/bs.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-qTLxYpjwx4w/UDNCg1APExI/AAAAAAAAAGs/YWfNBhLX34c/s1600/bs.jpg" /></a></div>
Twitter Bootstrap an awesome framework for web developers got a new version update. <br />
<a name='more'></a>Here is the list of key changes in the project:<br />
<br />
<ul>
<li>Submenu support on dropdowns</li>
<li>Affix JavaScript plugin</li>
<li>Block level buttons</li>
<li>State classes on table rows</li>
<li>Improved disabled states on navs and dropdowns</li>
<li>The navbar component is now white by default, with an optional class to darken it</li>
<li>Improved prepended and appended inputs</li>
<li>New base font-size and line-height</li>
<li>Added variable for navbar collapse trigger point</li>
<li>Fluid grid offsets</li>
<li>Fluid grid system variables are no longer fixed percentages</li>
<li>Removed LESS docs page</li>
<li><a href="https://github.com/twitter/bootstrap/issues?milestone=7&page=1&state=closed">Full list of changes</a>.</li>
</ul>
Go to <a href="http://twitter.github.com/bootstrap/">bootstrap's official website</a> for samples and documentation.Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.com0tag:blogger.com,1999:blog-3250394320566733179.post-89858139696620596332012-08-20T11:30:00.000-04:002012-08-20T15:47:56.591-04:00Tail for Windows?You would agree that linux's terminal and window's cmd.exe are not
comparable things, there are a lot of things which are not available in
cmd and one of those missing things is the tail utility which I find
very useful to watch updates in debug log files.<br />
Here are two solutions I use to get the same functionality on Windows.<br />
<br />
<a name='more'></a><br />
<br />
<h3>
<b>PowerShell</b></h3>
In the power shell you may use the "Get-Content" command, here is how:<br />
<div class="code">
Get-Content -Path "c:\path\to\your_log_file.txt" -Wait</div>
I could be too picky about this but the PS's syntax is much different from linux's terminal and I don't like it at all.<br />
<br />
<h3>
<b>Cmd.exe</b></h3>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://3.bp.blogspot.com/-F91LWCj3bQU/UDIo3H5WHNI/AAAAAAAAAC8/gH6RGQNUVrs/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-F91LWCj3bQU/UDIo3H5WHNI/AAAAAAAAAC8/gH6RGQNUVrs/s1600/3.jpg" /></a></div>
<br />
The other solution is to download and install the <a data-mce-href=" http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displayLang=en" href="http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displayLang=en">Windows Server Resource Kit</a>.
After installing the only thing you need is to set PATH variable
(Control Panel > System > Edit the system environment variables)
to the directory where the Kit was installed to and you may use tail
utility in a common Command Processor.<br />
<div class="code">
C:\>tail -f "c:\path\to\your_log_file.txt"</div>
Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.com0tag:blogger.com,1999:blog-3250394320566733179.post-52924870010897454202012-08-20T08:07:00.002-04:002012-08-20T11:18:32.594-04:00Ubuntu on the Vaio S seriesAt the end of the spring I have bought a new laptop, my previous one
(Samsung Q…. not sure what the exact model was too slow for me). My
choice came to the Vaio S series from Sony, it’s a nice laptop with
hi-res screen and keyboard illumination (which is important for me when I
code in the night).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-4ioxd61FFSI/UDImXgMq8dI/AAAAAAAAACk/OwDIahhw9bU/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-4ioxd61FFSI/UDImXgMq8dI/AAAAAAAAACk/OwDIahhw9bU/s1600/1.jpg" /></a></div>
<br />
<br />
It has pre-installed windows OS, but recently I tried to move all
developments to linux and what a surprise.. after installing ubuntu on
it, the laptop was heating like crazy. <br />
<a name='more'></a>So after digging more into the
subject I have tried the following things:<br />
<ul>
<li>Tried gnome shell</li>
<li>Installed “battery indicator” (for those who’re interested see ppa below) and switched to Powersave mode.</li>
<li>Installed proprietary drivers for the video card (this was my
biggest mistake because after installing them unity switched to 2D mode
and gnome shell was loading only in classic mode).</li>
<li>Dancing with a tambourine and putting ice around the laptop..</li>
</ul>
After a few hours of searching I finally found what the problem
was, the vaio has a hybrid video card (it has integrated card on the
motherboard and another ATI video card for faster graphics). You may
switch between these modes using the STAMINA/SPEED switch and it works
very well on Windows but unfortunately no drivers available for Ubuntu.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-gE5GjayVsLE/UDImZor2FTI/AAAAAAAAACs/0fauJMA5LBg/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-gE5GjayVsLE/UDImZor2FTI/AAAAAAAAACs/0fauJMA5LBg/s1600/2.jpg" /></a></div>
<br />
Well the solution is to use <a data-mce-href="https://help.ubuntu.com/community/HybridGraphics" href="https://help.ubuntu.com/community/HybridGraphics">vgaswitcheroo</a> mechanism to turn the ATI card off. Here is how to do this:<br />
<ol>
<li>Edit <code>/etc/modprobe.d/blacklist.conf</code></li>
<li>Add the the following line to the end of the file:<div class="code">
blacklist radeon</div>
</li>
<li>Then edit <code>/etc/rc.local file</code></li>
<li>And add the following code before exit 0<div class="code">
modprobe radeon<br />
chown -R $USER:$USER /sys/kernel/debug <br />
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch</div>
</li>
<li>Restart PC</li>
</ol>
To check if the above worked open a terminal and execute:<br />
<div class="code">
sudo less /sys/kernel/debug/vgaswitcheroo/switch</div>
If output is similar to this:<br />
Then all worked fine and your PC becomes less noisy.<br />
<div class="code">
0:IGD:+:Pwr:0000:00:02.0<br />
1:DIS: :Off:0000:01:00.0<br />
<br /></div>
P.S.<br />
<br />
<b>Battery Indicator applet</b><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-RMzJT3M-kII/UDImR-wV-TI/AAAAAAAAACc/tAPlG5qv9W0/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-RMzJT3M-kII/UDImR-wV-TI/AAAAAAAAACc/tAPlG5qv9W0/s1600/1.png" /></a></div>
<br />
<div class="code">
sudo apt-add-repository ppa:iaz/battery-status<br />
sudo apt-get update<br />
sudo apt-get install battery-status
</div>
Dmitryhttp://www.blogger.com/profile/16380195280960071099noreply@blogger.com3