Wednesday, October 28, 2009

DotNetNuke, Google Search History, News RSS, SEO

Thinking about SEO I know that an important part of it is generating unique content.
Well I don't have much time to write content(apart from this 15 mins break)

So do I generate any content at all?

Yes my Google Search History!

So I found information of Google search history features and realized that the you can get a RSS feed of google search history here:

https://www.google.com/history/?output=rss

But you have to log in with your gmail account to view this page.

So after a day struggling to build a custom module with authentication to Google I remembered that a basic DNN News/RSS module has a option to specify a username/password. So i tried it out an PUFF it worked.

Here is an example for published search history on my site.

I think it would be cool to expand this with a suggested result for the search.

Flex Outsourcing

Tuesday, June 30, 2009

Elance admission test

Here are the questions that i failed on:

Topic : Elance U Course – Find Work
1. How can you ask the client questions before submitting a proposal? Find the correct answer
a. This is impossible
b. Use the Public Messages forum
c. Verify your credentials
d. Take a skills test
Correct Answer: b


Topic : Elance U Course – Manage the Work
2. Why are milestones important? Find the correct answer
a. Outline the schedule and the work to be done
b. Define the payment schedule
c. Help keep the project on schedule
d. All of the above
Correct Answer: d


Topic : Elance U Course – Get Paid
3. What page lists your current account balance along with all transaction history? Find the correct answer
a. "Status Reports" under the "Manage" tab
b. The Water Cooler
c. "Account Activity" under "Get Paid"
d. The Inbox
Correct Answer: c

Hope it helps,

I passed with 88 that's just bad

Tuesday, March 24, 2009

list find predicate delegate .net

Here is an example how to use delegate to use for custom searching thru generic list

List<employee> ListEmployes = new List<employee>();
string strFirstName = "Mark";

Employee employeeResult = objListSomeClass.Find(delegate(Employee employee )
{
return employee.Name==strFirstName ;
}

capitalize first letter word C#

Just a quickie not this can be really helpful for displaying string properly.

string strSomething="PLEASE CAPITALIZE THE FIRST LETTER OF EVERY WORD"
or
string strSomething="please capitalize the first letter of every word"

System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(strSomething.ToLower())

the result
"Please Capitalize The First Letter Of Every Word"

DotNetNuke Custom Module Development

Tuesday, February 24, 2009

Gmail not working 502 Server Error

Tuesday February 24 2009

When tried to login to my gmail account i got this:

Server Error
The server encountered a temporary error and could not complete your request.

Please try again in 30 seconds.

Do we trust too much in cloud computing?
Most of us do not have backup of their gmail account just imagine what would happen if you lose it.

I think Google should enable a easy backup of all the gmail archive and even if we have to pay for it. Doing it via SMTP is just too slow and unreliable.

SOLUTION: You can always try to get your mail using POP, if its urgent

Configure your POP client - http://mail.google.com/support/bin/answer.py?answer=12103

but you probably should have done this first
Enabling POP - http://mail.google.com/support/bin/answer.py?hl=en&answer=13273

God(Google) help us!!!

Thursday, February 19, 2009

ASP.NET parse HTML string HtmlDocument

Here is a quick tutorial that shows how a string containing HTML can be parsed and navigated using HtmlDocument object.
You must use this namespace for HtmlBrowser and HtmlDocument objects

namespace System.Windows.Forms

First lets say you have a flat HTML in a string variable like this

string strHTML = "[some raw html]";
WebBrowser browser = new WebBrowser();
browser.ScriptErrorsSuppressed = true;
HtmlDocument htmlDocument = browser.Document.OpenNew(true);
htmlDocument.Write(strHTML);

I recommend to set ScriptErrorsSuppressed=true; to avoid possible JS problems while loading HTML.

Once you HtmlDocument object is ready you have these functions (similar to JavaScript) on your disposal:

htmlDocument.GetElementById(string id)
htmlDocument.GetElementsByTagName(string tagName)
htmlDocument.GetElementFromPoint(System.Drawing.Point point)

All these methods returns ether HtmlElement or HtmlElementCollection and here are useful methods for parsing thru elements

htmlElement.Parent

htmlElement.NextSibling

htmlElement.FirstChild

htmlElement.InnerHtml

htmlElement.InnerText

htmlElement.Children

htmlElement.GetElementsByTagName(string tagName)

As you can see this is exactly same as JavaScript DOM model so anybody that has experience with working with DOM will be right at home.

It would be nice to have something like JQuery server side to parse the document, if you know about a better way of parsing or a library dedicated to it fell free to add a comment?

Monday, February 16, 2009

DotNetNuke Professional, is it still opensource?

What does this mean? ... Purchase DotNetNuke
What about open source?
How will this affect future releases of DotNetNuke?
Should we start looking for a new open source CMS alternative for ASP.NET?

I think people of DNN joined collective paranoia and insanity of recession and started inventing new ways to get money. I'm sure this is not a good way to go. Sooner or later the community releases will become more and more buggy and we will be forced to buy the "PROFESSIONAL" version (whatever this means). At the end, my view is that DNN will become one more commercial CMS out there.

Do they want to say that the releases of DNN where unprofessional up till now?
That previous versions of DNN are just for amateurs?

Nice way of demeaning your own product.

And the fact there is no price listed on the site, but a simple contact form, means that they are probably just probing the market to see the response.

We as a community should give them our response.

Everybody that uses DNN should go to this address and give their voice about these changes
http://www.dotnetnuke.com/Home/Forms/Purchase/tabid/1241/Default.aspx

For the end of this post I leave you with this Wired article
Free! Why $0.00 Is the Future of Business

Friday, February 13, 2009

asp:HyperLink NavigateUrl Problem Absolute URL

I came across an idiotic problem with asp:HyperLink control.
What happened is that I noticed every time I bind a hyperlink NavigateURL field in code-behind, it points to current site + the url i specifed.

Example:

In Page_Load i do:

lnkAbsolute.NavigateURL = "http://www.google"

But the result on the page is

http://www.mysite.com/www.google.com

IDIOTIC


Solution

So the solution i found is not relay good but nevertheless a solution.

I saw that in Page_PreRened event my NavigateURL lost "http://" part of the URL
so you just have to re-add the "http://" prefix to the URL in Page_PreRender event, like so:

protected void Page_PreRender(object sender, EventArgs e)
{
if (!lnkAbsolute.NavigateUrl.StartsWith("http://") && !string.IsNullOrEmpty(lnkAbsolute.NavigateUrl))
{
lnkAbsolute.NavigateUrl = "http://" + lnkAbsolute.NavigateUrl;
}
}


Sometimes I just can believe how the simplest of things can hold you back.

Thursday, February 12, 2009

ASP.NET vs PHP. Top 5 sites running ASP.NET or IIS servers

Hi to all developers,

I decided to write this post after 100th time I had to defend the technology i choose to work on (which is ASP.NET). Often when somebody(client) decides what to use for their web site he asks around and they get an answer like
"Use PHP it is the best!!! Do not use ASP.NET it is expensive and not safe".
That is a incorrect generalization and often suggested by people working on PHP.


Then that somebody (usually the client) demands me to prove that ASP.NET is a viable framework for developing web application. And after the 100th time(Repetition is the mother of knowledge) I had to write a mail to explain that ASP.NET is a proven framework for developing web apps here is what i come up with:

Web Servers
There is a place on the web news.netcraft.com/ that can show you witch site use what web server, among other things. Latest data (Jan 2009) show:

Apache 52.26%
Microsoft 32.91%

So one third of all the web servers out there a hosted on Microsoft servers and probably most of the use ASP.NET.

Hosting
When I say hosting I mean dedicated or virtual server hosting and most of the hosting providers on the web that offer both Linux and Microsoft servers have the same price difference.

Usually Windows servers is 20% more expensive than Linux.

If you take that the average price for an average server on the web is around $150 a month the price difference is not really a problem.

Top 5 sites running ASP.NET or Microsoft/IIS servers
So I used Alexa The top 100 sites in the English language and searchdns.netcraft.com to get to top 5 sites that either are running on IIS and/or ASP.NET (I excluded all Microsoft sites)

www.orkut.com - 9th place. Social networking and discussion site operated by Google. I dose run on Linux but as far as I see it the extensions of url's on that sites is .aspx and that is ASP.NET (Correct me if I'm wrong
www.ebay.com 13th place. Uses Windows servers.
www.espn.go.com 35th place
www.doubleclick.com 73th place. Coordinates targeted Internet advertising campaigns for advertisers, and provides ad management services, software, and sales for publishers. At least they corporate website is running on ASP.NET.
www.imeem.com 82th place. Users interact with each other by watching, posting, and sharing content of all media types, including blogs, photos, audio, and video.

Also www.godaddy.com is one of the biggest domain registrar out there with around 26% global market share, running on ASP.NET . Source http://www.webhosting.info/registrars/reports/total_domains/GODADDY.COM?ob=gs&oo=asc

I'm sure i made some errors in the list but I'm also sure there are many other popular, highly visited and secure web sites out there that run on ASP.NET.

So to finish with this.

The security, speed and stability of a web site or application is not determined by the technology or the server used, but the quality and knowledge of people developing it.

I said Good Day Sir.