Improve iPhone Safari Readability

I like to catch up on my blog reading using my iPhone. However, many sites don’t have a mobile version that formats the page for a smaller device.

Instatpaper to the resuce!

Instapaper.com is known for allowing you to bookmark a web page and ‘Read It Later’ using either their website or iPhone app. What’s also great is they format the bookmarked web page so that it is readable on mobile devices. They also offer their ‘mobilizer engine’ to use as a separate service:

If you go to this site on your mobile browser: http://instapaper.com/m 

Then Enter a url of blog you like to read: For example: http://community.devexpress.com/blogs/aspnet/default.aspx

Hit Go and watch as all the formatting is removed and you see big text that only scrolls vertically. Beautiful and perfect for mobile browsers.

I’ve taken it a step further by creating a bookmarklet that will automatically call the ‘Instapaper mobilizer’ site for you when you’re reading a blog on your mobile browser. Here’s the steps to add it to an iPhone:

  1. From Safari, add a new bookmark and call it something like ‘Instapaper Mobilizer’.
  2. Edit the Bookmark you just added.
  3. javascript:var d=document,w=window,f=’http://www.instapaper.com/m’,l=d.location,e=encodeURIComponent,p=’?u=’+e(l.href),u=f+p;if(!w.open(u,’t’,’toolbar=0,resizable=0,status=1,width=250,height=150′))l.href=u;   Replace the url with the JavaScript code in this box.
  4. Now, while reading a blog, open the bookmark you just added.

And that’s it. Enjoy.

Advertisements

I’m a Creator and Social Manager

Taking up Travis’ suggestion, I took the color career test and got the following results. Surprisingly, it is not too different than my day job:

—————————————————-

Best Occupational Category
You’re a CREATOR

Keywords

Nonconforming, Impulsive, Expressive, Romantic, Intuitive, Sensitive, and Emotional

These original types place a high value on aesthetic qualities and have a great need for self-expression. They enjoy working independently, being creative, using their imagination, and constantly learning something new. Fields of interest are art, drama, music, and writing or places where they can express, assemble, or implement creative ideas.

CREATOR OCCUPATIONS
Suggested careers are Advertising Executive, Architect, Web Designer, Creative Director, Public Relations, Fine or Commercial Artist, Interior Decorator, Lawyer, Librarian, Musician, Reporter, Art Teacher, Broadcaster, Technical Writer, English Teacher, Architect, Photographer, Medical Illustrator, Corporate Trainer, Author, Editor, Landscape Architect, Exhibit Builder, and Package Designer.

CREATOR WORKPLACES
Consider workplaces where you can create and improve beauty and aesthetic qualities. Unstructured, flexible organizations that allow self-expression work best with your free-spirited nature.

Suggested Creator workplaces are advertising, public relations, and interior decorating firms; artistic studios, theaters and concert halls; institutions that teach crafts, universities, music, and dance schools. Other workplaces to consider are art institutes, museums, libraries, and galleries.

2nd Best Occupational Category
You’re a SOCIAL MANAGER

Keywords:

Tactful, Cooperative, Generous, Understanding, Insightful, Friendly, and Cheerful

This very social type enjoys working in groups, sharing responsibilities, and being the center of attention. Fields of interest are instructing, helping, nurturing, care giving and instructing-especially young people. They discuss and consider feelings in order to solve problems, lead, direct, persuade, guide, organize and enlighten others.

Handbook: Life Advice From My Big Sister

Check out this fantastic list that I got from my big sister. Some inspirational, useful, and good advice for everyone:

HANDBOOK 2010

Health

:
1. Drink plenty of water.

2. Eat breakfast like a king, lunch like a prince and dinner like a beggar.

3. Eat more foods that grow on trees and plants and eat less food that is manufactured in plants..

4. Live with the 3 E’s — Energy, Enthusiasm and Empathy

5. Make time to pray.

6. Play more games

7. Read more books than you did in 2009 .

8. Sit in silence for at least 10 minutes each day

9. Sleep for 7 hours.

10. Take a 10-30 minutes walk daily. And while you walk, smile.

Personality

:
11. Don’t compare your life to others.. You have no idea what their journey is all about.

12. Don’t have negative thoughts or things you cannot control.. Instead invest your energy in the positive present moment.

13. Don’t over do. Keep your limits.

14. Don’t take yourself so seriously. No one else does.

15. Don’t waste your precious energy on gossip.

16. Dream more while you are awake

17. Envy is a waste of time. You already have all you need..

18. Forget issues of the past. Don’t remind your partner with His/her mistakes of the past. That will ruin your present happiness.

19. Life is too short to waste time hating anyone. Don’t hate others.

20. Make peace with your past so it won’t spoil the present..

21. No one is in charge of your happiness except you.

22. Realize that life is a school and you are here to learn. Problems are simply part of the curriculum that appear and fade away like algebra class but the lessons you learn will last a lifetime.

23. Smile and laugh more.

24. You don’t have to win every argument. Agree to disagree….

Society

:
25. Call your family often.

26. Each day give something good to others.

27. Forgive everyone for everything.

28. Spend time w/ people over the age of 70 & under the age of 6.

29. Try to make at least three people smile each day.

30. What other people think of you is none of your business.

31. Your job won’t take care of you when you are sick. Your friends will. Stay in touch.

Life

:
32. Do the right thing!

33. Get rid of anything that isn’t useful, beautiful or joyful.

34. GOD heals everything.

35. However good or bad a situation is, it will change..

36. No matter how you feel, get up, dress up and show up.

37. The best is yet to come..

38. When you awake alive in the morning, thank GOD for it.

39. Your Inner most is always happy. So, be happy.

Last but not the least

:
40. Please Forward this to everyone you care about, I just did

How to disable command buttons in ASPxGridView

Update: Please check this code central example for a better approach: How to use ASPxCheckBox in DataItemTemplate to emulate a selection

Check out this quick tip on how to disable the Insert, Edit and Delete command buttons in the ASPxGridView.

We’ve also created a new ASPxGridView event to simply the approach described above. But more on that later.

Scenario

You’ve enabled edit/insert/delete functionality for your grid, however, you need to disable it for certain rows.

Solution

First, we should dynamically check which rows need to be disabled. Then we’ll use the HtmlCommandCellPrepared event because it allows you to change the settings of individual command column cells. For example, this code below will hide the ‘New’ button and disable the selection check box for every other row:

protected void ASPxGridView1_HtmlCommandCellPrepared(object sender, ASPxGridViewTableCommandCellEventArgs e)
{
    if (e.CommandCellType == DevExpress.Web.ASPxGridView.GridViewTableCommandCellType.Data)
    {
        // odd row
        if (e.VisibleIndex % 2 == 0)
        { 
            e.Cell.Controls[1].Visible = false;  // hide the New button
            ((WebControl)e.Cell.Controls[3]).Attributes["disabled"] = "true"; // disable the selection checkbox
        }
    }
}

You can download and see a live demo of this code at Code Central: How to customize command buttons in individual rows

New Event For Easier Approach

While the approach described above is good, the R&D team wanted to improve access to the command buttons at runtime. So a new event was implemented for the upcoming DXperience 2009 Volume 1 release. The new CommandButtonInitialize event allows you to change command button controls visibility and also enable/disable them easily. For example, the code below shows how to hide every third “Select” button and disable every second ‘Select” button:

protected void ASPxGridView1_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCommandButtonEventArgs e)
{
    if (e.Button.ButtonType != DevExpress.Web.ASPxGridView.ColumnCommandButtonType.Select) return;
    e.Visible = e.VisibleIndex % 3 != 1;
    e.Enabled = e.VisibleIndex % 2 != 1;
}

DXperience? What’s That?

DXperience is the .NET developer’s secret weapon. Get full access to a complete suite of professional components that let you instantly drop in new features, designer styles and fast performance for your applications. Try a fully-functional version of DXperience for free now: http://www.devexpress.com/Downloads/NET/

The year 2008 in photographs – boston.com

discoveryliftoffCheck out this set of pictures from Boston.com. It shows greats photos of events both happy, momentous and extremely tragic.

And this is only the first part. I’ll have to keep an eye out for parts 2 and 3:

The year 2008 in photographs (part 1 of 3)

2008 has been an eventful year to say the least – it is difficult to sum up the thousands of stories in just a handful of photographs. That said, I will try to do what I’ve done with other photo narratives here, and tell a story of 2008 in photographs. It’s not the story of 2008, it’s certainly not all stories, but as a collection it does show a good portion of what life has been like over the past 12 months. This is a multi-entry story, 120 photographs over three days. Watch for part 2 and part 3 tomorrow and the next day. (40 photos total)

DevExpress ASP.NET Themes – Easy 3 Step Customization for Your Projects

Check out the difference between a naked ASP.NET project and the same project using a Developer Express theme:

image image

Nice upgrade, isn’t it? Here are the 3 simple steps to add Developer themes to your project: 

1. Add a Combo Box for Selecting the Theme

First you’ll need to decide on which page you want to put the theme selection combo box. You can put it on a master page so that it’s available on all derived pages. Or you can put it on a user customization page, like an options/settings page. Putting the the combo box at the top of the page will make it easier for the user to find and select the theme. You can see a sample of this in the ASP.NET demos. I recommend binding this combo box to an XML file that contain a list of the available themes.

2. Use DevExpress ASP.NET Theme Deployment Tool

There are several great pre-built themes that ship with our ASP.NET controls like the Office 2003 themes. Check out the ASPxThemeDeployer video to learn how to copy the DevExpress ASP.NET themes to your local web projects. Click the image to watch the video:

image

3. Add Code To Load/Save the Themes

In this last step, we’ll add some code to bind as well as handle the load/save of the themes to cookies. Add this code to your CodeBehind file which contains the combo box. This will load and save the selected theme into a cookie so the users don’t have to re-select their favorite theme every time. And to make it easier handle these cookies, include one of JavaScript utility files in a new folder called ‘scripts’:

  • C:\Program Files\Developer Express .NET v8.1\Demos\ASPxGridView\CS\ASPxGridViewDemos\Scripts\Utilities.js

Please note that with the DXperience v2010 vol 1 release, we’ve moved the local demos location to the User Documents area. For example, on my Windows7 install, the file is located here now:

  • C:\Users\Public\Documents\DevExpress 2010.1 Demos\Components\ASPxGridView\CS\ASPxGridViewDemos\Scripts\Utilities.js

This file contains some methods which we’ll call from the client-side to save the theme whenever the user selects a new theme:

<dxe:ASPxComboBox AutoPostBack="True" DataSourceID="xdsThemes" Width="150px" 
ID="cbSkins" runat="server" EnableViewState="False" 
ClientInstanceName="cbSkins" OnDataBound="cbSkins_DataBound">
<ClientSideEvents SelectedIndexChanged="
function(s, e) {   
	DXSaveCurrentThemeToCookies(s.GetSelectedItem().value);
}" />

Here’s a complete sample project that shows the combo box for themes in action [Sample project: (C#) ChooseSkinDemo.zip | (VB) ChooseSkinDemoVB.zip].

Soft Orange Red Wine
image image
   
Youthful Black Glass
image image

Improve your UI by adding these Developer Express themes. Then leave a comment below about how much your users love this feature.

What’s New in 2008 Volume 2 for ASP.NET?

The 2nd major DXperience release of 2008 is just around the corner. This three (major) releases per year cycle is very useful. Each major release means new features, controls, functionality, etc. And in the 2008 Volume 2 (aka v8.2) release there are some great features from the ASP.NET team. Read below for the full list. This post also ties in with the other announcements about the v8.2 release:


Common Changes Across All ASP.NET Controls

 

Useful Class for Client-side Scripting

A new ASPxClientUtils class allows you to easily perform some typical client-side actions such as:

  • Determine web browser type
  • Work with arrays
  • Access an object’s parent or child object
  • Obtain event parameters

Enable/Disable Controls and Control Elements on the Client Side

Previously, enabling/disabling a control or a control element required a round trip to the server. In 2008 vol 2, the controls from the ASPxEditors and ASPxperience Libraries allow you to change their enabled state or the state of their elements (tabs, menu items) on the client side. This reduces the number of round trips to the server and increases web site responsiveness.

Distinguish Between Callbacks and Postbacks

A new server-side IsCallback property has been added to our web controls. This property allows you to find out whether a control takes part in callback processing.

Native Rendering for Data Editors

Some controls from the ASPxEditors Library (ASPxTextBox, ASPxMemo, ASPxListBox, ASPxComboBox and ASPxButton) can now be rendered as HTML INPUT elements of the appropriate types. This allows you to enable native rendering for these elements thus providing Windows® style UI in your web site. Native rendering results in less HTML code which improves an application’s overall performance.


ASPxHtmlEditor

Integrated Spelling Checker

The ASPxSpellChecker is now integrated into the ASPxHTMLEditor which enables spelling validation in the editor’s Design View. To check spelling, end-users can now simply press a built-in toolbar button.

Predefined Styles for Text Formatting

Previously, every toolbar button performed a very basic formatting operation – for instance, applying bold or italic formatting, changing background color, etc. Now you can create buttons that change multiple style attributes at once. This is extremely useful if end-users need to highlight multiple text fragments using the same style settings.

To enable this functionality, all you need is to create a custom CSS style and expose it via a toolbar’s specially designed dropdown editor.

Responding to Focus Changes via Client-side Events

Newly implemented client-side events allow you to respond to the focus event being received or lost by the editor’s Design View. For instance, this enables you to implement client-side user input validation when an end-user tries to leave the editor.

Complete XHTML compliance

HTML code entered into the editor’s HTML View can be automatically validated and transformed into XHTML 1.0 Transitional compliant markup. As the result, the editor’s content is always kept safe, since the editor removes all potentially harmful code – unknown tags and attributes, script elements, client-side event handlers and URLs with script content. Automatic validation also helps to keep HTML code validity by correcting invalid tag hierarchies and changing invalid attribute values.

The ASPxHtmlEditor exposes several options to control which automatic transformations are required. You can also update HTML code manually by overriding an event.


ASPxperience Suite

 

Obtaining Settings from Data Fields

Some controls like the ASPxNavBar, ASPxMenu and ASPxTabControl, now expose properties which allow you to specify data fields from whose items settings are to be obtained. Examples of settings that can be fetched from a data table are item tooltips, navigation URLs, image URLs, etc.

Data binding, an entirely new feature in this release, is now supported for the ASPxTabControl. Prior to v2008 vol 2, it could only work in unbound mode.

Easily Transmit Any Data onto the Client

All AJAX-enabled controls in the ASPxperience Suite now allow the same easy data exchange with the web server as in the ASPxGridView Suite. The Controls expose the CustomJSProperties event, which enables you to declare custom properties for the client control. You can specify these properties’ values on the server side and then access them on the client, as you would do with built-in properties.

New Media Formats for Object Container

The list of allowed video and audio types has been extended with QuickTime Video and QuickTime VR (virtual reality) types.

ASPxCallbackPanel Improvement

The panel’s content can now remain visible during callback processing. This behavior is optional – a loading panel is displayed by default.