programming

Unable to connect to any MySQL Host

I was debugging my colleague PC because the MySQL Connector.NET throws the said error. Found problem similar to it, but the solution was not satisfactory. This one throws a generic exception.
I was scratching my head, because MySQL Administrator and MySQL Query Browser works.
There must be something wrong.
I did a lot of things, such disabling the antivirus, check the WinSock, check .NET Trust level with no avail.
Then I just changed the connection string from localhost to 127.0.0.1, and then it works.

WTF just happened?

Well it seems that the 127.0.0.1 localhost entry in hosts.sam is missing. So put it there again and it works.

Damnit. How in the world the entry is deleted?

Tuesday, March 17th, 2009 programming No Comments

Multiple select file uploads

SWFUpload is a small JavaScript/Flash library to get the best of both worlds. It features the great upload capabilities of Flash and the accessibility and ease of HTML/CSS.

The best thing about this library it can be implemented in any web language, used it for my company .NET app. The documentation is good too as well as the plugins :D

http://swfupload.org/

Thursday, August 7th, 2008 programming No Comments

Include javascript programmatically using ASP.NET 2.0

The thing is I want to include javascript into the page programmatically mainly because I want to use the full url for the source of the javascript.

So I put these on the code behind during the OnLoad event.

int i = 1;
HtmlGenericControl script = new HtmlGenericControl("script");
script.Attributes.Add("type","text/javascript");
script.Attributes.Add("src",Page.ResolveUrl("~/your url"));
//add after the title tag
Page.Header.AddAt(i++,script);

Tags:

Thursday, September 27th, 2007 code snippet, programming No Comments

When we feel we need to work on our own

I felt that, really. I have this desire to start up my own company. But before that, I need some more experience. Experience of a system architect. I felt that some so called architect doesn’t even know what the hell that they are talking about. And what’s more they think they are right. Why can’t they just leave it at that?

There are three words what optimization of an architecture is: Don’t Overdo It. Unless you take “don’t” as two words then it’ll be four.
› Continue reading

Tuesday, August 14th, 2007 journal, nhibernate, programming No Comments

nhibernate data cloning

I’ve finally finished the most challenging task that I have to do in my current company, the data cloning using nhibernate. I never thought the logic behind it to be so damn complicated. And most of the week I was sick, so it’s kinda hell. anyway I’ve managed to install symfony on my domain, so stay tuned for a symfony app ;-)

Saturday, June 9th, 2007 life, nhibernate, programming No Comments

NHibernate and Lazy Loading

What is NHibernate? Simple. It’s the Hibernate port for .NET. Okay, for you reader who doesn’t know what is Hibernate is, it is actually an ORM tool, so that we can match Object Oriented Programming with an RDBMS. You see, RDBMS and OOP does not usually goes hand in hand, so that’s why Object Relational Mapping is needed.

My position at my current company is basically handling the back end stuff of our system. Meaning the Business Logic Component (BLC) layer and NHibernate. NHibernate itself is a very powerful tool, but as with Uncle Ben in Spider-Man said, With Great Power Comes Great Responsibility. It can be misused to used against you.
› Continue reading

Tuesday, May 15th, 2007 nhibernate, programming No Comments

Generating random number and send to user’s email

Someone asked me about this, here i thought to share with you all. The code is not the perfect, but important thing is the logic behind it.

You can find the snippet below. The logic is like a maybank2u transaction. You request the code, put it in the database with the user id, and send the random number to user’s email. After that, when the user upload the file, with the code, you check the database. that one in another script after you send the file to upload.

You need to have your php server configured with mail function, else it won’t work.

Code Snippet

Tags:

Wednesday, April 18th, 2007 code snippet, programming No Comments

Search

 

My Flickr