jQuery Extension for ASP .Net MVC

jQuery Extension for ASP .Net MVC Opensource and Paid

My boss told us to search for a jQuery Extension for ASP .Net MVC to make the development easier. After minutes of searching the web I have found two extensions that you and I can use:

  1. DJME 2 which is an free and Open source
  2. Telerik Extensions for ASP .NET in this case is a paid extension

Both extensions utilizes the creation of custom helper to make jQuery development quite easier but abstracted. Abstracted because you are learning how the extensions should be use to produce jQuery but your not really coding jQuery. 

So in the end, I will still recommend using jQuery it self, doing all the hard works of creating the JavaScript file and code all the way, so you can produce the right jQuery output you have ever wanted.

ASP .Net MVC 3 – WebMail

Easiest Email on ASP .Net mvc 3 using webmail using gmail


I have been searching the web on how to easily send email thru ASP .NET MVC 3 and finally found the right code for it, its called WebMail. Look at the code below and insert it to one of your Controller’s Action:

WebMail.SmtpServer = “smtp.gmail.com”;
WebMail.EnableSsl = true;
WebMail.SmtpPort = 25;
WebMail.UserName = “tjpublic1@gmail.com”;
WebMail.Password = “**********”;
WebMail.From = “tjpublic1@gmail.com”;
WebMail.Send(“********@******.com”, subject:”Subject”, body:”Message Here”);

Then try it on!

Its the Easiest Email on ASP .Net mvc 3 using webmail using gmail!

SQL Server Report Service

Time to remember an old friend on creating a report on ASP .Net, the Sql Server Report Service also known as SSRS. SSRS utilizes the MS SQL Server that simplifies the creation of report. The Concept is that you separate the location where your report is located so that even if your website is down you can still provide report and use it on other web programming language by putting it in an iFrame.

Upon reviewing here are the sites that made me remember:

In addition, SSRS need SQL Business Intelligence Development Studio (BIDS) in order to create reports and deploy directly these reports to the server.

ASP .Net MVC 3 File Upload

Doing File Upload in ASP .Net MVC 3 is easier than ASP .Net Web Form. On this example Only two controller and one view is needed to perform this task.


public class FileController : Controller
        // GET: /File/
        public ActionResult Index()
            return View();
        public ActionResult Upload(HttpPostedFileBase f)
            if (f.ContentLength > 0)
                string filePath = Path.Combine(HttpContext.Server.MapPath(“\\Uploads\\”), Path.GetFileName(f.FileName));
            return RedirectToAction(“Index”);
    ViewBag.Title = “Index”;
@using (Html.BeginForm(“Upload”, “File”, FormMethod.Post, new { enctype = “multipart/form-data” }))
    <input type=”file” name=”f” /><br />
    <input type=”submit” value=”Submit” />
Thats it. 
Download the source Here

public class FileController : Controller    {        //        // GET: /File/
        public ActionResult Index()        {            return View();        }        [HttpPost]        public ActionResult Upload(HttpPostedFileBase f)        {            if (f.ContentLength > 0)            {                string filePath = Path.Combine(HttpContext.Server.MapPath(“\\Uploads\\”), Path.GetFileName(f.FileName));                f.SaveAs(filePath);                            }            return RedirectToAction(“Index”);        }

wdCalendar in ASP .Net MVC 2



In line with my work I have successfully converted wdCalendar PHP version to ASP .Net MVC 2(a little tweak and it will be ok with MVC 3). Also I have fixed some problems:

  1. Datenot showing instead a LOADING message is shown
  2. After Creating a New Event refresh the calendar
  3. Default View is Month

Download wdCalendarMVC2

Thomie Jose San Agustin 

TWAMP v7.7.3a Released

TWAMP Muggle Elevated package v7.7.3a Taiwan and Japan version Korea Provence

(Provence is a desirable place, where only 2 yuan per kilogram of bananas) Apache/2.2.17 (Win32) mod_ssl/2.2.17 PHP/5.2.17 MariaDB/5.2.6 phpMyAdmin/3.3.10 Drupal v7. 7 Drupal v6.22 This is a green software, no installation, point the mouse to run under two

“This edition began carrying Drush the latest version of the suite (written in the installation instructions) 
New php fileinfo package (for mimemail module) add rules, voting API modules to Drupal 7.7 added poormanscron, transliteration module in TWAMP install profile for Drupal -6.22 new ckeditor, getid3, phpmailer libraries packages for Drupal-7.7phpMyAdmin to export the local path correct folder error”

This version included with Drupal 7.2 & Drupal 6.22 with the latest Japanese, Chinese is the body, Simplified Chinese language file is installed when the selected language interface to start the installation, no need to manually modify the settings.php change the root password for the database account or use the enclosed After the phpMyAdmin login root account manually modify ./TWAMPd/htdocs/drupal-7.2/sites/default/settings.php

TWAMPD v7.7.3
TWAMPD v7.7.3

Used as usual, to download, unzip, double click apmxe.exe / apmxe_zh-TW.exe 
and then open the browser URL http://localhost/ ( )

Windows 7 / Vista users, please note! 

  • Right is recommended as a system administrator to run apmxe_zh-TW.exe 
  • or directly apmxe_zh-TW.exe designated “special privilege level” 
  • (right click -> Properties -> Compatibility -> Privilege Level -> to System Management in the capacity to run the program) 
  • can avoid the default temporary file path (C: \ \ Windows \ \ Temp) can not be writtenの囧
  • Please check the machine can not start the http port is occupied! 
  • TWAMP start Apache on port 80/443 
  • MariaDB on port 3306 
  • if port is already occupied, you can not start TWAMP, for example, has been installed using the skype software or other httpd / mysql service program, modify the port or change the software boot sequence 
  • such as first and then start TWAMPd start skype you can chatter!

Download Here or Here

Get the User Referrer via JavaScript


You van get the user referrer via javascript using the following code:


The said code will give you the full url path to which your user came from.

Example is http://google.com/?some-strings=goes-here

So you can check if its from a user from a google with a particular search string.


Just a Note. It can also received the same domain to which your site is in. For an instance your domain is http://domain.com then you referesh the page, the said code will return http://domain.com because you just refresh the page.

PHP.ini Mail Settings

Note this, PHP.ini Mail Settings guide, is for users who has an email that is using the MS Office Outlook Email on their dev PC.

Open your PHP.ini and look for the following line of code:

[mail function]
;For Win32 only.
SMTP = <put here the SMTP server address of your email>
;SMTP = localhost
; http://php.net/smtp-port
smtp_port = <port of your smtp server>
;smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = <put your email address here>
;sendmail_from = webmaster@domain.com

PHP Developer TipsList

Some Tips for PHP Developers

  1. echo is faster than print.
  2. Wrap your string in single quotes (’) instead of double quotes (”) is faster because PHP searches for variables inside “…” and not in ‘…’, use this when you’re not using variables you need evaluating in your string.
  3. Use sprintf instead of variables contained in double quotes, it’s about 10x faster.
  4. Use echo’s multiple parameters (or stacked) instead of string concatenation.
  5. Use pre-calculations, set the maximum value for your for-loops before and not in the loop. ie: for ($x=0; $x < count($array); $x), this calls the count() function each time, use $max=count($array) instead before the for-loop starts.
  6. Unset or null your variables to free memory, especially large arrays.
  7. Avoid magic like __get, __set, __autoload.
  8. Use require() instead of require_once() where possible.
  9. Use full paths in includes and requires, less time spent on resolving the OS paths.
  10. require() and include() are identical in every way except require halts if the file is missing. Performance wise there is very little difference.
  11. Since PHP5, the time of when the script started executing can be found in $_SERVER[’REQUEST_TIME’], use this instead of time() or microtime().
  12. PCRE regex is quicker than EREG, but always see if you can use quicker native functions such as strncasecmp, strpbrk and stripos instead.
  13. When parsing with XML in PHP try xml2array, which makes use of the PHP XML functions, for HTML you can try PHP’s DOM document or DOM XML in PHP4.
  14. str_replace is faster than preg_replace, str_replace is best overall, however strtr is sometimes quicker with larger strings. Using array() inside str_replace is usually quicker than multiple str_replace.
  15. “else if” statements are faster than select statements aka case/switch.
  16. Error suppression with @ is very slow.
  17. To reduce bandwidth usage turn on mod_deflate in Apache v2 or for Apache v1 try mod_gzip.
  18. Close your database connections when you’re done with them.
  19. $row[’id’] is 7 times faster than $row[id], because if you don’t supply quotes it has to guess which index you meant, assuming you didn’t mean a constant.
  20. Use <?php … ?> tags when declaring PHP as all other styles are depreciated, including short tags.
  21. Use strict code, avoid suppressing errors, notices and warnings thus resulting in cleaner code and less overheads. Consider having error_reporting(E_ALL) always on.
  22. PHP scripts are be served at 2-10 times slower by Apache httpd than a static page. Try to use static pages instead of server side scripts.
  23. PHP scripts (unless cached) are compiled on the fly every time you call them. Install a PHP caching product (such as memcached or eAccelerator or Turck MMCache) to typically increase performance by 25-100% by removing compile times. You can even setup eAccelerator on cPanel using EasyApache3.
  24. An alternative caching technique when you have pages that don’t change too frequently is to cache the HTML output of your PHP pages. Try Smarty or Cache Lite.
  25. Use isset where possible in replace of strlen. (ie: if (strlen($foo) < 5) { echo “Foo is too short”; } vs. if (!isset($foo{5})) { echo “Foo is too short”; } ).
  26. ++$i is faster than $ i++, so use pre-increment where possible.
  27. Make use of the countless predefined functions of PHP, don’t attempt to build your own as the native ones will be far quicker; if you have very time and resource consuming functions, consider writing them as C extensions or modules.
  28. Profile your code. A profiler shows you, which parts of your code consumes how many time. The Xdebug debugger already contains a profiler. Profiling shows you the bottlenecks in overview.
  29. Document your code.
  30. Learn the difference between good and bad code.
  31. Stick to coding standards, it will make it easier for you to understand other people’s code and other people will be able to understand yours.
  32. Separate code, content and presentation: keep your PHP code separate from your HTML.
  33. Don’t bother using complex template systems such as Smarty, use the one that’s included in PHP already, see ob_get_contents and extract, and simply pull the data from your database.
  34. Never trust variables coming from user land (such as from $_POST) use mysql_real_escape_string when using mysql, and htmlspecialchars when outputting as HTML.
  35. For security reasons never have anything that could expose information about paths, extensions and configuration, such as display_errors or phpinfo() in your webroot.
  36. Turn off register_globals (it’s disabled by default for a reason!). No script at production level should need this enabled as it is a security risk. Fix any scripts that require it on, and fix any scripts that require it off using unregister_globals(). Do this now, as it’s set to be removed in PHP6.
  37. Avoid using plain text when storing and evaluating passwords to avoid exposure, instead use a hash, such as an md5 hash.
  38. Use ip2long() and long2ip() to store IP addresses as integers instead of strings.
  39. You can avoid reinventing the wheel by using the PEAR project, giving you existing code of a high standard.
  40. When using header(’Location: ‘.$url); remember to follow it with a die(); as the script continues to run even though the location has changed or avoid using it all together where possible.
  41. In OOP, if a method can be a static method, declare it static. Speed improvement is by a factor of 4..
  42. Incrementing a local variable in an OOP method is the fastest. Nearly the same as calling a local variable in a function and incrementing a global variable is 2 times slow than a local variable.
  43. Incrementing an object property (eg. $this->prop++) is 3 times slower than a local variable.
  44. Incrementing an undefined local variable is 9-10 times slower than a pre-initialized one.
  45. Just declaring a global variable without using it in a function slows things down (by about the same amount as incrementing a local var). PHP probably does a check to see if the global exists.
  46. Method invocation appears to be independent of the number of methods defined in the class because I added 10 more methods to the test class (before and after the test method) with no change in performance.
  47. Methods in derived classes run faster than ones defined in the base class.
  48. A function call with one parameter and an empty function body takes about the same time as doing 7-8 $localvar++ operations. A similar method call is of course about 15 $localvar++ operations.
  49. Not everything has to be OOP, often it is just overhead, each method and object call consumes a lot of memory.
  50. Never trust user data, escape your strings that you use in SQL queries using mysql_real_escape_string, instead of mysql_escape_string or addslashes. Also note that if magic_quotes_gpc is enabled you should use stripslashes first.
  51. Avoid the PHP mail() function header injection issue.
  52. Unset your database variables (the password at a minimum), you shouldn’t need it after you make the database connection.
  53. RTFM! PHP offers a fantastic manual, possibly one of the best out there, which makes it a very hands on language, providing working examples and talking in plain English. Please USE IT!


Hindi ba pedeng ganun?

Scenario 1

Sign: Bawal Tumawid Dito

Manong: Eh anu ngayon sino ba sumusunod dun?

Tumawid si Manong at Nabungo tapos namatay. Tapos yung nakabunggo nakulong pa at siya pa pinagbayad.


Scenario 2

Sign: Bawal Tumawid Dito, Pag Tumawid ka Bahala ka sa sarili mo

Manong: Eh anu ngayon sino ba sumusunod dun?

Tumawid si Manong at Nabungo tapos namatay.  Walang kasalanan si Driver at walang nakulong at hindi pinagastos si Manong.


Alin ang patas dun?

Philippine Association of Campus Student Advisers



Here is another website I have developed together with my partner, Calbin Montalban. Now staging hosted under our company website.

Staging: http://pacsa.combinatorics.tk

Live: http://pacsa.org.ph

The Adamson Chronicle Website


Here is another website I have developed together with my partner, Calbin Montalban.

Staging: http://theadamsonchronicle.tjsa.info

Live: http://theadamsonchronicle.tk

Love VS the x

by Catherine Mitch Operio on Saturday, December 18, 2010 at 9:16am

A teenage girl about 17 had gone to visit some friends one evening and time passed quickly as each shared their various experiences of the past year. 
She ended up staying longer than planned, and had to walk home alone. 
She wasn’t afraid because it was a small town and she lived only a few blocks away. 
As she walked along under the tall elm trees, Diane asked God to keep her safe from harm and danger. 
When she reached the alley, which was a short cut to her house, she decided to take it. 
However, halfway down the alley she noticed a man standing at the end as though he was waiting for her. 
She became uneasy and began to pray, asking for God’s protection. 
Instantly a comforting feeling of quietness and security wrapped round her, she felt as though someone was walking with her. 

When she reached the end of the alley, she walked right past the man and arrived home safely. 
The following day, she read in the newspaper that a young girl had been raped in the same alley just twenty minutes after she had been there. 
Feeling overwhelmed by this tragedy and the fact that it could have been her, she began to weep. 
Thanking the Lord for her safety and to help this young woman, she decided to go to the police station. 
She felt she could recognize the man, so she told them her story. 

The police asked her if she would be willing to look at a lineup to see if she could identify him. 
She agreed and immediately pointed out the man she had seen in the alley the night before. 
When the man was told he had been identified, he immediately broke down and confessed. 
The officer thanked Diane for her bravery and asked if there was anything they could do for her. 
She asked if they would ask the man one question. Diane was curious as to why he had not attacked her. 
When the policeman asked him, he answered, “Because she wasn’t alone. 
She had two tall men walking on either side of her.” Amazingly, whether you believe or not, you’re never alone. 
Did you know that 98% of teenagers will not stand up for God? Repost this as Love vs. Sex if you truly believe in God.


PS: God is always there in your heart and loves you 
no matter what and if you stand up for him he will stand up for you. 
I bet 93% of the people that read this wont repost it. I read this and reposted it. 
Well I bet you read this note because of the title, didn’t you?