Saturday, May 09, 2009 10:00:00 AM
|
Rate this Content
|
|
1 Votes
|
Recently I've begun using the jQueryUI tabs in mojoPortal as an alternative to YUI tabs. I still like the YUI tabs but there is only 1 skin available currently for YUI tabs, whereas there are a 18 themes for the jQuery UI tabs, so its likely that at least one of them will look good with a particular mojoPortal skin. This has got me thinking about switching to use the jQuery tabs in many or most places where we use YUI tabs. I still need to test a few things like making sure I can use FCKeditor inside the tabs like I can with the YUI tabs. One thing I like about the YUI tabs is that they automatically adjust to right to left layout if they are contained within and element with direction:rtl in the css.
I was worried at first whether the jQuery Tabs would support right to left layout because when I googled for it I could not find any explnations how to make the tabs layout from right to left. I found a number of people asking about it on mailing lists and forums but no-one offering any answers. So I used Firebug to study the css classes assigned to the elements and figured out the things that need to be overridden to make it layout from right to left. I thought I should post it since clearly there are people looking for hep with this. Its actually very straightforward, you include the normal css for the jquery ui theme, and you add another css file below it in the page (it must be lower in the page in order to override the style settings above it in the jquery ui css). There is only a little css needed because we want to override the minimum possible style settings, this is what is needed:
.ui-tabs { direction: rtl; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected,
.ui-tabs .ui-tabs-nav li.ui-state-default {float: right; }
.ui-tabs .ui-tabs-nav li a { float: right; }
I tested it with all 18 jQuery UI themes and it worked great. I hope this is helpful to others.

Friday, October 10, 2008 1:53:40 PM
|
Rate this Content
|
|
4 Votes
|
As I mentioned in my previous post, I was doing some testing today of mojoPortal under Medium Trust and was trying to resolve some issues. In most situations mojoPortal can be configured to run in Medium Trust, but occasionaly people have reported System.Configuration.ConfigurationPermission exceptions. I have not been able to reproduce that problem on my development machine. I add this to Web.config to configure medium trust for testing purposes:
<trust level="Medium" originUrl="" />
So today I encountered this exception on a new machine running in Medium Trust. Its not always easy to find out what is causing an exception like this because you don't get a lot of information in the stack trace, but I was able to pin it down to System.Web.Extensions.dll which is the MS AJAX library. We include this dll in the /bin folder with mojoPortal releases and in Full Trust this is ideal because we don't care if the dll is installed on the machine or not, but in Medium Trust, this dll can not run from the bin folder, it must be installed in the GAC (Global Assembly Cache) on the server. If it is installed in the GAC, the copy in the /bin folder will be ignored and the one in the GAC will be used. But if its not installed and the machine is configured for Medium Trust it will cause this mysterious SecurityException with System.Configuration.ConfigurationPermission.
So the reason I was never able to reproduce the problem on my development machine was because I already had this installed in the GAC. If you install the ASP.NET 2.0 AJAX 1.0 using ASPAJAXExtSetup.msi, it installs it in the GAC on your machine. Your only solution to this at a web host is for the host to install it on the server.
Friday, October 10, 2008 10:37:40 AM
|
Rate this Content
|
|
2 Votes
|
I was doing some testing today of mojoPortal under Medium Trust and was trying to resolve some issues. In most Medium Trust hosting situations mojoPortal can be configured to run in Medium Trust, but occasionaly people have reported System.Configuration.ConfigurationPermission exceptions. I have not been able to reproduce that problem on my development machine. I add this to Web.config to configure medium trust for testing purposes:
<trust level="Medium" originUrl="" />
I found this blog post by Phil Haack, where he mentioned that using an external config file with log4net could cause this exception and that moving the configuration into Web.config could solve it. Though he later updated that post and now says that it can work with an external file, I figured it was at least worth a try in case it is log4net causing this exception on some installations of mojoPortal. So I move the configuration into the Web.config file and a strange thing happened, the log messages started getting truncated to about 30 characters. So I did some googling for "log4net messages truncated" and found a number of messages about it but no real solution mentioned so I started reading more of the log4net documentation about the PatternLayout. I thought maybe this truncation was related to PatternLayout so I changed the config to use SimpleLayout and sure enough the messages were no longer truncated. But I wanted to use PatternLayout as I have all along if possible. Originally my configuration was like this:
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{url}] - %message%newline" />
</layout>
So I started chopping things out to see if any particular setting was the culprit and indeed it turned out to be the [%property{url}] that was causing the problem. It still seems like a log4net bug, but its strange that it only happens when not using an external config file for log4net.
So for me the solution was just to remove that part of the pattern so my current configuration is like this:
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %logger - %message %newline" />
</layout>
Just figured after all the time I spent figuring this out that I should blog it in case others are having the same trouble.
Now I'm still not sure if moving the log4net configuration into Web.config is going to solve the rogue medium trust issue that happens on some machines. If I can figure that one out it will be worth posting about it as well.
Monday, September 29, 2008 1:42:19 PM
|
Rate this Content
|
|
0 Votes
|
Those of you who do a lot of web development like me are used to occasional issues where client side code doesn't work the same across browsers, but less common and perhaps more pesky are bugs where things run differently on the server depending on the browser. We typically don't expect things to happen differently on the server due to the browser but sometimes they do.
I ran into this strange issue where events were firing twice for postbacks from Firefox but were firing normally when using IE. When you see double postbacks happening in the log, your first thought would be that the impatient user clicked the button twice, but in this case I knew that wasn't true because I was the user and also I have code to disable the button after it is clicked to prevent double postback. There is a very common technique used by many ASP.NET developers to do this. In mojoPortal we have a helper method that encapsulated it so we just pass in the button and text to show when its disabled like this:
UIHelper.DisableButtonAfterClick(
btnUpdate,
Resource.ButtonDisabledPleaseWait,
Page.ClientScript.GetPostBackEventReference(this.btnUpdate, string.Empty) );
and the guts of the method look like this:
public static void DisableButtonAfterClick(
WebControl button,
string disabledText,
string postbackEventReference)
{
if (button == null) return;
button.Attributes.Add("onclick", "this.value='"
+ disabledText
+ "';this.disabled = true;"
+ postbackEventReference);
}
The irony of it is that disabling a button inside an updatepanel actually causes double post back if the browser is Firefox. So the very code we are using to try and prevent double postback actually causes it to happen. All the events fire twice, OnInit, PageLoad and the button click event. Very strange indeed. The symptom doesn't happen in IE, and removing the code that disables the button fixes the problem in Firefox and events fire normally again, that is just once. So we are back to the problem of how to prevent the user from clicking the button twice if the button is inside an UpdatePanel. Our old way works in IE (and works in general outside of UpdatePanels) but actually causes double postback in Firefox.
I did some googling and found where someone else has reported this. I also found a free dll that solves it, but its not open source so I can't use it.
I wish I was posting a solution for this problem, but for the moment I've just gone with not disabling the button. If I find a good solution I'll update this post. but thought it worth mentioning for anyone else who is seeing double postbacks in Firefox. I will say my searches found a number of things that can cause double postback in Firefox, so this isn't the only possible cause to consider. For example if a page has an <asp:Image on it and the ImageUrl has not been specified, that apparently also causes double postbacks in Firefox.
Monday, September 29, 2008 12:41:23 PM
|
Rate this Content
|
|
0 Votes
|
I've finally come full circle and am happy developing on Vista again. I was an early adopter and over time I've complained about Vista a few times, so I think its only fair to be just as vocal now that I'm happy with it. In retrospect I think the main problem was that I upgraded a machine that was several years old and it just wasn't powerful enough.
Ever since I got new workstation, development has been a joy, productivity is high. Visual Studio solutions load fast, build fast, and debug fast. With 64 bit Vista you can use a lot more ram. I've got 8 gigs now where before 32 bit Vista/XP could only use 3 gigs. I've got a fast dual core processor (if I had it to do over I would spend more and go quad core). Also 10,000rpm drives make a big difference.
I can't even imagine going back to a 32 bit machine for day to day development. If you are struggling with VS on a slow machine its well worth the investment to get a new 64 bit workstation.
Wednesday, September 03, 2008 6:35:10 PM
|
Rate this Content
|
|
0 Votes
|
I spent the day today using Google Chrome as my browser and I have to say I'm very impressed with it. I like the UI and its so fast! I've always heard that web kit was fast but never tried it so maybe its web kit that should get the credit since Chrome is based on web kit.
When I first tried mojoPortal this morning using Chrome, the FCKeditor wasn't enabled and it was degrading to a plain text area. This turned out to be just a configuration issue in .NET code I had FCKeditor disabled for Safari. FCKeditor has claimed support for Safari for a while now but when I tested it after their initial support announcement it didn't work for me so I disabled it in mojoPortal. Then I kind of forgot about it for a while since I don't use Safari on a regular basis. Its been several upgrades of FCKeditor since I had tested so I tried enableing it again and it worked fine both in Safari and in Chrome.
So then with more poking around testing things in mojoPortal I found a couple of other things that didn't work like my friendly url suggest feature. It turned out that this was easily fixed by upgrading to the new version of Sarissa. Sarissa is a javascript library I use in a few features in mojoPortal and I had not upgraded it in a long time.
My fixes for these things will be in the mojoPortal svn trunk sometime later tonight and I'll be making a new release soon.
I feel a little worried for Mozilla and Firefox. I've been using Firefox for a long time as my main browser but I have to admit Chrome is very appealing and I may not go back to Firefox as my main browser. Of course I'll continue testing in all the major browsers. Some people are complaining that we now have one more browser to test but so far the rendering of mojoPortal has seemed really good so I'm not too concerned about that. I subscribe to the GAWDS (Guild of Accessible Web Designers) mailing list and there was a lot of talk in the last 2 days about accessibility problems with Chrome particulary for assistive technology like screen readers, but word is there will be improvement on that, after all its just a beta.
I'm sure they will be adding more polish to Chrome, but I would say this beta is a great start. The EULA gives me pause and I hope they change that based on feedback but I give them kudos for the first release. My only other concern is whether use of Chrome is making any more information about me available to google than if I use another browser. If using Chrome meeans sacrificing more privacy than other browsers it won't become my main browser. I also hope that since Silverlight works in Safari, it will also work in Chrome.
I made this post in my blog using Chrome.
Wednesday, August 27, 2008 11:53:55 AM
|
Rate this Content
|
|
1 Votes
|
These are all the cell phones I've ever had.

I remember when I first got that Samsung clamshell phone on the left, gosh, how long ago was that 1997, 98 99? Somewhere in there I'm sure. I remember being so excited about that phone when I first got it. As a kid I had always fantasized about those communicators they used on Star Trek and when I got this phone it was like the realisation of a childhood dream. I got rid of my land line pretty soon after that and haven't had one since.
I was pretty excited when PocketPC phones first came out. Being a Web Developer, the idea of always having access to the internet wherever my phone worked seemd like a dream. I think I got that phone around 2002 or 2003 and at the time I gave my old phone to my younger brother Frank who lived in North Carolina (I was living in TN at the time). It really wasn't a compelling internet experience, and though I kept it until long after my service contract expired, I got really tired of carrying around that big phone. I mean if you put it in your pocket people were like "hey is that the internet in your pocket or are you just happy to see me?". It was really a phone that needed a belt clip like Batman, but I really wasn't into that belt clip thing.
So then I got the Razr, must have been around 2004 or 2005, again I gave my old PocketPC phone to my younger brother Frank. I was much happier with the Razr, it was slick, it was small, and it was a joy to stop carrying that old boat anchor PocketPC.
Last month I got an iPhone. Its way beyond any phone I ever imagined seeing in my lifetime. Its got a compelling web surfing experience, and yet it fits nicely in your pocket without raising eyebrows. I know a lot of people like a physical keyboard and those folks tend to like Blackberries. I suppose if I was answering a lot of email with my phone I might wish for a real keyboard too. Honestly I haven't yet answered an email with my iPhone. For me its more about knowing whether I have important mail at any time than actually responding to it from my phone. It can usually wait until I'm near a computer again. After all, I'm near a computer about 95% of the time. For me its just another convenient way to service my internet addiction. I work long days and then finally collapse and watch movies at the end of the day when I can no longer keep going. I used to find myself getting up from the couch a lot just to check if any new mail had come in, or see how many people are on mojoPortal.com. Now I don't have to get up off the couch. In some ways I like the Facebook experience better on the iPhone than on a computer. I love having a lot of my music collection in my phone, love the GPS. Its a really great device.
So I thought again whether I should offer my old Razr to my younger brother Frank. The funny thing is, now that I'm living in North Carolina, I find out he never activated or used any of the phones I ever gave him, thats how I'm now able to take a picture of them all together. He hasn't committed to a new phone contract for like eight years now. He's still using this old monstrosity:

We're talking dinosaur phone. Not only that but he relies on this thing for all his communication and he lost the battery charger years ago, so he can only charge it now in his car and he's been doing this for years. I'd say he's way over due for a new phone.
Friday, August 15, 2008 6:06:57 AM
|
Rate this Content
|
|
2 Votes
|

I walk by this sign almost every day when I go for my exercise walks at the park, its always struck me as funny. Today I took this picture with my iPhone.
Friday, August 15, 2008 5:53:28 AM
|
Rate this Content
|
|
1 Votes
|
I got this email this morning which is definitely NOT from Yahoo, but from someone hoping I will send them my password. Its another identity theft scam. The interesting thing is there is no phishing in it, no links to bogus sites and its clever enough I worry whether more naive family members and friends may be taken in by it. It starts with a little marketing about cool new stuff to make it seem legit, but the hook is the fear of losing your account if you don't comply. The fact that there aren't any phishing links also tempts one to think its real. But Yahoo nor any site you have an account with, would never ask you to email them your username and password. Scary to think how many people will probably do what it says.
"The All-New Yahoo! You Must Be A Part Of It To Avoid De-activativation Of Your Yahoo Account.
The All-New Yahoo! Mail Beta Is:
Faster: Fewer steps to get things done.
Easier: Drag & drop organization.
Effortless: Automatically checks email for you.
With the all-new Yahoo! Mail Beta you must fill the Informations Below To Verify Your Account, PleaseThis For Your Benefit. Read Below To Understand More.
Dear Yahoo User,
Due to the congestion of Yahoo users, Yahoo would be shutting down all unused Accounts, You will have to confirm your E-mail by filling out your Login Information below after clicking the reply button, or your account will be suspended within 24 hours for security reasons.
* Username: .................................
* Password: ...................................
* Date of Birth: ................................
* Country Or Territory: .................................
After following the instructions in the above, your account will not be interrupted and will continue as normal. Thanks for your attention to this request. We apologize for any inconveniences.
Warning!!! Whosoever that refuses to update his/her account after two weeks of receiving this warning will lose his or her account permanently.Until then, feel free to visit our online help center at
http://help.yahoo.com/
for answers if you have not already done so."
Monday, July 14, 2008 10:49:41 AM
|
Rate this Content
|
|
0 Votes
|
I got a new machine about a week ago for my main development system and I am so happy with the improved speed. My previous machine had become so slow it was really getting in my way all the time. I had upgraded it to Vista about a year ago and after 8 months it became unusable, so I kind of blamed Vista and I went back to XP. After a clean install of XP it seemed better again for a little while but then I started using Visual Studio 2008. At first it was tolerable then it became worse over time and it was getting very frustrating waiting for it to do whatever its doing in the background all the time before I could do what I need to do. It was just getting in my way and hurting my productivity and attitude. So finally I realized, hey, this machine is 3 years old, I'm a developer, I need a new faster machine, its crazy for me to limp along on this old hardware.
I bought an HP Workstation for about $2,350 plus tax and shipping with no monitor, keyboard or mouse, as I already have that stuff. So far its so much faster than anything I've used I'm really happy with it. I got 8GB of RAM and 2 10,000RPM drives and a fast Core Duo processor. If I had it to do over I'd probably spend more and get a Quad Core processor, but this machine is plenty fast. It opens large Visual Studio solutions almost instantly, builds are very fast, and development in general is a joy again because I'm not hindered waiting for my machine anymore. I'm running 64 bit Vista Business, obviously 64 bit since you can't address 8GB of ram with a 32 bit version of Windows.
I guess I waited so long because I'm in a self funded startup business and trying to be very frugal, but I think to be succesful I need to be very productive and to be very productive I need to have a responsive machine. It was worth every penny. Development is fun again.