Here is a php function that can be used to get current currency values from Yahoo.
<?php function get_currency_value($from, $to) { $url = “http://finance.yahoo.com/d/quotes.csv?f=l1&s=$from$to=X”; $handle = fopen($url, ‘r’); if ($handle) { $result = fgetcsv($handle); fclose($handle); $rate = $result[0]; return $rate; } } echo ‘R’.get_currency_value(‘USD’, ‘ZAR’); ?>
The method, as I used it, will return 1 [...]
This is a pretty nice way to get the MD5 encryption of text using Java. You will need to add the following jar file to your project to accomplish this.
MD5 Library
It’s always good to use some sort of encryption on your passwords or inputs that you don’t want anybody just [...]
I have found this code snippet on some site and it’s a great way to validate an email address in your Java application.
import java.util.regex.Matcher; import java.util.regex.Pattern; public static boolean isValidEmailAddress(String strEmailAddress) { String expression = “^[\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[A-Z]{2,4}$”; CharSequence inputStr = strEmailAddress; Pattern pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(inputStr); return matcher.matches(); }
This blog will be used basically for anything that I set my heart to. I will post development code snippets, the gospel of Jesus Christ and many other stuff. Be sure to check in regularly for any new posts or just add the RSS feed to your list.
Archives

