Nurasto.com Website

My digital scrapbook

Method Overloading in PHP

on under Software and Web Development3 Comments

I wrote PHP post more than ASP.NET does isn’t it? I am increasing it right now.

Okay, I was said that PHP doesn’t support method/function polymorphism or more correct term is overloading, but I was wrong. PHP does support it explicitly which require developer involvement to mimic method overloading like C#, VB.NET or JAVA does.  We could use magic method __call(string $name, array $arguments). I am trying to explain how we could do that in PHP comparing with optional argument like we always do.

Read More

Anti-Pattern Mambo Jambo with PHP Class

on under Uncategorized • Be the first to comment

Anti-Pattern is an alias for software component who do the project without Design Pattern. PHP feature able to implement design pattern but sometimes design pattern make us really sweat especially for simple site. Model View Controller also implement few Design Pattern and you will accidently realize this is huge and amazing yet confusing.

Steping into Object Oriented Software Engineering is not an easy task, I admit it but when we spare our time to learn the fundamental of Object Oriented it would worth for our coding's life. The basic fundamental of Object Oriented in PHP are Inheritance, Encapsulation, and Polymorphism. Let's talk about these matter.

Read More

SyntaxHighlighter BlogEngine.NET Extension

on under Uncategorized • 3 Comments

This is my first extension for BlogEngine.NET. It will add HTML javascript syntax code in head section and rendering javascript function after the content place holder to be able to use SyntaxHighlighter. The only weakness of this extension that is I need to tweak the TinyMCE before be able to use this extension. You could see my post about how to setup SyntaxHighlighter in BlogEngine.net.

The features that existed in this extension is add particular syntax js file which tell the extension which js file need to be inserted. So, you may want csharp and xml/html be available on your site but ignoring the rest. The extension also add the core javascript  and CSS file from SyntaxHighlighter directory automatically. BlogEngine Page and Post able to use this extension.

If you’re in hurry. This is patch package, so you could patch your blogengine right away, but if you’re advanced user and any modification had been held to files in admin file, please just extract the extension. The extension doesn’t have any warranty, so be careful, I am not recommended to overwrite your working blog. You could download the file JSSyntaxHighlighter.zip (97.17 kb).

To know how extension work then please Read More

SyntaxHighlighter in BlogEngine.Net

on under Uncategorized • Be the first to comment

My biggest concern on my last blog is how to deliver code in BlogEngine.Net. The CodeFormater extension not working like I want and make me little bit frustrated when using the extension. I am looking around to find any cool replacer of CodeFormater then I found SyntaxHighlighter using JavaScript as the engine. Cool right? and you may use it in any application you want regardless the server side language but it will cost in matter of bandwith.

When I want to implement it into my theme, I am looking around for solution before I starting to code and I found tutorials about how to Adding SyntaxHighlighter to BlogEngine.NET. I decide to follow the instruction and some of step are missing. First, you must add the CSS into your theme. The simplest one is by edit your current site.master template and copying the style into the theme, for example:

<link rel="stylesheet" type="text/css" href="SyntaxHighlighter.css" />

You must add this in head section of HTML document. You may asked why you need to copy into your theme directory? because any CSS reference in <head runat="server"> would be replace by BlogEngine.Net into like this

<link rel="stylesheet" type="text/css" href="/themes/yourtheme/css.axd?name=/css/SyntaxHighlighter.css" />

Now, I need some tuning in our tinyMCE.ascx located on Admin folder. I decide to use the uncompressed TinyMCE to make life easier to this

<script type="text/javascript" src="<%=Utils.RelativeWebRoot%>admin/tiny_mce/tiny_mce_src.js"></script>

Yeah, I know it will cost bandwith but I need the function work right. I would look at the compressed version if I have time. Good Luck.

jQuery in BlogEngine.Net

on under Software and Web Development7 Comments

I am trying to implement jQuery in BlogEngine.Net and I found errors while accessing the page which the errors tell me that element has no properties.  Fortunately, I found the solution which makes me surprise because it's work like magic and of course you need to replace the $ sign in all elements. If you want to try what I am doing with jQuery, just press search image in right corner of your screen.

In searching of jQuery integration, I accidentally found a great article to use Intellisense for JQuery in Visual Studio 2008. It helps me a lot to code because the auto completion is working, you may find the complete instruction in that site. Well, it's not the latest jQuery version but it may help you to start learning jQuery.

If you're looking offline help for jQuery you may download the CHM file on this site.