My contemplations and diurnal novelties are publicized here

Archive for March, 2012

Adding label to ExtJs Pie Chart other than legend


I do run into a problem where i have to show label on pie chart other than captions on legend. Some what like below

My Team lead researched and found a way to do so

label: {
field: ‘name’,
display: ‘rotate’,
contrast: true,
renderer: function (label)
{
// this will change the text displayed on the pie
var cmp = Ext.getCmp(‘chartCmpRedemption’); // id of the chart
var index = cmp.store.findExact(‘name’, label); // the field containing the current label
var data = cmp.store.getAt(index).data;
return data.data1; // the field containing the label to display on the chart
}
}

 

How to add days to current date using PHP


Here is the code:-

$todayDate = date(“Y-m-d”);// current date
$date = strtotime(date(“Y-m-d”, strtotime($todayDate)) . ” +30 day”);
echo “After adding thirty days: “.date(‘Y-m-d’, $date).”<br>”;

Taken from:- http://www.roseindia.net/tutorial/php/phpdate/php-date-add-1-day.html

How to create Virtual Host in Apache on multiple ports


You need to modify the httpd.conf file located at C:\Program Files (x86)\Zend\Apache2\conf. All you have to do place the lines posted below after #Listen 12.34.56.78: 8080. 

Listen 8080
NameVirtualHost *:8080

<VirtualHost *:8080>
ServerName ubl-ois
DocumentRoot “D:\Program Files (x86)\Zend\Apache2\htdocs\v0.8\public”

<Directory “D:\Program Files (x86)\Zend\Apache2\htdocs\v0.8\public”>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Listen 8081

<VirtualHost *:8081>
ServerName ubl-ois-beu
DocumentRoot “D:\Program Files (x86)\Zend\Apache2\htdocs\BEU\public”

<Directory “D:\Program Files (x86)\Zend\Apache2\htdocs\BEU\public”>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

How to change work days or start of your week in outlook 2010


Goto File–> Options –> Calendar

How to get a sub string starting from a position in php


Query:-
I need to find a sub string, which is enclosed in ‘[‘ and ‘]’
e.g My String [test]
I need to get ‘test’ out of this whole string so what i did.

Solution:-

echo substr($string, strpos($string,'[‘,0) + 1, (strpos($string,’]’) – strpos($string,'[‘,0)) – 1 ) ;

Explanation:-

Substring(You string, First string position + 1, Last String Postition – First String Position – 1);

Asma-ul-Husna


You can find the recitation of 99 Name of Allah here

Invoke or BeginInvoke cannot be called on a control until the window handle has been created


Installing SQL server 2008 on 64 OS is a nightmare. You will be observing several errors once you try to install it. Here is my success journey

  1. I installed Visual Studio 2008 SP1\vs90sp1
  2. Then I installed Microsoft® SQL Server® 2008 Management Studio Express (64 Bit)
  3. Then I installed Microsoft® SQL Server® 2008 Express (64 Bit)

And somehow SQL server 2008 is installed on my 64 Bit (Window 7)

%d bloggers like this: