Binary Expressions

Next Page »

2008-10-23

TaskFreak! v0.6.2 - Tweaking Priority Menu

Filed under: — Adam @ 10:42 am

Background Knowledge


For some reason or another the priority menu in the edit task panel is not wide enough and therefore it cuts off the priority names. This can be easily fixed by modifying some inline CSS. Yes I agree this should be done within the skin’s CSS file, however there is nothing present in the CSS file to alter that I could find.

(more…)

TaskFreak! v0.6.2 - Add My Projects List

Filed under: — Adam @ 10:17 am

Background Knowledge


TaskFreak! presently does not have a means via the web interface to present a complete list of tasks for which the current user is the project leader. I will show you how to add “My Projects” list based on bpiper’s solution with a slight difference. My solution is almost identical to bpiper’s but with a different approach to continue support of the supported interface languages. To do this each supported language file will require to be edited.

Thanks to bpiper for posting your solution.

(more…)

2008-10-22

Make a Difference, Vote for Ron Paul

Filed under: — Adam @ 11:15 pm
Legalize Freedom, VoteRonPaul.com

Source: Vote Ron Paul
Source: Ron Paul’s Congressional Website
Source: Ron Paul’s Campaign For Liberty
Source: Ron Paul Revoltion
Source: Wikipedia on Ron Paul

Ron Paul - 1983 - Power Over Money

Filed under: — Adam @ 11:03 pm

Ron Paul speaks the truth and tried to grab your attention in 1983. Are you listening now?

Ron Paul said in 1983, “There’s No Greater Power than the Power Over Money”.

Source: There is no greater power than the power over money
Source: YouTube

Apple Mac Advert - Bean Counter

Filed under: — Adam @ 10:42 pm

Source: YouTube

George Carlin Nails It

Filed under: — Adam @ 10:24 pm

Source: YouTube

This Hour Has 22 minutes - Apology in Washington

Filed under: — Adam @ 10:00 pm

Source: YouTube

2008-10-14

Pear::Date Returned Timezone is Wrong

Filed under: — Adam @ 1:05 pm

Background Knowledge


I’m trying to determine the difference in minutes between two timestamps. I’m using Pear::Date to do this. The issue comes into play when I noticed that the wrong timezone was being used by Pear::Date, UTC. If I do not use Pear::Date the timezone is set correctly.

I have tried using date_default_timezone_set() and it does set the timezone back, however I feel this shouldn’t be necessary as the default timezone should be used. I have been using date_default_timezone_get() to determine what timezone is being used.

It’s my understanding that Pear::Date uses UTC when it is unable to determine the default timezone. As far as I know I have the default timezone set correctly and with a valid ID (see below). I was able to determine that the timezone changed from my default timezone to UTC after I used Date::setFromDateDiff(). This does not seem right at all.

I have checked the following.

  • Pear v1.7.2 stable
  • Pear::Date v1.4.7 stable
  • php.ini (default timezone) - date.timezone = “Canada/Saskatchewan”
  • phpinfo() - Correct configure file being loaded, /var/www/conf/php.ini.
  • phpinfo() - Under Date, date/time support is enabled.
  • phpinfo() - Default timezone - Canada/Saskatchewan
  • phpinfo() - date.timezone - Canada/Saskatchewan / Canada/Saskatchewan

PHP Code Test Case


1
2
3
4
5
6
7
8
9
require_once("Date.php");
 
$obFirstDate = new Date('20081014155640');
$obSecondDate = new Date(date("YmdHis",time()));
 
$obDateSpan = new Date_Span();
$obDateSpan->setFromDateDiff($obFirstDate, $obSecondDate);
echo (int)$obDateSpan->toMinutes();
echo "<br />".date_default_timezone_get();

Solution - Unknown


Does anyone have any suggestions where to look or what to do to fix this problem?

2008-10-10

Pink - Dear Mr. President

Filed under: — Adam @ 10:43 am

Source: Pink’s Music Video of Dear Mr. President
Source: Pink’s Official website
Source: Pink’s Official MySpace
Source: Pink’s Official YouTube channel
Source: Song Lyrics of Dear Mr. President

Lego Mario designed using modo

Filed under: — Adam @ 9:34 am

I came across this amazing Mario figure made entirely out of Lego. The designer Keith Brogan, created the Lego Mario figure using NextEngine 3D scanner and a commercial software package called Modo.

Source: Luxology Forum

2008-10-8

Using short if statement in programming

Filed under: — Adam @ 2:50 pm

In many programing languages it is possible to shorten if statements using what’s called the ternary operator. It is sometimes referred as the “one line if statement” or the “short if statement”. This can help at times to produce cleaner code, however use this operator wisely as it is not always best to be used for more complicated statements.

PHP Example of an if statement


1
2
3
4
5
6
7
8
if($nFoo > 0)
{
   echo "I'm at the work.";
}
else
{
   echo "I'm at home.";
}

PHP Example using the ternary operator


1
echo $nFoo > 0 ? "I'm at the work." : "I'm at home.";

The expression (expr1) ? (expr2) : (expr3) evaluates to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE.

Source: Wikipedia on Ternary Operator
Source: PHP Manual: Comparison Operators

2008-10-7

How To - Pad Zeros (prefix or suffix)

Filed under: — Adam @ 1:00 pm

Background Knowledge


There is certain times when one needs to pad zeros to the beginning (prefix) or ending (suffix) of a integer.

Below is what I came up with for a solution in JavaScript. All one has to do is call the function with the integer value, the length (integer) of the padding and position to place the padding. Use “start” for the prefix or use “end” for the suffix. Please lets see some comments on how to improve this small block of code.

Solution


1
2
3
4
5
6
7
8
9
10
11
function fnPaddingZeros(nInterger,nPaddingLength,szPaddingPos)
{
	//convert integer to string
	nInterger=nInterger.toString();
	while(nInterger.length < nPaddingLength)
	{
		if(szPaddingPos == "start") { nInterger = '0' + nInterger; }
		else if(szPaddingPos == "end") { nInterger = nInterger + '0'; }
	}
	return nInterger;
}

Next Page »

Take back your mailbox - CAUCE.org

Powered By Wordpress PHP: Hypertext Preprocessor MySQL Powered Download Juice, the cross-platform podcast receiver
Proud To Be Canadian Get Firefox Valid XHTML Valid CSS
<NO>OOXML Logo


25 queries. 0.603 seconds.
Copyright © 2004 - 2005 by Adam Douglas