4th
JUN

Check For Email pattern

Posted by M. 4Gani under Linuxi:

check for email pattern

if( !preg_match( “/^(([^<>()[\]\\\\.,;:\s@\”]+(\.[^<>()[\]\\\\.,;:\s@\”]+)*)|(\”([^\”\\\\\r]|(\\\\[\w\W]))*\”))@((\[([0-9]{1,3}\.){3}[0-9]{1,3}\])|(([a-z\-0-9áàäçéèêñóòôöüæøå]+\.)+[a-z]{2,}))$/i”, $email ) ) {
$msg = ‘Email address was not recognized as a valid email pattern’;
}

get the mx host name

if( preg_match( “/@\[[\d.]*\]$/”, $email ) ) {
$mxHost[0] = preg_replace( “/[\w\W]*@\[([\d.]+)\]$/”, “$1”, $email );
$msg = ‘Email address contained IP address ‘.$mxHost[0].’ – no need for MX lookup’;
// get all mx servers – if no MX records, assume domain is MX (SMTP RFC)
$domain = preg_replace( “/^[\w\W]*@([^@]*)$/i”, “$1”, $email );
if( !getmxrr( $domain, $mxHost, $weightings ) ) { $mxHost[0] = $domain;
$msg = ‘Failed to obtain MX records, defaulting to ‘.$domain.’ as specified by SMTP protocol’;
}

28th
JUL

Clean up the Ubuntu

Posted by M. 4Gani under Linuxi:

 

Install the Debian menu to make all installed applications

Missing Icons & Fix Broken Icons

sudo apt-get update
sudo apt-get install menu menu-xdg
update-menus

 

Keeping Ubuntu clean

Install deborphan with command:
sudo apt-get install deborphan

To delete unnecessary libraries just execute:
sudo deborphan | xargs sudo apt-get -y remove --purge

To delete unnecessary data


packages
use command:
sudo deborphan --guess-data | xargs sudo apt-get -y remove --purge

To see all


packages
which aren’t required by any others use command
deborphan --guess-all

There is another tool to delete orphaned

packages, it’s  GtkOrpha:
sudo apt-get install gtkorphan

Once it’s installed go to System –> Administration –> Remove Orphaned

Packages, enter your password and proceed with cleaning up.

Another nice tip is to clean partial and orphaned

packages by commands:
sudo apt-get autoclean
sudo apt-get autoremove

21st
MAY

increase the screen resolutions

Posted by M. 4Gani under Linuxi:


Enter in root terminal:
$ sudo dpkg-reconfigure -phigh xserver-xorg

Select your video card by scroll up or down keys on your keyboard) and then hit enter.
the next select the resolutions that you would like to be available for Ubuntu by using the arrow keys to scroll up and down, and the Space Bar to select them.

Restart X by clicking Control+Alt+Delete (backspace). to set up new resolutions.

This starts the Xorg config process.

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
sudo dpkg-reconfigure xserver-xorg
sudo xinit — :2

Look for errors:

tail -f /var/log/Xorg.0.log

Restart all servers by bouncing XDM (or gdm or kdm):

sudo /etc/init.d/xdm start

This starts a new X server — usually on tty8 or tty9 (CTRL-ALT-F8). You can go back to the original X server by pressing CTRL-ALT-F7.

9th
OCT

Java Tips

Posted by M. 4Gani under Linuxi:

Convert Map to ArrayList:
Map hashmap = new HashMap () ;
hashmap.put ( “one”,new Integer (1) ) ;
hashmap.put ( “two”,null ) ;
hashmap.put ( “three”, new String (“THREE”) ) ;

aList = new ArrayList ( hashmap.values () ) ;

System.out.println ( “The size of HashMap = “+hashmap.size () ) ;
System.out.println ( “If hashmap empty = “+hashmap.isEmpty () ) ;
System.out.println ( “The value for the \”three\” key =”+hashmap.get (“three”) ) ;
hashmap.remove ( “two” ) ;

Set set= hashmap.keySet () ;
Iterator iter = set.iterator () ;
int i=1;
while ( iter.hasNext () ) {
System.out.println ( ” “+i+” ) “+hashmap.get ( iter.next () ) ) ;
i++;
}

OR:
for (Iterator iter = hashmap.keySet().iterator(); iter.hasNext();)
{
KeyType element = (KeyType) iter.next();
ValType value = (ValType)hashmap.get(element);
}

hashmap.clear () ;

Use for-each loop through Map entry set:
Map hashmap = new HashMap () ;
for ( Map.Entry pair : hashmap )
{
System.out.println ( pair.getKey () + ” :: ” + pair.getValue () ) ;
}

Use ArrayList:
ArrayList arraylist = new ArrayList () ;

arraylist.add ( “india”,””, new String(“three”),null,”new Integer (1) ” ) ;
arraylist.add ( new Float (3.5) ) ;
arraylist.add ( 1,dummy ) ;

Add array Elements to the arraylist:
String array [] = { “foo”,””,”tow”,null,”new Integer (1) ” } ;
for ( int i=0;i < array.length;i++ )
{
arraylist.add ( i,array [i] ) ;
}

for ( int i=0;i < arraylist.size () ;i++ )
{
System.out.println ( ” “+ ( i+1 ) +” ) “+arraylist.get ( i ) ) ;
}

System.out.println ( “The size of arraylist =”+arraylist.size () ) ;
System.out.println ( “The arraylist is Empty? =”+arraylist.isEmpty () ) ;

Set the element at position one:
arraylist.set ( 1,”J2EE Programmer” ) ;

Converts arraylist to array:
Object array [] = arraylist.toArray () ;

for ( int i=0;i < array.length;i++ )
{
System.out.println ( ” “+ ( i+1 ) +” ) “+ array [ i ] ) ;
}

String value = “FOO”;
if ( “FOO”.equals(value) ) {
// do something
}

substring in Java
returnString = (xmlString.substring(xmlString.indexOf(“<ns1:queryReference>”) + 20, xmlString.indexOf(“</ns1:queryReference>”)));

10th
SEP

Domain and Whois lookup

Posted by M. 4Gani under Linuxi:

 

We can save your money, time, and effort on getting your website up and running.
We work mainly with small sized businesses who would like to use
their website to effectively market their products and services.

Domain and Whois lookup
Domain name:
all .ir .com .net .org .info

 

Find who owns a host. WHOIS lookup:

.

 

Find the host of a chosen IP address



With our high level of experience with developing PHP/MySQL applications
we can develop any type of web based application that you can think of.


We can do also develop any of the following types of websites:


E-Commerce Secure Shopping Cart
CUSTOMER SUPPORT:
Support Ticket Systems
Product Catalogues


PORTAL SYSTEMS
IMAGE GALLERIES
Discussion/Message Boards & Blogs


CONTENT MANAGEMENT:
Joomla Installations
Wordpress Installations and more…


Do contact us for a discussion of your requirements.

 

Content Management
Image Galleries
Joomla
Mambo
php-Nuke
Drupal
PHP-Fusion
e107
phpWebsite
Gallery2
Coppermine
SimpleViewer
Plogger
ZenPhoto
Singapore
IPG
Weblogs
Discussion Boards
WordPress
b2evolution
php-BB
SMF
Phorum

E-Commerce
Chat
ZenCart
osCommerce
CubeCart
phpOpenChat
phpMyChat
Phorum
Groupware
 
RoundCube
IlohaMail

nmsGuestbook
Gbook

WebCalendar
dotProject
ExtCalendar
netOffice
php-Projekt

هر کجای دنیا نصب هرگونه برنامه آماده روی سایت شما از قبيل:
تالار گفتگو PHPBBوبلاگ Word Press
سیستم مدیریت (CMS) فارسی جمله Joomlaسیستم مدیریت (CMS) فارسی مامبو Mambo Oscommerce, ZenCart ارائه كاملترين فروشگاه اينترنتي
Nukeطراحي و توسعه سيستمهاي مخصوص مديريت ارتباط با مشتريان (Customer Relationship Management System)
طراحي و توسعه برنامه هاي كاربردي تحت ويندوز مبتني بر بانك اطلاعاتي Ms SQL
خدمات طراحي آرم ، لوگو ، بروشور ، كارتالوگ
ارائه راهكارهاي تجارت الكترونيك (E-Commerce)
ارائه راهكارهاي مولتي مديا (Multi Media Soltions)
طراحي و توسعه بانكهاي اطلاعاتي تحت وب
ثبت وب سایت در موتورهای جستجو گوگل، یاهو

برای کسب اطلاعات بیشترمی توانید با ای میل host@forgani.com تماس حاصل نمایید.
سرویس مناسب برای اشخاص و موسسات کوچک
وب سايت حرفه اي همراه با آخرين تكنولوژي طراحي صفحات وب
مناسب برای شرکتهای کوچک و متوسط
طراحي وثبت سايت از ما-پيشنهاد قيمت ازشما

 

 

See more website here...

  • Odlinks
  • Farsi-News
  • Advertise Here