Monday, July 11, 2011
Dimensions for Android
Density-independent Pixels - an abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi (dots per inch) screen, so160dp is always one inch regardless of the screen density. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion. You should use these units when specifying view dimensions in your layout, so the UI properly scales to render at the same actual size on different screens. (The compiler accepts both “dip” and “dp”, though “dp” is more consistent with “sp”.)
sp
Scale-independent Pixels - this is like the dp unit, but it is also scaled by the user’s font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and the user’s preference.
pt
Points - 1/72 of an inch based on the physical size of the screen.
px
Pixels - corresponds to actual pixels on the screen. This unit of measure is not recommended because the actual representation can vary across devices; each devices may have a different number of pixels per inch and may have more or fewer total pixels available on the screen.
mm
Millimeters - based on the physical size of the screen.
in
Inches - based on the physical size of the screen.
To make it absolutely clear – never use any of the above but sp or dp unless you absolutely have to. Using sp / dp will make your Android applications compatible with multiple screen densities and resolutions.
Ref: -http://developer.android.com/guide/topics/resources/more-resources.html#Dimension
Monday, September 13, 2010
Print Mysql Database Structure Using PHP
<?php
$HOSTNAME = 'localhost';
$USERNAME = 'root';
$PASSWORD = '';
$DBNAME = 'rizvi_test_db';
mysql_select_db($DBNAME, mysql_connect($HOSTNAME, $USERNAME, $PASSWORD)) or die(mysql_error());
$result = mysql_query("SHOW TABLES;") or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo $row[0]; //print the table name
$result2 = mysql_query("DESCRIBE ".$row[0].";") or die(mysql_error()); //get details schema for each table
echo "<table border='1' width='70%'>";
echo "<tr><td>Field</td><td>Type</td><td>Null</td><td>Key</td><td>Default</td><td>Extra</td>";
while($row2 = mysql_fetch_array($result2)){
for($i=0; $i<6; $i++){
if($row2[$i] == "" || $row2[$i] == NULL){
$row2[$i] = " ";
}
}
echo "<tr>";
echo "<td>".$row2[0]."</td><td>".$row2[1]."</td><td>".$row2[2]."</td><td>".$row2[3]."</td><td>".$row2[4]."</td><td>".$row2[5];
echo "</tr>";
}
echo "</table>";
echo "<br/>";
}
?>
Wednesday, September 01, 2010
How to remove mootools.js and caption.js from Joomla1.5 ?
<script type="text/javascript" src="/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/media/system/js/caption.js"></script>
To remove above javascript's import, you just need to
add the following code at the top of your template's index.php file.
<?php
//remove mootools.js and caption.js
$headerstuff=$this->getHeadData();
reset($headerstuff['scripts']);
foreach($headerstuff['scripts'] as $key=>$value){
unset($headerstuff['scripts'][$key]);
}
$this->setHeadData($headerstuff);
?>
Thursday, May 27, 2010
മെയ് 26 2009
Btech കഴിഞ്ഞിട്ടു ഒരു മാസം ആകാറായി , നാലഞ്ച് interview ഒക്കെ അറ്റന്ഡ് ചെയ്തു ചൊറിയും കുത്തിയിരിക്കുന്ന സമയം , മേനിയാന്നത്തെ പത്രതില്ലേ പരസ്യം കണ്ടു ഒരു PHP interview ന്നു എറണാകുളം പോകാന് നില്ക്കുന്നു . കഴിയ്യില്ല് w3schools ന്നും അടിച്ചുമാറ്റിയ ചില PHP നോട്ട്സ് മാത്രം .
ഒരു തുള്ളി ജല പാനം പോലലും കഴിക്കാതെ intercity യിലല് ചാടി കയറി ..... 10 30 യോഒടെ EKM എത്തി ........... interview ക്ക് എത്തിപെട്ടത് ഒരു കൂതറ സ്ഥലത്ത് ....... അവര്ക്ക് 6000 രൂ വേണമെന്ന് ........ പോയി പണി നോക്ക്കാന് പറഞ്ഞു ..
ഞാന് ഇറങ്ങി .......... 2 : 15 ന്റെ നേത്രാവതിക്ക് .......കയറാം ...എന്ന് കരുതീ...എറണാകുള തില്ലേ ...ഒടുകത്ത ട്രഫ്ഫികും താണ്ടി .............2 : 15 ന്നു ......എത്തിയപോഴേക്കും ......ട്രെയിന് അതാ പോകുന്നു
........അവസാനത്തെ boogie യും ലക്ഷ്യം വെച്ച് ഒരു സിനിമ style chasingനടുത്തി ............ ട്രെയിന് ഇല്ലെക്ക് ചാടിയപ്പോഴേക്കും ........ റെയില്വേ പോലീസ് ന്റെ ലാത്തി ...എന്നെ വിഴുത്തി.......platform ഇല്ലെക്ക് തെറിച്ചു വീണ എന്നെ ഒരുത്തനും mind ചെയ്തില്ല .........പോരാത്തതിനു .......പോലീസ് കാരന്റെ ........തെറിയുംമ്മം
........ഒരു വിധം കഷ്ട്ടപെട്ടു .......bench ഇല്ലിരിന്നു ......... എന്നെനി അടുത്ത ട്രെയിന് 4 :20 ന്നെ ഉളു ..... സമയം പോക്കന് വേണ്ടി ...... ജോസ് jn ....left ഇല്ലോട്ടു ഒരു പിടിത്തം പിടിച്ചു ........ ഒരു ഒന്നൊന്നര കിലോ മീറ്റര് ..... കഴിന്നു ... കൊച്ചിന് Shipyard എതിയപോള് ..... ഒരു ആഗ്രഹം .........shipyard കാണണം ..............
തൊട്ടടുത്തുള്ള ....vallamattam estate 5th floorillu കയറി ........Shipyard കണ്ടു ..... കൊള്ളാം !!! ......... തിരിഞ്ഞു നോക്കിയപ്പോള് ..അതാ അവിടെ ....ഒരു സോഫ്റ്റ്വെയര് കമ്പനി .........
e2Mars ............ഏതായാലും അവിടെ എത്തി ..........ഒന്ന് കയരികളയാം എന്ന് കരുതി ............ Central Manager സതിഷ് ഫിലിപ്പ് ....... ഇന്നേ കണ്ടു ......കൊറേ സമസാരിച്ചു ....... .... ആദ്യം ഇംഗ്ലീഷ് ആയിരുന്നു ...പിന്നെ .......എന്റെ അവസ്ഥ കണ്ടു അങ്ങേരു മലയാളം ആക്കി .........
എന്റെ കാഴിച്ചപടുക്കള് ....നന്നായി ബോധിച്ചു ........അങ്ങനേ എന്നെ അവിടെ ........ എടുത്തു ....... ഒരു മാസം ........ അപ്പ്രെന്ടിസയിട്ടുഇ .......... 5 ദിവിസം കൊണ്ട് php , html , css ..തുടങ്ങിയവ....പടിച്ചുവര്ര
1st ജൂണ് ഇന് DOJ തന്നു ............
ഇന്നു "മെയ് 26 2010 " ........ ഒരു വര്ഷം .......... കഴിഞ്ഞ 21 വര്ഷം ജീവിച്ചതിനെക്കള് കുടുതല്ല് ...ഞാന് ജീവിച്ചു
............ കഥ തുടരും ........
Saturday, April 17, 2010
change all text in a column to caps
Sub change()
Dim rng As Range, cell As Range
Set rng = Range("A1:A" & Cells(65536, "A").End(xlUp).Row)
For Each cell In rng
If (cell.Value <> "") Then
cell.Value = UCase(cell.Value)
End If
Next cell
End Sub
Load any module within a joomla 1.5 content article
One of the questions that often gets asked is "How can I load a Joomla! 1.5 Module into a content Article? This is in fact an easy thing to do, and can provide useful solutions such as:
By default, Joomla! Modules can be placed in any Module Position of the Template, but they do not load into Content Articles. This tutorial will explain how to enable and use Module loading within your Joomla! Articles, Here are the steps: Step 1 - Create a new Module or Copy an existing one.Within your Joomla! Administration, navigate to Extensions > Module Manager. If you are creating a new Module, click on the New button at the top right of the screen, or you can put a tick in the box next to an existing Module and copy it using the Copy button. If you copy an existing Module, the new Module will be created or copied and placed within the Module listing. Step 2 - Edit the Module
On the left side of the Module Edit Screen you will see some properties such as Module Title, Enabled, Module Position etc. Here is where the power of Joomla! shows itself. Usually we would just click on the Module Position field and select an available Module Position, but it is also possible to enter in your own value here as believe it or not, this field is editable! We need to edit this field and enter in a custom Module Position Name which will be used for our in-content use. Instead of clicking on the Arrow next to this field, click on the text within the field, and enter in your own value such as, content_custommod If you need to make other changes to your Module parameters then do so and when you are finished, make sure you click the "SAVE" button at the top right of the screen. Your new custom module position will then be saved with this Module. Step 3 - Check the Plugin
Step 4 - Load Module in ArticleNavigate to the Article Manager Screen, and Edit the Article you wish to load the Module within. Click on it's title to load the Article Edit Screen. Within the desired location of the Article, enter the following syntax in, which is code to tell the Module to load.
IMPORTANT NOTE: Do not enter in a common Template Module Position such as "Top" or "Left" into your loadposition tag. This may display all of the modules that are then set to show in that Position. |
Monday, April 05, 2010
Tiny Mce Joomla 1.5 Editor Image Browse Is Not Working [SOLVED]
Well the problem is with flash. So if it is not working for you just do this
Go to: administration mode
Menu: Site, Global Configuration
Choose: Enable Flash Uploader [No]
Friday, April 02, 2010
Get Menu Alias in Joomla
$theMenu = JSite::getMenu();
$theActiveMenu = $theMenu->getActive();
return $theActiveMenu->alias;
}
Thursday, April 01, 2010
Access joomla session from external pages
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__FILE__) );//this is when we are in the root
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
$session =& JFactory::getSession();
$myUser = $session->get( 'myUser', 'empty' );
Wednesday, March 31, 2010
php-smtp-email-validation
Example :
// include SMTP Email Validation Class
require_once('smtp_validateEmail.class.php');
// the email to validate
$email = 'user@example.com';
// an optional sender
$sender = 'user@mydomain.com';
// instantiate the class
$SMTP_Validator = new SMTP_validateEmail();
// turn on debugging if you want to view the SMTP transaction
$SMTP_Validator->debug = true;
// do the validation
$results = $SMTP_Validator->validate(array($email), $sender);
// view results
echo $email.' is '.($results[$email] ? 'valid' : 'invalid')."\n";
// send email?
if ($results[$email]) {
//mail($email, 'Confirm Email', 'Please reply to this email to confirm', 'From:'.$sender."\r\n"); // send email
} else {
echo 'The email addresses you entered is not valid';
}
Tuesday, March 30, 2010
Load the Joomla scripts in a Non-Joomla PHP Script
define( '_JEXEC', 1 );
define( '_VALID_MOS', 1 );
// JPATH_BASE should point to Joomla!'s root directory
define( 'JPATH_BASE', realpath(dirname(__FILE__) .'/' ) );
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
$user =& JFactory::getUser();
$session =& JFactory::getSession();
Joomla User Authentication Script For External websites
$result = mysql_query($query);
if (mysql_num_rows($result)>0){
$dbpassword=mysql_result($result, 0);
mysql_close($link);
list($md5pass, $saltpass) = split(":", $dbpassword);
if ((md5($_POST["passwd"].$saltpass))==$md5pass) {
echo "Success" ;
} else {$messaggio="Password error:";}
}
Thursday, March 25, 2010
New Website for Greenlemon: Internet Marketing & Web Design Company Kerala, India Launched
Saturday, January 02, 2010
Happy New Year To All
Wednesday, July 08, 2009
Top 10 Dumbest Online Business Ideas That Made It Big Time.
source :- http://weirdtechnewshub.blogspot.com/2006/07/top-10-dumbest-online-business-ideas.html
1000000 pixels, charge a dollar per pixel – that’s perhaps the dumbest idea for online business anyone could have possible come up with. Still, Alex Tew, a 21-year-old who came up with the idea, is now a millionaire.
2. SantaMail
Ok, how’s that for a brilliant idea. Get a postal address at North Pole,
3. Doggles
Create goggles for dogs and sell them online? Boy, this IS the dumbest idea for a business. How in the world did they manage to become millionaires and have shops all over the world with that one? Beyond me.
4. LaserMonks
LaserMonks.com is a for-profit subsidiary of the Cistercian Abbey of Our Lady of Spring Bank, an eight-monk monastery in the hills of
5. AntennaBalls
You can’t sell antenna ball online. There is no way. And surely it wouldn’t make you rich. But this is exactly what Jason Wall did, and now he is now a millionaire.
6. FitDeck
Create a deck of cards featuring exercise routines, and sell it online for $18.95. Sounds like a disaster idea to me. But former Navy SEAL and fitness instructor Phil Black reported last year sales of $4.7 million. Surely beats what military pays.
How would you like to go on a date with an HIV positive person? Paul Graves and Brandon Koechlin thought that someone would, so they created a dating site for HIV positive folks last year. Projected 2006 sales are $110,000, and the two hope to have 50,000 members by their two-year mark.
Christie Rein was tired of carrying diapers around in a freezer bag. The 34-year-old mother of three found herself constantly stuffing diapers for her infant son into freezer bags to keep them from getting scrunched up in her purse. Rein wanted something that was compact, sleek and stylish, so in November 2004, she sat down with her husband, Marcus, who helped her design a custom diaper bag that's big enough to hold a travel pack of wipes and two to four diapers.With more than $180,000 in sales for 2005, Christie's company, Diapees & Wipees, has bags in 22 different styles, available online and in 120 boutiques across the globe for $14.99.
9. TruGamerz
Faux-suede padded covers for game controllers and gel thumb pads for analog joysticks? No one will buy that. Forget it. The product proved to be so popular, it got picked up by Target.com and Walmart.com and annual sales new exceed half a million dollars.
Fake wishbones. Now, this stupid idea is just destined to flop. Who in the world needs FAKE PLASTIC wishbones? A lot of people, it turns out. Now producing 30,000 wishbones daily (they retail for 3 bucks a pop) Ken Ahroni, the company founder, expects 2006 sales to reach $1 million.
11. To see other businesses that have not made the top 10 list but came pretty close, visit Uncommon Business Blog
Advantages and Disadvantages of Flash Web Design By Vijayanand Yadla
Article Source: http://EzineArticles.com/?expert=Vijayanand_Yadla
Points to be considered when planning a Flash based web site:
1. Purpose of the web site: If the primary purpose of the web site is to offer artistic or visual effects to the visitors (such as a business that is primarily a Design/Arts company, with visitors coming to the web site on some reference other than search engines) then Flash is recommended.
2. If you are developing a web site for getting more potential customers using Search Engine Optimization (SEO) techniques, then it is recommended to limit Flash only to certain portions of the web site or not to use at all.
3. Flash is not considered to be search engine friendly. Therefore, a Flash-based web site may not rank well in the search engine results (Also called SERPs). It is important to know that search engines (as well as humans) like simple and quick to follow web pages, and not a complex and difficult to navigate web site.
4. Usually visitors are not interested in reading something passively. Keep in mind that most visitors spend less than 30 seconds on a web site. You need to offer the visitor what he/she is looking for in the shortest possible time (A good navigation system, and few number of clicks to reach the intended product or service). This is possible using a dynamic web page.
5. A Flash movie becomes obsolete after a few months time. It is necessary to update a Flash web site regularly (This also true for non-Flash web sites also). It is more expensive and time consuming to update and maintain a Flash web site than a traditional web site ( In this context, a traditional web site is one that uses HTML with limited amount of script).
6. What about cgi or .php based web sites? These are server side scripting languages. The web page is rendered in html format to the browser. The web sites based on .cgi or .php are being indexed by most search engines, including Google. It is normally safe to use these technologies for web site design. However, some limitations apply.
The compelling reason to go for a web site developed without Flash is to get more visibility on the Web.
On the other side, if it is very important to impress the web site visitor with a visual presentation, use of Flash is inevitable.
Flash™ is a trade mark of Adobe Systems® Inc. and duly recognized.
Wednesday, July 01, 2009
Ajax :- XMLHttpRequest response bypassing the Cache
- You can add a header to the request: xhReq.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2005 00:00:00 GMT");
- You can make the URL unique by appending a timestamp var url = "sum.phtml?figure1=5&figure2=1×tamp=" + new Date().getTime();
Friday, June 26, 2009
Closed-Source PHP
To some developers, one of the large drawbacks to PHP is that it provides no official method for distributing closed-source, binary web applications. Developers of commercial applications often want to keep their source code private, for various reasons.
There are, however, some third-party solutions. From the people that brough you the PHP interpreter comes the Zend Encoder . This encoder converts your PHP into a binary form which Zend calls ‘Zend Intermediate Code’. Zend Encoder’s major drawback to small developers is its price tag, currently $2400 US. Binaries created with the Zend Encoder can be executed using the freeZend Optimizer, which is installed on many LAMP hosting accounts, making binaries created with the Zend Encoder somewhat portable.
A competitor to the Zend Encoder is ionCube’s PHP Encoder. The cost of the PHP Encoder starts at $199, making it more affordable. To use the binaries generated by the PHP Encoder, you’ll need to have their PHP Acceleratorinstalled on the server, which is not as common as the Zend Optimizer. It is therefore likely to be less portable.
Also available is Turck MMCache. Recent versions of MMCache include an encoder and loader for PHP, allowing PHP scripts to be distributed in an intermediate binary form. The price is right - MMCache is free and open source. It is also likely to be more attractive to hosting companies, as it can be installed at the same time as the Zend Optimizer.
Alternative products exist that do not distribute a compiled version of the application, and thus may not require an interpreter installed on the server. However, such products tend to rely on either code obfuscation, or source code encryption. The problem with both of these is that the source code can be accessed by somebody with programming skills, even though it may be difficult.
Code obfuscation changes the names of functions and variables to strange, garbage-like names and removes all your formatting. This makes it very hard to understand the code, though if somebody really wanted to borrow from it or modify it, they could.
The problem with source code encryption is that you will also need to supply a means of decrypting the source along with the key to do so. This gives users all they need to decrypt your source. The user will need to either install a binary executable (such as a PHP extension) or a PHP script to decrypt the files, and the user can reverse-engineer this to obtain the source code. The decrypting process also detracts from performance.
Some may claim that distributing PHP applications as ‘closed-source’, in binary form, is a bad thing as it is detrimental to the open source community from which PHP itself comes. However, The PHP Group themselves are happy for PHP to be used commercially - the PHP license is very permissive in order “to help PHP become as popular as possible”. I would argue that if being able distribute their applications in binary form only allows more developers to switch to PHP, it is a good thing for PHP
Courtesy :- Thomas Rutter ( sitepoint.com)
How to make money from Open source ?
Next, download the project which appears to have the most overlap with your intended product. Scope the code, audit it for quality, comments, structure and evenness. If it passes muster, you read through the documentation to determine if there's a section to jumpstart new developers into the complexities of the code base. Most of the good open source software projects have this, which is what enables them to become good open source projects.
Now, start making some mods, for example stylesheet changes, logo changes, form changes etc. You want to get a feel for how much time and effort would be involved to get up to speed with this code, and how much effort would be involved in adding any missing functionality your putative product may need, which this open source project lacks.
It's now up to you to determine if indeed utilising this codebase will get you to your intended destination faster than if you started from scratch. Bear in mind a few things however; many widely-used open source projects have seen successive iterations of quality and security feedback, loopsÃ, Code being fixed and enhanced and security exploits being patched. If you start your project from scratch, it may be years before you reach a similar maturity level. Factor this cost in to your decision process too.
Do the right thing by the existing project community; make contact, alerting them to the fact that you intend to build a commercial application upon their codebase, but that you will comply with the licence they have stipulated for the project. Contact with the open source developer community isn't mandatory, just common courtesy.
By commercial support, I mean commercial support. Charge the customers $200 per hour for it, but make sure you deliver the goods. You should also play the perpetual code escrow card. Many potential customers of vertical business applications need to be guaranteed that they will not be left stranded when deploying a new line of business system.
This is one of the main reasons encountered when Australian firms have trouble competing against larger international players. The argument goes that buyers are unsure of smaller Australian firms' business longevity and worry about code escrow. Ensuring that potential customers have full access to the source code is a great way of nullifying this competitive disadvantage.
In short, open sourcing saves you many of the marketing and sales costs necessary in taking your application globally. If your product is good, and there is a global market for it, you have a far greater chance of reaching that market through open sourcing.
Achieving the same marketing reach using traditional means, would cost millionsââ,¬"money that few Australian developers have. News of good quality open source projects travels fast.
Next up, provide installation, customisation and enhancement services. This is where the real money is. Show the market you are a serious commercial open source player. Whilst your code is indeed open source, and your users could extend it themselves, most businesses do not have the time nor the inclination to undertake this kind of activity; it's not their core business. Firms will instead turn to you.
Additionally, no one should know the code as well as you, and your time to build for extensions and any integration work will far exceed others' value delivery. All you need to do is capture just a small percentage of all those users who pulled down a free download and you can generate some real revenue with customisation work. And because any such resultant work can be open source too, you can slowly build upon the functionality of your product, thus attracting more users.
Finally, you can make money by re-licencing. Just because you licence your software under an open source licence, doesn't mean you can't also licence it under non-open source terms as well. For various tactical reasons, the best open source licence to use for this purpose is the General Public Licence (GPL). This approach works especially well for libraries and for products which you could classify as 'engines', such as computing engines (scientific and engineering), database or transactional engines. By using the GPL, anyone who links to your engine or library and plans to redistribute that combination as a total product must also licence their own IP under the GPL.
Many potential customers would prefer not to do this, which gives you the opportunity to sell them a version of your product which is not based on an open source licence. Are there issues with open source licences when reusing the code of others? Specifically, aren't we in trouble if we reuse open source code in our own projects? In most circumstances, no. Most developers in Australia are building bespoke software, which is not for redistribution beyond the client purchasing the service.
This model is compatible with all open source licences. If you or your client wants to redistribute modified binaries of GPL licenced products, you must also supply the source code to your modifications under the GPL.
If you use any of the BSD-like licences (Apache, MIT etc.) only attribution is needed within your derived modified binaries. You do not need to make available the source code to your modifications.
For the full text visit www.builderau.com