diff --git a/public/articles.html b/public/articles.html new file mode 100644 index 0000000..7060405 --- /dev/null +++ b/public/articles.html @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + +Better ListView .NET control: Improved List View control for C# and VB.NET (Windows Forms) + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+
+ +
Articles for .NET developers
+ + + +
+ +
+ +
+
+
+ + + + + +
+ + + + + + + + + + \ No newline at end of file diff --git "a/public/articles/\\\".html" "b/public/articles/\\\".html" new file mode 100644 index 0000000..d659db7 --- /dev/null +++ "b/public/articles/\\\".html" @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
+ +
+ + + +
+ + + +
+
+
+

Better ListView: Alternative list view control for .NET

+ + + +
+ +
+ + + + + + + + + + + + + + + +
+ +
+ + +
+

Seamless integration with .NET 2.0 and higher

+ +
+ + + + +
+

Better ListView

+
+ + +
+

Thumbnails

+
+ + +
+

Multi-line Items

+
+ + +
+

Item Hierarchy

+
+ + + + + + + + + + + +
+ +
+ + + +
+ + +
+
+ + + + + +
+ + + + + diff --git a/public/articles/visual-studio-toolbox-control-integration.html b/public/articles/visual-studio-toolbox-control-integration.html new file mode 100644 index 0000000..40155ac --- /dev/null +++ b/public/articles/visual-studio-toolbox-control-integration.html @@ -0,0 +1,1838 @@ + + + + + + + + + + + + + + + +Visual Studio Toolbox Control Integration - visual studio + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+
+ +
+ +
Articles for .NET developers
+ +

Visual Studio Toolbox Control Integration

+ +
+ + + + +

The Most Complete Guide to Visual Studio Toolbox Control Integration

+

Libor +Tinka, Lead Developer, ComponentOwl.com

+

+

+

Contents

+

1. Introduction
+2. Prerequisites
+3. Creating a Sample Control
+4. Manual Toolbox Integration
+5. Toolbox Integration using TCI
+6. Toolbox Integration using DTE
+7. Toolbox Integration using VSI Packages
+8. Toolbox Integration using VSPackages
+9. Toolbox Integration using VSIX Packages
+10. Supporting Multiple Version of .NET Framework
+11. Sample Source Code

+

1. Introduction

+

This tutorial is intended for developers who would like to distribute their +WPF or WinForms controls and automatically put them into Visual Studio Toolbox +during installation.

+

I struggled with Toolbox integration earlier because there are several possible +approaches (harder to decide between them). Each approach have its own pros and cons and +no overall comparison is provided. I wrote this tutorial to shed some light on the topic +and spare you hours, maybe days of research and experimenting with aspects of +Visual Studio (Toolbox) extensibility.

+

We will first take a look on Toolbox control integration in general to get a +big picture. Each approach will be then discussed in detail and the following +question will be answered:

+
    +
  • How to install control in Visual Studio Toolbox?
  • +
  • How to update the control?
  • +
  • How to uninstall/remove the control?
  • +
  • How to support multiple Visual Studio versions?
  • +

+

There are several options on how to integrate your controls with Visual +Studio Toolbox:

+
    +
  • Manual installation
  • +
  • Toolbox Control Installer (TCI)
  • +
  • Visual Studio Automation Object Model (DTE)
  • +
  • VSPackage
  • +
  • VSI package
  • +
  • VSIX package
  • +
+

Manual installation

+

The simplest way of adding control into Visual Studio Toolbox is from within +the IDE.

+

This approach have one crucial drawback, which is that you leave Toolbox +integration to the user. Many developers are not that experienced with Visual +Studio and when your component is shipped, even if you provide appropriate +step-by-step guide, they may find it too complicated and rather try +another component which "just works". I thought that every developer using +Visual Studio is experienced enough to know how to add new items in VS Toolbox, +but I received few e-mails from users who uninstalled the product just because +the component have not appeared in the Toolbox and they thought it is broken +(without reading our documentation, of course). On the other hand, there is +a group of users who are not experienced developers, but are in charge of trying +some products in a given company (e.g. project managers). These people can +install the component, play with it and they would really appreciate if it just +works. This increases chance they will actually purchase your product.

+

Advantages: zero effort
+Disadvantages: require experienced users, slows user +producitivity, updating controls is not intuitive

+

Toolbox Control Installer (TCI)

+

Visual Studio 2005 SDK contained a VSPackage called Toolbox Control +Installer. This package comes pre-installed with Visual Studio 2008 and newer. +Its job is to simplify the specific task of extending Visual Studio Toolbox. +This approach requires you to install your assembly in GAC (Global Assembly +Cache) and create a key in Windows Registry.

+

Advantages: simple and fast component installation, updating +and removing
+Disadvantages: requires installation in GAC (not always +wanted), VS 2005 supported with SDK only

+

Visual Studio Automation Object Model (DTE)

+

If you are not afraid of COM, you can try DTE (Development Tools Environment) approach. +There is already a project on CodePlex called +Visual Studio Toolbox Manager, +which solves the toolbox integration problem using a simple command-line +application. The project is outdated since it does not support Visual Studio +2010 and newer. I made a project called DteToolboxInstaller, which +is also a command-line application and does support Visual Studio 2013, 2012, 2010, +2008 and 2005. You can use the project as you like. The main disadvantage of DTE +approach is the speed. The installer have to run devenv.exe using the automation interface, create a +fake VS Solution, open Toolbox, add the stuff and then close the Solution. The +whole process take no less than 10 seconds. If you want to integrate with two or +three versions of Visual Studio, it can take well over a minute.

+

Advantages: does not require updating registry or GAC, full +control over Toolbox
+Disadvantages: very slow, separate installation required for +every version of Visual Studio

+

VSPackage

+

A VSPackage seems to be a natural option. VSPackages allow any type +of Visual Studio extension and you can manipulate Toolbox as well. There was a trouble +with VSPackages in providing a Package Load Key (PLK) which can be +generated only manually using web form. The requirement for PLK vanished with +Visual Studio 2010 (hooray!). The nice thing about VSPackage approcach is that it does not slow +down the installation process. The package is loaded and the controls are installed +on-demand (when the Toolbox is opened for the first time after installation). +After trying all the approaches, using VSPackage seems to be fastest and most +universal one.

+

Advantages: quick installation, appearance in About box and +other extensibility features
+Disadvantages: cmplicated setup, each component requires its +own package if shipped separately

+

VSI Package

+

VSI packages are quite old but you can use them for integration with Visual +Studio 2005 and newer. It have very simple structure and you can create one even +without Visual Studio. The only trouble with VSI compared to other +approaches is invoking a wizard form which cannot be suppressed. The +installation just cannot run in "quiet" mode. Another trouble with VSI is that a +digital signature is required in order to get rid of a warning dialog. Your control will be always installed under "My Controls" tab in the +Toolbox, which is not always desirable.

+

Advantages: simple creation, installer provided by Visual +Studio, automated creation and signing requires several specific steps
+Disadvantages: no quiet mode (extra steps when custom installer +is used), manual uninstallation

+

VSIX Package

+

VSIX packages came with Visual Studio 2010 so you can integrate with 2010 or +newer. the .VSI and .VSIX file extensions are associated with Visual Studio so +you can simply double-click it or run it via shell. You can also run +VsixInstaller.exe utility that performs the installation. Good news: No more +nag screens when VSIX is not signed - the installer only contains a dialog with +simple text: "This extension does not contain a digital signature." +Even better news: The VsixInstaller supports quiet mode!

+

Please note that VSI and VSIX package installers contain features like +displaying EULA, choosing which components to install or localization. When +deploying your controls for use in Visual Studio, you won't need an installer on +top of the package.

+

Advantages: installer provided by Visual Studio, quiet mode, +fast installation
+Disadvantages: package project required, automated creation is +complicated, no support for VS 2005 and 2008

+

Comparison of Approaches

+

Here is a table summarizing features of the discussed approaches. As you can +see, the VSPackage approach gives you the most freedom, but is also hardest +to implement. We will discuss every approach so +that you will be able to impement the one that suits you best.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 20052008201020122013SpeedInstall AutomationUninstall automation 
Manual installationdepends on user
TCIfast 
EnvDTEslow 
VSImoderate 
VSIXmoderate (faster than VSI) 
VSPackagefast 
+ +

2. Prerequisites

+

We will focus on integration with Visual Studio 2010, 2012 and 2013. Hence you will need:

+
    +
  • Visual Studio 2010 (or 2012, 2013)
  • +
  • Visual Studio 2010 SDK (or 2012 SDK, 2013 SDK)
  • +
  • Microsoft Windows SDK
  • +
+

The VS SDK contains regpkg.exe tool and project templates discussed in VSIX +and VSPackage approaches.

+

The Windows SDK contains gacutil.exe, guidgen.exe, signtool.exe and other +useful tools.

+

There are two kinds of versioning used for Visual Studio. One is based on the +release name (e.g. Visual Studio 2008) and the other is a classic version number +(e.g. 8.0). Both will be used, so it should be noted which version numbers +correspond to which versions of Visual Studio:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Release nameVersion number
Visual Studio 20058.0
Visual Studio 20089.0
Visual Studio 201010.0
Visual Studio 201211.0
Visual Studio 201312.0
+

3. Creating a Sample Control

+

We will start by creating simple WinForms control for integration in VS +Toolbox.

+

You can start with File - New - Project... (Control+Shift+N) and select +Windows Forms Controls Library template.

+

Of course, you can also create empty Class Library project, add references to +System.Drawing and System.Windows.Forms and create a new control. In fact, any +DLL containing public classes derived from Control will +suffice.

+

We want to support .NET Runtime version 4.0 and 4.5, so the control should be +built against .NET 4.0 to ensure compatibility (the lower framework version you +use, the wider range of compatible frameworks since they are backward +compatible). It should be noted that .NET 4.5 is an in-place update of .NET 4.0 +and hence the 4.5 assemblies will work on machines with 4.0 runtime installed +unless you use some feature specific to 4.5.

+

If you have multiple controls in your assembly and don't want to use some of +them in Toolbox, decorate them with ToolboxItem attribute with +defaultType parameter set to false:

+
+[ToolboxItem(false)]
+public class InvisibleControl : UserControl
+{
+  ...
+}
+
+

I have created a very simple control called SampleControl:

+

+

Finally, I set version of the assembly 3.3.0.0 (I chose just something else +than 1.0.0.0 to see where the specific version number appears).

+

Custom Transparent Icon for the Toolbox

+

Icons for Toolbox are 16 by 16 pixel images. Various image formats are supported +(BMP, JPEG, PNG and ICO). However, you need to +create 256-color BMP image to ensure transparency. The transparent color is determined by bottom left +pixel of the icon. Transparency works for magenta (#ff00ff):

+

+

The icon file should have same name as the control class (i.e. +SampleControl.BMP).

+

Finally, use ToolboxBitmapAttribute to link icon with the control class:

+
+[ToolboxBitmap(typeof(SampleControl), "Resources.SampleControl.bmp")]
+public partial class SampleControl : UserControl
+{
+	...
+}
+
+

Note that icon location matters, at least in C#. Since I have added +the icon under custom folder named Resources, I need to reference +Resources.SampleControl.bmp instead of just SampleControl.bmp.

+

Here is the resulting transparent icon in Toolbox:

+

+

Marking the Control as Toolbox Item

+

We can mark control as toolbox item by adding a ToolboxItemAttribute +with defaultType parameter set to true:

+
+[ToolboxItem(true)]
+public partial class SampleControl : UserControl
+...
+
+

This decoration is optional since the controls within assembly are +considered toolbox items by default. However, we can mark certain control +classes with ToolboxItem(false) to hide them from Toolbox. This +comes in handy when we have multiple projects and there are too many controls in +the Toolbox because loaded from all the other projects.

+

Signing the Assembly

+

The assembly containing controls (SampleControl.dll in our +case) should be strongly named if we want them installed in GAC +(Global Assembly Cache) later on. This is optional in most cases, but the Toolbox Controls +Installer approach requires the assembly being installed in GAC, hence the +strong name is necessary there.

+

To give an assembly a strong name, open project properties and find +Signing tab:

+

+

Check the "Sign the assembly" option and select "<New...>" +from the combo box. This will create a new .SNK file in your project which will +be used to sign the assembly. You can also browse for existing key file. If you +want to distribute multiple assemblies with custom controls, it is a best +practice to use same strong name key for each assembly (it is possible to have +one .SNK file located in Solution folder and put just a link to that file in +each project; when we browse for the key under the Signing tab, the link will be +used without copying the file).

+

The SNK (Strong Name Key) file is basically a private key to digitally sign +your assembly. There is also a public key which can be used to verify the +assembly and its shorter variant called "public key token" for assembly +identification.

+

4. Manual Toolbox Integration

+

Installing

+

To install component into Visual Studio Toolbox manually, open some form or +control in designer, open the Toolbox window (Control+Alt+X), right-click on the +Toolbox window and select "Choose Items...":

+

+

The "Choose Toolbox Items" dialog will show up:

+

+

You can browse for DLL file with your component by clicking the "Browse..." +button.

+

This is the simplest way of putting component in the Toolbox without extra +actions required.

+

This can be unpleasant for end-users since it means many clicks they have +to perform. I will explain how to integrate a component a little bit more so that it +will be visible under the ".NET Framework Components" tab in the above dialog box and +possibly show up in Toolbox automatically without extra effort of the user.

+

Making the Control Visible in "Choose Toolbox Items" Dialog Box

+

As you can see on the above picture, the SampleControl component is already +displayed in the dialog box under ".NET Framework Components" tab.

+

This is because the folder containing our control is registered as "assembly folder" in the +registry and hence is searched when the above dialog is populated.

+

You can register your own assembly this way by creating a key in registry:

+
32-bit OS: HKLM\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\<your control name>
+64-bit OS: HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\AssemblyFolders\<your control name>
+

You can also create key for specific version of .NET runtime (this comes in +handy if you distribute different components for different versions of .NET):

+
32-bit OS: HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\<your control name>
+64-bit OS: HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\<your control name>
+

In both cases, the default value for the key is a string with full path to +the folder with your assembly.

+

You can specify Toolbox tab in which the component should show up by adding +subkey named "Toolbox" with single string value "TabName" this value has Toolbox +tab name as data. When you add such control in the Toolbox, it will reside under +new tab with the specified name:

+

+

+

The control should also appear in "Choose Toolbox Items" dialog box if it +is installed in Global Assembly Cache.

+

The control pops up in the Toolbox automatically in +its own tab in Visual Studio 2012/2013.

+

Installing the Control in GAC

+

The benefit of GAC (Global Assembly Cache) is that the user needs not to +browse for your control. He will just select it form the above dialog box +without having to know where it is actually installed (the dialog is populated +by controls from "assembly folders" and from the GAC).

+

The GAC have one useful feature and disadvantage at the same time: It allows +holding multiple versions of the same assembly. When user makes reference to +your control from GAC and set "Specific Version" to true in +Reference Properties window, it will be tied to that version. When you install an +"update", a new version will be added to GAC, but the user will stay with the +older one. Of course, the "Choose Toolbox Items" dialog will show both versions, +so the user can just replace old reference with the new one.

+

You can make the installer removing any older versions from GAC during +installation and add/keep just the newest one. This will force the user to +replace the reference since it breaks the build.

+

You can work with GAC by using tool called gacutil.exe or +from code. We will discuss both approaches.

+

The gacutil.exe is located in Microsoft Windows SDK directory. There are two +such extecutables:

+
c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe
+c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil.exe
+

The former is for .NET Framework up to version 3.5. The latter is for +.NET 4.0 and higher. This is for compatibility reasons as a separate GAC have +been introduced with .NET 4.0.

+

You can install an assembly to GAC by calling:

+
gacutil.exe /i SampleControl.dll
+

To uninstall it, we refer to our assembly by its assembly name, not file +name:

+
gacutil.exe /u SampleControl
+

Finally, you can check if the assembly is installed in GAC by listing any +instances of the provided name:

+
gacutil.exe /l SampleControl
+

It is not wise, however, to use gacutil.exe from a custom +installer as it is located in SDK that user might not have installed. +Furthermore, the SDK license does not allow bundling gacutil.exe +with your installer.

+

Some installers like Inno Setup or MSI allow installing in GAC anyway.

+

You can also work with GAC using +System.EnterpriseServices.Internal.Publish class. The class have two +methods: GacInstall and GacRemove. Both +methods take just path to assembly file as a parameter, so for example:

+
(new Publish()).GacInstall(assemblyPath);
+

will install the specified assembly in GAC.

+

Updating

+

Updating the control depends on how it is installed and referenced.

+

If you have added component in the Toolbox manually via "Choose Toolbox Items" +dialog box and "Browse..." button, i.e. as a file reference, the +default property of such reference is that it simply points to the specified +file no matter which version it have (unless user sets "Specific Version" to +true in reference properties window; the default is +false in this case). Simply replacing the DLL with the control by a newer +file will suffice. If the user have specified "Specific Version" to true, +the build will break because the reference is no longer valid. He needs to +replace the reference by a new one pointing on the same file which now have +newer version.

+

If you have added the component from GAC (these components also appear in the +"Choose Toolbox Items" dialog box), the "Specific Version" property of the +reference is true by default:

+

+

This means that even if you install a newer version of the component in GAC, +the project will still reference the older version and both versions will reside +in GAC.

+

If you remove all versions of the component from GAC (e.g. using +gacutil.exe) and then install just the newest one, the build will break +unless the user changed "Specific Version" property to false.

+

Removing

+

Removing the manually installed control consists of just reverting all the +steps done during the installation.

+

In case of file references, deleting the file is sufficient.

+

In case of tighter integration (GAC, registry), the registry keys need to be +deleted and the control can be removed from GAC (e.g. using gacutil.exe).

+

Resetting Toolbox and Clearing the Toolbox Cache

+

The Toolbox can fall into state where it does not display some items, some are +duplicate and some can be disabled. Sometimes the only remedy is to let Visual +Studio rebuild the +Toolbox from scratch.

+

To do that, right-click on the Toolbox window and select "Reset +Toolbox". Visual Studio will go through all the installed packages and reloads +components into the Toolbox.

+

If this won't help, you can perform hard reset of the Toolbox. Exit +Visual Studio and delete all .TBD files in the following folder:

+
\Users\<user>\AppData\Local\Microsoft\VisualStudio\10.0\
+

It should be up to four files:

+

+

Once removed, start Visual Studio again. After showing the Toolbox, all items +should load instead of loading only the cached versions.

+

5. Toolbox Integration using TCI

+

Installing

+

Toolbox Control Installer is a VS package pre-installed in Visual Studio 2008 and +newer. It looks in Windows registry for components and loads them in the +Toolbox.

+

Before using TCI, one can check if it is installed in the given version of +VS. For example, the following registry key should exist if the Visual Studio +2010 have TCI installed:

+
32-bit OS: HKLM\SOFTWARE\Microsoft\VisualStudio\10.0\Packages\{2c298b35-07da-45f1-96a3-be55d91c8d7a}
+64-bit OS: HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Packages\{2c298b35-07da-45f1-96a3-be55d91c8d7a}
+

The TCI package GUID is always the same so you can make the check for any +version of Visual Studio with the above key (only change the version number from +10.0 to corresponding version number, of course).

+

The only prerequisites for the assembly is that it should have strong name +(i.e. to be signed). See section "Creating the Sample Control" for more +information.

+

The installation consists of putting the control in GAC (see previous +section for more information) and creating registry keys.

+

Suppose we have the SampleControl installed in GAC:

+

+

We will make reference to this assembly from registry by creating the +following key:

+
32-bit OS: HKLM\SOFTWARE\Microsoft\VisualStudio\10.0\ToolboxControlsInstaller\SampleControl, Version=3.7.0.0, Culture=neutral, PublicKeyToken=3cc4c7b61201d46c
+64-bit OS: HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\ToolboxControlsInstaller\SampleControl, Version=3.7.0.0, Culture=neutral, PublicKeyToken=3cc4c7b61201d46c
+

The default value for the key is the Toolbox tab name name you would like to +have for the component(s), e.g. "Component Owl".

+

Installing in Visual Studio 2012 and 2013

+

One extra step is required to make this work in Visual Studio 2012/2013, which is +adding the registry key also in its user config hive, i.e.:

+
HKCU\Software\Microsoft\VisualStudio\11.0_Config\ToolboxControlsInstaller\SampleControl, Version=3.7.0.0, Culture=neutral, PublicKeyToken=3cc4c7b61201d46c
+

for VS 2012. Use 12.0_Config for VS 2013.

+

Updating

+

Updating the component is very simple. Just modify the above registry keys by +changing the version number.

+

Removing

+

To remove the component, delete the above registry keys. You should also +remove the corresponding assembly from GAC.

+

Automating Integration with TCI using TciToolboxInstaller

+

I made a simple command-line application called TciToolboxInstaller +which does all the described steps. The usage is simple:

+
TciToolboxInstaller.exe [install|uninstall] [vs2005|vs2008|vs2010|vs2012|vs2013] [tab name] [assembly path]
+

For example, if you like to install SampleControl.dll in Visual Studio 2012 +Toolbox, just call:

+
TciToolboxInstaller.exe install vs2012 "Component Owl" SampleControl.dll
+

You can use quotes for the last two parameters if they contain spaces.

+

The TciToolboxInstaller project is contained in sample +source code.

+

6. Toolbox Integration using DTE

+

Installing

+

The +DTE (Development Tools Environment) approach does not require working +with GAC or registry. It remotely manipulates Visual Studio Toolbox and +adds/removes items as needed.

+

The whole installation is done from (managed) code using COM wrappers. It +works in the following steps:

+
    +
  • Check if an instance of Visual Studio is not running. If not, continue.
  • +
  • Retrieve an EnvDTE.DTE object corresponding to the + version of Visual Studio we want to integrate with.
  • +
  • Create a "dummy" project using the DTE object
  • +
  • Obtain Toolbox window and ToolBox object from it.
  • +
  • Find or create ToolBoxTab object.
  • +
  • Add item in the Toolbox tab (ToolBoxTab.ToolBoxItems.Add).
  • +
  • Wait until current instance of Visual Studio stops running.
  • +
+

Here are some of the step/strongs in C# code - it is an excerpt from +DteToolboxInstaller project provided in sample source code:

+
+// obtain a DTE object
+Type typeDTE = Type.GetTypeFromProgID("VisualStudio.DTE.11.0");
+
+DTE dte = (DTE)Activator.CreateInstance(typeDTE, true);
+
+// create a temporary file
+string tempFile = Path.GetFileNameWithoutExtension(Path.GetTempFileName());
+string tempDirectory = string.Format("{0}{1}", Path.GetTempPath(), tempFile);
+
+// create Visual Studio Solution
+Solution4 solution = (dte.Solution as Solution4);
+
+string templatePath = solution.GetProjectTemplate(TemplateName, "CSharp");
+
+solution.AddFromTemplate(templatePath, tempDirectory, DummyProjectName, false);
+
+// get Toolbox window
+Window window = dte.Windows.Item(Constants.vsWindowKindToolbox);
+
+// get Toolbox
+ToolBox toolBox = (ToolBox)window.Object;
+
+// get Toolbox tab
+ToolBoxTab toolBoxTab = (GetToolBoxTab(toolBox.ToolBoxTabs) ?? toolBox.ToolBoxTabs.Add(this.tabName));
+
+// add new item under the Toolbox tab
+toolBoxTab.ToolBoxItems.Add(assemblyName, this.assemblyPath, vsToolBoxItemFormat.vsToolBoxItemFormatDotNETComponent);
+
+// select the Toolbox tab
+toolBoxTab.Activate();
+
+// cleanup
+dte.Solution.Close(false);
+dte.Quit();
+Marshal.ReleaseComObject(dte);
+
+// wait till Visual Studio turns off completely
+if (IsVisualStudioRunning())
+{
+	Thread.Sleep(VisualStudioProcessTimeout);
+}
+
+

There are several obstacles on implementing the DTE approach.

+

First of all, we need to ensure that Visual Studio is not running during the +installation - this is because we want messages sent to Visual Studio instance +will arrive in the "invisible" one ran from our code and not the one which the +user have currently opened.

+

Similarly, we would like to wait a while until the instance terminates after +installation. This is necessary when integrating with multiple versions of +Visual Studio when just a single instance have to be running at a time. Doing two +installations too quickly in succession may cause the previous one to fail +because a Visual Studio instance is still running.

+

The communication between our code and Visual Studio is mediated by OLE +message filter which needs to be implemented. You can take a look on +DteToolboxInstaller (see below) source code, where is a working installer +implemented that uses this approach.

+

Updating and Removing

+

Since we have full control over the Toolbox with this approach, updating or +removing items/tabs is done with the corresponding DTE objects.

+

Automatic Integration with DTE using DteToolboxInstaller

+

I made a simple command-line application called DteToolboxInstaller +which does all the necessary steps and solves the deals with the discussed +obstacles. The usage is simple:

+
DteToolboxInstaller.exe [install|uninstall] [vs2005|vs2008|vs2010|vs2012|vs2013] [tab name] [assembly path]
+

For example, if you like to install SampleControl.dll in Visual Studio 2012 +Toolbox, just call:

+
DteToolboxInstaller.exe install vs2012 "Component Owl" SampleControl.dll
+

You can use quotes for the last two parameters if they contain spaces.

+

The DteToolboxInstaller project is contained in sample +source code.

+

7. Toolbox Integration using VSI Packages

+

Let's consider you don't have a custom installer and want to distribute your +components in some kind of simple extension package that Visual Studio +understands.

+

Visual Studio contains an installer for so called VSI packages that will +do the integration work for you. If you have Visual Studio installed, the .VSI +extension is already associated with the Visual Studio Content Installer.

+

Creating the VSI Package

+

I have created an empty folder and copied SampleControl.dll in +it. All that is needed to make a VSI package is to create a .VSCONTENT file, +which is simply a XML file satisfying +Visual Studio Content Installer schema:

+
+<VSContent xmlns="http://schemas.microsoft.com/developer/vscontent/2005"> 
+    <Content>
+        <FileName>SampleControl.dll</FileName>
+        <DisplayName>SampleControl</DisplayName>
+        <Description>ComponentOwl.com SampleControl</Description>
+        <FileContentType>Toolbox Control</FileContentType>
+        <ContentVersion>2.0</ContentVersion>
+    </Content>
+</VSContent>
+
+

The content is readable and pretty straightforward. The +ContentVersion element can contain either "1.0" (support for Visual +Studio 2005, 2008 and 2010) or "2.0" (support for Visual Studio 2008, 2010, +2012, 2013).

+

Now we zip the two files and rename extension of the archive to .VSI. We +should end up with the following three files:

+

+

If you double-click the SampleControl.vsi, the Visual Studio +Content Installer opens up. You can start the installer from command line as +well:

+
32-bit OS: C:\Program Files\Common Files\Microsoft Shared\MSEnv\VSContentInstaller.exe SampleControl.vsi
+64-bit OS: C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSContentInstaller.exe SampleControl.vsi
+

The installer have a form o wizard:

+

+

Signing the VSI Package

+

By default, the VSI package is not signed. This causes showing: "Publisher: +Unknown" label on the first page of the installation wizard and an unpleasant +dialog box later on:

+

+

To avoid this, you need to digitally sign the VSI package. Of course, you +have to own a digital certificate (usually an X.509 certificate stored in .PFX +file).

+

Because we cannot sign ZIP files, we need to convert the .VSI file (which is +actually a ZIP archive with just an altered extension) to self-extracting archive that the Visual Studio Content +Installer recognizes. There is a tool called MakeZipExe +to do this task:

+
MakeZipExe.exe -zipfile:SampleControl.vsi -output:SampleControl-unsigned.vsi -overwrite
+

The MakeZipExe tool is located at Visual Studio's binary +folder:

+
c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MakeZipExe.exe
+

The second step is signing the .EXE file using signtool.exe. +You can find signtool.exe in Microsoft Windows SDK, i.e.:

+
c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\signtool.exe
+

Here is a sample usage of signtool.exe:

+
signtool.exe sign /du "http://www.componentowl.com/sample-control" /f certificate.pfx /p abc123 /t "http://timestamp.comodoca.com/authenticode" "SampleControl-signed.vsi"
+

When signed, the "Publisher" and "Information URL" labels are filled in the +installer and no dialog box appears. The benefit of signing is obvious - your +users will know they are installing trusted, possibly high-quality software and there +is a higher chance of your software being used more widely (for example, the +government sector usually require such certified software).

+

You can also add an EULA to your VSI package. This can be done by adding a +comment metadata in the archive by ZIP archiver that supports such feature (e.g. +WinZip).

+

Uninstalling the Control from Toolbox

+

As far as I know, the control cannot be removed from the Toolbox +programmatically. You need to delete the control's DLL located at

+
c:\Users\<user>\Documents\Visual Studio 2010\Controls\
+

the same should be done for every version of Visual Studio installed.

+

In Visual Studio, right-click on Toolbox and select "Reset Toolbox". The +component will not be found and disappear. Similarly, you can just +delete the control from the Toolbox or select "Choose Items..." from context +menu and untick the control there:

+

 

+

Drawbacks of Using VSI Package

+

One drawback of using VSI package is that the installer runs every version of +VS IDE you have installed and which is supported by the package. The form will +disappear eventually, but it lowers user experience.

+

Another drawback is that when you want to update your control, the installer +offers whether to rename, replace or skip the file (e.g. SampleControl.dll). User have to decide to +update, which also slows down installation and requires user interaction.

+

You also cannot specify custom Toolbox tab. All controls are installed under +"My Controls" tab:

+

+

8. Toolbox Integration using VSPackages

+

This approach brings full control over the integration and other benefits. The VSPackages are loaded on-demand, so +the integration process won't slow down a custom installer.

+

Although VSPackage and our sample control can be packed within the same +assembly, we will create a separate Visual Studio Package project.

+

When user opens Toolbox in VS for the first time after installation, the IDE +will look in registry for any registered packages and load them (if not loaded +previously).

+

Creating VSPackage Project

+

We would like to have our VSPackage compatible with VS 2010, 2012 +and 2013, so we will work in Visual Studio 2010.

+

Select "File - New - Project.." (Control+Shift+N) and +select the "Visual Studio Package" template:

+

+

This will start a "Visual Studio Package Wizard":

+

+

You can leave most options in the wizard on defaults. Leave all the check boxes unchecked +on "Page 3 of 7" and "Page 7 of 7":

+

+

+

Now we will take a look on the generated files. Open the Guids.cs +file:

+
+// Guids.cs
+// MUST match guids.h
+using System;
+
+namespace ComponentOwl.ToolboxIntegration
+{
+    static class GuidList
+    {
+        public const string GuidSampleVSPackagePkgString = "00000000-8fdf-48b6-98f8-4ff21a3a4def";
+        public const string GuidSampleVSPackageCmdSetString = "def6519d-5ace-4062-95d6-4ee43f4a5de9";
+
+        public static readonly Guid GuidSampleVSPackageCmdSet = new Guid(GuidSampleVSPackageCmdSetString);
+    };
+}
+
+

Here are the GUIDs that +uniquely identify your package. I have edited the first four hex digits of +package identifier to "00000000" so that we can find it more easily later. This is +just for purpose of convenience in our sample project. Always use randomly generated GUID +in a real-world application. Visual Studio will generate a new GUID +whenever you create a new VSPackage project.

+

You can also generate new GUIDs any time, for example using +online GUID +generator or guidgen.exe utility from Windows SDK. When these numbers are changed, your package will be different from +Visual Studio's point of view.

+

Another important file here is source.extension.vsixmanifest. +If you double-click on the file in Solution Explorer, the VSIX Manifest Designer +will show up:

+

+

Not all the fields are mandatory, but I will fill all of them nevertheless:

+
    +
  • ID - Unique product "Identity" - the ID is limited to + 100 characters and the recommended format is "Company.Product.Feature.Name". + We can leave the VSPackage's GUID here.
  • +
  • Product Name - This field is used for Toolbox Tab name, + so I will put "Component Owl Controls" here.
  • +
  • Author - Your name or company name - + "ComponentOwl.com", for example.
  • +
  • Version - This is version of the package and its + contents. The format is same as for assembly versions: + Major.Minor.Build.Revision. I will put "1.4.0.128" here.
  • +
  • Description - Speaks for itself.
  • +
  • Locale - Language for the package.
  • +
  • Supported VS Editions - Here you can specify which + editions of Visual Studio 2010 you would like to support. Of course, it can + support VS 2012/2013 as well, but for now I will just check Ultimate, Premium and + Professional editions.
  • +
  • Supported Framework Runtime - Minimum and maximum .NET + Framework Runtime versions your extension supports. Since my component will + support 4.0 and 4.5 runtime, I will put 4.0 and 4.5 here.
  • +
+

Adding Support for Visual Studio 2012/2013

+

We have specified supported Visual Studio Editions in VSIX Manifest Designer, +through the "Visual Studio Version and Edition" dialog box:

+

+

As you can see, only Visual Studio 2010 is supported here because VSIX is new +to 2010 and of course VS 2010 does not know about 2012/2013. We have to +source.extensions.vsixmanifest file for manual editing. Select the file +in Solution Explorer and press F7 (View Code):

+
+<?xml version="1.0" encoding="utf-8"?>
+<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
+  <Identifier Id="aaaaaaaa-8fdf-48b6-98f8-4ff21a3a4def">
+    <Name>SampleVsPackage</Name>
+    <Author>ComponentOwl.com</Author>
+    <Version>1.0</Version>
+    <Description xml:space="preserve">Information about my package</Description>
+    <Locale>1033</Locale>
+    <InstalledByMsi>false</InstalledByMsi>
+    <SupportedProducts>
+      <VisualStudio Version="10.0">
+        <Edition>Ultimate</Edition>
+        <Edition>Premium</Edition>
+        <Edition>Pro</Edition>
+      </VisualStudio>
+    </SupportedProducts>
+    <SupportedFrameworkRuntimeEdition MinVersion="4.0" MaxVersion="4.5" />
+  </Identifier>
+  <References>
+    <Reference Id="Microsoft.VisualStudio.MPF" MinVersion="10.0">
+      <Name>Visual Studio MPF</Name>
+    </Reference>
+  </References>
+  <Content>
+    <VsPackage>|%CurrentProject%;PkgdefProjectOutputGroup|</VsPackage>
+  </Content>
+</Vsix>
+
+

Take a look on the Vsix/Identifier/SupportedProducts/VisualStudio +element (highlighted in bold). Copy and paste this element and modify +Version attribute on the second one to "11.0":

+
+<VisualStudio Version="11.0">
+  <Edition>Ultimate</Edition>
+  <Edition>Premium</Edition>
+  <Edition>Pro</Edition>
+</VisualStudio>
+
+

The edition tags are valid for version 11.0 because Visual Studio 2012 +template generates the same edition names.

+

Writing Package Code

+

Now we will take a look on the VSPackage code itself. Open the +SampleVSPackage.cs +file. I kept only the necessary code and added the ProvideToolboxItems attribute:

+
+[PackageRegistration(UseManagedResourcesOnly = true)]
+[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
+[Guid(GuidList.guidSampleVsPackagePkgString)]
+[ProvideToolboxItems(1)]
+public sealed class SampleVsPackage : Package
+{
+}
+
+

Our VSPackage implementation inherits from +Microsoft.VisualStudio.Shell.Package class and is decorated by three +attributes:

+
    +
  • PackageRegistrationAttribute - Specifies that package + registration tool should look for additional attributes (will be discussed + later).
  • +
  • InstalledProductRegistrationAttribute - Provides + information for the Visual Studio splash screen and About box.
  • +
  • GuidAttribute - Provides custom GUID for the class + because automatic GUID is undesirable here (Visual Studio need to be able to trace our + package by its unique ID).
  • +
  • ProvideToolboxItemsAttribute - Specifies that the + package provides toolbox items. There are various uses of VSPackages, but we + are interested in intalling controls to Visual Studio Toolbox, hence this + attribute.
  • +
+

The strings "#110" and "#112" in +InstalledProductRegistrationAttribute refer to keys in +VSPackage.resx. You can open this file and edit package name and +description there:

+

+

Now we write methods within SampleVsPackage class that work with the Toolbox:

+
+private const string ComponentFile = "SampleControl.dll";
+private const string TabName = "Component Owl";
+
+private void InstallToolboxItems()
+{
+    IToolboxService toolboxService = (IToolboxService)GetService(typeof(IToolboxService));
+
+    foreach (ToolboxItem item in ToolboxService.GetToolboxItems(GetAssemblyName()))
+    {
+        toolboxService.AddToolboxItem(item, TabName);
+    }
+}
+
+private void RemoveToolboxItems()
+{
+    IToolboxService toolboxService = (IToolboxService)GetService(typeof(IToolboxService));
+
+    foreach (ToolboxItem item in ToolboxService.GetToolboxItems(GetAssemblyName()))
+    {
+        toolboxService.RemoveToolboxItem(item);
+    }
+}
+
+private AssemblyName GetAssemblyName()
+{
+    string pathAssembly = String.Concat(
+        Path.GetDirectoryName(GetType().Assembly.Location),
+        Path.DirectorySeparatorChar,
+        ComponentFile);
+
+    return AssemblyName.GetAssemblyName(pathAssembly);
+}
+
+

The method names InstallToolboxItems and +RemoveToolboxItems +speak for themselves. Both methods look for SampleControl.dll in the same +location as the VSPackage's assembly. They get all toolbox items from the +assembly and either put them under "Component Owl" tab or remove them.

+

The ToolboxService class comes from +System.Drawing.Design and we need to add reference to this asssembly in +order to use ToolboxService.

+

Building the Package

+

Before building the SampleVsPackage project, open project +properties, find the VSIX tab and uncheck all the options:

+

+

Finally, build the project. Just two files, SampleVsPackage.dll +and SampleVsPackage.pdb, should be generated.

+

Registering the Package

+

Until the package can be loaded by Visual Studio, it needs to be +registered. +The registration is simply writing specific keys into Windows Registry.

+

To do that, find the Package Registration Utility (RegPkg.exe). It should be +located in Visual Studio SDK directory, e.g.:

+
32-bit OS: c:\Program Files\Microsoft Visual Studio 11.0\VSSDK\VisualStudioIntegration\Tools\Bin\RegPkg.exe
+64-bit OS: c:\Program Files (x86)\Microsoft Visual Studio 11.0\VSSDK\VisualStudioIntegration\Tools\Bin\RegPkg.exe
+

You can copy the tool where it suits you.

+

Here is a sample usage of RegPkg:

+
32-bit OS: RegPkg.exe /root:SOFTWARE\Microsoft\VisualStudio\11.0 /codebase SampleVsPackage.dll
+64-bit OS: RegPkg.exe /root:SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0 /codebase SampleVsPackage.dll
+

This will write package registration information into the Windows Registry, +hence registers the package. Similar call have to be done by your custom installer in +order to register the package.

+

Instead of writing into registry, RegPkg.exe can gereate a REG file (several +other formats are available) so that you can write package information into +registry using the file. To do that, use /regfile parameter:

+
32-bit OS: RegPkg.exe /root:SOFTWARE\Microsoft\VisualStudio\11.0 /regfile:SampleVsPackage.ref /codebase SampleVsPackage.dll
+64-bit OS: RegPkg.exe /root:SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0 /regfile:SampleVsPackage.ref /codebase SampleVsPackage.dll
+

This creates SampleVsPackge.reg file you can use any time +later instead of RegPkg.exe itself.

+

There are two other options for specifying how the package will be registered: +codebase and assembly. When /codebase +parameter is used (as in the sample above), the registry will point to the location on disk where your +package is located (see + +Assembly.CodeBase property for more information).

+

Another option is the /assembly parameter - this assumbes +that your VSPackage assembly is located in GAC (Global Assembly Cache). See +section Installing the Control in GAC for more information.

+

You can check out the registry after the package registration:

+

+

Package Registration for Visual Studio 2012/2013

+

Regrettably, simply registering package is not enough for Visual Studio 2012/2013 to load +it (see this + +blog post). Because of performance optimizations, VS developers removed +feature that looks for changes in VS registry root and thus we need to call

+
devenv.exe /Setup
+

In order to finish package registration.

+

This call can be very time consuming since Visual Studio 2012/2013 goes through all +extensions and looks for changes. On the other hand, I tried running devenv.exe with /Setup +parameter on fresh install of Visual Studio 2012/2013 and it was instant. On older +installation, however, the operation took well over a minute (it behaves just +like Microsoft Windows, which progressively slows down during its lifetime).

+

We can speed things up by a little hack. One of the things the /Setup +does is copying registry keys from HKLM to Visual Studio's 11.0_Config hive (or 12.0_Config, respectively). We can just write registry under this key +instead of calling devenv.exe and avoid possibly lengthy operation.

+

The hive is located in +HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config.

+

So let's open and edit the SampleVsPackage.reg file we have +generated using RegPkg.exe earlier. Here is the modified version where only the +registry root has been changed:

+
+REGEDIT4
+
+[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\InstalledProducts\SampleVsPackage]
+@="#110"
+"Package"="{00000000-8fdf-48b6-98f8-4ff21a3a4def}"
+"PID"="1.0"
+"ProductDetails"="#112"
+"LogoID"="#400"
+[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Packages\{00000000-8fdf-48b6-98f8-4ff21a3a4def}]
+@="ComponentOwl.ToolboxIntegration.SampleVsPackage, SampleVsPackage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30782fc44cbe0af5"
+"InprocServer32"="C:\\Windows\\SYSTEM32\\MSCOREE.DLL"
+"Class"="ComponentOwl.ToolboxIntegration.SampleVsPackage"
+"CodeBase"="C:\\projects\\articles\\2012-10-22 Visual Studio Toolbox Control Integration\\ToolboxIntegration\\SampleVsPackage\\bin\\Debug\\SampleVsPackage.DLL"
+[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Packages\{00000000-8fdf-48b6-98f8-4ff21a3a4def}]
+[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Packages\{00000000-8fdf-48b6-98f8-4ff21a3a4def}\Toolbox]
+"Default Items"=dword:00000001
+
+

The highlighted parts have been edited.

+

So in addition to standard package registration, we also write in the +registry where Visual Studio 2012/2013 user config hive resides. This is sufficient +for our VSPackage to load.

+

However, this is really a hack - editing of user configuration in registry +may cause Visual Studio to not load your user settings and show up as when +running for the first time. I tried this hack on my machine and it worked, but +there may be some hidden glitches. If you want to follow standard procedure, +just call "devenv.exe /Setup".

+

Loading VSPackage

+

If you did all the previous steps, your package should load when you open +Windows Forms Designer and show Toolbox (Cotrol+Alt+X). You can notice your +package name displaying in status bar for a while, then SampleControl should show up in the +Toolbox under "Component Owl" tab:

+

+

Displaying Your Extension in VS About Box

+

If you want information about your extension to be visible in Visual Studio +splash screen and About Box, implement IVsInstalledProduct +interface:

+
+...
+
+public sealed class SampleVsPackage : Package, IVsInstalledProduct
+{
+
+...
+
+	int IVsInstalledProduct.IdBmpSplash(out uint pIdBmp)
+	{
+	    pIdBmp = 0;
+	    return 0;
+	}
+	
+	int IVsInstalledProduct.IdIcoLogoForAboutbox(out uint pIdIco)
+	{
+	    pIdIco = 400;
+	    return 0;
+	}
+	
+	int IVsInstalledProduct.OfficialName(out string pbstrName)
+	{
+	    pbstrName = "ComponentOwl SampleControl";
+	    return 0;
+	}
+	
+	int IVsInstalledProduct.ProductDetails(out string pbstrProductDetails)
+	{
+	    pbstrProductDetails = "SampleControl control.\r\nFor more information see http://www.componentowl.com";
+	    return 0;
+	}
+	
+	int IVsInstalledProduct.ProductID(out string pbstrPID)
+	{
+	    pbstrPID = "3.3.0.0";
+	    return 0;
+	}
+	
+	...
+	
+}
+
+

This code causes the component to show up in the list of "Installed Products" +in Visual Studio about box:

+

+

As for the splash screen, Visual Studio 2008 used to display extensions in +its splash screen, but later version do not:

+

    +    +

+

Troubleshooting Package Load Failures

+

You may encounter this dialog when playing with packages:

+

+

When you click "No", the package will be skipped later when loading packages. +You can re-enable loading all packages by running

+
devenv.exe /ResetSkipPkgs
+

To debug package load problem, you can do just what the dialog says. Run

+
devenv.exe /log
+

and then take a look on the ActivityLog.xml (path is shown +in the dialog). There you can find cause of the problem in one of the "entry" +elements:

+
+...
+<entry>
+  <record>106</record>
+  <time>2012/10/26 06:07:36.920</time>
+  <type>Error</type>
+  <source>VisualStudio</source>
+  <description>CreateInstance failed for package [ComponentOwl.ToolboxIntegration.SampleVSPackage, SampleVSPackage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=87379c2b0cde9bc3]</description>
+  <guid>{761F0CB7-64C1-4695-91D2-6E3C26C12314}</guid>
+  <hr>80070002</hr>
+  <errorinfo>Could not load file or assembly 'file:///C:\projects\articles\2012-10-22 Visual Studio Toolbox Control Integration\ToolboxIntegration\SampleVSPackage\bin\SampleVSPackage.DLL' or one of its dependencies. The system cannot find the file specified.</errorinfo>
+</entry>
+...
+
+

In this particular case, the problem was caused by changing output path from +"bin\SampleVSPackage.dll" to "bin\Debug\SampleVSPackage.dll" +so the file does not longer exist at the location for which it is registered. +The solution is to either change the location back or unregister the package +(i.e. remove the corresponding registry entries - the GUID is provided in the +log).

+

Past Troubles with Package Load Keys

+

The above problem with package load failure happened on Visual Studio 2005 +and 2008 because a Package Load Key (PLK) had to be provided by the VSPackage. +The PLK is basically a hashcode computed from metadata about package (name, +author/company, version). The PLK had to be obtained from a website provided by +Microsoft.

+

I believe PLK caused many troubles and headaches to developers, including +myself.

+

This is no longer relevant for Visual Studio 2010 and newer (requirement for +PLKs removed), so we won't discuss this topic in more depth

+

Update Control Already Installed in Toolbox

+

Suppose we have already integrated SampleControl version 3.3.0.0 in the +Visual Sudio Toolbox:

+

+

We would like to update this control to version 3.4.0.0.

+

First of all, we update assembly information of the SampleControl +project:

+

+

If we "deploy" (copy) SampleControl.dll to the folder with +SampleVsPackage.dll where it is registered, the SampleControl will no longer be +visible in Toolbox, because the control in Toolbox should still be 3.3.0.0 and +this version is no longer to be found.

+

You don't need to increment assembly version of the SampleVsPackage project, +but at least you have to increment parameter of the ProvideToolboxItems attribute:

+
+[PackageRegistration(UseManagedResourcesOnly = true)]
+[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
+[Guid(GuidList.guidSampleVsPackagePkgString)]
+[ProvideToolboxItems(2)]
+public sealed class SampleVsPackage : Package, IVsInstalledProduct
+{
+	...
+}
+
+

The package need to be re-registered (see section Registering the Package) +which will effectively update just the "Default Items" value in the Toolbox key:

+

+

This will cause Visual Studio to update your control in the Toolbox:

+

+

Remove Control from the Toolbox

+

Now we would like to remove control from the Visual Studio Toolbox. This +step can be done by custom uninstaller.

+

One way to do that is to simply unregister the VSPackage using +RegPkg.exe:

+
32-bit OS: RegPkg.exe /unregister /root:SOFTWARE\Microsoft\VisualStudio\10.0 SampleVsPackage.dll
+64-bit OS: RegPkg.exe /First of all, we update assembly information of the unregisFirst of all, we update assembly information of the ter /root:SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0 SampleVsPackage.dll
+

You can also do this manually by simply removing the registry entry of the +corresponding package, e.g.:

+
32-bit OS: HKLM\SOFTWARE\Microsoft\VisualStudio\10.0\Packages\{a9696de6-e209-414d-bbec-a0506fb0e924}
+64-bit OS: HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Packages\{a9696de6-e209-414d-bbec-a0506fb0e924}
+

On Visual Studio 2012/2013, the key need to be removed in user config registry +hive or call "devenv.exe /Setup" after removing the registry key in HKLM. For +more information, see section Package Registration for Visual Studio 2012/2013.

+

9. Toolbox Integration using VSIX Packages

+

Microsoft have removed most /po +f the drawbacks of VSI packages by introducing VSIX. The +price is that VSIX is a little bit more complicated and Visual Studio 2008 is no +longer supported.

+

There are two versions of VSIX Schema. Version 1.0 is what Visual Studio 2010 +understand. There is also version 2.0 for Visual Studio 2012/2013. We want a VSIX +Package compatible with both, so we will work in Visual Studio 2010.

+

Create a new Project from Template

+

If you have Visual Studio 2010 SDK installed, you can create a new VSIX +package project with control from a template.

+

Select "File - New - Project.." (Control+Shift+N) and +then select the "Windows Forms Toolbox Control" or "WPF +Toolbox Control" template:

+

+

The projects is basically a VSPackage wrapped in VSIX container after +build. The package assembly also contain the control class named +ToolboxControl.

+

There are three important files generated by the template:

+
    +
  • ProvideToolboxControlAttribute.cs - This is attribute + for ToolboxControl class. We will discuss it later.
  • +
  • source.extension.vsixmanifest - This is manifest XML + file for our VSIX package. It contains all information about the package and + what it contains.
  • +
  • ToolboxControl.cs - This is a sample control to be + installed in Visual Studio Toolbox.
  • +
+

Create a new Project from VSPackage

+

We can also start with VSPackage like the one we have already created in +previous section. I will create a new VSPackage project (as in previous +chapter), name it SampleVsixPackage and configure it according +to "Windows Forms Toolbox Control" template to show you all the differences.

+

The basic configuration of source.extension.vsixmanifest is +the same as in previous chapter.

+

Project properties differs from VSPackage we have created earlier on the VSIX +tab, where we have the first two check boxes checked:

+

+

Update the Manifest File

+

Double-click on the source.extension.vsixmanifest file to +open up the VSIX Manifest Designer:

+

+

If you are not sure about some part of the form, please take a look on +section Create VSPackage Project, where the form is described in more +detail.

+

In addition to previous VSPackage project, I have also filled the following +optional boxes:

+
    +
  • License Terms - If you have EULA or other licence in + TXT or RTF format, you can browse for it.
  • +
  • Icon - You can browse for an icon representing the + extension. It should be 32x32 pixels large, PNG, BMP, JPEG or ICO image + format.
  • +
  • Preview Image - Thumbnail image representing the + extension. It should be 200x200 pixels large, PNG, BMP or JPEG image format.
  • +
  • More Info URL - URL of a website containing more + information about the extension.
  • +
  • Getting Started Guide - URL of a website with + documentation; you can also provide relative path to HTML file with the + local documentation.
  • +
+

Add Control

+

Let's create a new WPF control within the SampleVsixPackage +project itself. I will name it SampleWpfControl to distinguish +it from SampleControl we have created earlier.

+

To ensure our control will show up in Toolbox of Visual Studio 2012/2013, we have +to decorate the SampleWpfControl class by +ProvideToolboxControlAttribute:

+
+[ProvideToolboxControl("SampleWpfControl", true)]
+public partial class SampleWpfControl : UserControl
+{
+	...
+}
+
+

You also have to provide implementation of the attribute class:

+
+[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
+[System.Runtime.InteropServices.ComVisibleAttribute(false)]
+public sealed class ProvideToolboxControlAttribute : RegistrationAttribute
+{
+	private const string ToolboxControlsInstallerPath = "ToolboxControlsInstaller";
+
+	public ProvideToolboxControlAttribute(string name, bool isWpfControls)
+	{
+		if (name == null)
+		{
+			throw new ArgumentException("name");
+		}
+
+		this.Name = name;
+		this.IsWpfControls = isWpfControls;
+	}
+
+	private bool IsWpfControls { get; set; }
+	private string Name { get; set; }
+
+	public override void Register(RegistrationAttribute.RegistrationContext context)
+	{
+		if (context == null)
+		{
+			throw new ArgumentNullException("context");
+		}
+
+		using (Key key = context.CreateKey(String.Format(CultureInfo.InvariantCulture, "{0}\\{1}",
+														 ToolboxControlsInstallerPath,
+														 context.ComponentType.Assembly.FullName)))
+		{
+			key.SetValue(String.Empty, this.Name);
+			key.SetValue("Codebase", context.CodeBase);
+			if (this.IsWpfControls)
+			{
+				key.SetValue("WPFControls", "1");
+			}
+		}
+
+	}
+
+	public override void Unregister(RegistrationAttribute.RegistrationContext context)
+	{
+		if (context != null)
+		{
+			context.RemoveKey(String.Format(CultureInfo.InvariantCulture, "{0}\\{1}",
+														 ToolboxControlsInstallerPath,
+														 context.ComponentType.AssemblyQualifiedName));
+		}
+	}
+}
+
+

This code is generated if you create project from template.

+

The project in Solution Explorer should look like this:

+

+

+

Adding Controls from Other Projects

+

What if we would like to use SampleControl.dll as in the VSI +package scenario?

+

Of course, we can click "Add Content" in the VSIX Manifest designer and +simply add "Toolbox Control" content from other project:

+

+

However, this is possible only if the SampleControl project +itself is a package project!

+

Lucklily, since the VSIX package is still just a ZIP archive, we can take a +look on how to add such external DLLs to it manually.

+

Setting Up VSIX Installer

+

The VSIX Installer tool (VsixInstaller.exe) is located in +Visual Studio's binary folder:

+
32-bit OS: c:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\VSIXInstaller.exe
+64-bit OS: c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\VSIXInstaller.exe
+

You can hit F6 and Visual Studio will build your project to create +SampleVsixPackage.vsix file. This is our VSIX package.

+

The VSIX Installer should be associated with the .VSIX file extension, so it is +usually possible +to just double-click on the file and see the VSIX installer.

+

The installation can fail in the very first step:

+

+

This problem appears if you have invalid manifest file. If this happen, open +source.extension.vsixmanifest and fill in all missing data. +Furthermore, you can check if the XML is valid according to +VSIX Extension +Schema.

+

Now we are able to rebuild and run the VSIX installer again:

+

+

Make the VSIX Package Compatible with Visual Studio 2012/2013

+

To make our VSIX package working with Visual Studio 2012 and newer, we need +to manually update the manifest file. Select the +source.extension.vsixmanifest file and press F7 (View Code):

+
+<?xml version="1.0" encoding="utf-8"?>
+<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
+  <Identifier Id="ComponentOwl.ToolboxControl.Express">
+    <Name>Component Owl</Name>
+    <Author>ComponentOwl.com</Author>
+    <Version>1.0</Version>
+    <Description xml:space="preserve">Windows Forms Toolbox Control</Description>
+    <Locale>1033</Locale>
+    <MoreInfoUrl>http://www.componentowl.com/toolbox-control</MoreInfoUrl>
+    <License>license.rtf</License>
+    <GettingStartedGuide>http://www.componentowl.com/documentation/toolbox-control</GettingStartedGuide>
+    <Icon>icon.png</Icon>
+    <PreviewImage>overview.jpg</PreviewImage>
+    <SupportedProducts>
+      <VisualStudio Version="10.0">
+        <Edition>Ultimate</Edition>
+        <Edition>Premium</Edition>
+        <Edition>Pro</Edition>
+      </VisualStudio>
+      <VisualStudio Version="11.0">
+        <Edition>Ultimate</Edition>
+        <Edition>Premium</Edition>
+        <Edition>Pro</Edition>
+      </VisualStudio>
+      <VisualStudio Version="12.0">
+        <Edition>Ultimate</Edition>
+        <Edition>Premium</Edition>
+        <Edition>Pro</Edition>
+      </VisualStudio>
+    </SupportedProducts>
+    <SupportedFrameworkRuntimeEdition MinVersion="4.0" MaxVersion="5.0" />
+  </Identifier>
+  <References />
+  <Content>
+    <ToolboxControl>|%CurrentProject%;PkgdefProjectOutputGroup|</ToolboxControl>
+  </Content>
+</Vsix>
+
+

The bolded text have been added. I have simply added a new +VisualStudio element with higher version and all the editions (they are +relevant for VS 2012 and 2013 as its own template also generates these).

+

The VSIX installer will show Visual Studio 2012 options as +well after this update (if installed, of course):

+

+

Please note that Visual Studio 2012/2013 also works with 2.0 version of the +schema, so if you create VSIX package in Visual Studio 2012/2013, it won't be +compatible with 2010. The solution is hence to use 1.0 version of the schema +and add support for newer Visual Studio as described earlier.

+

A great advantage over VSI package is that installation of Toolbox control is +really fast with VSIX.

+

Regrettably, the control won't show up in Visual Studio 2012/2013 Toolbox in its +default configuration. You need to enable loading-per user extensions (this +option is enabled by default in Visual Studio 2010):

+

+

Signing the VSIX Package

+

Unlike older VSI package, there is no nag screen when the package is not +signed. Instead, a label appears informing user that the package is not +signed.

+

To sign a VSIX package, we need PackageSignatureManager from +System.IO.Packaging (WindowsBase.dll). I made a simple command-line application called SignVsix (you can +find it in sample source code) that takes three arguments (VSIX file path, PFX +certificate path and password for the certificate):

+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.IO.Packaging;
+using System.Security.Cryptography;
+using System.Security.Cryptography.X509Certificates;
+
+internal class Program
+{
+	private static void Main(string[] args)
+	{
+		// first argument - path to VSIX package
+		string paramPathPackage = args[0].Replace("\"", "");
+		// second argument - path to PFX certificate
+		string paramPathCertificate = args[1].Replace("\"", "");
+		// third argument - password for the certificate
+		string paramPassword = args[2];
+
+		// open VSIX package
+		Package package = Package.Open(paramPathPackage, FileMode.Open);
+
+		// load certificate
+		byte[] certificate = File.ReadAllBytes(paramPathCertificate);
+
+		// sign all parts of the package
+		var signatureManager = new PackageDigitalSignatureManager(package)
+		{
+			CertificateOption = CertificateEmbeddingOption.InSignaturePart
+		};
+
+		List<Uri> partsToSign = new List<Uri>();
+
+		foreach (PackagePart packagePart in package.GetParts())
+		{
+			partsToSign.Add(packagePart.Uri);
+		}
+
+		partsToSign.Add(PackUriHelper.GetRelationshipPartUri(signatureManager.SignatureOrigin));
+		partsToSign.Add(signatureManager.SignatureOrigin);
+		partsToSign.Add(PackUriHelper.GetRelationshipPartUri(new Uri("/", UriKind.RelativeOrAbsolute)));
+
+		try
+		{
+			signatureManager.Sign(partsToSign, new X509Certificate2(certificate, paramPassword));
+		}
+		catch (CryptographicException cryptographicException)
+		{
+			Console.WriteLine("Signing failed: {0}", cryptographicException.Message);
+		}
+	}
+}
+
+

The usage is very simple:

+
SignVsix.exe SampleVsixPackage.vsix certificate.pfx abc123
+

When the file is signed, VSIX Installer shows label "Digital Signature: +<Author Name>" on the first page:

+

+

Dissecting the VSIX Package

+

If you look on the project references, you can see reference to +Microsoft.VisualStudio.Shell.Immutable.10. This reference points to +Visual Studio 2010 SDK and we cannot expect this dependency present on end-user's machine. This +library contains ProvideToolboxControlAttribute class, which is +used by our ToolboxControl.

+

Since a software development company may want to develop many components, it would be nice to have an +universal VSIX package which can be adjusted for any control.

+

Let's take a look on the ToolboxControl.vsix. It is simply a +ZIP archive containing the manifest, resources, ToolboxControl binary and a +ToolboxControl.pkgdef file. If we look through all its content, +we easily generate our own VSIX packages on demand, even without Visual Studio. +There should also be a programmatic way on generating VSIX packages using +classes from System.IO.Packaging.

+

Update Toolbox Control via VSIX Package

+

If you made changes to your control and want to re-install the package, an +error message appear:

+

+

In order to provide an update, you need to increment version number in the +VSIX manifest:

+

+

You can also increment version number in the Package class attribute, but +this is not necessary for the VSIX to perform update:

+
+[InstalledProductRegistration("#110", "#112", "2.0", IconResourceID = 400)]
+[Guid(GuidList.guidSampleVsixPackagePkgString)]
+public sealed class SampleVsixPackage : Package
+{
+	...
+}
+
+

Of course, you can also increment version of the assembly.

+

Uninstall the VSIX Package

+

The VSIX Installer can be used to uninstall control from the Toolbox via +/uninstall parameter followed by package ID (the constant located in +Guids.cs: GuidList.guidSampleVsixPackagePkgString):

+
VSIXInstaller.exe /uninstall:e3dfd099-d0ab-4b8e-b26d-639032c29ad9
+

It is also possible to uninstall VSIX Package manually using +Extension Manager (Tools - Extension Manager...). In Visual Studio +2012/2013, the corresponding dialog is called Extensions and Updates +(Tools - Extensions and Updates...).

+

+

Quiet Mode

+

Both installation and uninstallation can be performed in quiet mode by using /quiet parameter. This will suppress +user interface of the installer, which is handy when you want to automate +Toolbox control integration with your custom installer.

+

10. Supporting Multiple Version of .NET Framework

+

Since .NET Framework is backward-compatible, building a component on lowest +possible framework ensures compatibility with higher versions as well.

+

I heard from several users that the component may not be displayed in Toolbox +although it seems that the Toolbox respects the .NET compatibility and display +.NET 2.0 component even when working in .NET 4.0 (Client Profile) project.

+

There is also a scenario where you want to support additional features from +higher version of .NET (for example, drawing text using GDI+ in .NET 2.0 and +drawing text using WPF in .NET 3.5 and higher). You may also want to add +extensive Windows Forms Designer support, which is not available in Client +Profile framework.

+

The solution to this is to build several DLLs, each with different features +and possibly different target frameworks. Then integrate all the assemblies.

+

This does not pose a problem when DTE approach is used, +alhtough it is better to give each version of the component unique name or place +them in separate tabs (e.g. "Component Owl WinForms - .NET 2.0").

+

When TCI approach is used, each version of the assembly +requires different public key token, because they have to reside in GAC +side-by-side. Furthermore, they need a separate registry key based on the public +key token.

+

The VSI and VSIX approaches require +renaming the component or customizing Toolbox tab in the +ProvideToolboxControlAttribute (see part Toolbox Control Integration using +VSIX Packages for more information).

+

The VSPackage approach allows you to place all the versions +in Visual Studio Toolbox under their respective tabs.

+

When manual approach is used, you can of course add each +version of the assembly separately and also create separate tabs in the Toolbox.

+ +

11. Sample Source Code

+ +

The attached sample source is a Visual Studio 2010 Solution containing +implementations of all the presented approaches. The binaries are contained +under "bin\Release" subfolders and batch files (.CMD extension) are provided +where appropriate.

+ +

+Download sample source code (212 KB) +

+ +

You can find the following folders in the archive:

+

DteToolboxInstaller - A command-line application for +installing/uninstalling assemblies in VS Toolbox using Visual Studio Automation +Object Model (DTE). Custom tab name and VS version can be specified. The tool +can be used in real-world application.

+

SampleControl - Windows Forms control for testing the +integration.

+

SampleVsixPackage - VSIX package project (basically a +VSPackage that is further packaged with the sample control), the resulting +package can be installed by VSIX Installer that comes with Visual Studio.

+

SampleVsPackage - VSPackage that is able to install all +control assemblies located in its own folder. Contains batch files for package +registration/unregistration.

+

SignVsix - A command-line application for signing VSIX +packages. Sample batch file is provided. Valid PFX certificate need to be +provided by the user.

+

TciToolboxInstaller - A command-line application for +installing/uninstalling assemblies in VS Toolbox using Toolbox Control Installer +package (but does not depend on it). Custom tab name and VS version can be +specified. The tool can be used in real-world application.

+

VSI - Basic setting for creating VSI package and a sample +VSI package created from the files. Batch file for signing the VSI package is +provided.

+

 

+ +

+Download sample source code (212 KB) +

+ +Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.Component Owl WinForms - .NET 2.0 +
+ +
+ +
+ + + + + +
+ +
+ + +
+
+ + + + + +
+ + + + + + + + + + \ No newline at end of file diff --git a/public/better-listview-express.html b/public/better-listview-express.html new file mode 100644 index 0000000..ab51a74 --- /dev/null +++ b/public/better-listview-express.html @@ -0,0 +1,448 @@ + + + + + + + + + + + + + + + +Free list-view control for .NET WinForms (C#, VB.net) - freeware Better LIstView Express by Component Owl + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+
+

Better ListView Express edition: Free .NET listview control

+ + + +
+ +
+ + + + + + + + + + + + + + + +
+ +
+ +
+ Free Download + +

Version 3.15 / May 27, 2015

+
+ +
+

Seamless integration with .NET 2.0 and higher

+ +
+ + + + + + + + +
+ Share this page if you like it: +
+ +
+
+ + + + +
+ +
+ +
+ +
+ +
+ + +
+
+ + + + + +
+ + + + + + + + + + \ No newline at end of file diff --git "a/public/better-listview-express/\\\".html" "b/public/better-listview-express/\\\".html" new file mode 100644 index 0000000..6386908 --- /dev/null +++ "b/public/better-listview-express/\\\".html" @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
+ +
+ + + +
+ + + +
+
+
+

Better ListView: Alternative list view control for .NET

+ + + +
+ +
+ + + + + + + + + + + + + + + +
+ +
+ + +
+

Seamless integration with .NET 2.0 and higher

+ +
+ + + + +
+

Better ListView

+
+ + +
+

Thumbnails

+
+ + +
+

Multi-line Items

+
+ + +
+

Item Hierarchy

+
+ + + + + + + + + + + +
+ +
+ + + +
+ + +
+
+ + + + + +
+ + + + + diff --git a/public/better-listview-express/comparison-with-full-version.html b/public/better-listview-express/comparison-with-full-version.html new file mode 100644 index 0000000..95a9675 --- /dev/null +++ b/public/better-listview-express/comparison-with-full-version.html @@ -0,0 +1,900 @@ + + + + + + + + + + + + + + + +Comparison of Better ListView, Better ListView Express, and regular .NET list-view components + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+
+

Better ListView Express edition: Free .NET listview control

+ + + +
+ +
+ + + + + + + + + + + + + + + +
+ +
+ +
+ Free Download + +

Version 3.15 / May 27, 2015

+
+ +
+

Seamless integration with .NET 2.0 and higher

+ +
+ + + + + + + + +
+ Share this page if you like it: +
+ +
+
+ + + + +
+ +
+ +
+ +
+ +
+ + +
+
+ + + + + +
+ + + + + + + + + + \ No newline at end of file diff --git a/public/better-listview-express/documentation.html b/public/better-listview-express/documentation.html new file mode 100644 index 0000000..2702484 --- /dev/null +++ b/public/better-listview-express/documentation.html @@ -0,0 +1,228 @@ + + + + + +Better ListView Documentation + + + +
+

+ Better ListView Express Documentation + +

+ + +

+ + Introduction, Comparison + +
What this documentation covers; brief comparison to regular .NET + ListView +

+

+ + Quick Start + +
Step-by-step tutorial for using Better ListView in your + application +

+

+ + Background Image + +
Image on the control background, setting its layout and + opacity +

+

+ + Check Boxes + +
Enabling two and three state check boxes on items +

+

+ + Collections + +
Working with collections of columns, items, sub-items, + groups +

+

+ + Columns + +
Hiding, resizing and reordering column headers +

+

+ + Context Menus + +
Displaying context menus on the control, column headers, groups + and items +

+

+ + Data Binding + +
Complex binding of custom list-based data to the + control +

+

+ + Drag and Drop + +
Setting-up Drag and Drop functionality and effects +

+

+ + Embedded Controls + +
Custom item and sub-item editing controls +

+

+ + Empty Text + +
Displaying customized text on empty list +

+

+ + Focusing Elements + +
How items, sub-items and groups can be focused and how to detect + focus changes +

+

+ + Groups + +
Working with item groups +

+

+ + Hit Test + +
Getting info for cursor position in the control +

+

+ + Insertion Mark + +
Specifying insertion mark location and apperance +

+

+ + Item Hierarchy + +
Setting-up tree-like item hierarchy (parent and child items), item + indentation +

+

+ + Item Reordering + +
Changing item order automatically with Drag and Drop +

+

+ + Items + +
Working with ListView items +

+

+ + Label Editing + +
Inline editing of items and sub-items +

+

+ + Layout Properties + +
Element and element part sizes and padding, multi-line text, image + border +

+

+ + Multi-line Items + +
Setting up items with multiple lines of text +

+

+ + Owner Drawing + +
Custom drawing over the control and its parts +

+

+ + Performance + +
Understanding Better ListView performance settings +

+

+ + Saving and Loading ListView Content + +
Storing and retrieving items and groups in binary or XML + format +

+

+ + Searching Items + +
Item searching by typing or programmatically +

+

+ + Serialization + +
Overview of Better ListView serialization capabilities +

+

+ + Sorting Items + +
Ordering items with multiple columns and custom + comparers +

+

+ + Sub-items + +
Working with sub-items which are attached under items +

+

+ + Text Formatting + +
Text alignment and trimming +

+

+ + Tooltips + +
Displaying customized tooltips on control and its parts +

+

+ + Views + +
Ways of displaying items, detecting view change +

+ + + + +
+ diff --git a/public/better-listview-express/quick-start-guide.html b/public/better-listview-express/quick-start-guide.html new file mode 100644 index 0000000..2bc917c --- /dev/null +++ b/public/better-listview-express/quick-start-guide.html @@ -0,0 +1,303 @@ + + + + +Quick Start + + + + +
+
+ + + + +

Quick Start

+ +

Table of Contents

+

Tutorial Prerequisites

+

Step-by-step tutorial

+

Installation + Troubleshooting

+

Migrating from .NET ListView

+

Learning Resources and Getting + Support

+ + + + +

+Tutorial Prerequisites

+ + + +

+Step-by-step Tutorial

+ + +

Start with a new "Windows Forms Application" + project. A designer with empty Form appears. Display the + Toolbox window (View - + Toolbox):

+ +

+ +

The Toolbox should contain a new tab called + "ComponentOwl" containing all the installed component + from ComponentOwl, including Better ListView.

+ +

+

Express editions of ComponentOwl Controls are listed in separate + tab called "ComponentOwl (Express Controls)".

+
+

If you chose not to integrate component in + Visual Studio during installation or the component have not been + successfully integrated, please follow the next steps.

+ +

Right-click on empty area of the Toolbox window and select + "Choose Items...":

+ +

+ +

In the "Choose Toolbox Items" dialog, select + the ".NET Framework Components" tab. If the comonent + has been properly installed, it will be already listed here. If you find + it, make sure the newest version is checked (e.g. 2.5.2.0 instead of + 1.0.0.0) and click "OK":

+ +

+ +

If you need other than installed version (e.g. DLL to match for + specific .NET Framework version) click on the + "Browse..." button:

+ +

+ +

Browse for the betterlistview.dll file containing the + component.

+ +

+

If you use Better ListView Express edition, + locate component named BetterListViewExpress or DLL named + betterlistviewexpress.dll.

+
+

The location depends on where you installed the product. The default + location is:

+ +
C:\Program Files\Component Owl\Better ListView\Redistributable
+ +

You can choose the file right within + "Redistributable" folder. This is .NET 2.0 component + compatible with .NET Framework 2.0 or higher. If you want binary for a + specific .NET version, choose the file from ".NET Framework + Specific" folder:

+ +

+ +

Make sure the check box next to + "BetterListView" is checked and click + "OK":

+ +

+ +

Now the component should appear in your Toolbox:

+ +

+ +

Select the component and place it on designer surface:

+ +

+ +

Now you can design Better ListView the same way as any other + control:

+ +

+ + +

+Installation + Troubleshooting

+ + +

If the component does not appear in Toolbox, make sure that your + target framework version is a full-featured .NET Framework 2.0, 3.0, 3.5 + or 4.0. The Compact Framework or Client Profile are not supported.

+ +

You can also try the "Reset Toolbox" option + from the Toolbox context menu, restart Visual Studio and try to add the + control again.

+ +

Sometimes even the Toolbox can get corrupted (known issue on Visual + Studio 2010) and its cache needs to be cleared. Simply remove all + ".tbd" files from this folder:

+ +

Vista/Windows 7:

+ +
\Users\<user>\AppData\Local\Microsoft\VisualStudio\10.0\*.tbd
+ +

Windows XP:

+ +
\Documents and Settings\<user directory>\Local Settings\Application Data\Microsoft\VisualStudio\10.0\*.tbd
+ +

Make sure the Visual Studio is not running when removing the files. + The Toolbox should reload its default items when opened.

+ + + + + + +

+Migrating from .NET ListView

+ + +

We did our best to make Better ListView as similar to regular .NET + ListView as possible. Better ListView, however, is not a ListView-derived + control - it is completely autonomous WinForms control. The following + rules of thumb will help you to migrate from ListView to Better + ListView:

+ + +

To compare usage of .NET ListView and Better ListView, consider the + following code using the regular .NET + ListView:

+ +

C#

+
BetterListView listView = new BetterListView();
+
+BetterListViewItem item = new BetterListViewItem("new item");
+
+listView.Items.Add(item);
+
+listView.View = BetterListViewView.List;
+
+// ...
+
+BetterListViewHitTestInfo hitTestInfo = listView.HitTest(new Point(0, 0));
+ +

Visual Basic

+
Dim listView As New BetterListView()
+
+Dim item As New BetterListViewItem("new item")
+
+listView.Items.Add(item)
+
+listView.View = BetterListViewView.List
+
+' ...
+
+Dim hitTestInfo As BetterListViewHitTestInfo = listView.HitTest(New Point(0, 0))
+ + +

+Learning resources and getting + support

+ + +

The documentation and learning resources include:

+ + +

You can find all these resources in Start Menu - Better + ListView.

+ +

The C# and Visual Basic Samples are located at:

+ +

Vista/Windows 7:

+ +
\Users\<user>\Documents\ComponentOwl\Better ListView Samples
+ +

Windows XP:

+ +
\Documents and Settings\<user directory>\My Documents\ComponentOwl\Better ListView Samples
+ +

Make sure the Visual Studio is not running when removing the files. + The Toolbox should reload its default items when opened.

+ +

We will happily answer any of your questions and provide further + assistance. Just email us at support@componentowl.com. + Or, you can use the online form at www.componentowl.com/support.

+ + + +
+ + + + + +
+ + + +
+ diff --git a/public/better-listview-express/releases?since=3.14.0.html b/public/better-listview-express/releases?since=3.14.0.html new file mode 100644 index 0000000..89ba94d --- /dev/null +++ b/public/better-listview-express/releases?since=3.14.0.html @@ -0,0 +1,592 @@ + + + + + + + + + + + + + + + +Better ListView .NET control: Improved List View control for C# and VB.NET (Windows Forms) + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+
+

Better ListView Express edition: Free .NET listview control

+ + + +
+ +
+ + + + + + + + + +
+ +
+ +
+ Free Download + +

Version 3.15 / May 27, 2015

+
+ +
+

Seamless integration with .NET 2.0 and higher

+ +
+ + + + + + + + +
+ Share this page if you like it: +
+ +
+
+ + + + +
+ +
+ +
+ +
+ +
+ + +
+
+ + + + + +
+ + + + + + + + + + \ No newline at end of file diff --git a/public/blog/2011/01/index.html b/public/blog/2011/01/index.html new file mode 100644 index 0000000..e4d3e32 --- /dev/null +++ b/public/blog/2011/01/index.html @@ -0,0 +1,213 @@ + + + + + + + +January « 2011 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/02/displaying-thumbnails-withs-borders-and-shadows/index.html b/public/blog/2011/02/displaying-thumbnails-withs-borders-and-shadows/index.html new file mode 100644 index 0000000..4a002b8 --- /dev/null +++ b/public/blog/2011/02/displaying-thumbnails-withs-borders-and-shadows/index.html @@ -0,0 +1,292 @@ + + + + + + + +Displaying Thumbnails with Borders and Shadows « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + +
+

Displaying Thumbnails with Borders and Shadows

+ + + +
+

We’ve just released Better ListView version 1.50 with some new features – thumbnails view, image borders support (inc. shadows), and more.

+

Our great inspiration for designing Better ListView is nothing less than the mighty Windows Explorer. This file manager uses obviously much more powerful control that the regular .NET list-view alone is.

+

It supports some extra views, line Contents and Extra Large Icons. It is also possible to adjust image size by rolling a mouse wheel while holding Control key.

+

Better ListView has the capability of displaying item icons with arbitrary sizes, but we also extended it with one extra view: Thumbnails:

+
Thumbnails Sample

Thumbnails Sample

+

This view aligns items in the center while keeping constant spacing between items. Thumbnails also keep just single line of text for compactness. On the other hand, LargeIcon view varies horizontal space between items to fill client area evenly and breaks long text into several lines.

+

The constant spacing is inspired by various photo managers, where image thumbnails are better viewed side-by-side (and the view looks also more organized).

+

Image thumbnails also look better with some kind border or frame. We added this new feature in Better ListView 1.5 and it works in all views. There are several pre-defined types of borders, but user can draw his own:

+
    +
  • None – simply no border at all
  • +
  • Single – single line border
  • +
  • SingleOffset – single line with a spacing between image and the border
  • +
  • SymmetricShadow – smooth shadow around image
  • +
  • DropShadow – smooth shadow on the right bottom part of the image
  • +
+

Thumbnails use DropShadow by default, but it can be adjusted for every view separately. One can also adjust thickness of the border/shadow and define custom spacing around image.

+

Take a look at one possible setting:

+
Image Borders

Image Borders

+

This is SingleOffset border of width 3 pixels. Notice that also column header images can have its borders (these are SymmetricShadow).

+

When the border is defined and image size should be kept the same, some spacing have to be added around image. You can adjust this spacing to draw you own borders or any additional graphics (such as overlay icons). Here is an example –

+
Thumbnail with Extra Icons

Thumbnail with Extra Icons

+

Download Better ListView

+

You can download Better ListView and play with it yourself.

+ +
+ + + + +
+ + + + + + + + + + + +
+ +

Leave a Reply

+ + + + +
+ + +

+

+ +

+

+ +

+

+ + + + +

+ +

+ + +

+

+
+ +
+ + + +
+ + + +
+
+ + + + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/02/index.html b/public/blog/2011/02/index.html new file mode 100644 index 0000000..4e957f6 --- /dev/null +++ b/public/blog/2011/02/index.html @@ -0,0 +1,213 @@ + + + + + + + +February « 2011 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/02/page/2/index.html b/public/blog/2011/02/page/2/index.html new file mode 100644 index 0000000..5a67419 --- /dev/null +++ b/public/blog/2011/02/page/2/index.html @@ -0,0 +1,253 @@ + + + + + + + + Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + + + + +
+

BLV and Internet Explorer

+ + + +
+

As you all know we are constantly working on improving BetterListView, but once in a while you might encounter a problem which has not found its way to our documentation yet.

+

Today, our blog post covers an interesting case when using Internet Explorer.
+When instantiating an ActiveX control written as a .NET assembly exposed via Interop you might get the following message:

+

System.IO.FileNotFoundException("Could not load file or assembly 'BetterListView, Version=3.8.2.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx' or one of its dependencies. The system cannot find the file specified.")

+

The solution to this problem is a fairly simple one, quoting from an MSDN article:
+“… you can install it in the global assembly cache so that it can be activated from any COM client. If the assembly is only going to be activated by a single application, you can place it in that application’s directory.”

+

Concluding from this short excerpt, you are basically left you with two options:
+1) You may register BetterListView in GAC if it is to be shared. But you should be careful with GAC because it allows holding multiple versions of the same assembly. You can make the installer remove any older versions from GAC during installation and add/keep just the newest one.
+2) You can put your .net assembly with all third-party DLLs in one directory during installation if it is to be private.

+

We recommend the second solution as we reckon it to be the safer one.

+
+ + + +
+ + +
+

Centering Images in Better ListView Sub-items

+ + + +
+
Centered images in Better ListView

Centered images in Better ListView

+

Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

+

The image will be centered inside available space regardless of text.

+

This is useful for sub-items and column headers consisting of image only.

+
+ + + +
+ + + + + +
+ + + +
+
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/02/what-we-are-working-on-groups-item-hierarchy-support/index.html b/public/blog/2011/02/what-we-are-working-on-groups-item-hierarchy-support/index.html new file mode 100644 index 0000000..03b0ff2 --- /dev/null +++ b/public/blog/2011/02/what-we-are-working-on-groups-item-hierarchy-support/index.html @@ -0,0 +1,288 @@ + + + + + + + +What we are working on: Groups, Item hierarchy support « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + +
+

What we are working on: Groups, Item hierarchy support

+ + + +
+

We are currently working on another major upgrade of our list view control for .net. This update should be released in less than 30 days.

+

It will contain two new major features: Excellent item grouping support, and support of simple hierarchical structure in the details view (collapsible list view items).

+

Better list view groups

+

Better ListView does not support grouping in the current version 1.50. However, this new upgrade will add excellent grouping support. The groups in Better ListView will be much more powerful and flexible than the groups in the regular .net list view. The groups will:

+
    +
  • Support collapse/expand
  • +
  • Support checkboxes (3-state)
  • +
  • Support their own images
  • +
  • Support their own tooltips
  • +
  • Be selectable
  • +
  • Support custom fonts
  • +
  • Support their own custom context menu
  • +
+

Item hierarchy of list view items

+

The new version of Better ListView will also support easy to use tree-like item hierarchy. You will be able to simply set parent of any list item, and thus create a simple tree in the details view of the list view control.

+
    +
  • All parent items will support collapse/expand
  • +
  • All parent items will have configurable checkbox (so you can show or hide it for each item)
  • +
+ +
+ + + + +
+ + + + + + + + + + + +
+ +

Leave a Reply

+ + + + +
+ + +

+

+ +

+

+ +

+

+ + + + +

+ +

+ + +

+

+
+ +
+ + + +
+ + + +
+
+ + + + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/03/index.html b/public/blog/2011/03/index.html new file mode 100644 index 0000000..ce4b7eb --- /dev/null +++ b/public/blog/2011/03/index.html @@ -0,0 +1,213 @@ + + + + + + + +March « 2011 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/03/page/2/index.html b/public/blog/2011/03/page/2/index.html new file mode 100644 index 0000000..6412b41 --- /dev/null +++ b/public/blog/2011/03/page/2/index.html @@ -0,0 +1,253 @@ + + + + + + + + Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + + + + +
+

BLV and Internet Explorer

+ + + +
+

As you all know we are constantly working on improving BetterListView, but once in a while you might encounter a problem which has not found its way to our documentation yet.

+

Today, our blog post covers an interesting case when using Internet Explorer.
+When instantiating an ActiveX control written as a .NET assembly exposed via Interop you might get the following message:

+

System.IO.FileNotFoundException("Could not load file or assembly 'BetterListView, Version=3.8.2.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx' or one of its dependencies. The system cannot find the file specified.")

+

The solution to this problem is a fairly simple one, quoting from an MSDN article:
+“… you can install it in the global assembly cache so that it can be activated from any COM client. If the assembly is only going to be activated by a single application, you can place it in that application’s directory.”

+

Concluding from this short excerpt, you are basically left you with two options:
+1) You may register BetterListView in GAC if it is to be shared. But you should be careful with GAC because it allows holding multiple versions of the same assembly. You can make the installer remove any older versions from GAC during installation and add/keep just the newest one.
+2) You can put your .net assembly with all third-party DLLs in one directory during installation if it is to be private.

+

We recommend the second solution as we reckon it to be the safer one.

+
+ + + +
+ + +
+

Centering Images in Better ListView Sub-items

+ + + +
+
Centered images in Better ListView

Centered images in Better ListView

+

Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

+

The image will be centered inside available space regardless of text.

+

This is useful for sub-items and column headers consisting of image only.

+
+ + + +
+ + + + + +
+ + + +
+
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/05/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/index.html b/public/blog/2011/05/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/index.html new file mode 100644 index 0000000..21b1595 --- /dev/null +++ b/public/blog/2011/05/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/index.html @@ -0,0 +1,302 @@ + + + + + + + +Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more) « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + +
+

Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more)

+ + + +
+
Hierarchical items in two groups

Hierarchical items in two groups

+

We are currently working hard on finishing Better ListView version 2.0 which will add new features: Support for groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.

+

We expect to release this upgrade in about a month. It will be a free upgrade for current and new users.

+

Groups

+

Groups in Better ListView have comparable capabilities as other Better ListView elements (column headers, items, sub-items). For example, you can adjust the foreground/background colors, font, image – and owner drawing is possible as well.

+

You can even include images into group headers (as you can see in the preview above), which is not possible in .NET ListView.

+

Groups are collapsible by default and the expand button can be switched off on each group individually.

+

Here are groups combined with Tile view (the second group is collapsed):

+
Groups with Tile view

Groups with Tile view

+

The previous figure displays vertically oriented groups, but Better ListView also support horizontally oriented groups in the List mode:

+
Groups with List view

Groups with List view

+

We put special effort to mimic the group display and behavior of Windows Explorer. The group headers can display all of the 15 group header states available in Windows visual style and their display is governed by the same logic as in the ListView counterpart.

+

The group headers always look perfect and native, right out of the box. You don’t need to tweak anything.

+

Item Hierarchy

+
+
+

+
Items with hierarchy

Items with hierarchy

+

+
+
+
+

This works in the similar way as in the standard TreeView control. Each item (or node) has property called ChildItems which can be filled with new BetterListViewItem instances. SubItems collection can still be used in either items and child-items (child items are treated in the very same way as their parents).

+

Item hierarchy can be combined with Groups feature as seen in the first preview.

+

Multi-Line Items

+
Multi-line items

Multi-line items

+

A simple setting of item layout (MaximumTextLines property) allows breaking item text into several lines (up to the specified value). When the text is longer than MaximumTextLines, then the default trimming method is used (one from the TextTrimming enumeration: None, TrimCharacter, TrimWord, EllipsisCharacter, EllipsisWord, EllipsisPath).

+

Multi-line text can be used in every view and also in column headers.

+

Another New Features

+

There are also bunch of new minor features including:

+

Adjustable paddings – Every element part (e.g. item check box, group image…) contains customizable spaces at each side, so the user can easily create space where he needs and customize items/column headers/group headers to the finest detail.

+

Focusing sub-items – Items, group headers and even sub-items can be keyfocused. User can now invoke label editing or scroll to any “cell” in the Details-with-columns view solely with keyboard.

+

IEnumerable implementations –  BetterListView, BetterListViewGroup and BetterListViewItem implements IEnumerable interface for iterating through the whole item hierarchy, so using recursion to traverse child items is not necessary.

+ +
+ + + + +
+ + + + + + + + + + + +
+ +

Leave a Reply

+ + + + +
+ + +

+

+ +

+

+ +

+

+ + + + +

+ +

+ + +

+

+
+ +
+ + + +
+ + + +
+
+ + + + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/05/index.html b/public/blog/2011/05/index.html new file mode 100644 index 0000000..43319e0 --- /dev/null +++ b/public/blog/2011/05/index.html @@ -0,0 +1,211 @@ + + + + + + + +May « 2011 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/06/index.html b/public/blog/2011/06/index.html new file mode 100644 index 0000000..b297dc3 --- /dev/null +++ b/public/blog/2011/06/index.html @@ -0,0 +1,213 @@ + + + + + + + +June « 2011 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/07/index.html b/public/blog/2011/07/index.html new file mode 100644 index 0000000..7313909 --- /dev/null +++ b/public/blog/2011/07/index.html @@ -0,0 +1,213 @@ + + + + + + + +July « 2011 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/07/windows-theme-support-in-better-listview/index.html b/public/blog/2011/07/windows-theme-support-in-better-listview/index.html new file mode 100644 index 0000000..1371f51 --- /dev/null +++ b/public/blog/2011/07/windows-theme-support-in-better-listview/index.html @@ -0,0 +1,277 @@ + + + + + + + +Windows Theme Support in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + +
+

Windows Theme Support in Better ListView

+ + + +
+

Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

+

Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

+

One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

+

The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

+
Better ListView in Classic theme

Better ListView in Classic theme

+
Better ListView in XP Luna Theme

Better ListView in XP Luna Theme

+
Better ListView in Aero Theme

Better ListView in Aero Theme

+

 

+ +
+ + + + +
+ + + + + + + + + + + +
+ +

Leave a Reply

+ + + + +
+ + +

+

+ +

+

+ +

+

+ + + + +

+ +

+ + +

+

+
+ +
+ + + +
+ + + +
+
+ + + + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/08/index.html b/public/blog/2011/08/index.html new file mode 100644 index 0000000..099337c --- /dev/null +++ b/public/blog/2011/08/index.html @@ -0,0 +1,213 @@ + + + + + + + +August « 2011 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/09/index.html b/public/blog/2011/09/index.html new file mode 100644 index 0000000..d4141fc --- /dev/null +++ b/public/blog/2011/09/index.html @@ -0,0 +1,213 @@ + + + + + + + +September « 2011 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/10/index.html b/public/blog/2011/10/index.html new file mode 100644 index 0000000..4d0102f --- /dev/null +++ b/public/blog/2011/10/index.html @@ -0,0 +1,211 @@ + + + + + + + +October « 2011 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/11/index.html b/public/blog/2011/11/index.html new file mode 100644 index 0000000..01adaaf --- /dev/null +++ b/public/blog/2011/11/index.html @@ -0,0 +1,213 @@ + + + + + + + +November « 2011 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/11/page/2/index.html b/public/blog/2011/11/page/2/index.html new file mode 100644 index 0000000..127174c --- /dev/null +++ b/public/blog/2011/11/page/2/index.html @@ -0,0 +1,253 @@ + + + + + + + + Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + + + + +
+

BLV and Internet Explorer

+ + + +
+

As you all know we are constantly working on improving BetterListView, but once in a while you might encounter a problem which has not found its way to our documentation yet.

+

Today, our blog post covers an interesting case when using Internet Explorer.
+When instantiating an ActiveX control written as a .NET assembly exposed via Interop you might get the following message:

+

System.IO.FileNotFoundException("Could not load file or assembly 'BetterListView, Version=3.8.2.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx' or one of its dependencies. The system cannot find the file specified.")

+

The solution to this problem is a fairly simple one, quoting from an MSDN article:
+“… you can install it in the global assembly cache so that it can be activated from any COM client. If the assembly is only going to be activated by a single application, you can place it in that application’s directory.”

+

Concluding from this short excerpt, you are basically left you with two options:
+1) You may register BetterListView in GAC if it is to be shared. But you should be careful with GAC because it allows holding multiple versions of the same assembly. You can make the installer remove any older versions from GAC during installation and add/keep just the newest one.
+2) You can put your .net assembly with all third-party DLLs in one directory during installation if it is to be private.

+

We recommend the second solution as we reckon it to be the safer one.

+
+ + + +
+ + +
+

Centering Images in Better ListView Sub-items

+ + + +
+
Centered images in Better ListView

Centered images in Better ListView

+

Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

+

The image will be centered inside available space regardless of text.

+

This is useful for sub-items and column headers consisting of image only.

+
+ + + +
+ + + + + +
+ + + +
+
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/11/vertical-alignment-and-text-wrapping-in-better-listview/index.html b/public/blog/2011/11/vertical-alignment-and-text-wrapping-in-better-listview/index.html new file mode 100644 index 0000000..b50b1e5 --- /dev/null +++ b/public/blog/2011/11/vertical-alignment-and-text-wrapping-in-better-listview/index.html @@ -0,0 +1,312 @@ + + + + + + + +Vertical Alignment and Text Wrapping in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + +
+

Vertical Alignment and Text Wrapping in Better ListView

+ + + +
+

.NET ListView supports horizontal alignment of text in columns, items, sub-items and groups. Since Better ListView adds many new features, like multi-line items and images of arbitrary size, vertical alignment comes in handy.

+

By default, each view has its defaults, but you can customize text alignment on every column, item, sub-item and group individually:

+
+
Vertical alignments of text

Vertical alignments of text

+
+
+
+
+

The vertical alignment feature is a new property of each element type. For example, .NET ListView item has a property called Align which refers to horizontal alignment. Better ListView extends this to two independent properties called AlignHorizontal and AlignVertical. The naming scheme is same for columns, items, sub-items and groups.

+

Better ListView also supports splitting text in column headers and items (sub-items) into multiple lines.

+

We extended this functionality by adding a BetterListViewItem.TextWrapping and BetterListViewSubItem.TextWrapping properties. With these, you can control how the text in sub-items will be wrapped. There are three possible values:

+
    +
  • Layout – the text will be wrapped to multiple lines, up to value specified by MaximumTextLines property of the corresponding view (layout)
  • +
  • None – the text will not be wrapped at all
  • +
  • Space – the text will be wrapped, but only to available space (item will never get higher due to wrapping text in sub-item with this setting)
  • +
+
The following screenshot shows these three wrapping modes in action:
+
+
Various text wrapping modes

Various text wrapping modes

+
+

The sub-item in the first column has TextWrapping set to Layout and the layout has MaximumTextLines set to 4. The sub-item text thus can be split to up to four lines. It is actually split just to three because the column is wide enough.

+

The sub-item in the second column has TextWrapping set to None, which means the text in this sub-item is kept on single line.

+

The sub-item in the third column has TextWrapping set to Space. As you can see, even if the MaximumTextLines is set to 4, the sub-item text is limited to three lines, preventing item to grow larger.

+ +
+ + + + +
+ + + + + +

One Response to “Vertical Alignment and Text Wrapping in Better ListView”

+ +
    +
  1. +
    +
    + Daniel N says:
    + + + +

    Very nice guys… With each new version, Better ListView is doing exactly that: just getting better and better!

    +

    I am particularly keen to try putting in my own linebreaks into items in the details view.

    + + +
    +
  2. +
+ + + + + +
+ +

Leave a Reply

+ + + + +
+ + +

+

+ +

+

+ +

+

+ + + + +

+ +

+ + +

+

+
+ +
+ + + +
+ + + +
+
+ + + + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/12/how-to-dynamically-resize-focused-item/index.html b/public/blog/2011/12/how-to-dynamically-resize-focused-item/index.html new file mode 100644 index 0000000..6be1617 --- /dev/null +++ b/public/blog/2011/12/how-to-dynamically-resize-focused-item/index.html @@ -0,0 +1,308 @@ + + + + + + + +How To: Dynamically Resize Focused Item « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + +
+

How To: Dynamically Resize Focused Item

+ + + +
+

Better ListView 2.4.0 now supports setting MaximumTextLines property on every item and sub-item, so you can have multi-line items each with different number text lines:

+
Dynamic resizing of the focused item

Dynamic resizing of the focused item

+

We also introduced FocusedItemChanged event, so that you can detect when focus has moved from one element (item / sub-item / group) to another.

+

These features can be combined to display only the focused item with more details to save space code of the FocusedItemChanged event handler may look like this:

+

C#

+

[csharp gutter=”false” toolbar=”false”]
+void ListViewFocusedItemChanged(object sender, BetterListViewFocusedItemChangedEventArgs eventArgs)
+{
+ BetterListView listView = (BetterListView)sender;

+

listView.BeginUpdate();

+

if (eventArgs.FocusedItemOld != null)
+ {
+ // set single line of text for currenly unfocused item
+ eventArgs.FocusedItemOld.MaximumTextLines = 1;
+ }

+

if (eventArgs.FocusedItemNew != null)
+ {
+ // set three lines of text for currenly focused item
+ eventArgs.FocusedItemNew.MaximumTextLines = 3;
+ }

+

listView.EndUpdate();
+}
+[/csharp]

+

Visual Basic

+

[vb gutter=”false” toolbar=”false”]
+Sub ListViewFocusedItemChanged(sender As Object, eventArgs As BetterListViewFocusedItemChangedEventArgs)
+ Dim ListView As BetterListView = DirectCast(sender, BetterListView)

+

ListView.BeginUpdate()

+

If eventArgs.FocusedItemOld IsNot Nothing Then
+ ‘ set single line of text for currenly unfocused item
+ eventArgs.FocusedItemOld.MaximumTextLines = 1
+ End If

+

If eventArgs.FocusedItemNew IsNot Nothing Then
+ ‘ set three lines of text for currenly focused item
+ eventArgs.FocusedItemNew.MaximumTextLines = 3
+ End If

+

ListView.EndUpdate()
+End Sub
+[/vb]

+ +
+ + + + +
+ + + + + + + + + + + +
+ +

Leave a Reply

+ + + + +
+ + +

+

+ +

+

+ +

+

+ + + + +

+ +

+ + +

+

+
+ +
+ + + +
+ + + +
+
+ + + + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2011/12/index.html b/public/blog/2011/12/index.html new file mode 100644 index 0000000..22b543a --- /dev/null +++ b/public/blog/2011/12/index.html @@ -0,0 +1,211 @@ + + + + + + + +December « 2011 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2012/01/index.html b/public/blog/2012/01/index.html new file mode 100644 index 0000000..a042cc3 --- /dev/null +++ b/public/blog/2012/01/index.html @@ -0,0 +1,213 @@ + + + + + + + +January « 2012 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2012/01/page/2/index.html b/public/blog/2012/01/page/2/index.html new file mode 100644 index 0000000..85f4a7e --- /dev/null +++ b/public/blog/2012/01/page/2/index.html @@ -0,0 +1,253 @@ + + + + + + + + Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + + + + +
+

BLV and Internet Explorer

+ + + +
+

As you all know we are constantly working on improving BetterListView, but once in a while you might encounter a problem which has not found its way to our documentation yet.

+

Today, our blog post covers an interesting case when using Internet Explorer.
+When instantiating an ActiveX control written as a .NET assembly exposed via Interop you might get the following message:

+

System.IO.FileNotFoundException("Could not load file or assembly 'BetterListView, Version=3.8.2.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx' or one of its dependencies. The system cannot find the file specified.")

+

The solution to this problem is a fairly simple one, quoting from an MSDN article:
+“… you can install it in the global assembly cache so that it can be activated from any COM client. If the assembly is only going to be activated by a single application, you can place it in that application’s directory.”

+

Concluding from this short excerpt, you are basically left you with two options:
+1) You may register BetterListView in GAC if it is to be shared. But you should be careful with GAC because it allows holding multiple versions of the same assembly. You can make the installer remove any older versions from GAC during installation and add/keep just the newest one.
+2) You can put your .net assembly with all third-party DLLs in one directory during installation if it is to be private.

+

We recommend the second solution as we reckon it to be the safer one.

+
+ + + +
+ + +
+

Centering Images in Better ListView Sub-items

+ + + +
+
Centered images in Better ListView

Centered images in Better ListView

+

Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

+

The image will be centered inside available space regardless of text.

+

This is useful for sub-items and column headers consisting of image only.

+
+ + + +
+ + + + + +
+ + + +
+
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2012/01/read-only-mode-in-better-listview/index.html b/public/blog/2012/01/read-only-mode-in-better-listview/index.html new file mode 100644 index 0000000..85c7522 --- /dev/null +++ b/public/blog/2012/01/read-only-mode-in-better-listview/index.html @@ -0,0 +1,279 @@ + + + + + + + +Read-Only Mode in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + +
+

Read-Only Mode in Better ListView

+ + + +
+

Better ListView 2.5 introduces a new boolean property called ReadOnly.

+

When set to true, the Better ListView does not respond to keyboard and mouse input. There are, however, some exceptions that make the Read-only mode different to the Disabled mode (when Enabled property is set to false).

+

When in Read-only mode, content of the Better ListView can be still scrolled (the scroll bars are enabled) and groups/items can be expanded/collapsed.

+

The difference between Disabled and Read-only can be seen on the following images:

+
Normal state

Normal state

+
Disabled state

Disabled state

+
Read-only state

Read-only state

+

 

+

As you can see, the Better ListView is displayed normally in Read-only mode, but the group header does not have a hot state (because cannot be focused). Items also cannot be focused or selected, but the expand buttons are still interactive.

+

The scroll bars would also be enabled and can be used, which is different from Disabled mode where everything is grayed and cannot be used.

+ +
+ + + + +
+ + + + + + + + + + + +
+ +

Leave a Reply

+ + + + +
+ + +

+

+ +

+

+ +

+

+ + + + +

+ +

+ + +

+

+
+ +
+ + + +
+ + + +
+
+ + + + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2012/02/index.html b/public/blog/2012/02/index.html new file mode 100644 index 0000000..52ce4c2 --- /dev/null +++ b/public/blog/2012/02/index.html @@ -0,0 +1,213 @@ + + + + + + + +February « 2012 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2012/03/index.html b/public/blog/2012/03/index.html new file mode 100644 index 0000000..5e25e83 --- /dev/null +++ b/public/blog/2012/03/index.html @@ -0,0 +1,213 @@ + + + + + + + +March « 2012 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2012/04/index.html b/public/blog/2012/04/index.html new file mode 100644 index 0000000..fc2a47e --- /dev/null +++ b/public/blog/2012/04/index.html @@ -0,0 +1,213 @@ + + + + + + + +April « 2012 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2012/08/index.html b/public/blog/2012/08/index.html new file mode 100644 index 0000000..277f0df --- /dev/null +++ b/public/blog/2012/08/index.html @@ -0,0 +1,213 @@ + + + + + + + +August « 2012 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2012/09/index.html b/public/blog/2012/09/index.html new file mode 100644 index 0000000..4100cc2 --- /dev/null +++ b/public/blog/2012/09/index.html @@ -0,0 +1,211 @@ + + + + + + + +September « 2012 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2012/12/index.html b/public/blog/2012/12/index.html new file mode 100644 index 0000000..bc748e1 --- /dev/null +++ b/public/blog/2012/12/index.html @@ -0,0 +1,213 @@ + + + + + + + +December « 2012 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2013/01/index.html b/public/blog/2013/01/index.html new file mode 100644 index 0000000..519b5b0 --- /dev/null +++ b/public/blog/2013/01/index.html @@ -0,0 +1,213 @@ + + + + + + + +January « 2013 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2013/02/index.html b/public/blog/2013/02/index.html new file mode 100644 index 0000000..f6ee056 --- /dev/null +++ b/public/blog/2013/02/index.html @@ -0,0 +1,211 @@ + + + + + + + +February « 2013 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2013/03/index.html b/public/blog/2013/03/index.html new file mode 100644 index 0000000..2437b44 --- /dev/null +++ b/public/blog/2013/03/index.html @@ -0,0 +1,213 @@ + + + + + + + +March « 2013 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2014/02/index.html b/public/blog/2014/02/index.html new file mode 100644 index 0000000..d72ce85 --- /dev/null +++ b/public/blog/2014/02/index.html @@ -0,0 +1,211 @@ + + + + + + + +February « 2014 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2014/04/index.html b/public/blog/2014/04/index.html new file mode 100644 index 0000000..dfaf8f0 --- /dev/null +++ b/public/blog/2014/04/index.html @@ -0,0 +1,213 @@ + + + + + + + +April « 2014 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2014/07/index.html b/public/blog/2014/07/index.html new file mode 100644 index 0000000..15f36f7 --- /dev/null +++ b/public/blog/2014/07/index.html @@ -0,0 +1,211 @@ + + + + + + + +July « 2014 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2014/08/index.html b/public/blog/2014/08/index.html new file mode 100644 index 0000000..23c3f1e --- /dev/null +++ b/public/blog/2014/08/index.html @@ -0,0 +1,211 @@ + + + + + + + +August « 2014 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2016/11/index.html b/public/blog/2016/11/index.html new file mode 100644 index 0000000..916d564 --- /dev/null +++ b/public/blog/2016/11/index.html @@ -0,0 +1,211 @@ + + + + + + + +November « 2016 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2017/02/index.html b/public/blog/2017/02/index.html new file mode 100644 index 0000000..91554e4 --- /dev/null +++ b/public/blog/2017/02/index.html @@ -0,0 +1,211 @@ + + + + + + + +February « 2017 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/2017/03/index.html b/public/blog/2017/03/index.html new file mode 100644 index 0000000..676dec6 --- /dev/null +++ b/public/blog/2017/03/index.html @@ -0,0 +1,211 @@ + + + + + + + +March « 2017 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/activation-issues-and-how-to-solve-them/feed/index.html b/public/blog/activation-issues-and-how-to-solve-them/feed/index.html new file mode 100644 index 0000000..ea83fa9 --- /dev/null +++ b/public/blog/activation-issues-and-how-to-solve-them/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Activation issues and how to solve them + + http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/alternating-rows-in-better-listview/feed/index.html b/public/blog/alternating-rows-in-better-listview/feed/index.html new file mode 100644 index 0000000..cbd8fc8 --- /dev/null +++ b/public/blog/alternating-rows-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Alternating Rows in Better ListView + + http://www.componentowl.com/blog/alternating-rows-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/better-listview-1-50-released/feed/index.html b/public/blog/better-listview-1-50-released/feed/index.html new file mode 100644 index 0000000..eb64c68 --- /dev/null +++ b/public/blog/better-listview-1-50-released/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Better ListView 1.50 released + + http://www.componentowl.com/blog/better-listview-1-50-released/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/better-listview-1-52-released/feed/index.html b/public/blog/better-listview-1-52-released/feed/index.html new file mode 100644 index 0000000..36a9c6b --- /dev/null +++ b/public/blog/better-listview-1-52-released/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Better ListView 1.52 released + + http://www.componentowl.com/blog/better-listview-1-52-released/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/better-listview-2-0-samples-preview/feed/index.html b/public/blog/better-listview-2-0-samples-preview/feed/index.html new file mode 100644 index 0000000..4f4f875 --- /dev/null +++ b/public/blog/better-listview-2-0-samples-preview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Better ListView 2.0 Samples Launcher + + http://www.componentowl.com/blog/better-listview-2-0-samples-preview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/feed/index.html b/public/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/feed/index.html new file mode 100644 index 0000000..7f63037 --- /dev/null +++ b/public/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more) + + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/better-listview-2-00-released/feed/index.html b/public/blog/better-listview-2-00-released/feed/index.html new file mode 100644 index 0000000..140b5b7 --- /dev/null +++ b/public/blog/better-listview-2-00-released/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Better ListView 2.00 released + + http://www.componentowl.com/blog/better-listview-2-00-released/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/better-listview-2-1-optimizations-done-minor-features-and-testing/feed/index.html b/public/blog/better-listview-2-1-optimizations-done-minor-features-and-testing/feed/index.html new file mode 100644 index 0000000..9235cc2 --- /dev/null +++ b/public/blog/better-listview-2-1-optimizations-done-minor-features-and-testing/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Better ListView 2.1: Optimizations Done, Minor Features and Testing + + http://www.componentowl.com/blog/better-listview-2-1-optimizations-done-minor-features-and-testing/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/better-listview-2-10-released/feed/index.html b/public/blog/better-listview-2-10-released/feed/index.html new file mode 100644 index 0000000..c0ede2b --- /dev/null +++ b/public/blog/better-listview-2-10-released/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Better ListView 2.10 released + + http://www.componentowl.com/blog/better-listview-2-10-released/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/better-listview-released/feed/index.html b/public/blog/better-listview-released/feed/index.html new file mode 100644 index 0000000..3840950 --- /dev/null +++ b/public/blog/better-listview-released/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Better ListView released + + http://www.componentowl.com/blog/better-listview-released/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/better-listview-reviewed-at-devproconnections-com/feed/index.html b/public/blog/better-listview-reviewed-at-devproconnections-com/feed/index.html new file mode 100644 index 0000000..b601f8c --- /dev/null +++ b/public/blog/better-listview-reviewed-at-devproconnections-com/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Better ListView reviewed at DevProConnections.com + + http://www.componentowl.com/blog/better-listview-reviewed-at-devproconnections-com/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/better-listview-tip-how-to-draw-custom-selection/feed/index.html b/public/blog/better-listview-tip-how-to-draw-custom-selection/feed/index.html new file mode 100644 index 0000000..7e0b640 --- /dev/null +++ b/public/blog/better-listview-tip-how-to-draw-custom-selection/feed/index.html @@ -0,0 +1,49 @@ + + + Comments on: Better ListView Tip: How to Draw Custom Selection + + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + By: Libor Tinka + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/#comment-1286 + + Mon, 29 Oct 2012 22:37:06 +0000 + http://www.componentowl.com/blog/?p=808#comment-1286 + + We have balanced performance with features, this is a price for having fully managed control with rich features (tree items, multi-line text). If you want something extremely fast, faster than ListView, handling 100 000 000 items like a charm … use DOS text mode! :)

+

We have happy customers who use Better ListView in complex systems like airline ticket booking and they are very intelligent people – I don’t think they are stupid developers.

+]]>
+
+ + By: Claudiu + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/#comment-1285 + + Fri, 28 Sep 2012 09:50:29 +0000 + http://www.componentowl.com/blog/?p=808#comment-1285 + + Better list view is only for stupid developers and plase do not compare it with standard list view. Performance is an important think and betterlistview has no performance compared with list view. Make an loop with 100000 items for add to list and you will see ….

+]]>
+
+
+
+ + \ No newline at end of file diff --git a/public/blog/better-listview-tip-how-to-draw-custom-selection/index.html?replytocom=1285.html b/public/blog/better-listview-tip-how-to-draw-custom-selection/index.html?replytocom=1285.html new file mode 100644 index 0000000..c82304e --- /dev/null +++ b/public/blog/better-listview-tip-how-to-draw-custom-selection/index.html?replytocom=1285.html @@ -0,0 +1,367 @@ + + + + + + + +Better ListView Tip: How to Draw Custom Selection « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + +
+

Better ListView Tip: How to Draw Custom Selection

+ + + +
+
Customized item selection.

Customized item selection.

+

 

+

By default, Better ListView uses system theme for drawing selections.

+

To draw custom selection, you can use owner drawing capabilities of Better ListView:

+

C#

+

[csharp gutter=”false” toolbar=”false”]
+class CustomListView : BetterListView
+{
+ protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
+ {
+ base.OnDrawItemBackground(eventArgs);

+

if (eventArgs.Item.Selected)
+ {
+ Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
+ eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
+ brushSelection.Dispose();
+ }
+ }

+

protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
+ {
+ eventArgs.DrawSelection = false;

+

base.OnDrawItem(eventArgs);

+

if (eventArgs.Item.Selected)
+ {
+ eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
+ }
+ }
+}
+[/csharp]

+

Visual Basic

+

[vb gutter=”false” toolbar=”false”]
+Class CustomListView
+ Inherits BetterListView
+ Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
+ MyBase.OnDrawItemBackground(eventArgs)

+

If eventArgs.Item.Selected Then
+ Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
+ eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
+ brushSelection.Dispose()
+ End If
+ End Sub

+

Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
+ eventArgs.DrawSelection = False

+

MyBase.OnDrawItem(eventArgs)

+

If eventArgs.Item.Selected Then
+ eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
+ End If
+ End Sub
+End Class
+[/vb]

+

In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

+

The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

+

The OnDrawItem method contains two things:

+
    +
  1. Turn off  default selection.
  2. +
  3. Draw custom selection border if the item is selected.
  4. +
+

Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

+

Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

+

To allow these states, considerable coding need to be done.

+

In case you need this level of customization, please contact us for Custom Coding support.

+

 

+ +
+ + + + +
+ + + + + +

2 Responses to “Better ListView Tip: How to Draw Custom Selection”

+ +
    +
  1. +
    +
    + Claudiu says:
    + + + +

    Better list view is only for stupid developers and plase do not compare it with standard list view. Performance is an important think and betterlistview has no performance compared with list view. Make an loop with 100000 items for add to list and you will see ….

    + + +
    +
      +
    • +
      +
      + Libor Tinka says:
      + + + +

      We have balanced performance with features, this is a price for having fully managed control with rich features (tree items, multi-line text). If you want something extremely fast, faster than ListView, handling 100 000 000 items like a charm … use DOS text mode! :)

      +

      We have happy customers who use Better ListView in complex systems like airline ticket booking and they are very intelligent people – I don’t think they are stupid developers.

      + + +
      +
    • +
    +
  2. +
+ + + + + +
+ +

Leave a Reply to Claudiu

+ + + + +
+ + +

+

+ +

+

+ +

+

+ + + + +

+ +

+ + +

+

+
+ +
+ + + +
+ + + +
+
+ + + + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/better-listview-tip-how-to-draw-custom-selection/index.html?replytocom=1286.html b/public/blog/better-listview-tip-how-to-draw-custom-selection/index.html?replytocom=1286.html new file mode 100644 index 0000000..ea01dec --- /dev/null +++ b/public/blog/better-listview-tip-how-to-draw-custom-selection/index.html?replytocom=1286.html @@ -0,0 +1,367 @@ + + + + + + + +Better ListView Tip: How to Draw Custom Selection « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + +
+

Better ListView Tip: How to Draw Custom Selection

+ + + +
+
Customized item selection.

Customized item selection.

+

 

+

By default, Better ListView uses system theme for drawing selections.

+

To draw custom selection, you can use owner drawing capabilities of Better ListView:

+

C#

+

[csharp gutter=”false” toolbar=”false”]
+class CustomListView : BetterListView
+{
+ protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
+ {
+ base.OnDrawItemBackground(eventArgs);

+

if (eventArgs.Item.Selected)
+ {
+ Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
+ eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
+ brushSelection.Dispose();
+ }
+ }

+

protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
+ {
+ eventArgs.DrawSelection = false;

+

base.OnDrawItem(eventArgs);

+

if (eventArgs.Item.Selected)
+ {
+ eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
+ }
+ }
+}
+[/csharp]

+

Visual Basic

+

[vb gutter=”false” toolbar=”false”]
+Class CustomListView
+ Inherits BetterListView
+ Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
+ MyBase.OnDrawItemBackground(eventArgs)

+

If eventArgs.Item.Selected Then
+ Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
+ eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
+ brushSelection.Dispose()
+ End If
+ End Sub

+

Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
+ eventArgs.DrawSelection = False

+

MyBase.OnDrawItem(eventArgs)

+

If eventArgs.Item.Selected Then
+ eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
+ End If
+ End Sub
+End Class
+[/vb]

+

In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

+

The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

+

The OnDrawItem method contains two things:

+
    +
  1. Turn off  default selection.
  2. +
  3. Draw custom selection border if the item is selected.
  4. +
+

Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

+

Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

+

To allow these states, considerable coding need to be done.

+

In case you need this level of customization, please contact us for Custom Coding support.

+

 

+ +
+ + + + +
+ + + + + +

2 Responses to “Better ListView Tip: How to Draw Custom Selection”

+ +
    +
  1. +
    +
    + Claudiu says:
    + + + +

    Better list view is only for stupid developers and plase do not compare it with standard list view. Performance is an important think and betterlistview has no performance compared with list view. Make an loop with 100000 items for add to list and you will see ….

    + + +
    +
      +
    • +
      +
      + Libor Tinka says:
      + + + +

      We have balanced performance with features, this is a price for having fully managed control with rich features (tree items, multi-line text). If you want something extremely fast, faster than ListView, handling 100 000 000 items like a charm … use DOS text mode! :)

      +

      We have happy customers who use Better ListView in complex systems like airline ticket booking and they are very intelligent people – I don’t think they are stupid developers.

      + + +
      +
    • +
    +
  2. +
+ + + + + +
+ +

Leave a Reply to Libor Tinka

+ + + + +
+ + +

+

+ +

+

+ +

+

+ + + + +

+ +

+ + +

+

+
+ +
+ + + +
+ + + +
+
+ + + + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/better-thumbnail-browser-component-released/feed/index.html b/public/blog/better-thumbnail-browser-component-released/feed/index.html new file mode 100644 index 0000000..073a5f3 --- /dev/null +++ b/public/blog/better-thumbnail-browser-component-released/feed/index.html @@ -0,0 +1,36 @@ + + + Comments on: Better Thumbnail Browser Component Released + + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + By: Nathaniel Wise + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comment-1289 + + Wed, 23 Jan 2013 09:20:46 +0000 + http://www.componentowl.com/blog/?p=823#comment-1289 + + this is one useful for the example and overviews.in my website i m not used this type of functionality but this is something good component.

+]]>
+
+
+
+ + \ No newline at end of file diff --git a/public/blog/better-thumbnail-browser-component-released/index.html?replytocom=1289.html b/public/blog/better-thumbnail-browser-component-released/index.html?replytocom=1289.html new file mode 100644 index 0000000..0d59fa0 --- /dev/null +++ b/public/blog/better-thumbnail-browser-component-released/index.html?replytocom=1289.html @@ -0,0 +1,315 @@ + + + + + + + +Better Thumbnail Browser Component Released « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

Owl's Blog on .NET development

+ +
Component Owl codes Better ListView control all night so you don't have to.
+ + + + +
+

Better Thumbnail Browser Component Released

+ + + +
+

 

+

We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

+
Better Thumbnail Browser Overview

Better Thumbnail Browser Overview

+

The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

+

My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

+

Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

+

Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

+
    +
  • Load images from a folder, database or custom source automatically
  • +
  • Load thumbnails with arbitrary sizes on background while progressively displaying them
  • +
  • Handle zooming thumbnails on the fly
  • +
  • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
  • +
  • Loading thumbnails in custom order
  • +
  • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
  • +
  • Manage updating individual thumbnails or their count on the fly
  • +
  • Support showing loading progress
  • +
+

The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

+
Better Thumbnail Browser with Windows 8 Theme

Better Thumbnail Browser with Windows 8 Theme

+

 

+

Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

+
thumbnailBrowser.Path = "c:\\images";
+

And that’s it!

+

Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

+

 

+

 

+ +
+ + + + +
+ + + + + +

One Response to “Better Thumbnail Browser Component Released”

+ +
    +
  1. +
    +
    + Nathaniel Wise says:
    + + + +

    this is one useful for the example and overviews.in my website i m not used this type of functionality but this is something good component.

    + + +
    +
  2. +
+ + + + + +
+ +

Leave a Reply to Nathaniel Wise

+ + + + +
+ + +

+

+ +

+

+ +

+

+ + + + +

+ +

+ + +

+

+
+ +
+ + + +
+ + + +
+
+ + + + + +
+ + + + + + \ No newline at end of file diff --git a/public/blog/binding-images-in-better-listview/feed/index.html b/public/blog/binding-images-in-better-listview/feed/index.html new file mode 100644 index 0000000..329ca5b --- /dev/null +++ b/public/blog/binding-images-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Binding Images in Better ListView + + http://www.componentowl.com/blog/binding-images-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/blv-and-internet-explorer/feed/index.html b/public/blog/blv-and-internet-explorer/feed/index.html new file mode 100644 index 0000000..b2892dc --- /dev/null +++ b/public/blog/blv-and-internet-explorer/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: BLV and Internet Explorer + + http://www.componentowl.com/blog/blv-and-internet-explorer/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/category/announcements/feed/index.html b/public/blog/category/announcements/feed/index.html new file mode 100644 index 0000000..87a9e63 --- /dev/null +++ b/public/blog/category/announcements/feed/index.html @@ -0,0 +1,328 @@ + + + + Announcements – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

Better ListView Sub-item Check Boxes

+

Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

+

This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

+

Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

+

Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

+

Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

+]]>
+ http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
+ + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

+

We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

+
Better Thumbnail Browser Overview

Better Thumbnail Browser Overview

+

The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

+

My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

+

Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

+

Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

+
    +
  • Load images from a folder, database or custom source automatically
  • +
  • Load thumbnails with arbitrary sizes on background while progressively displaying them
  • +
  • Handle zooming thumbnails on the fly
  • +
  • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
  • +
  • Loading thumbnails in custom order
  • +
  • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
  • +
  • Manage updating individual thumbnails or their count on the fly
  • +
  • Support showing loading progress
  • +
+

The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

+
Better Thumbnail Browser with Windows 8 Theme

Better Thumbnail Browser with Windows 8 Theme

+

 

+

Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

+
thumbnailBrowser.Path = "c:\\images";
+

And that’s it!

+

Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

+

 

+

 

+]]>
+ http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
+ + Better ListView 2.10 released + http://www.componentowl.com/blog/better-listview-2-10-released/ + http://www.componentowl.com/blog/better-listview-2-10-released/#respond + Fri, 14 Oct 2011 16:57:54 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=373 + + A new version with major improvements, optimizations and fixes has been released! It addresses many suggestions provided by you, our valued customers.

+

Improved Performance

+

We put a considerable effort into optimizing Better ListView 2 to provide advanced features (e.g. hierarchical and multi-line items, collapsible groups) while still being swift and responsive.

+

The overall performance has greatly improved. Better ListView 2.1 can easily handle 10.000 items while still being very fast. The parts where improvements are best seen are:

+
+
    +
  • Adding many items to the list
  • +
  • Expanding/collapsing of hierarchical items
  • +
  • Resizing a column
  • +
+
We also added new options in the Performance property group, so you can easily switch between fast and powerful options.
+
+

Samples in both C# and Visual Basic

+

We added easy to understand samples for both C# and Visual Basic.

+

You can simply follow a link from start menu to open the Visual Studio project for your favourite language, and play with all the features of Better ListView.

+
C# and VB Samples projects in Solution Explorer

C# and VB Samples projects in Solution Explorer

+

 

+

Extended Documentation

+

We added a Quick Start Tutorial to help you with setup, activation and integration of Better ListView in your projects, as well as many entirely new chapters in the documentation.

+

All code samples are from now on provided in both C# and Visual Basic to be easy to understand to both C# and VB.net developers.

+

Smoother migration from .NET ListView to Better ListView

+

Better ListView now contains all the constructor/method overloads and properties of the regular .NET ListView, so that for each member of .NET ListView there is an easily discoverable equivalent in Better ListView.

+]]>
+ http://www.componentowl.com/blog/better-listview-2-10-released/feed/ + 0 +
+ + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

+
Item hierarchy with multi-line items in groups

Item hierarchy with multi-line items in groups

+

Summary of what’s new:

+

We have added four new major features:

+
    +
  • Groups – items can be organized in collapsible groups
  • +
  • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
  • +
  • Multi-Line Items – item texts can break in several lines and each item can have different size
  • +
  • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
  • +
+

Many existing features of Better ListView has been enhanced in favor of these. For example:

+
    +
  • Item reordering can be done with hierarchical items as well; user can even create child items
  • +
  • It is possible to move items between different groups
  • +
+

Some of the minor features added are:

+
    +
  • Layouts can be adjustable – item sizes and spacings, even internal spacings
  • +
  • Added new label editing controls (calendar and drop down box)
  • +
  • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
  • +
  • Multi-line items support added
  • +
  • See full changelog for details
  • +
+

We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

+

About then new version

+

The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

+

Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

+

Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

+

List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

+

Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

+

Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

+
Better ListView 2

Thumbnails in groups

+
DataTable bound to Better ListView

DataTable bound to Better ListView

+

Other news – new comics for developers!

+

We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

+]]>
+ http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
+ + Better ListView 1.52 released + http://www.componentowl.com/blog/better-listview-1-52-released/ + http://www.componentowl.com/blog/better-listview-1-52-released/#respond + Tue, 29 Mar 2011 16:21:14 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=213 + + Another minor release with many fixes and some new features.

+

See what’s new in Better ListView 1.52.

+

Download the new version.

+

We are still working on the new major features (Item hierarchy, groups) as described here. These new features are near completion.

+]]>
+ http://www.componentowl.com/blog/better-listview-1-52-released/feed/ + 0 +
+ + Better ListView 1.50 released + http://www.componentowl.com/blog/better-listview-1-50-released/ + http://www.componentowl.com/blog/better-listview-1-50-released/#respond + Mon, 14 Feb 2011 19:28:55 +0000 + + + + http://www.componentowl.com/blog/?p=119 + + We are happy to announce that we’ve released new version (1.50) of Better ListView.

+

You can just Download Better ListView and install it over your current installation.

+

The changes include:

+
    +
  • New samples and new samples launcher!
  • +
  • Added Thumbnails view
  • +
  • Added support for image borders
  • +
  • Extended owner-drawing capabilities
  • +
  • Extended label editing capabilities
  • +
  • Changed type of BetterListViewDrawColumnHeaderBackgroundEventArgs.ColumnHeaderBounds from Rectangle to BetterListViewColumnHeaderBounds (more options available)
  • +
  • Fixed behaviour of layouts in special cases
  • +
  • Fixed SelectedIndexChanged event raising before Better ListView state has changed
  • +
  • Fixed light borders of downsampled images
  • +
  • Fixed redraw bug when calling some of the RemoveRange() overrides
  • + +]]> + http://www.componentowl.com/blog/better-listview-1-50-released/feed/ + 0 + + + Better ListView reviewed at DevProConnections.com + http://www.componentowl.com/blog/better-listview-reviewed-at-devproconnections-com/ + http://www.componentowl.com/blog/better-listview-reviewed-at-devproconnections-com/#respond + Sat, 05 Feb 2011 13:51:20 +0000 + + + + http://www.componentowl.com/blog/?p=93 + + Our component got recently reviewed by Mike Riley. The review has a very positive tone. Here are some excerpts:

    +

    From the Better ListView review at DevProConnections.com:

    +

    In addition to creating a new ListView control to incorporate broader flexibility and functionality, Better ListView could also be called Fixed ListView, as it corrects a number of annoying problems with the standard ListView that Microsoft delivers to Visual Studio customers. For example, drag and drop and check boxes actually work they way one expects, and column headers and list sorting behave the way they do in the Windows Explorer and other native Windows OS applications. Likewise, improvements that go beyond the standard ListView, such as support for various image sizes and locations (in the column header or subitems, for example) further elevate Better ListView beyond Microsoft’s offering.

    +

    The review also states:

    +

    The control is very easy and intuitive to use and is well documented

    +

    The reviewer found the product obviously immensely helpful:

    +

    The enhancements I found most useful for my own projects were the automatic layout, context menus, improved drag and drop, item searching, and sorting options. Thanks to both the source code–included demos, the online documentation, and the obvious property names of the control’s “better” features, I was able to put the component to use faster than it took me to install the setup package.

    +

    The only negative thing mentioned in the review was our pricing:

    +

    Although I found using the control fast and intuitive, the one aspect that is a downer is the price. Considering that this is the era of .NET component bundles that offer hundreds of components, pricing this single .NET Windows Form control at the price ComponentOwl has is too high for my tastes.

    +

    Let me elaborate on that a bit. Although there are huge component packs for .NET, not a single one of them has a list view like our Better ListView. Most of the list view controls included in “packs” are simply not as powerful, which is only logical. Developers of these packs simply can’t focus their development just on the list view control that much, as they also have other 100 controls to develop and update.

    +

    However, the biggest drawback of list views that are part of a component packages is this: They usually implement their own class names and conventions, but what’s worse, their own custom look and behavior. These list view controls usually do not look and behave like native list view should. They can easily frustrate the user, right during the first few seconds of using them. I think that the first impression is important. So these controls are not easy drop-in replacements, but rather a whole different approach, which may be suited for some projects, but is IMHO inferior for standard Windows desktop applications, as compared to using controls that respect native look and behavior, like our Better ListView does.

    +

    Yes, we are perfectionists.

    +]]>
    + http://www.componentowl.com/blog/better-listview-reviewed-at-devproconnections-com/feed/ + 0 +
    + + Better ListView released + http://www.componentowl.com/blog/better-listview-released/ + http://www.componentowl.com/blog/better-listview-released/#respond + Mon, 03 Jan 2011 12:34:43 +0000 + + + + http://www.componentowl.com/blog/?p=34 + + Welcome to our development blog!

    +

    After a year of hard work, development and testing, we’ve finally released Better ListView.

    +

    You can learn all about it (screenshots, comparison table, download) at Better ListView page.

    +

    This blog will feature not just posts about new releases, but also various useful .NET and programming related topics in general. We are currently busy with the product launch, but interesting posts are coming soon – definitely stay tuned!

    +

    Shall you have any questions, don’t hesitate to contact us.

    +]]>
    + http://www.componentowl.com/blog/better-listview-released/feed/ + 0 +
    + + + + \ No newline at end of file diff --git a/public/blog/category/announcements/index.html b/public/blog/category/announcements/index.html new file mode 100644 index 0000000..2687191 --- /dev/null +++ b/public/blog/category/announcements/index.html @@ -0,0 +1,226 @@ + + + + + + + +Announcements « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + + +

    Archive for the ‘Announcements’ Category

    + + + + + +
    + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/category/better-listview/feed/index.html b/public/blog/category/better-listview/feed/index.html new file mode 100644 index 0000000..f2c97a4 --- /dev/null +++ b/public/blog/category/better-listview/feed/index.html @@ -0,0 +1,525 @@ + + + + Better ListView – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Activation issues and how to solve them + http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/ + http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/#respond + Wed, 01 Mar 2017 17:22:52 +0000 + + + + + http://www.componentowl.com/blog/?p=927 + + Dear Readers,
    +Periodically we get emails from users having problems with the activation. So we put together a check list on how to deal with the most frequent issues. In case these fixes do not help you solve your problem, please contact contact support at support@componentowl.com and we will be happy to help you out.
    +Below, you will find some obstacles we have stumbled across in the past.

    +
      +
    1. Try to rebuild the project/solution
    2. +
    3. Restart Visual Studio if rebuilding the solution did not stop the nag screen
    4. +
    5. If you use Better ListView in a Class Library project, it should be referenced and activated in both, the main project and the Class Library project.
    6. +
    7. Do the main project (executable) and all referenced projects contain the licenses.licx file within the Properties folder? If not, rebuild the main project (executable) and copy the licenses.licx file to the appropriate location in all referenced projects (Class Library or other executables).
    8. +
    9. The licenses.licx file should contain only a single reference to Better ListView with the current version number (e.g. ComponentOwl.BetterListView.BetterListView, BetterListView, Version=3.7.2.0, Culture=neutral, PublicKeyToken=e6c91a3add447be2). If there are more lines referencing Better ListView, remove the obsolete ones. You can also delete the licenses.licx file and rebuild the project to regenerate it.
    10. +
    11. Run the Activator application (installed along with the product) and check if it displays a valid license (license info should be displayed in green).
    12. +
    13. You can try to finish the activation via the Activator app and then rebuild the main project. The Activator allows custom proxy settings for activation from behind a web proxy (often present in corporate environments).
    14. +
    15. Check, if the license-blv.dat file is present in the “C:\ProgramData\Component Owl\” folder after activation. If not, please contact support at support@componentowl.com
    16. +
    17. Check, if your projects reference the same version of Better ListView as the one that is installed. Open the „Reference Properties“ window by right clicking on Better ListView reference in the Solution Explorer. Then check if there is a Specific Version property set to true. If so, remove the reference and add a new reference to Better ListView with the correct version. You can also just set Specific Version property to false.
    18. +
    19. The Better ListView has to be activated on each machine where it is built. Do not copy the license-blv.dat file because this is specific to each machine. Rather follow the activation process on each machine.
    20. +
    +

    We hope these clues can help you, in case you encounter a problem during the activation. As mentioned before, please contact support, if the issues persist.

    +]]>
    + http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/feed/ + 0 +
    + + The Three Main Advantages Better ListView has Over the Classic .NET Framework + http://www.componentowl.com/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/ + http://www.componentowl.com/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/#respond + Thu, 09 Feb 2017 21:51:12 +0000 + + + + http://www.componentowl.com/blog/?p=921 + + Dear Readers,
    +When evaluating an alternative to replace the .NET ListView you might stumble upon the question: what sets the different solutions available apart from each other? Which one meets my demands the best?
    +Here are the three main reasons we think Better ListView is the ideal solution for you if you are planning to use a professional alternative:

    +

    1) The intuitive approach on getting started

    +

    The good thing is, you can get started right away. Due to the build-up of processes, as well as the well documented procedures you have almost no learning period. Component Owl keeps its design close to the original .NET ListView so you do not have to get acquainted to a completely new system. But still, the changes made are substantial enough to make your working routine so much easier. Whether its the inbuilt drag & drop, the sub-item images or the multi-column sorting, the processes are meant to make your life easier.

    +

    2) The fast and helpful support

    +

    As Component Owl has been on the market for quite a while now, it has been further developed and improved countless times, resulting in a detailed and meaningful FAQ which answer to the majority of your questions. In case you cannot find the answer you need, you can rely on our support system which will give you feedback on you request within 24 hours. This allows you to keep the workflow going with almost no interruptions and puts you ahead of the freeware users.

    +

    3) The possibility to customize

    +

    Just like every developer has his own style of working, Component Owl can be customized to every user needs. The many opportunities to adapt your surface to your favorite design or to arrange the necessary tools the way you need them, allows you to optimize your workflow to perform even better.

    +

    These 3 named advantages are just a few of the many that Component Owl offers you. For more infromation just check out our trial version to see for yourself.

    +]]>
    + http://www.componentowl.com/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/feed/ + 0 +
    + + BLV and Internet Explorer + http://www.componentowl.com/blog/blv-and-internet-explorer/ + http://www.componentowl.com/blog/blv-and-internet-explorer/#respond + Sun, 13 Nov 2016 22:37:47 +0000 + + + + + http://www.componentowl.com/blog/?p=914 + + As you all know we are constantly working on improving BetterListView, but once in a while you might encounter a problem which has not found its way to our documentation yet.

    +

    Today, our blog post covers an interesting case when using Internet Explorer.
    +When instantiating an ActiveX control written as a .NET assembly exposed via Interop you might get the following message:

    +

    System.IO.FileNotFoundException("Could not load file or assembly 'BetterListView, Version=3.8.2.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx' or one of its dependencies. The system cannot find the file specified.")

    +

    The solution to this problem is a fairly simple one, quoting from an MSDN article:
    +“… you can install it in the global assembly cache so that it can be activated from any COM client. If the assembly is only going to be activated by a single application, you can place it in that application’s directory.”

    +

    Concluding from this short excerpt, you are basically left you with two options:
    +1) You may register BetterListView in GAC if it is to be shared. But you should be careful with GAC because it allows holding multiple versions of the same assembly. You can make the installer remove any older versions from GAC during installation and add/keep just the newest one.
    +2) You can put your .net assembly with all third-party DLLs in one directory during installation if it is to be private.

    +

    We recommend the second solution as we reckon it to be the safer one.

    +]]>
    + http://www.componentowl.com/blog/blv-and-internet-explorer/feed/ + 0 +
    + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    + + How to Add Grid Lines in Empty Space in Better ListView + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/#respond + Wed, 30 Apr 2014 09:51:46 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=894 + + Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    +]]>
    + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/ + 0 +
    + + Alternating Rows in Better ListView + http://www.componentowl.com/blog/alternating-rows-in-better-listview/ + http://www.componentowl.com/blog/alternating-rows-in-better-listview/#respond + Tue, 22 Apr 2014 22:38:15 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=888 + + Alternating Rows

    Alternating Rows

    +

    Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.

    +

    Simply add DrawItemBackground event handler and fill background on odd/even items:

    +

     

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    + if ((eventArgs.Item.Index & 1) == 1)
    + {
    + eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
    + }
    +}
    +[/csharp]

    +]]>
    + http://www.componentowl.com/blog/alternating-rows-in-better-listview/feed/ + 0 +
    + + Search Filtering in Better ListView + http://www.componentowl.com/blog/search-filtering-in-better-listview/ + http://www.componentowl.com/blog/search-filtering-in-better-listview/#comments + Mon, 03 Feb 2014 14:58:30 +0000 + + + + + http://www.componentowl.com/blog/?p=882 + + Search Filtering

    Search Filtering with highlight

    +

    There are few ways of making searching in large list of items more convenient. For example, Better ListView provides Search Highlighting and Item Hiding features that can be used to improve searching. The above animation shows both of these features in action when searching for a word “pear” using keyboard.

    +

    The implementation is very simple and involves handling just two events: ItemSearch (raised whenever item is searched, e.g. using keyboard ) and KeyDown:

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new BetterListView();

    +

    listView.Items.AddRange(new[] { “apple”, “pear”, “pineapple”, “orange”, “grapefruit”, “cherry”, “avocado” });

    +

    listView.ItemSearch += listView_ItemSearch;
    +listView.KeyDown += listView_KeyDown;
    +[/csharp]

    +

    The ItemSearch event handler finds matching items and sets their visibility accordingly. It also updates the highlighting:

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_ItemSearch(object sender, BetterListViewItemSearchEventArgs eventArgs)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    // update item visibility according to search query string
    + foreach (var item in listView.Items)
    + {
    + bool match = item.Text.Contains(eventArgs.QueryString);

    +

    if (match)
    + {
    + item.Visible = true;

    +

    item.SearchHighlight = new BetterListViewSearchHighlight(
    + 0,
    + item.Text.IndexOf(eventArgs.QueryString, StringComparison.Ordinal),
    + eventArgs.QueryString.Length);
    + }
    + else
    + {
    + item.Visible = false;
    + }
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Finally, the KeyDown event handler resets the view when Escape key is pressed (all items are made visible and the highlight is removed):

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_KeyDown(object sender, KeyEventArgs e)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (e.KeyCode == Keys.Escape)
    + {
    + // remove search highlight
    + //NOTE: we could use BetterListView.RemoveSearchHighlight() but this applies to visible items only and some items are hidden at the time
    + foreach (var item in listView.Items)
    + {
    + item.SearchHighlight = BetterListViewSearchHighlight.Empty;
    + }

    +

    // make all items visible
    + foreach (var item in listView.Items)
    + {
    + item.Visible = true;
    + }

    +

    // mark the key as handled
    + e.Handled = true;

    +

    // suppress KeyPress event to prevent ItemSearch from happening
    + e.SuppressKeyPress = true;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    And that’s it!

    +]]>
    + http://www.componentowl.com/blog/search-filtering-in-better-listview/feed/ + 2 +
    + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/category/better-listview/index.html b/public/blog/category/better-listview/index.html new file mode 100644 index 0000000..5c738f8 --- /dev/null +++ b/public/blog/category/better-listview/index.html @@ -0,0 +1,298 @@ + + + + + + + +Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + + +

    Archive for the ‘Better ListView’ Category

    + + + + + +
    + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/category/components/feed/index.html b/public/blog/category/components/feed/index.html new file mode 100644 index 0000000..bd39381 --- /dev/null +++ b/public/blog/category/components/feed/index.html @@ -0,0 +1,739 @@ + + + + Components – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Activation issues and how to solve them + http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/ + http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/#respond + Wed, 01 Mar 2017 17:22:52 +0000 + + + + + http://www.componentowl.com/blog/?p=927 + + Dear Readers,
    +Periodically we get emails from users having problems with the activation. So we put together a check list on how to deal with the most frequent issues. In case these fixes do not help you solve your problem, please contact contact support at support@componentowl.com and we will be happy to help you out.
    +Below, you will find some obstacles we have stumbled across in the past.

    +
      +
    1. Try to rebuild the project/solution
    2. +
    3. Restart Visual Studio if rebuilding the solution did not stop the nag screen
    4. +
    5. If you use Better ListView in a Class Library project, it should be referenced and activated in both, the main project and the Class Library project.
    6. +
    7. Do the main project (executable) and all referenced projects contain the licenses.licx file within the Properties folder? If not, rebuild the main project (executable) and copy the licenses.licx file to the appropriate location in all referenced projects (Class Library or other executables).
    8. +
    9. The licenses.licx file should contain only a single reference to Better ListView with the current version number (e.g. ComponentOwl.BetterListView.BetterListView, BetterListView, Version=3.7.2.0, Culture=neutral, PublicKeyToken=e6c91a3add447be2). If there are more lines referencing Better ListView, remove the obsolete ones. You can also delete the licenses.licx file and rebuild the project to regenerate it.
    10. +
    11. Run the Activator application (installed along with the product) and check if it displays a valid license (license info should be displayed in green).
    12. +
    13. You can try to finish the activation via the Activator app and then rebuild the main project. The Activator allows custom proxy settings for activation from behind a web proxy (often present in corporate environments).
    14. +
    15. Check, if the license-blv.dat file is present in the “C:\ProgramData\Component Owl\” folder after activation. If not, please contact support at support@componentowl.com
    16. +
    17. Check, if your projects reference the same version of Better ListView as the one that is installed. Open the „Reference Properties“ window by right clicking on Better ListView reference in the Solution Explorer. Then check if there is a Specific Version property set to true. If so, remove the reference and add a new reference to Better ListView with the correct version. You can also just set Specific Version property to false.
    18. +
    19. The Better ListView has to be activated on each machine where it is built. Do not copy the license-blv.dat file because this is specific to each machine. Rather follow the activation process on each machine.
    20. +
    +

    We hope these clues can help you, in case you encounter a problem during the activation. As mentioned before, please contact support, if the issues persist.

    +]]>
    + http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/feed/ + 0 +
    + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    + + How to Store Better ListView Content in a String (User Request) + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/ + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/#respond + Sat, 04 Aug 2012 00:03:49 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=796 + + Is it possible to store entire Better ListView content (items with hierarchy and sub-items, columns and groups) in a single string?

    +

    Better ListView already supports saving and loading its content using SaveContent and LoadContent methods. These methods support either XML or binary format.

    +

    I chose binary format for storing data in string  because it is more compact than XML. Binary representation (basically an array of bytes) can be converted to Base64 string. Loading the content from string work similarly, the steps are performed in opposite direction:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +// SAVE
    +// create MemoryStream to hold binary data
    +MemoryStream stream = new MemoryStream();
    +// store Better ListView content in memory stream
    +this.listView.SaveContentBinary(stream);
    +// copy content of MemoryStream to byte array
    +byte[] contentBinary = new byte[stream.Length];
    +stream.Seek(0, SeekOrigin.Begin);
    +// convert byte array to Base64 string
    +stream.Read(contentBinary, 0, (int)stream.Length); // move to beginning of the stream
    +string contentStringBase64 = Convert.ToBase64String(contentBinary);
    +// close stream
    +stream.Close();
    +stream.Dispose();

    +

    // CLEAR
    +this.listView.Clear();

    +

    // LOAD
    +// create MemoryStream to hold binary data
    +stream = new MemoryStream();
    +// convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64);
    +// write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length);
    +stream.Seek(0, SeekOrigin.Begin); // move to beginning of the stream
    +// load content of Better ListView from memory stream
    +this.listView.LoadContentBinary(stream);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +‘ SAVE
    +‘ create MemoryStream to hold binary data
    +Dim stream As New MemoryStream()
    +‘ store Better ListView content in memory stream
    +Me.listView.SaveContentBinary(stream)
    +‘ copy content of MemoryStream to byte array
    +Dim contentBinary As Byte() = New Byte(stream.Length – 1) {}
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ convert byte array to Base64 string
    +stream.Read(contentBinary, 0, CInt(stream.Length))
    +‘ move to beginning of the stream
    +Dim contentStringBase64 As String = Convert.ToBase64String(contentBinary)
    +‘ close stream
    +stream.Close()
    +stream.Dispose()

    +

    ‘ CLEAR
    +Me.listView.Clear()

    +

    ‘ LOAD
    +‘ create MemoryStream to hold binary data
    +stream = New MemoryStream()
    +‘ convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64)
    +‘ write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length)
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ move to beginning of the stream
    +‘ load content of Better ListView from memory stream
    +Me.listView.LoadContentBinary(stream)
    +[/vb]

    +

     

    +

    Although saving and loading data this way is convenient, please consider the following drawback:

    +
      +
    • Standard serialization mechanism of .NET is used for converting classes and structures to XML or binary representation – hence the serialized data may not be possible to deserialize on different version of Better ListView if any public members of the serialized class have been changed.
    • +
    • The generated string is very long (few kilobytes for just two items).
    • +
    • Lots of data are stored which are not related to content itself (e.g. item colors).
    • +
    • The serialized representation is considered read-only – any changes can cause problems with deserialization; if you really want flexible way of storing ListView content, consider building a model or data layer that supports storing the data you need the way you need.
    • +
    +

    On the other hand, using this way may be convenient when you want to transfer or copy ListView content between controls on even across application domain (Better ListView itself uses this mechanism to allow Drag and Drop between two applications – this “tour de force” kind of Drag and Drop is not avaiable in regular .NET ListView).

    +]]>
    + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/feed/ + 0 +
    + + File Explorer with Better ListView + http://www.componentowl.com/blog/file-explorer-with-better-listview/ + http://www.componentowl.com/blog/file-explorer-with-better-listview/#respond + Tue, 09 Aug 2011 16:04:31 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=340 + + In release 2.0.2 we added a sample demonstrating how Better ListView can be used to construct folder tree and file browser to make a standalone file explorer:

    +

    File Explorer Sample

    +

    There are two controls derived from BetterListView. One for the navigation pane (folder tree on left side) and one for the file view (on the right side).

    +

    The FolderListView control allows browsing through virtual folders as well as folders on removable drives. We needed this control in our products because .NET does not provide any similar managed control (there is only FolderBrowserDialog, but we actually need a control).

    +

    You can use it for your purposes as well, it is available in Better ListView Samples source code.

    +

    Many features of Better ListView can be used to enhance file browsing, for example:

    +
      +
    • Drag and Drop – moving or copying files
    • +
    • Label Edit – renaming files
    • +
    • Thumbnails – display thumbnails of image files
    • +
    • Custom Tooltips – display extra information on each file item
    • +
    • Groups – organize files into groups (e.g. by size)
    • +
    • Check Boxes – select folders and sub-folders properly with three-state check boxes
    • +
    • Images – every file type could display different image (extracted icon)
    • +
    • Context Menus – do extra operations with files, like displaying file properties
    • +
    • Searching – doing keyboard search is very easy to search for some file
    • +
    • Sorting – sort files according to multiple properties (this is demonstrated in the sample)
    • +
    • Background Image – show that the user is located in special folder by ambient image on the background
    • +
    +]]>
    + http://www.componentowl.com/blog/file-explorer-with-better-listview/feed/ + 0 +
    + + Synergy of Better ListView and Our Applications + http://www.componentowl.com/blog/synergy-of-better-listview-and-our-applications/ + http://www.componentowl.com/blog/synergy-of-better-listview-and-our-applications/#respond + Thu, 27 Jan 2011 19:33:12 +0000 + + + + http://www.componentowl.com/blog/?p=40 + + When developing sofware application, a custom component of some non-trivial scale is sometimes needed. Complex components are often created in companies as internal, single-purpose projects and never see wider public. This would be the case with our custom ListView component, but its scale and versability convinced us to made it available for others. You can read the story behind, or just take a look on how exactly we use it.

    +

    We at Dextronet are developing several desktop applications, which benefits from custom components. Our flagship product Swift To-Do List and ImagingShop (yet in the docks) both needed a serious visual component for major part of its client area. Look at screenshots of these applications:

    + + + + + + + +
    Swift To-Do ListImagingShop
    +

    It may not be noticeable where the ListView-like component is, so there is the highlighted version:

    + + + + + + + +
    Swift To-Do ListImagingShop
    +

    These parts look very different, as the applications have different purpose. One is a task management/sheduling software, and the second is a photo management/editing software.

    +

    In the first case, we have to deal with specific requirements like multi-column sorting, cell highlighting, item reordering and of course many, many more

    +

    In the second case, photo application required display of arbitrarily-sized thumbnails, custom tooltips and multi-line captions.

    +

    It was apparent, that the .NET ListView is not able to fullfill all of these requirements even if we bend and customize it to the limit. ListView is also a visual component of long history dating back to the earliest versions of Microsoft Windows. During its lifetime, it grabbed problematic stuff, that have to be kept for backward compatibility.

    +

    And the .NET ListView is a wrapper around all this. It contains hacks and workarounds to make it work more properly. Even with all that, try to display a backround watermark image while retaining Vista visual style. Impossible.

    +

    So we designed a control that lacks all the bugs and drawbacks of the .NET ListView while containing all the sweet features. It was ready to use for our needs.

    +

    But it has some 40 K lines of code and aspiring to be itself a product. We decided to develop Better ListView as a commercialy available component at the very beginning of its development.

    +

    We agreed on this kind of win-win-win strategy (for the end-user, for customer-developer, and for us) and hope all will benefit from maintaining a better Better ListView :-)

    +]]>
    + http://www.componentowl.com/blog/synergy-of-better-listview-and-our-applications/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/category/components/index.html b/public/blog/category/components/index.html new file mode 100644 index 0000000..12b18cb --- /dev/null +++ b/public/blog/category/components/index.html @@ -0,0 +1,228 @@ + + + + + + + +Components « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/category/programming/feed/index.html b/public/blog/category/programming/feed/index.html new file mode 100644 index 0000000..ab20a24 --- /dev/null +++ b/public/blog/category/programming/feed/index.html @@ -0,0 +1,178 @@ + + + + Programming – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + BLV and Internet Explorer + http://www.componentowl.com/blog/blv-and-internet-explorer/ + http://www.componentowl.com/blog/blv-and-internet-explorer/#respond + Sun, 13 Nov 2016 22:37:47 +0000 + + + + + http://www.componentowl.com/blog/?p=914 + + As you all know we are constantly working on improving BetterListView, but once in a while you might encounter a problem which has not found its way to our documentation yet.

    +

    Today, our blog post covers an interesting case when using Internet Explorer.
    +When instantiating an ActiveX control written as a .NET assembly exposed via Interop you might get the following message:

    +

    System.IO.FileNotFoundException("Could not load file or assembly 'BetterListView, Version=3.8.2.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx' or one of its dependencies. The system cannot find the file specified.")

    +

    The solution to this problem is a fairly simple one, quoting from an MSDN article:
    +“… you can install it in the global assembly cache so that it can be activated from any COM client. If the assembly is only going to be activated by a single application, you can place it in that application’s directory.”

    +

    Concluding from this short excerpt, you are basically left you with two options:
    +1) You may register BetterListView in GAC if it is to be shared. But you should be careful with GAC because it allows holding multiple versions of the same assembly. You can make the installer remove any older versions from GAC during installation and add/keep just the newest one.
    +2) You can put your .net assembly with all third-party DLLs in one directory during installation if it is to be private.

    +

    We recommend the second solution as we reckon it to be the safer one.

    +]]>
    + http://www.componentowl.com/blog/blv-and-internet-explorer/feed/ + 0 +
    + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/category/programming/index.html b/public/blog/category/programming/index.html new file mode 100644 index 0000000..3a78378 --- /dev/null +++ b/public/blog/category/programming/index.html @@ -0,0 +1,214 @@ + + + + + + + +Programming « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/category/tutorials/feed/index.html b/public/blog/category/tutorials/feed/index.html new file mode 100644 index 0000000..316b314 --- /dev/null +++ b/public/blog/category/tutorials/feed/index.html @@ -0,0 +1,897 @@ + + + + Tutorials – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    + + How to Add Grid Lines in Empty Space in Better ListView + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/#respond + Wed, 30 Apr 2014 09:51:46 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=894 + + Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    +]]>
    + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/ + 0 +
    + + Alternating Rows in Better ListView + http://www.componentowl.com/blog/alternating-rows-in-better-listview/ + http://www.componentowl.com/blog/alternating-rows-in-better-listview/#respond + Tue, 22 Apr 2014 22:38:15 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=888 + + Alternating Rows

    Alternating Rows

    +

    Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.

    +

    Simply add DrawItemBackground event handler and fill background on odd/even items:

    +

     

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    + if ((eventArgs.Item.Index & 1) == 1)
    + {
    + eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
    + }
    +}
    +[/csharp]

    +]]>
    + http://www.componentowl.com/blog/alternating-rows-in-better-listview/feed/ + 0 +
    + + Search Filtering in Better ListView + http://www.componentowl.com/blog/search-filtering-in-better-listview/ + http://www.componentowl.com/blog/search-filtering-in-better-listview/#comments + Mon, 03 Feb 2014 14:58:30 +0000 + + + + + http://www.componentowl.com/blog/?p=882 + + Search Filtering

    Search Filtering with highlight

    +

    There are few ways of making searching in large list of items more convenient. For example, Better ListView provides Search Highlighting and Item Hiding features that can be used to improve searching. The above animation shows both of these features in action when searching for a word “pear” using keyboard.

    +

    The implementation is very simple and involves handling just two events: ItemSearch (raised whenever item is searched, e.g. using keyboard ) and KeyDown:

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new BetterListView();

    +

    listView.Items.AddRange(new[] { “apple”, “pear”, “pineapple”, “orange”, “grapefruit”, “cherry”, “avocado” });

    +

    listView.ItemSearch += listView_ItemSearch;
    +listView.KeyDown += listView_KeyDown;
    +[/csharp]

    +

    The ItemSearch event handler finds matching items and sets their visibility accordingly. It also updates the highlighting:

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_ItemSearch(object sender, BetterListViewItemSearchEventArgs eventArgs)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    // update item visibility according to search query string
    + foreach (var item in listView.Items)
    + {
    + bool match = item.Text.Contains(eventArgs.QueryString);

    +

    if (match)
    + {
    + item.Visible = true;

    +

    item.SearchHighlight = new BetterListViewSearchHighlight(
    + 0,
    + item.Text.IndexOf(eventArgs.QueryString, StringComparison.Ordinal),
    + eventArgs.QueryString.Length);
    + }
    + else
    + {
    + item.Visible = false;
    + }
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Finally, the KeyDown event handler resets the view when Escape key is pressed (all items are made visible and the highlight is removed):

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_KeyDown(object sender, KeyEventArgs e)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (e.KeyCode == Keys.Escape)
    + {
    + // remove search highlight
    + //NOTE: we could use BetterListView.RemoveSearchHighlight() but this applies to visible items only and some items are hidden at the time
    + foreach (var item in listView.Items)
    + {
    + item.SearchHighlight = BetterListViewSearchHighlight.Empty;
    + }

    +

    // make all items visible
    + foreach (var item in listView.Items)
    + {
    + item.Visible = true;
    + }

    +

    // mark the key as handled
    + e.Handled = true;

    +

    // suppress KeyPress event to prevent ItemSearch from happening
    + e.SuppressKeyPress = true;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    And that’s it!

    +]]>
    + http://www.componentowl.com/blog/search-filtering-in-better-listview/feed/ + 2 +
    + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/category/tutorials/index.html b/public/blog/category/tutorials/index.html new file mode 100644 index 0000000..c8c9259 --- /dev/null +++ b/public/blog/category/tutorials/index.html @@ -0,0 +1,248 @@ + + + + + + + +Tutorials « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/centering-images-in-better-listview-sub-items/feed/index.html b/public/blog/centering-images-in-better-listview-sub-items/feed/index.html new file mode 100644 index 0000000..cc3eebe --- /dev/null +++ b/public/blog/centering-images-in-better-listview-sub-items/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Centering Images in Better ListView Sub-items + + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/combined-items-in-better-listview/feed/index.html b/public/blog/combined-items-in-better-listview/feed/index.html new file mode 100644 index 0000000..8b53f1d --- /dev/null +++ b/public/blog/combined-items-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Combined Items in Better ListView + + http://www.componentowl.com/blog/combined-items-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/coming-soon-better-listview-2-1-optimized-for-performance/feed/index.html b/public/blog/coming-soon-better-listview-2-1-optimized-for-performance/feed/index.html new file mode 100644 index 0000000..a492b8e --- /dev/null +++ b/public/blog/coming-soon-better-listview-2-1-optimized-for-performance/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Coming soon: Better ListView 2.1 Optimized for Performance + + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/comments/feed/index.html b/public/blog/comments/feed/index.html new file mode 100644 index 0000000..a09240a --- /dev/null +++ b/public/blog/comments/feed/index.html @@ -0,0 +1,126 @@ + + + Comments for Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Comment on Are You a Zen Coder or Distraction-Junkie? by Coding Dojo Day 1 | Invoke Interests + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comment-1397 + + Thu, 02 Apr 2015 07:58:08 +0000 + http://www.componentowl.com/blog/?p=664#comment-1397 + + […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

    +]]>
    +
    + + Comment on Search Filtering in Better ListView by Libor Tinka + http://www.componentowl.com/blog/search-filtering-in-better-listview/#comment-1369 + + Sun, 06 Jul 2014 21:38:54 +0000 + http://www.componentowl.com/blog/?p=882#comment-1369 + + Yes, this feature is also available in Express version.

    +]]>
    +
    + + Comment on Are You a Zen Coder or Distraction-Junkie? by Foobar + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comment-1365 + + Fri, 06 Jun 2014 09:30:12 +0000 + http://www.componentowl.com/blog/?p=664#comment-1365 + + and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

    +]]>
    +
    + + Comment on Search Filtering in Better ListView by mustafa salah + http://www.componentowl.com/blog/search-filtering-in-better-listview/#comment-1353 + + Sat, 03 May 2014 14:52:37 +0000 + http://www.componentowl.com/blog/?p=882#comment-1353 + + Is this applicable for Express version?

    +]]>
    +
    + + Comment on Custom Scroll Bar Size in Better ListView by Libor Tinka + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comment-1346 + + Mon, 03 Feb 2014 14:39:00 +0000 + http://www.componentowl.com/blog/?p=878#comment-1346 + + Height of any element in Better ListView can be changed.

    +]]>
    +
    + + Comment on Custom Scroll Bar Size in Better ListView by Libor Tinka + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comment-1345 + + Mon, 03 Feb 2014 14:38:25 +0000 + http://www.componentowl.com/blog/?p=878#comment-1345 + + You can do that with CustomHeight propety (see the Support/Documentation).

    +]]>
    +
    + + Comment on Custom Scroll Bar Size in Better ListView by Dan + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comment-1344 + + Fri, 31 Jan 2014 15:27:23 +0000 + http://www.componentowl.com/blog/?p=878#comment-1344 + + Can you change the button height as this would make it a great option for touch screen apps.

    +]]>
    +
    + + Comment on Custom Scroll Bar Size in Better ListView by brokey + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comment-1340 + + Wed, 27 Nov 2013 09:46:21 +0000 + http://www.componentowl.com/blog/?p=878#comment-1340 + + Change size of ListView items

    +]]>
    +
    + + Comment on Enabling Search Highlight in Better ListView by Camiel Hessels + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comment-1290 + + Mon, 28 Jan 2013 19:54:49 +0000 + http://www.componentowl.com/blog/?p=843#comment-1290 + + Awesome, just what I need! Thanks!

    +]]>
    +
    + + Comment on Better Thumbnail Browser Component Released by Nathaniel Wise + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comment-1289 + + Wed, 23 Jan 2013 09:20:46 +0000 + http://www.componentowl.com/blog/?p=823#comment-1289 + + this is one useful for the example and overviews.in my website i m not used this type of functionality but this is something good component.

    +]]>
    +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/custom-behavior-of-group-headers-in-better-listview/feed/index.html b/public/blog/custom-behavior-of-group-headers-in-better-listview/feed/index.html new file mode 100644 index 0000000..b46127a --- /dev/null +++ b/public/blog/custom-behavior-of-group-headers-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Custom Behavior of Group Headers in Better ListView + + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/custom-item-height-in-details-view-of-better-listview/feed/index.html b/public/blog/custom-item-height-in-details-view-of-better-listview/feed/index.html new file mode 100644 index 0000000..5b6ea4f --- /dev/null +++ b/public/blog/custom-item-height-in-details-view-of-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Custom Item Height in Details View of Better ListView + + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/index.html b/public/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/index.html new file mode 100644 index 0000000..75a9eec --- /dev/null +++ b/public/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Custom label edit: How to rename file names without extension in Better ListView + + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/custom-scroll-bar-size-in-better-listview/feed/index.html b/public/blog/custom-scroll-bar-size-in-better-listview/feed/index.html new file mode 100644 index 0000000..8a2f1ea --- /dev/null +++ b/public/blog/custom-scroll-bar-size-in-better-listview/feed/index.html @@ -0,0 +1,66 @@ + + + Comments on: Custom Scroll Bar Size in Better ListView + + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + By: Libor Tinka + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comment-1346 + + Mon, 03 Feb 2014 14:39:00 +0000 + http://www.componentowl.com/blog/?p=878#comment-1346 + + Height of any element in Better ListView can be changed.

    +]]>
    +
    + + By: Libor Tinka + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comment-1345 + + Mon, 03 Feb 2014 14:38:25 +0000 + http://www.componentowl.com/blog/?p=878#comment-1345 + + You can do that with CustomHeight propety (see the Support/Documentation).

    +]]>
    +
    + + By: Dan + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comment-1344 + + Fri, 31 Jan 2014 15:27:23 +0000 + http://www.componentowl.com/blog/?p=878#comment-1344 + + Can you change the button height as this would make it a great option for touch screen apps.

    +]]>
    +
    + + By: brokey + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comment-1340 + + Wed, 27 Nov 2013 09:46:21 +0000 + http://www.componentowl.com/blog/?p=878#comment-1340 + + Change size of ListView items

    +]]>
    +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/custom-scroll-bar-size-in-better-listview/index.html?replytocom=1340.html b/public/blog/custom-scroll-bar-size-in-better-listview/index.html?replytocom=1340.html new file mode 100644 index 0000000..b64a8d7 --- /dev/null +++ b/public/blog/custom-scroll-bar-size-in-better-listview/index.html?replytocom=1340.html @@ -0,0 +1,345 @@ + + + + + + + +Custom Scroll Bar Size in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Custom Scroll Bar Size in Better ListView

    + + + +
    +
    Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    + +
    + + + + +
    + + + + + +

    4 Responses to “Custom Scroll Bar Size in Better ListView”

    + +
      +
    1. + + +
    2. +
    3. +
      +
      + Dan says:
      + + + +

      Can you change the button height as this would make it a great option for touch screen apps.

      + + +
      + +
    4. +
    + + + + + +
    + +

    Leave a Reply to brokey

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/custom-scroll-bar-size-in-better-listview/index.html?replytocom=1344.html b/public/blog/custom-scroll-bar-size-in-better-listview/index.html?replytocom=1344.html new file mode 100644 index 0000000..f20b5c9 --- /dev/null +++ b/public/blog/custom-scroll-bar-size-in-better-listview/index.html?replytocom=1344.html @@ -0,0 +1,345 @@ + + + + + + + +Custom Scroll Bar Size in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Custom Scroll Bar Size in Better ListView

    + + + +
    +
    Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    + +
    + + + + +
    + + + + + +

    4 Responses to “Custom Scroll Bar Size in Better ListView”

    + +
      +
    1. + + +
    2. +
    3. +
      +
      + Dan says:
      + + + +

      Can you change the button height as this would make it a great option for touch screen apps.

      + + +
      + +
    4. +
    + + + + + +
    + +

    Leave a Reply to Dan

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/custom-scroll-bar-size-in-better-listview/index.html?replytocom=1345.html b/public/blog/custom-scroll-bar-size-in-better-listview/index.html?replytocom=1345.html new file mode 100644 index 0000000..0311e7c --- /dev/null +++ b/public/blog/custom-scroll-bar-size-in-better-listview/index.html?replytocom=1345.html @@ -0,0 +1,345 @@ + + + + + + + +Custom Scroll Bar Size in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Custom Scroll Bar Size in Better ListView

    + + + +
    +
    Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    + +
    + + + + +
    + + + + + +

    4 Responses to “Custom Scroll Bar Size in Better ListView”

    + +
      +
    1. + + +
    2. +
    3. +
      +
      + Dan says:
      + + + +

      Can you change the button height as this would make it a great option for touch screen apps.

      + + +
      + +
    4. +
    + + + + + +
    + +

    Leave a Reply to Libor Tinka

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/custom-scroll-bar-size-in-better-listview/index.html?replytocom=1346.html b/public/blog/custom-scroll-bar-size-in-better-listview/index.html?replytocom=1346.html new file mode 100644 index 0000000..cd6fef4 --- /dev/null +++ b/public/blog/custom-scroll-bar-size-in-better-listview/index.html?replytocom=1346.html @@ -0,0 +1,345 @@ + + + + + + + +Custom Scroll Bar Size in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Custom Scroll Bar Size in Better ListView

    + + + +
    +
    Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    + +
    + + + + +
    + + + + + +

    4 Responses to “Custom Scroll Bar Size in Better ListView”

    + +
      +
    1. + + +
    2. +
    3. +
      +
      + Dan says:
      + + + +

      Can you change the button height as this would make it a great option for touch screen apps.

      + + +
      + +
    4. +
    + + + + + +
    + +

    Leave a Reply to Libor Tinka

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/custom-spacing-between-items-in-details-view/feed/index.html b/public/blog/custom-spacing-between-items-in-details-view/feed/index.html new file mode 100644 index 0000000..203a328 --- /dev/null +++ b/public/blog/custom-spacing-between-items-in-details-view/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Custom Spacing between Items in Details View + + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/feed/index.html b/public/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/feed/index.html new file mode 100644 index 0000000..17e4aea --- /dev/null +++ b/public/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/feed/index.html @@ -0,0 +1,57 @@ + + + Comments on: Customize Label Editing (Embedded) Control for Each Line in Better ListView + + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + By: Libor Tinka + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/#comment-1281 + + Wed, 25 Apr 2012 13:57:20 +0000 + http://www.componentowl.com/blog/?p=771#comment-1281 + + Thanks for noticing… I have corrected it.

    +]]>
    +
    + + By: Göran + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/#comment-1280 + + Wed, 25 Apr 2012 10:53:17 +0000 + http://www.componentowl.com/blog/?p=771#comment-1280 + + There is a tiny error in the VB code below “‘ show my custom control on the third row”.
    +The index should be “2”, not “0”.

    +

    :-)

    +

    Thanks for a great product and for a great and humorous site!

    +

    /G

    +]]>
    +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/index.html?replytocom=1280.html b/public/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/index.html?replytocom=1280.html new file mode 100644 index 0000000..424fd12 --- /dev/null +++ b/public/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/index.html?replytocom=1280.html @@ -0,0 +1,364 @@ + + + + + + + +Customize Label Editing (Embedded) Control for Each Line in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Customize Label Editing (Embedded) Control for Each Line in Better ListView

    + + + +
    +

    Embedded controls for label edit in Better ListView can be customized not only for every column, but even for every row.

    +

    This is not a new feature, but would be nice to mention that you can possibly have a different custom editing control for every cell…

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +{
    + // show editing controls in the second column
    + if (eventArgs.SubItem.Index == 1)
    + {
    + // show my custom control on the first row
    + if (eventArgs.SubItem.Item.Index == 0)
    + {
    + return (new DocumentAccessConrol());
    + }

    +

    // show my custom control on the second row
    + if (eventArgs.SubItem.Item.Index == 1)
    + {
    + return (new BetterListViewComboBoxEmbeddedControl());
    + }

    +

    // show my custom control on the third row
    + if (eventArgs.SubItem.Item.Index == 2)
    + {
    + return (new BetterListViewTextBoxEmbeddedControl());
    + }
    + }

    +

    return null;
    +}
    +[/csharp]

    +

     

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Function ListViewRequestEmbeddedControl(ByVal sender As Object, ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    + As IBetterListViewEmbeddedControl

    +

    ‘ show editing controls in the second column
    + If eventArgs.SubItem.Index = 1 Then

    +

    ‘ show my custom control on the first row
    + If eventArgs.SubItem.Item.Index = 0 Then
    + Return (New DocumentAccessConrol())
    + End If

    +

    ‘ show my custom control on the second row
    + If eventArgs.SubItem.Item.Index = 1 Then
    + Return (New BetterListViewComboBoxEmbeddedControl())
    + End If

    +

    ‘ show my custom control on the third row
    + If eventArgs.SubItem.Item.Index = 2 Then
    + Return (New BetterListViewTextBoxEmbeddedControl())
    + End If

    +

    End If

    +

    Return Nothing

    +

    End Function
    +[/vb]

    +

     

    +

    And there is the result:

    +
    Custom Embedded Control on the First Line

    Custom Embedded Control on the First Line

    +

     

    +
    TextBox Control on the Third Line

    TextBox Control on the Third Line

    + +
    + + + + +
    + + + + + +

    2 Responses to “Customize Label Editing (Embedded) Control for Each Line in Better ListView”

    + +
      +
    1. +
      +
      + Göran says:
      + + + +

      There is a tiny error in the VB code below “‘ show my custom control on the third row”.
      +The index should be “2”, not “0”.

      +

      :-)

      +

      Thanks for a great product and for a great and humorous site!

      +

      /G

      + + +
      + +
    2. +
    + + + + + +
    + +

    Leave a Reply to Göran

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/index.html?replytocom=1281.html b/public/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/index.html?replytocom=1281.html new file mode 100644 index 0000000..e934b25 --- /dev/null +++ b/public/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/index.html?replytocom=1281.html @@ -0,0 +1,364 @@ + + + + + + + +Customize Label Editing (Embedded) Control for Each Line in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Customize Label Editing (Embedded) Control for Each Line in Better ListView

    + + + +
    +

    Embedded controls for label edit in Better ListView can be customized not only for every column, but even for every row.

    +

    This is not a new feature, but would be nice to mention that you can possibly have a different custom editing control for every cell…

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +{
    + // show editing controls in the second column
    + if (eventArgs.SubItem.Index == 1)
    + {
    + // show my custom control on the first row
    + if (eventArgs.SubItem.Item.Index == 0)
    + {
    + return (new DocumentAccessConrol());
    + }

    +

    // show my custom control on the second row
    + if (eventArgs.SubItem.Item.Index == 1)
    + {
    + return (new BetterListViewComboBoxEmbeddedControl());
    + }

    +

    // show my custom control on the third row
    + if (eventArgs.SubItem.Item.Index == 2)
    + {
    + return (new BetterListViewTextBoxEmbeddedControl());
    + }
    + }

    +

    return null;
    +}
    +[/csharp]

    +

     

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Function ListViewRequestEmbeddedControl(ByVal sender As Object, ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    + As IBetterListViewEmbeddedControl

    +

    ‘ show editing controls in the second column
    + If eventArgs.SubItem.Index = 1 Then

    +

    ‘ show my custom control on the first row
    + If eventArgs.SubItem.Item.Index = 0 Then
    + Return (New DocumentAccessConrol())
    + End If

    +

    ‘ show my custom control on the second row
    + If eventArgs.SubItem.Item.Index = 1 Then
    + Return (New BetterListViewComboBoxEmbeddedControl())
    + End If

    +

    ‘ show my custom control on the third row
    + If eventArgs.SubItem.Item.Index = 2 Then
    + Return (New BetterListViewTextBoxEmbeddedControl())
    + End If

    +

    End If

    +

    Return Nothing

    +

    End Function
    +[/vb]

    +

     

    +

    And there is the result:

    +
    Custom Embedded Control on the First Line

    Custom Embedded Control on the First Line

    +

     

    +
    TextBox Control on the Third Line

    TextBox Control on the Third Line

    + +
    + + + + +
    + + + + + +

    2 Responses to “Customize Label Editing (Embedded) Control for Each Line in Better ListView”

    + +
      +
    1. +
      +
      + Göran says:
      + + + +

      There is a tiny error in the VB code below “‘ show my custom control on the third row”.
      +The index should be “2”, not “0”.

      +

      :-)

      +

      Thanks for a great product and for a great and humorous site!

      +

      /G

      + + +
      + +
    2. +
    + + + + + +
    + +

    Leave a Reply to Libor Tinka

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/displaying-thumbnails-withs-borders-and-shadows/feed/index.html b/public/blog/displaying-thumbnails-withs-borders-and-shadows/feed/index.html new file mode 100644 index 0000000..35e2528 --- /dev/null +++ b/public/blog/displaying-thumbnails-withs-borders-and-shadows/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Displaying Thumbnails with Borders and Shadows + + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/displayingmultiline-items-in-listview/feed/index.html b/public/blog/displayingmultiline-items-in-listview/feed/index.html new file mode 100644 index 0000000..4ca3b70 --- /dev/null +++ b/public/blog/displayingmultiline-items-in-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Displaying Multi-Line Text In ListView + + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/enabling-search-highlight-in-better-listview/feed/index.html b/public/blog/enabling-search-highlight-in-better-listview/feed/index.html new file mode 100644 index 0000000..443f874 --- /dev/null +++ b/public/blog/enabling-search-highlight-in-better-listview/feed/index.html @@ -0,0 +1,36 @@ + + + Comments on: Enabling Search Highlight in Better ListView + + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + By: Camiel Hessels + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comment-1290 + + Mon, 28 Jan 2013 19:54:49 +0000 + http://www.componentowl.com/blog/?p=843#comment-1290 + + Awesome, just what I need! Thanks!

    +]]>
    +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/enabling-search-highlight-in-better-listview/index.html?replytocom=1290.html b/public/blog/enabling-search-highlight-in-better-listview/index.html?replytocom=1290.html new file mode 100644 index 0000000..91e3089 --- /dev/null +++ b/public/blog/enabling-search-highlight-in-better-listview/index.html?replytocom=1290.html @@ -0,0 +1,374 @@ + + + + + + + +Enabling Search Highlight in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Enabling Search Highlight in Better ListView

    + + + +
    +

    We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    + +
    + + + + +
    + + + + + +

    One Response to “Enabling Search Highlight in Better ListView”

    + +
      +
    1. +
      +
      + Camiel Hessels says:
      + + + +

      Awesome, just what I need! Thanks!

      + + +
      +
    2. +
    + + + + + +
    + +

    Leave a Reply to Camiel Hessels

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/feed/index.html b/public/blog/feed/index.html new file mode 100644 index 0000000..b8bd45a --- /dev/null +++ b/public/blog/feed/index.html @@ -0,0 +1,525 @@ + + + + Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Activation issues and how to solve them + http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/ + http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/#respond + Wed, 01 Mar 2017 17:22:52 +0000 + + + + + http://www.componentowl.com/blog/?p=927 + + Dear Readers,
    +Periodically we get emails from users having problems with the activation. So we put together a check list on how to deal with the most frequent issues. In case these fixes do not help you solve your problem, please contact contact support at support@componentowl.com and we will be happy to help you out.
    +Below, you will find some obstacles we have stumbled across in the past.

    +
      +
    1. Try to rebuild the project/solution
    2. +
    3. Restart Visual Studio if rebuilding the solution did not stop the nag screen
    4. +
    5. If you use Better ListView in a Class Library project, it should be referenced and activated in both, the main project and the Class Library project.
    6. +
    7. Do the main project (executable) and all referenced projects contain the licenses.licx file within the Properties folder? If not, rebuild the main project (executable) and copy the licenses.licx file to the appropriate location in all referenced projects (Class Library or other executables).
    8. +
    9. The licenses.licx file should contain only a single reference to Better ListView with the current version number (e.g. ComponentOwl.BetterListView.BetterListView, BetterListView, Version=3.7.2.0, Culture=neutral, PublicKeyToken=e6c91a3add447be2). If there are more lines referencing Better ListView, remove the obsolete ones. You can also delete the licenses.licx file and rebuild the project to regenerate it.
    10. +
    11. Run the Activator application (installed along with the product) and check if it displays a valid license (license info should be displayed in green).
    12. +
    13. You can try to finish the activation via the Activator app and then rebuild the main project. The Activator allows custom proxy settings for activation from behind a web proxy (often present in corporate environments).
    14. +
    15. Check, if the license-blv.dat file is present in the “C:\ProgramData\Component Owl\” folder after activation. If not, please contact support at support@componentowl.com
    16. +
    17. Check, if your projects reference the same version of Better ListView as the one that is installed. Open the „Reference Properties“ window by right clicking on Better ListView reference in the Solution Explorer. Then check if there is a Specific Version property set to true. If so, remove the reference and add a new reference to Better ListView with the correct version. You can also just set Specific Version property to false.
    18. +
    19. The Better ListView has to be activated on each machine where it is built. Do not copy the license-blv.dat file because this is specific to each machine. Rather follow the activation process on each machine.
    20. +
    +

    We hope these clues can help you, in case you encounter a problem during the activation. As mentioned before, please contact support, if the issues persist.

    +]]>
    + http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/feed/ + 0 +
    + + The Three Main Advantages Better ListView has Over the Classic .NET Framework + http://www.componentowl.com/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/ + http://www.componentowl.com/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/#respond + Thu, 09 Feb 2017 21:51:12 +0000 + + + + http://www.componentowl.com/blog/?p=921 + + Dear Readers,
    +When evaluating an alternative to replace the .NET ListView you might stumble upon the question: what sets the different solutions available apart from each other? Which one meets my demands the best?
    +Here are the three main reasons we think Better ListView is the ideal solution for you if you are planning to use a professional alternative:

    +

    1) The intuitive approach on getting started

    +

    The good thing is, you can get started right away. Due to the build-up of processes, as well as the well documented procedures you have almost no learning period. Component Owl keeps its design close to the original .NET ListView so you do not have to get acquainted to a completely new system. But still, the changes made are substantial enough to make your working routine so much easier. Whether its the inbuilt drag & drop, the sub-item images or the multi-column sorting, the processes are meant to make your life easier.

    +

    2) The fast and helpful support

    +

    As Component Owl has been on the market for quite a while now, it has been further developed and improved countless times, resulting in a detailed and meaningful FAQ which answer to the majority of your questions. In case you cannot find the answer you need, you can rely on our support system which will give you feedback on you request within 24 hours. This allows you to keep the workflow going with almost no interruptions and puts you ahead of the freeware users.

    +

    3) The possibility to customize

    +

    Just like every developer has his own style of working, Component Owl can be customized to every user needs. The many opportunities to adapt your surface to your favorite design or to arrange the necessary tools the way you need them, allows you to optimize your workflow to perform even better.

    +

    These 3 named advantages are just a few of the many that Component Owl offers you. For more infromation just check out our trial version to see for yourself.

    +]]>
    + http://www.componentowl.com/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/feed/ + 0 +
    + + BLV and Internet Explorer + http://www.componentowl.com/blog/blv-and-internet-explorer/ + http://www.componentowl.com/blog/blv-and-internet-explorer/#respond + Sun, 13 Nov 2016 22:37:47 +0000 + + + + + http://www.componentowl.com/blog/?p=914 + + As you all know we are constantly working on improving BetterListView, but once in a while you might encounter a problem which has not found its way to our documentation yet.

    +

    Today, our blog post covers an interesting case when using Internet Explorer.
    +When instantiating an ActiveX control written as a .NET assembly exposed via Interop you might get the following message:

    +

    System.IO.FileNotFoundException("Could not load file or assembly 'BetterListView, Version=3.8.2.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx' or one of its dependencies. The system cannot find the file specified.")

    +

    The solution to this problem is a fairly simple one, quoting from an MSDN article:
    +“… you can install it in the global assembly cache so that it can be activated from any COM client. If the assembly is only going to be activated by a single application, you can place it in that application’s directory.”

    +

    Concluding from this short excerpt, you are basically left you with two options:
    +1) You may register BetterListView in GAC if it is to be shared. But you should be careful with GAC because it allows holding multiple versions of the same assembly. You can make the installer remove any older versions from GAC during installation and add/keep just the newest one.
    +2) You can put your .net assembly with all third-party DLLs in one directory during installation if it is to be private.

    +

    We recommend the second solution as we reckon it to be the safer one.

    +]]>
    + http://www.componentowl.com/blog/blv-and-internet-explorer/feed/ + 0 +
    + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    + + How to Add Grid Lines in Empty Space in Better ListView + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/#respond + Wed, 30 Apr 2014 09:51:46 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=894 + + Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    +]]>
    + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/ + 0 +
    + + Alternating Rows in Better ListView + http://www.componentowl.com/blog/alternating-rows-in-better-listview/ + http://www.componentowl.com/blog/alternating-rows-in-better-listview/#respond + Tue, 22 Apr 2014 22:38:15 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=888 + + Alternating Rows

    Alternating Rows

    +

    Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.

    +

    Simply add DrawItemBackground event handler and fill background on odd/even items:

    +

     

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    + if ((eventArgs.Item.Index & 1) == 1)
    + {
    + eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
    + }
    +}
    +[/csharp]

    +]]>
    + http://www.componentowl.com/blog/alternating-rows-in-better-listview/feed/ + 0 +
    + + Search Filtering in Better ListView + http://www.componentowl.com/blog/search-filtering-in-better-listview/ + http://www.componentowl.com/blog/search-filtering-in-better-listview/#comments + Mon, 03 Feb 2014 14:58:30 +0000 + + + + + http://www.componentowl.com/blog/?p=882 + + Search Filtering

    Search Filtering with highlight

    +

    There are few ways of making searching in large list of items more convenient. For example, Better ListView provides Search Highlighting and Item Hiding features that can be used to improve searching. The above animation shows both of these features in action when searching for a word “pear” using keyboard.

    +

    The implementation is very simple and involves handling just two events: ItemSearch (raised whenever item is searched, e.g. using keyboard ) and KeyDown:

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new BetterListView();

    +

    listView.Items.AddRange(new[] { “apple”, “pear”, “pineapple”, “orange”, “grapefruit”, “cherry”, “avocado” });

    +

    listView.ItemSearch += listView_ItemSearch;
    +listView.KeyDown += listView_KeyDown;
    +[/csharp]

    +

    The ItemSearch event handler finds matching items and sets their visibility accordingly. It also updates the highlighting:

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_ItemSearch(object sender, BetterListViewItemSearchEventArgs eventArgs)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    // update item visibility according to search query string
    + foreach (var item in listView.Items)
    + {
    + bool match = item.Text.Contains(eventArgs.QueryString);

    +

    if (match)
    + {
    + item.Visible = true;

    +

    item.SearchHighlight = new BetterListViewSearchHighlight(
    + 0,
    + item.Text.IndexOf(eventArgs.QueryString, StringComparison.Ordinal),
    + eventArgs.QueryString.Length);
    + }
    + else
    + {
    + item.Visible = false;
    + }
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Finally, the KeyDown event handler resets the view when Escape key is pressed (all items are made visible and the highlight is removed):

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_KeyDown(object sender, KeyEventArgs e)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (e.KeyCode == Keys.Escape)
    + {
    + // remove search highlight
    + //NOTE: we could use BetterListView.RemoveSearchHighlight() but this applies to visible items only and some items are hidden at the time
    + foreach (var item in listView.Items)
    + {
    + item.SearchHighlight = BetterListViewSearchHighlight.Empty;
    + }

    +

    // make all items visible
    + foreach (var item in listView.Items)
    + {
    + item.Visible = true;
    + }

    +

    // mark the key as handled
    + e.Handled = true;

    +

    // suppress KeyPress event to prevent ItemSearch from happening
    + e.SuppressKeyPress = true;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    And that’s it!

    +]]>
    + http://www.componentowl.com/blog/search-filtering-in-better-listview/feed/ + 2 +
    + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/file-explorer-with-better-listview/feed/index.html b/public/blog/file-explorer-with-better-listview/feed/index.html new file mode 100644 index 0000000..65cbe8d --- /dev/null +++ b/public/blog/file-explorer-with-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: File Explorer with Better ListView + + http://www.componentowl.com/blog/file-explorer-with-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/hiding-column-headers-in-better-listview/feed/index.html b/public/blog/hiding-column-headers-in-better-listview/feed/index.html new file mode 100644 index 0000000..9e5eada --- /dev/null +++ b/public/blog/hiding-column-headers-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Hiding Column Headers in Better ListView + + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/hiding-items-in-better-listview/feed/index.html b/public/blog/hiding-items-in-better-listview/feed/index.html new file mode 100644 index 0000000..55f4dcd --- /dev/null +++ b/public/blog/hiding-items-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Hiding Items in Better ListView + + http://www.componentowl.com/blog/hiding-items-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/hot-tracking-items-in-better-listview/feed/index.html b/public/blog/hot-tracking-items-in-better-listview/feed/index.html new file mode 100644 index 0000000..60296b7 --- /dev/null +++ b/public/blog/hot-tracking-items-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Hot Tracking Items in Better ListView + + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/index.html b/public/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/index.html new file mode 100644 index 0000000..ac65a7b --- /dev/null +++ b/public/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: How to Add Grid Lines in Empty Space in Better ListView + + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/how-to-change-list-view-mouse-wheel-scroll-speed/feed/index.html b/public/blog/how-to-change-list-view-mouse-wheel-scroll-speed/feed/index.html new file mode 100644 index 0000000..6b249fd --- /dev/null +++ b/public/blog/how-to-change-list-view-mouse-wheel-scroll-speed/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: How to Change List View Mouse Wheel Scroll Speed + + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/how-to-display-items-in-custom-states/feed/index.html b/public/blog/how-to-display-items-in-custom-states/feed/index.html new file mode 100644 index 0000000..79f26fb --- /dev/null +++ b/public/blog/how-to-display-items-in-custom-states/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: How to Display Items in Custom States + + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/how-to-dynamically-resize-focused-item/feed/index.html b/public/blog/how-to-dynamically-resize-focused-item/feed/index.html new file mode 100644 index 0000000..be959bb --- /dev/null +++ b/public/blog/how-to-dynamically-resize-focused-item/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: How To: Dynamically Resize Focused Item + + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/how-to-hide-a-column-in-better-listview/feed/index.html b/public/blog/how-to-hide-a-column-in-better-listview/feed/index.html new file mode 100644 index 0000000..0025c11 --- /dev/null +++ b/public/blog/how-to-hide-a-column-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: How to Hide a Column in Better ListView + + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/index.html b/public/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/index.html new file mode 100644 index 0000000..499e50d --- /dev/null +++ b/public/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: How to Make Items Fading on Edges in Better ListView + + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/how-to-store-better-listview-content-in-a-string-user-request/feed/index.html b/public/blog/how-to-store-better-listview-content-in-a-string-user-request/feed/index.html new file mode 100644 index 0000000..a126c6b --- /dev/null +++ b/public/blog/how-to-store-better-listview-content-in-a-string-user-request/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: How to Store Better ListView Content in a String (User Request) + + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=103.html b/public/blog/index.html?p=103.html new file mode 100644 index 0000000..853d9c4 --- /dev/null +++ b/public/blog/index.html?p=103.html @@ -0,0 +1,292 @@ + + + + + + + +Displaying Thumbnails with Borders and Shadows « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Displaying Thumbnails with Borders and Shadows

    + + + +
    +

    We’ve just released Better ListView version 1.50 with some new features – thumbnails view, image borders support (inc. shadows), and more.

    +

    Our great inspiration for designing Better ListView is nothing less than the mighty Windows Explorer. This file manager uses obviously much more powerful control that the regular .NET list-view alone is.

    +

    It supports some extra views, line Contents and Extra Large Icons. It is also possible to adjust image size by rolling a mouse wheel while holding Control key.

    +

    Better ListView has the capability of displaying item icons with arbitrary sizes, but we also extended it with one extra view: Thumbnails:

    +
    Thumbnails Sample

    Thumbnails Sample

    +

    This view aligns items in the center while keeping constant spacing between items. Thumbnails also keep just single line of text for compactness. On the other hand, LargeIcon view varies horizontal space between items to fill client area evenly and breaks long text into several lines.

    +

    The constant spacing is inspired by various photo managers, where image thumbnails are better viewed side-by-side (and the view looks also more organized).

    +

    Image thumbnails also look better with some kind border or frame. We added this new feature in Better ListView 1.5 and it works in all views. There are several pre-defined types of borders, but user can draw his own:

    +
      +
    • None – simply no border at all
    • +
    • Single – single line border
    • +
    • SingleOffset – single line with a spacing between image and the border
    • +
    • SymmetricShadow – smooth shadow around image
    • +
    • DropShadow – smooth shadow on the right bottom part of the image
    • +
    +

    Thumbnails use DropShadow by default, but it can be adjusted for every view separately. One can also adjust thickness of the border/shadow and define custom spacing around image.

    +

    Take a look at one possible setting:

    +
    Image Borders

    Image Borders

    +

    This is SingleOffset border of width 3 pixels. Notice that also column header images can have its borders (these are SymmetricShadow).

    +

    When the border is defined and image size should be kept the same, some spacing have to be added around image. You can adjust this spacing to draw you own borders or any additional graphics (such as overlay icons). Here is an example –

    +
    Thumbnail with Extra Icons

    Thumbnail with Extra Icons

    +

    Download Better ListView

    +

    You can download Better ListView and play with it yourself.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=119.html b/public/blog/index.html?p=119.html new file mode 100644 index 0000000..e17436f --- /dev/null +++ b/public/blog/index.html?p=119.html @@ -0,0 +1,284 @@ + + + + + + + +Better ListView 1.50 released « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Better ListView 1.50 released

    + + + +
    +

    We are happy to announce that we’ve released new version (1.50) of Better ListView.

    +

    You can just Download Better ListView and install it over your current installation.

    +

    The changes include:

    +
      +
    • New samples and new samples launcher!
    • +
    • Added Thumbnails view
    • +
    • Added support for image borders
    • +
    • Extended owner-drawing capabilities
    • +
    • Extended label editing capabilities
    • +
    • Changed type of BetterListViewDrawColumnHeaderBackgroundEventArgs.ColumnHeaderBounds from Rectangle to BetterListViewColumnHeaderBounds (more options available)
    • +
    • Fixed behaviour of layouts in special cases
    • +
    • Fixed SelectedIndexChanged event raising before Better ListView state has changed
    • +
    • Fixed light borders of downsampled images
    • +
    • Fixed redraw bug when calling some of the RemoveRange() overrides
    • + + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=129.html b/public/blog/index.html?p=129.html new file mode 100644 index 0000000..dc7f813 --- /dev/null +++ b/public/blog/index.html?p=129.html @@ -0,0 +1,288 @@ + + + + + + + +What we are working on: Groups, Item hierarchy support « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    What we are working on: Groups, Item hierarchy support

    + + + +
    +

    We are currently working on another major upgrade of our list view control for .net. This update should be released in less than 30 days.

    +

    It will contain two new major features: Excellent item grouping support, and support of simple hierarchical structure in the details view (collapsible list view items).

    +

    Better list view groups

    +

    Better ListView does not support grouping in the current version 1.50. However, this new upgrade will add excellent grouping support. The groups in Better ListView will be much more powerful and flexible than the groups in the regular .net list view. The groups will:

    +
      +
    • Support collapse/expand
    • +
    • Support checkboxes (3-state)
    • +
    • Support their own images
    • +
    • Support their own tooltips
    • +
    • Be selectable
    • +
    • Support custom fonts
    • +
    • Support their own custom context menu
    • +
    +

    Item hierarchy of list view items

    +

    The new version of Better ListView will also support easy to use tree-like item hierarchy. You will be able to simply set parent of any list item, and thus create a simple tree in the details view of the list view control.

    +
      +
    • All parent items will support collapse/expand
    • +
    • All parent items will have configurable checkbox (so you can show or hide it for each item)
    • +
    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=189.html b/public/blog/index.html?p=189.html new file mode 100644 index 0000000..c99ee7f --- /dev/null +++ b/public/blog/index.html?p=189.html @@ -0,0 +1,275 @@ + + + + + + + +How to Change List View Mouse Wheel Scroll Speed « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    How to Change List View Mouse Wheel Scroll Speed

    + + + +
    +

    Did you know that you can change the mouse wheel scroll speed of Better ListView?

    +

    Better ListView has property MouseWheelScrollExtent which is defined as “relative number of items to scroll for a single mouse wheel detent“.

    +

    What does it mean? Well, it basically defines by how many items will the list view scroll when you move the mouse wheel up or down. The default value of this property in version 1.51 is 2, so whenever you scroll up or down with your mouse wheel, the list view will move two items up or down.

    +

    You can set the MouseWheelScrollExtent to a larger value for faster scrolling, just like this:

    +

    BetterListView.MouseWheelScrollExtent := 3;

    +

    Now, every time you scroll, the list view will move by 3 items (which is similar to Windows Explorer, which usually moves by 3 items in the Details view).

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=204.html b/public/blog/index.html?p=204.html new file mode 100644 index 0000000..30e5a0b --- /dev/null +++ b/public/blog/index.html?p=204.html @@ -0,0 +1,284 @@ + + + + + + + +Work in Progress: “Groups” / “Item Hierarchy” Features « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Work in Progress: “Groups” / “Item Hierarchy” Features

    + + + +
    +

    We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=213.html b/public/blog/index.html?p=213.html new file mode 100644 index 0000000..b9e1910 --- /dev/null +++ b/public/blog/index.html?p=213.html @@ -0,0 +1,273 @@ + + + + + + + +Better ListView 1.52 released « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Better ListView 1.52 released

    + + + +
    +

    Another minor release with many fixes and some new features.

    +

    See what’s new in Better ListView 1.52.

    +

    Download the new version.

    +

    We are still working on the new major features (Item hierarchy, groups) as described here. These new features are near completion.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=232.html b/public/blog/index.html?p=232.html new file mode 100644 index 0000000..6280c41 --- /dev/null +++ b/public/blog/index.html?p=232.html @@ -0,0 +1,302 @@ + + + + + + + +Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more) « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more)

    + + + +
    +
    Hierarchical items in two groups

    Hierarchical items in two groups

    +

    We are currently working hard on finishing Better ListView version 2.0 which will add new features: Support for groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.

    +

    We expect to release this upgrade in about a month. It will be a free upgrade for current and new users.

    +

    Groups

    +

    Groups in Better ListView have comparable capabilities as other Better ListView elements (column headers, items, sub-items). For example, you can adjust the foreground/background colors, font, image – and owner drawing is possible as well.

    +

    You can even include images into group headers (as you can see in the preview above), which is not possible in .NET ListView.

    +

    Groups are collapsible by default and the expand button can be switched off on each group individually.

    +

    Here are groups combined with Tile view (the second group is collapsed):

    +
    Groups with Tile view

    Groups with Tile view

    +

    The previous figure displays vertically oriented groups, but Better ListView also support horizontally oriented groups in the List mode:

    +
    Groups with List view

    Groups with List view

    +

    We put special effort to mimic the group display and behavior of Windows Explorer. The group headers can display all of the 15 group header states available in Windows visual style and their display is governed by the same logic as in the ListView counterpart.

    +

    The group headers always look perfect and native, right out of the box. You don’t need to tweak anything.

    +

    Item Hierarchy

    +
    +
    +

    +
    Items with hierarchy

    Items with hierarchy

    +

    +
    +
    +
    +

    This works in the similar way as in the standard TreeView control. Each item (or node) has property called ChildItems which can be filled with new BetterListViewItem instances. SubItems collection can still be used in either items and child-items (child items are treated in the very same way as their parents).

    +

    Item hierarchy can be combined with Groups feature as seen in the first preview.

    +

    Multi-Line Items

    +
    Multi-line items

    Multi-line items

    +

    A simple setting of item layout (MaximumTextLines property) allows breaking item text into several lines (up to the specified value). When the text is longer than MaximumTextLines, then the default trimming method is used (one from the TextTrimming enumeration: None, TrimCharacter, TrimWord, EllipsisCharacter, EllipsisWord, EllipsisPath).

    +

    Multi-line text can be used in every view and also in column headers.

    +

    Another New Features

    +

    There are also bunch of new minor features including:

    +

    Adjustable paddings – Every element part (e.g. item check box, group image…) contains customizable spaces at each side, so the user can easily create space where he needs and customize items/column headers/group headers to the finest detail.

    +

    Focusing sub-items – Items, group headers and even sub-items can be keyfocused. User can now invoke label editing or scroll to any “cell” in the Details-with-columns view solely with keyboard.

    +

    IEnumerable implementations –  BetterListView, BetterListViewGroup and BetterListViewItem implements IEnumerable interface for iterating through the whole item hierarchy, so using recursion to traverse child items is not necessary.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=260.html b/public/blog/index.html?p=260.html new file mode 100644 index 0000000..4bf1f55 --- /dev/null +++ b/public/blog/index.html?p=260.html @@ -0,0 +1,285 @@ + + + + + + + +List-View Drag and Drop Item Reorder (Sort) « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    List-View Drag and Drop Item Reorder (Sort)

    + + + +
    +

    Reordering items in list view control using drag and drop is very tricky. Implementation of item reorder requires multiple issues to be solved:

    +
      +
    • Initialization of the drag & drop
    • +
    • Insertion mark that previews where will be the dragged item moved
    • +
    • The actual reordering of the items (custom code might be needed)
    • +
    • Support of multiple drag drop effects (copy, move, link)
    • +
    • It should not interfere with external drag and drop outside of the listview control
    • +
    • It should not interfere with internal drag and drop into items.
    • +
    • Reorder of multiple items (including non-continuous selection)
    • +
    +

    Our Better ListView control supports drag and drop item reordering out of the box. Zero code is needed – all you have to do is to set the property BetterListViewItemReorderMode to Enabled.

    +

    It works just like this:

    +

    Item drag and drop reorder

    +

    Item drag and drop reorder

    +

    You can just download and install Better ListView, and start using it right away. It can do everything the regular .NET listview component can, and much more.

    +

    See more in the Drag Drop Sample that is included with Better ListView. It includes source code.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=278.html b/public/blog/index.html?p=278.html new file mode 100644 index 0000000..57b2a0a --- /dev/null +++ b/public/blog/index.html?p=278.html @@ -0,0 +1,276 @@ + + + + + + + +Better ListView 2.0 Samples Launcher « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Better ListView 2.0 Samples Launcher

    + + + +
    +

    We have finished all the major features of Better ListView 2.0 (groups, item hierarchy, multi-line items) and now we are soaked in tedious work of updating samples and documentation.

    +

    Here is a preview of the new samples launcher:

    +
    Better ListView 2.0 Samples Launcher

    Better ListView 2.0 Samples Launcher

    +

    We decided to put all samples in a single form for easier navigation. “Hot” features are highlighted in the tree hierarchy.

    +

    You can display source code easily for each sample:

    +
    Better ListView 2.0 Samples Launcher

    Better ListView 2.0 Samples Launcher

    +

    Most samples provide sidebar with basic options and property grid with all the Better ListView properties.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=287.html b/public/blog/index.html?p=287.html new file mode 100644 index 0000000..ee41813 --- /dev/null +++ b/public/blog/index.html?p=287.html @@ -0,0 +1,277 @@ + + + + + + + +Windows Theme Support in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Windows Theme Support in Better ListView

    + + + +
    +

    Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=304.html b/public/blog/index.html?p=304.html new file mode 100644 index 0000000..eb3a405 --- /dev/null +++ b/public/blog/index.html?p=304.html @@ -0,0 +1,304 @@ + + + + + + + +Better ListView 2.00 released « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Better ListView 2.00 released

    + + + +
    +

    A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=330.html b/public/blog/index.html?p=330.html new file mode 100644 index 0000000..ef399bb --- /dev/null +++ b/public/blog/index.html?p=330.html @@ -0,0 +1,280 @@ + + + + + + + +How to Hide a Column in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    How to Hide a Column in Better ListView

    + + + +
    +

    The most popular view in ListView-like controls seems to be the “Details” view with columns, items and sub-items.

    +

    When someone wants to remove a column, he usually thinks of simply removing the column header from the Columns collection. Unfortunately, it’s not that simple. The sub-items get shifted and he needs to remove sub-items corresponding to the removed column for all items as well.

    +

    This is because ListView is not a control for displaying grids (a matrix of cells), but really the lists – sequences of objects, and the sub-items are not cells either, they are something like an extension of each item to support additional information about the item.

    +

    So how we neatly hide a column?

    +

    We introduced Column Hiding feature in the version 2.0.1. You can simply call Hide() on your column header instance and you’re done! There is also corresponding Show() method provided. Or you can set boolean Visible property. Now the column and all subsequent sub-items are hidden from view (although they are still present in data, of course):

    +

     

    +
    Hiding column via context menu

    Hiding column via context menu...

    +

     

    +
    The sixth column is hidden...

    ...and the sixth column gets hidden.

    +

     

    +

    Download Better ListView

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=34.html b/public/blog/index.html?p=34.html new file mode 100644 index 0000000..d92b5ff --- /dev/null +++ b/public/blog/index.html?p=34.html @@ -0,0 +1,273 @@ + + + + + + + +Better ListView released « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Better ListView released

    + + + +
    +

    Welcome to our development blog!

    +

    After a year of hard work, development and testing, we’ve finally released Better ListView.

    +

    You can learn all about it (screenshots, comparison table, download) at Better ListView page.

    +

    This blog will feature not just posts about new releases, but also various useful .NET and programming related topics in general. We are currently busy with the product launch, but interesting posts are coming soon – definitely stay tuned!

    +

    Shall you have any questions, don’t hesitate to contact us.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=340.html b/public/blog/index.html?p=340.html new file mode 100644 index 0000000..b8467bc --- /dev/null +++ b/public/blog/index.html?p=340.html @@ -0,0 +1,288 @@ + + + + + + + +File Explorer with Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    File Explorer with Better ListView

    + + + +
    +

    In release 2.0.2 we added a sample demonstrating how Better ListView can be used to construct folder tree and file browser to make a standalone file explorer:

    +

    File Explorer Sample

    +

    There are two controls derived from BetterListView. One for the navigation pane (folder tree on left side) and one for the file view (on the right side).

    +

    The FolderListView control allows browsing through virtual folders as well as folders on removable drives. We needed this control in our products because .NET does not provide any similar managed control (there is only FolderBrowserDialog, but we actually need a control).

    +

    You can use it for your purposes as well, it is available in Better ListView Samples source code.

    +

    Many features of Better ListView can be used to enhance file browsing, for example:

    +
      +
    • Drag and Drop – moving or copying files
    • +
    • Label Edit – renaming files
    • +
    • Thumbnails – display thumbnails of image files
    • +
    • Custom Tooltips – display extra information on each file item
    • +
    • Groups – organize files into groups (e.g. by size)
    • +
    • Check Boxes – select folders and sub-folders properly with three-state check boxes
    • +
    • Images – every file type could display different image (extracted icon)
    • +
    • Context Menus – do extra operations with files, like displaying file properties
    • +
    • Searching – doing keyboard search is very easy to search for some file
    • +
    • Sorting – sort files according to multiple properties (this is demonstrated in the sample)
    • +
    • Background Image – show that the user is located in special folder by ambient image on the background
    • +
    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=348.html b/public/blog/index.html?p=348.html new file mode 100644 index 0000000..44960d7 --- /dev/null +++ b/public/blog/index.html?p=348.html @@ -0,0 +1,279 @@ + + + + + + + +Coming soon: Better ListView 2.1 Optimized for Performance « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Coming soon: Better ListView 2.1 Optimized for Performance

    + + + +
    +

    Better ListView 2 comes with many hot features, like groups and item hierarchy. Great features, unfortunately, often come at the price of decreased performance. However, we want to have Better ListView both feature-rich and fast.

    +

    Some users noticed a performance drop when working with large number of items (say 10 000+). Our top priority for version 2.1 is the overall optimization of Better ListView. Several optimizations have already been made in the recent updates (column resizing and thumbnail images), but we have to go further. You can expect Better ListView to be much snappier in the upcoming 2.1 update. The optimizations will cover these areas:

    +
      +
    • Faster collection operations (adding, removing, sorting) of large number of items
    • +
    • Faster expand/collapse of groups and items
    • +
    • Faster column resizing with multi-line items
    • +
    +

    We will also take a look on smoother Visual Studio integration, so you can see Better ListView ready in toolbox just after installation (we have to deal with Visual Studio Packages, which is quite an esoteric topic). If Better ListView doesn’t currently appear in your Visual Studio toolbox automatically, you can just right-click the toolbox window, and use “Choose Items” to add the DLL file yourself.

    +

    Some background info for the more curious of you: Version 1.5 of Better ListView was very fast. It was so fast because every item in the list had precisely the same size. Some operations, like hit testing, was done in constant time and no extra measurement of individual items was necessary. The new major 2.0 version of Better ListView supports items with variable sizes, and irregular layout consisting of grouped items. However, we observed that even in complex settings, there are just few “types” of items – for example, there are only three possible item sizes when using multi-line items with up to three lines of text. Our optimizations will thus be focused on taking advantage of this to reduce most expensive operations back to constant time complexity.

    +
    photo by Michael Roper

    photo by Michael Roper

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=359.html b/public/blog/index.html?p=359.html new file mode 100644 index 0000000..ddb3209 --- /dev/null +++ b/public/blog/index.html?p=359.html @@ -0,0 +1,302 @@ + + + + + + + +Better ListView 2.1: Optimizations Done, Minor Features and Testing « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Better ListView 2.1: Optimizations Done, Minor Features and Testing

    + + + +
    +

    We’ve managed to improve performance of Better ListView 2.1 significantly. There are some raw results for Better ListView filled with 10 000 items, each with 10 sub-items:

    + + + + + + + + + + + + + + + + + + +
    Better ListView 2.0Better ListView 2.1
    load 10K items3.5 s0.8 s
    item expand/collapse2 s0.04 s
    +

    Some other expensive operations (e.g. column-resizing) can now be done smoothly even for a very large number of items.

    +

    We will come with detailed analysis on release of the version 2.1.

    +

    To our excitement, it is now even faster than Visual Studio Error List, which uses a kind of ListView control with multi-line items:

    +
    vs-error-list

    Visual Studio Error List

    +

    Some customers asked us how to do certain things they were accustomed to do in .NET ListView. We found that many users of the .NET ListView use specific constructors, methods and properties provided by accompanied classes, e.g.:

    +
      +
    • ListViewItem.ctor(string, int, ListViewGroup)
    • +
    • ListViewSubItem.ResetStyle()
    • +
    • CheckedListViewItemCollection.IndexOfKey(string)
    • +
    +

    Since Better ListView supports virtually all the features of original .NET ListView, we are implementing all of these members to make user’s transition from ListView to Better ListView as easy as possible.

    +

    The new version will contain extended documentation with a quick start tutorial with real-world use cases (e.g. “How to set-up Drag and Drop”).

    +

    Finally, we inspected the source code XML documentation with StyleCop tool to make sure everything is properly commented. We are extremely diligent about the code quality and its (re)usability which is certainly an interest of almost everyone using code of a 3rd party component.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=373.html b/public/blog/index.html?p=373.html new file mode 100644 index 0000000..8bd5f1b --- /dev/null +++ b/public/blog/index.html?p=373.html @@ -0,0 +1,291 @@ + + + + + + + +Better ListView 2.10 released « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Better ListView 2.10 released

    + + + +
    +

    A new version with major improvements, optimizations and fixes has been released! It addresses many suggestions provided by you, our valued customers.

    +

    Improved Performance

    +

    We put a considerable effort into optimizing Better ListView 2 to provide advanced features (e.g. hierarchical and multi-line items, collapsible groups) while still being swift and responsive.

    +

    The overall performance has greatly improved. Better ListView 2.1 can easily handle 10.000 items while still being very fast. The parts where improvements are best seen are:

    +
    +
      +
    • Adding many items to the list
    • +
    • Expanding/collapsing of hierarchical items
    • +
    • Resizing a column
    • +
    +
    We also added new options in the Performance property group, so you can easily switch between fast and powerful options.
    +
    +

    Samples in both C# and Visual Basic

    +

    We added easy to understand samples for both C# and Visual Basic.

    +

    You can simply follow a link from start menu to open the Visual Studio project for your favourite language, and play with all the features of Better ListView.

    +
    C# and VB Samples projects in Solution Explorer

    C# and VB Samples projects in Solution Explorer

    +

     

    +

    Extended Documentation

    +

    We added a Quick Start Tutorial to help you with setup, activation and integration of Better ListView in your projects, as well as many entirely new chapters in the documentation.

    +

    All code samples are from now on provided in both C# and Visual Basic to be easy to understand to both C# and VB.net developers.

    +

    Smoother migration from .NET ListView to Better ListView

    +

    Better ListView now contains all the constructor/method overloads and properties of the regular .NET ListView, so that for each member of .NET ListView there is an easily discoverable equivalent in Better ListView.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=398.html b/public/blog/index.html?p=398.html new file mode 100644 index 0000000..e350f4e --- /dev/null +++ b/public/blog/index.html?p=398.html @@ -0,0 +1,364 @@ + + + + + + + +How to Display Items in Custom States « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    How to Display Items in Custom States

    + + + +
    +

    One of our customers recently asked us if it is possible in Better ListView to draw item highlighted even when the control loses focus. This is an interesting and useful feature, so we implemented it right away.

    +

    Owner drawing in Better ListView 2.3.0 and higher allows you to draw elements (column headers, items, sub-items and groups) in any state you wish (hot, selected, focused and any combination of the three).

    +

    For example, we would like to highlight several items in one Better ListView depending on hovered item in other Better ListView:

    +
    Better ListView shows multiple hot items

    Better ListView shows multiple hot items

    +

    Items can be also be drawn as if the control is focused, enabled or disabled. This feature can be applied when you wish to display items in highlighted state even if Better ListView is not focused:

    +
    Better ListView keeps selected items highlighted

    Better ListView keeps selected items highlighted

    +

    We implemented the first sample (showing mulitple hot items) by inheriting from BetterListView, making a new class called HotListView. The implementation is very simple:

    +

     

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class HotListView : BetterListView
    +{
    +public HashSet HotItems
    +{
    +get
    +{
    +return this.hotItems;
    +}
    +set
    +{
    +this.hotItems = value;

    +

    Refresh();
    +}
    +}

    +

    private HashSethotItems = new HashSet();

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    +{
    +if (this.hotItems.Contains(eventArgs.Item.Index))
    +{
    +eventArgs.ItemStateInfo = new BetterListViewItemStateInfo(
    +eventArgs.ItemStateInfo.ItemState | BetterListViewItemState.Hot,
    +eventArgs.ItemStateInfo.ExpandButtonState,
    +eventArgs.ItemStateInfo.CheckBoxState);
    +}

    +

    base.OnDrawItem(eventArgs);
    +}
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class HotListView
    +Inherits BetterListView
    +Public Property HotItems() As HashSet(Of Integer)
    +Get
    +Return Me.m_hotItems
    +End Get
    +Set
    +Me.m_hotItems = value

    +

    Refresh()
    +End Set
    +End Property

    +

    Private m_hotItems As New HashSet(Of Integer)()

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    +If Me.m_hotItems.Contains(eventArgs.Item.Index) Then
    +eventArgs.ItemStateInfo = New BetterListViewItemStateInfo(eventArgs.ItemStateInfo.ItemState Or BetterListViewItemState.Hot, eventArgs.ItemStateInfo.ExpandButtonState, eventArgs.ItemStateInfo.CheckBoxState)
    +End If

    +

    MyBase.OnDrawItem(eventArgs)
    +End Sub
    +End Class
    +[/vb]

    +

     

    +

    The HotListView contains one property called HotItems. When drawing items (OnDrawItem method), it looks whether the item is in the HotItems set. If so, item drawing state is altered so that the item will be drawn as hot.

    +

    The modified ListView for second sample is even simpler. We call it HighlightListView:

    +

     

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class HighlightListView : BetterListView
    +{
    +protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    +{
    +if ((eventArgs.ItemStateInfo.ItemState & BetterListViewItemState.Selected) == BetterListViewItemState.Selected)
    +{
    +// if the item is selected, always draw control as if it is focused
    +eventArgs.DrawFocused = true;
    +}

    +

    base.OnDrawItem(eventArgs);
    +}
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class HighlightListView
    +Inherits BetterListView
    +Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    +If (eventArgs.ItemStateInfo.ItemState And BetterListViewItemState.Selected) = BetterListViewItemState.Selected Then
    +‘ if the item is selected, always draw control as if it is focused
    +eventArgs.DrawFocused = True
    +End If

    +

    MyBase.OnDrawItem(eventArgs)
    +End Sub
    +End Class
    +[/vb]

    +

     

    +

    This modification only draws selected items as if the control is always focused.

    +

    UPDATE: From Better ListView 2.3.1, you can simply use HideSelectionMode property to keep selected items highlighted.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=40.html b/public/blog/index.html?p=40.html new file mode 100644 index 0000000..fc46161 --- /dev/null +++ b/public/blog/index.html?p=40.html @@ -0,0 +1,296 @@ + + + + + + + +Synergy of Better ListView and Our Applications « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Synergy of Better ListView and Our Applications

    + + + +
    +

    When developing sofware application, a custom component of some non-trivial scale is sometimes needed. Complex components are often created in companies as internal, single-purpose projects and never see wider public. This would be the case with our custom ListView component, but its scale and versability convinced us to made it available for others. You can read the story behind, or just take a look on how exactly we use it.

    +

    We at Dextronet are developing several desktop applications, which benefits from custom components. Our flagship product Swift To-Do List and ImagingShop (yet in the docks) both needed a serious visual component for major part of its client area. Look at screenshots of these applications:

    + + + + + + + +
    Swift To-Do ListImagingShop
    +

    It may not be noticeable where the ListView-like component is, so there is the highlighted version:

    + + + + + + + +
    Swift To-Do ListImagingShop
    +

    These parts look very different, as the applications have different purpose. One is a task management/sheduling software, and the second is a photo management/editing software.

    +

    In the first case, we have to deal with specific requirements like multi-column sorting, cell highlighting, item reordering and of course many, many more

    +

    In the second case, photo application required display of arbitrarily-sized thumbnails, custom tooltips and multi-line captions.

    +

    It was apparent, that the .NET ListView is not able to fullfill all of these requirements even if we bend and customize it to the limit. ListView is also a visual component of long history dating back to the earliest versions of Microsoft Windows. During its lifetime, it grabbed problematic stuff, that have to be kept for backward compatibility.

    +

    And the .NET ListView is a wrapper around all this. It contains hacks and workarounds to make it work more properly. Even with all that, try to display a backround watermark image while retaining Vista visual style. Impossible.

    +

    So we designed a control that lacks all the bugs and drawbacks of the .NET ListView while containing all the sweet features. It was ready to use for our needs.

    +

    But it has some 40 K lines of code and aspiring to be itself a product. We decided to develop Better ListView as a commercialy available component at the very beginning of its development.

    +

    We agreed on this kind of win-win-win strategy (for the end-user, for customer-developer, and for us) and hope all will benefit from maintaining a better Better ListView :-)

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=437.html b/public/blog/index.html?p=437.html new file mode 100644 index 0000000..cddcb8c --- /dev/null +++ b/public/blog/index.html?p=437.html @@ -0,0 +1,312 @@ + + + + + + + +Vertical Alignment and Text Wrapping in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Vertical Alignment and Text Wrapping in Better ListView

    + + + +
    +

    .NET ListView supports horizontal alignment of text in columns, items, sub-items and groups. Since Better ListView adds many new features, like multi-line items and images of arbitrary size, vertical alignment comes in handy.

    +

    By default, each view has its defaults, but you can customize text alignment on every column, item, sub-item and group individually:

    +
    +
    Vertical alignments of text

    Vertical alignments of text

    +
    +
    +
    +
    +

    The vertical alignment feature is a new property of each element type. For example, .NET ListView item has a property called Align which refers to horizontal alignment. Better ListView extends this to two independent properties called AlignHorizontal and AlignVertical. The naming scheme is same for columns, items, sub-items and groups.

    +

    Better ListView also supports splitting text in column headers and items (sub-items) into multiple lines.

    +

    We extended this functionality by adding a BetterListViewItem.TextWrapping and BetterListViewSubItem.TextWrapping properties. With these, you can control how the text in sub-items will be wrapped. There are three possible values:

    +
      +
    • Layout – the text will be wrapped to multiple lines, up to value specified by MaximumTextLines property of the corresponding view (layout)
    • +
    • None – the text will not be wrapped at all
    • +
    • Space – the text will be wrapped, but only to available space (item will never get higher due to wrapping text in sub-item with this setting)
    • +
    +
    The following screenshot shows these three wrapping modes in action:
    +
    +
    Various text wrapping modes

    Various text wrapping modes

    +
    +

    The sub-item in the first column has TextWrapping set to Layout and the layout has MaximumTextLines set to 4. The sub-item text thus can be split to up to four lines. It is actually split just to three because the column is wide enough.

    +

    The sub-item in the second column has TextWrapping set to None, which means the text in this sub-item is kept on single line.

    +

    The sub-item in the third column has TextWrapping set to Space. As you can see, even if the MaximumTextLines is set to 4, the sub-item text is limited to three lines, preventing item to grow larger.

    + +
    + + + + +
    + + + + + +

    One Response to “Vertical Alignment and Text Wrapping in Better ListView”

    + +
      +
    1. +
      +
      + Daniel N says:
      + + + +

      Very nice guys… With each new version, Better ListView is doing exactly that: just getting better and better!

      +

      I am particularly keen to try putting in my own linebreaks into items in the details view.

      + + +
      +
    2. +
    + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=450.html b/public/blog/index.html?p=450.html new file mode 100644 index 0000000..b6d51e1 --- /dev/null +++ b/public/blog/index.html?p=450.html @@ -0,0 +1,278 @@ + + + + + + + +Displaying Multi-Line Text In ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Displaying Multi-Line Text In ListView

    + + + +
    +

    Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=468.html b/public/blog/index.html?p=468.html new file mode 100644 index 0000000..ce31094 --- /dev/null +++ b/public/blog/index.html?p=468.html @@ -0,0 +1,308 @@ + + + + + + + +How To: Dynamically Resize Focused Item « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    How To: Dynamically Resize Focused Item

    + + + +
    +

    Better ListView 2.4.0 now supports setting MaximumTextLines property on every item and sub-item, so you can have multi-line items each with different number text lines:

    +
    Dynamic resizing of the focused item

    Dynamic resizing of the focused item

    +

    We also introduced FocusedItemChanged event, so that you can detect when focus has moved from one element (item / sub-item / group) to another.

    +

    These features can be combined to display only the focused item with more details to save space code of the FocusedItemChanged event handler may look like this:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +void ListViewFocusedItemChanged(object sender, BetterListViewFocusedItemChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (eventArgs.FocusedItemOld != null)
    + {
    + // set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1;
    + }

    +

    if (eventArgs.FocusedItemNew != null)
    + {
    + // set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Sub ListViewFocusedItemChanged(sender As Object, eventArgs As BetterListViewFocusedItemChangedEventArgs)
    + Dim ListView As BetterListView = DirectCast(sender, BetterListView)

    +

    ListView.BeginUpdate()

    +

    If eventArgs.FocusedItemOld IsNot Nothing Then
    + ‘ set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1
    + End If

    +

    If eventArgs.FocusedItemNew IsNot Nothing Then
    + ‘ set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3
    + End If

    +

    ListView.EndUpdate()
    +End Sub
    +[/vb]

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=476.html b/public/blog/index.html?p=476.html new file mode 100644 index 0000000..cb976ec --- /dev/null +++ b/public/blog/index.html?p=476.html @@ -0,0 +1,277 @@ + + + + + + + +Non-selectable Items in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Non-selectable Items in Better ListView

    + + + +
    +

    One of our users asked us whether it would be possible to make specific Better ListView items to be non-selectable because he wanted to have them in “disabled” state.

    +

    We quickly realized that it might be very useful, in some cases, to have items with informative character only. Some of such non-selectable items can even be used as separators with the help of owner drawing:

    +
    Non-selectable items

    Non-selectable items

    +

    The non-selectable items behave just as their name suggests. They cannot be focused (they are skipped when jumping from item to item with arrow keys) and do not respond to drag selection:

    +
    Non-selectable items

    Non-selectable items

    +

    It is very easy to set-up such items. Simply set BetterListViewItem.Selectable property to false.

    +

    The non-selectable items are displayed in the same way as normal items. They can contain child items (which are selectable until their Selectable property is set to false) and can be interactively expanded/collapsed.

    +

    If you need to have all items non-selectable to use Better ListView for display-only, consider using the Read-only mode, which has been also introduced in version 2.5.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=478.html b/public/blog/index.html?p=478.html new file mode 100644 index 0000000..5e24279 --- /dev/null +++ b/public/blog/index.html?p=478.html @@ -0,0 +1,276 @@ + + + + + + + +Combined Items in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Combined Items in Better ListView

    + + + +
    +

    Hierarchical (tree-like) items can be used to support non-selectable child items in Better ListView 2.5.0 and newer. We call these Combined items as they are combined with its children to look and behave as single item:

    +
    Combined items

    Combined items

    +

    Combined item has selection ranging over all its child items. This can be seen when the combined item is selected or focused:

    +
    Combined items - selection

    Combined items - selection

    +

    Child items of the combined item are still interactive, though not focusable/selectable. They can contain further children (be expanded/collapsed with expand button as well) and can contain interactive check boxes. The visual part of combined child items is also fully available, to the child items can contain images and even sub-items.

    +

    To set-up combined items, simply set AllowSelectChildItems property to false on all items you wish to combine.

    +

    Combined items can be used in any level of item hierarchy.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=480.html b/public/blog/index.html?p=480.html new file mode 100644 index 0000000..42ee6c5 --- /dev/null +++ b/public/blog/index.html?p=480.html @@ -0,0 +1,304 @@ + + + + + + + +Custom Behavior of Group Headers in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Custom Behavior of Group Headers in Better ListView

    + + + +
    +

    When developing our desktop applications, me and Jiri needed to adjust behavior of group headers in the Better ListView control.

    +

    We discovered that making group header behavior customizable would be useful not only for us, but for other developers who utilize Better ListView as well, so we implemented this feature officially in Better ListView 2.5.0.

    +

    There are two new properties: ShowDefaultGroupHeader and GroupHeaderBehavior.

    +

    Hiding the Default Group Header

    +

    The ShowDefaultGroupHeader is initially set to true. This means that the default group (the group containing items which do not have a specific group) have its header displayed:

    +
    Default group header is visible

    Default group header is visible

    +

    When ShowDefaultGroupHeader is set to false, the “Default” group header on top can be hidden:

    +
    Default group header is hidden

    Default group header is hidden

    +

    Adjusting Group Header Behavior

    +

    The group headers have two kinds of behavior. They can be focused and can cause selection of items. Both of these functions can be invoked by keyboard and mouse.

    +

    The GroupHeaderBehavior property allows changing this behavior for keyboard and mouse separately.

    +

    By default, the property is set to BetterListViewGroupHeaderBehavior.All, so that all functions of the group header are turned on.

    +

    You may want to make group headers completely non-interactive. This can be done by setting the property to BetterListViewGroupHeaderBehavior.None.

    +

    Other values of the enum can be combined to create desired behavior.

    +

    Keyboard:

    +
      +
    • Focus only
    • +
    • Focus and select items in the group
    • +
    +

    Mouse:

    +
      +
    • Focus
    • +
    • Select items in the group
    • +
    • Highligh when mouse cursor is over the group header
    • +
    +
    The expand button of group headers can still be used even if the group header has all the behaviors turned off. If you need to hide the expand button as well, set BetterListViewGroup.AllowShowExpandButton to false.
    +

    Use Case: Metadata Viewer

    +

    Here Better ListView is used for viewing image metadata tags:

    +
    Metadata View window

    Metadata View window

    +

    Only one tag can be selected at a time, so clicking on a group header has no effect on selection and need not to be highlighted.

    +

    One may still need, however, to allow focusing the group header with keyboard and mouse so that it is possible to collapse/expand the group with arrow keys. The desired behavior can be set this way:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus & BetterListViewGroupHeaderBehavior.MouseFocus);[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus And BetterListViewGroupHeaderBehavior.MouseFocus)[/vb]

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=482.html b/public/blog/index.html?p=482.html new file mode 100644 index 0000000..d735bcd --- /dev/null +++ b/public/blog/index.html?p=482.html @@ -0,0 +1,279 @@ + + + + + + + +Read-Only Mode in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Read-Only Mode in Better ListView

    + + + +
    +

    Better ListView 2.5 introduces a new boolean property called ReadOnly.

    +

    When set to true, the Better ListView does not respond to keyboard and mouse input. There are, however, some exceptions that make the Read-only mode different to the Disabled mode (when Enabled property is set to false).

    +

    When in Read-only mode, content of the Better ListView can be still scrolled (the scroll bars are enabled) and groups/items can be expanded/collapsed.

    +

    The difference between Disabled and Read-only can be seen on the following images:

    +
    Normal state

    Normal state

    +
    Disabled state

    Disabled state

    +
    Read-only state

    Read-only state

    +

     

    +

    As you can see, the Better ListView is displayed normally in Read-only mode, but the group header does not have a hot state (because cannot be focused). Items also cannot be focused or selected, but the expand buttons are still interactive.

    +

    The scroll bars would also be enabled and can be used, which is different from Disabled mode where everything is grayed and cannot be used.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=546.html b/public/blog/index.html?p=546.html new file mode 100644 index 0000000..9c3ffeb --- /dev/null +++ b/public/blog/index.html?p=546.html @@ -0,0 +1,275 @@ + + + + + + + +Hiding Items in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Hiding Items in Better ListView

    + + + +
    +

    We currently introduced a BetterListViewItem.Visible property to allow hiding items visually, but keeping then in the Items collection:

    +
    Making items invisible

    Making items invisible

    +

    The above image shows two groups of items. The first groups uses hiding of items with the Visible property, while the second group simply turns off drawing of ceratin items.

    +

    The first approach is useful when you need to hide item as if it is removed, but keep it actually within Items collection.

    +

    The second approach need to create new control inheriting from BetterListView, overrride the OnDrawItem method and set properties like BetterListViewDrawItemEventArgs.DrawImage to false or simply not call the base implementation of OnDrawItem.

    +

    The second (owner drawing) approach is useful when you need just to switch off display of item without changing the item layout.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=664.html b/public/blog/index.html?p=664.html new file mode 100644 index 0000000..82a6744 --- /dev/null +++ b/public/blog/index.html?p=664.html @@ -0,0 +1,1187 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=753.html b/public/blog/index.html?p=753.html new file mode 100644 index 0000000..4760bc3 --- /dev/null +++ b/public/blog/index.html?p=753.html @@ -0,0 +1,276 @@ + + + + + + + +Custom Spacing between Items in Details View « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Custom Spacing between Items in Details View

    + + + +
    +

    Better ListView 2.6 newly supports custom spacing between items in Details view:

    +
    Custom Spacing between Items

    Custom Spacing between Items

    +

    This property has been recently available in other views, but Details view was exception since its selections needed to be treated in different way: They overlap by 1 pixel so that the double border is avoided in neighboring selections:

    +
    1 px overlap of items

    1 px overlap of items

    +

    We have resolved this to get proper behavior with custom spacings and now the spacing can be set the same way as in any other view:

    +

    Simply set LayoutItemsCurrent.ElementOuterPadding to have custom horizontal and vertical padding between items.

    +

    You can set this specifically for Details view by refering to property LayoutItemsDetails or LayoutItemsDetailsColumns (Details view with columns).

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=760.html b/public/blog/index.html?p=760.html new file mode 100644 index 0000000..256fcc0 --- /dev/null +++ b/public/blog/index.html?p=760.html @@ -0,0 +1,276 @@ + + + + + + + +Custom Item Height in Details View of Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Custom Item Height in Details View of Better ListView

    + + + +
    +

    Better ListView 2.7.0.0 now supports items of arbitrary height in Details view:

    +
    Items with custom height

    Items with custom height

    +

    Items with variable heights were possible in recent versions of Better ListView as well, but this adjustment was limited to heights which are multiples of text line height.

    +

    We have introduced a BetterListViewItem.CustomHeight property, which is 0 by default.

    +

    Every item has some minimum size (defined by the font and image) but it can get arbitrarily larger. The following formula explains how item height is measured in Better ListView:

    +

    height = max(minimum height, image height, text height, custom height)

    +

    Setting minimum height for all items is possible through layout properties and the latter is defined by the item itself.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=771.html b/public/blog/index.html?p=771.html new file mode 100644 index 0000000..1c9f386 --- /dev/null +++ b/public/blog/index.html?p=771.html @@ -0,0 +1,363 @@ + + + + + + + +Customize Label Editing (Embedded) Control for Each Line in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Customize Label Editing (Embedded) Control for Each Line in Better ListView

    + + + +
    +

    Embedded controls for label edit in Better ListView can be customized not only for every column, but even for every row.

    +

    This is not a new feature, but would be nice to mention that you can possibly have a different custom editing control for every cell…

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +{
    + // show editing controls in the second column
    + if (eventArgs.SubItem.Index == 1)
    + {
    + // show my custom control on the first row
    + if (eventArgs.SubItem.Item.Index == 0)
    + {
    + return (new DocumentAccessConrol());
    + }

    +

    // show my custom control on the second row
    + if (eventArgs.SubItem.Item.Index == 1)
    + {
    + return (new BetterListViewComboBoxEmbeddedControl());
    + }

    +

    // show my custom control on the third row
    + if (eventArgs.SubItem.Item.Index == 2)
    + {
    + return (new BetterListViewTextBoxEmbeddedControl());
    + }
    + }

    +

    return null;
    +}
    +[/csharp]

    +

     

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Function ListViewRequestEmbeddedControl(ByVal sender As Object, ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    + As IBetterListViewEmbeddedControl

    +

    ‘ show editing controls in the second column
    + If eventArgs.SubItem.Index = 1 Then

    +

    ‘ show my custom control on the first row
    + If eventArgs.SubItem.Item.Index = 0 Then
    + Return (New DocumentAccessConrol())
    + End If

    +

    ‘ show my custom control on the second row
    + If eventArgs.SubItem.Item.Index = 1 Then
    + Return (New BetterListViewComboBoxEmbeddedControl())
    + End If

    +

    ‘ show my custom control on the third row
    + If eventArgs.SubItem.Item.Index = 2 Then
    + Return (New BetterListViewTextBoxEmbeddedControl())
    + End If

    +

    End If

    +

    Return Nothing

    +

    End Function
    +[/vb]

    +

     

    +

    And there is the result:

    +
    Custom Embedded Control on the First Line

    Custom Embedded Control on the First Line

    +

     

    +
    TextBox Control on the Third Line

    TextBox Control on the Third Line

    + +
    + + + + +
    + + + + + +

    2 Responses to “Customize Label Editing (Embedded) Control for Each Line in Better ListView”

    + +
      +
    1. +
      +
      + Göran says:
      + + + +

      There is a tiny error in the VB code below “‘ show my custom control on the third row”.
      +The index should be “2”, not “0”.

      +

      :-)

      +

      Thanks for a great product and for a great and humorous site!

      +

      /G

      + + +
      + +
    2. +
    + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=780.html b/public/blog/index.html?p=780.html new file mode 100644 index 0000000..f340450 --- /dev/null +++ b/public/blog/index.html?p=780.html @@ -0,0 +1,275 @@ + + + + + + + +Right-aligned Images in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Right-aligned Images in Better ListView

    + + + +
    +

    Better ListView 2.9.0 now supports more customizable image alignment. For example, images can be aligned on the right part of item:

    +
    Right-aligned Images

    Right-aligned Images

    +

    The alignment can be set separately on every sub-item (using AlignImageHorizontal and AlignImageVertical properties).

    +

    Moreover, the right-aligned images can be used in column headers and groups:

    +
    Group image alignment

    Group image alignment

    +

    The alignment of images is similar to that of text. Every image has its frame, which can be possibly larger than the image itself. In such case, the image needs to be further aligned within the frame. This has been done automatically by centering the image within frame, but now you have full control over the alignment.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=796.html b/public/blog/index.html?p=796.html new file mode 100644 index 0000000..05e87e2 --- /dev/null +++ b/public/blog/index.html?p=796.html @@ -0,0 +1,341 @@ + + + + + + + +How to Store Better ListView Content in a String (User Request) « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    How to Store Better ListView Content in a String (User Request)

    + + + +
    +

    Is it possible to store entire Better ListView content (items with hierarchy and sub-items, columns and groups) in a single string?

    +

    Better ListView already supports saving and loading its content using SaveContent and LoadContent methods. These methods support either XML or binary format.

    +

    I chose binary format for storing data in string  because it is more compact than XML. Binary representation (basically an array of bytes) can be converted to Base64 string. Loading the content from string work similarly, the steps are performed in opposite direction:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +// SAVE
    +// create MemoryStream to hold binary data
    +MemoryStream stream = new MemoryStream();
    +// store Better ListView content in memory stream
    +this.listView.SaveContentBinary(stream);
    +// copy content of MemoryStream to byte array
    +byte[] contentBinary = new byte[stream.Length];
    +stream.Seek(0, SeekOrigin.Begin);
    +// convert byte array to Base64 string
    +stream.Read(contentBinary, 0, (int)stream.Length); // move to beginning of the stream
    +string contentStringBase64 = Convert.ToBase64String(contentBinary);
    +// close stream
    +stream.Close();
    +stream.Dispose();

    +

    // CLEAR
    +this.listView.Clear();

    +

    // LOAD
    +// create MemoryStream to hold binary data
    +stream = new MemoryStream();
    +// convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64);
    +// write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length);
    +stream.Seek(0, SeekOrigin.Begin); // move to beginning of the stream
    +// load content of Better ListView from memory stream
    +this.listView.LoadContentBinary(stream);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +‘ SAVE
    +‘ create MemoryStream to hold binary data
    +Dim stream As New MemoryStream()
    +‘ store Better ListView content in memory stream
    +Me.listView.SaveContentBinary(stream)
    +‘ copy content of MemoryStream to byte array
    +Dim contentBinary As Byte() = New Byte(stream.Length – 1) {}
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ convert byte array to Base64 string
    +stream.Read(contentBinary, 0, CInt(stream.Length))
    +‘ move to beginning of the stream
    +Dim contentStringBase64 As String = Convert.ToBase64String(contentBinary)
    +‘ close stream
    +stream.Close()
    +stream.Dispose()

    +

    ‘ CLEAR
    +Me.listView.Clear()

    +

    ‘ LOAD
    +‘ create MemoryStream to hold binary data
    +stream = New MemoryStream()
    +‘ convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64)
    +‘ write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length)
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ move to beginning of the stream
    +‘ load content of Better ListView from memory stream
    +Me.listView.LoadContentBinary(stream)
    +[/vb]

    +

     

    +

    Although saving and loading data this way is convenient, please consider the following drawback:

    +
      +
    • Standard serialization mechanism of .NET is used for converting classes and structures to XML or binary representation – hence the serialized data may not be possible to deserialize on different version of Better ListView if any public members of the serialized class have been changed.
    • +
    • The generated string is very long (few kilobytes for just two items).
    • +
    • Lots of data are stored which are not related to content itself (e.g. item colors).
    • +
    • The serialized representation is considered read-only – any changes can cause problems with deserialization; if you really want flexible way of storing ListView content, consider building a model or data layer that supports storing the data you need the way you need.
    • +
    +

    On the other hand, using this way may be convenient when you want to transfer or copy ListView content between controls on even across application domain (Better ListView itself uses this mechanism to allow Drag and Drop between two applications – this “tour de force” kind of Drag and Drop is not avaiable in regular .NET ListView).

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=803.html b/public/blog/index.html?p=803.html new file mode 100644 index 0000000..c38efa3 --- /dev/null +++ b/public/blog/index.html?p=803.html @@ -0,0 +1,283 @@ + + + + + + + +Hiding Column Headers in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Hiding Column Headers in Better ListView

    + + + +
    +

    Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=808.html b/public/blog/index.html?p=808.html new file mode 100644 index 0000000..b4605cd --- /dev/null +++ b/public/blog/index.html?p=808.html @@ -0,0 +1,366 @@ + + + + + + + +Better ListView Tip: How to Draw Custom Selection « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Better ListView Tip: How to Draw Custom Selection

    + + + +
    +
    Customized item selection.

    Customized item selection.

    +

     

    +

    By default, Better ListView uses system theme for drawing selections.

    +

    To draw custom selection, you can use owner drawing capabilities of Better ListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +class CustomListView : BetterListView
    +{
    + protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
    + brushSelection.Dispose();
    + }
    + }

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + eventArgs.DrawSelection = false;

    +

    base.OnDrawItem(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
    + brushSelection.Dispose()
    + End If
    + End Sub

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + eventArgs.DrawSelection = False

    +

    MyBase.OnDrawItem(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
    + End If
    + End Sub
    +End Class
    +[/vb]

    +

    In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

    +

    The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

    +

    The OnDrawItem method contains two things:

    +
      +
    1. Turn off  default selection.
    2. +
    3. Draw custom selection border if the item is selected.
    4. +
    +

    Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

    +

    Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

    +

    To allow these states, considerable coding need to be done.

    +

    In case you need this level of customization, please contact us for Custom Coding support.

    +

     

    + +
    + + + + +
    + + + + + +

    2 Responses to “Better ListView Tip: How to Draw Custom Selection”

    + +
      +
    1. +
      +
      + Claudiu says:
      + + + +

      Better list view is only for stupid developers and plase do not compare it with standard list view. Performance is an important think and betterlistview has no performance compared with list view. Make an loop with 100000 items for add to list and you will see ….

      + + +
      +
        +
      • +
        +
        + Libor Tinka says:
        + + + +

        We have balanced performance with features, this is a price for having fully managed control with rich features (tree items, multi-line text). If you want something extremely fast, faster than ListView, handling 100 000 000 items like a charm … use DOS text mode! :)

        +

        We have happy customers who use Better ListView in complex systems like airline ticket booking and they are very intelligent people – I don’t think they are stupid developers.

        + + +
        +
      • +
      +
    2. +
    + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=823.html b/public/blog/index.html?p=823.html new file mode 100644 index 0000000..3b9260c --- /dev/null +++ b/public/blog/index.html?p=823.html @@ -0,0 +1,314 @@ + + + + + + + +Better Thumbnail Browser Component Released « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Better Thumbnail Browser Component Released

    + + + +
    +

     

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    + +
    + + + + +
    + + + + + +

    One Response to “Better Thumbnail Browser Component Released”

    + +
      +
    1. +
      +
      + Nathaniel Wise says:
      + + + +

      this is one useful for the example and overviews.in my website i m not used this type of functionality but this is something good component.

      + + +
      +
    2. +
    + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=831.html b/public/blog/index.html?p=831.html new file mode 100644 index 0000000..35dd9a6 --- /dev/null +++ b/public/blog/index.html?p=831.html @@ -0,0 +1,316 @@ + + + + + + + +Custom label edit: How to rename file names without extension in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Custom label edit: How to rename file names without extension in Better ListView

    + + + +
    +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=843.html b/public/blog/index.html?p=843.html new file mode 100644 index 0000000..25c4c76 --- /dev/null +++ b/public/blog/index.html?p=843.html @@ -0,0 +1,373 @@ + + + + + + + +Enabling Search Highlight in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Enabling Search Highlight in Better ListView

    + + + +
    +

    We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    + +
    + + + + +
    + + + + + +

    One Response to “Enabling Search Highlight in Better ListView”

    + +
      +
    1. +
      +
      + Camiel Hessels says:
      + + + +

      Awesome, just what I need! Thanks!

      + + +
      +
    2. +
    + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=850.html b/public/blog/index.html?p=850.html new file mode 100644 index 0000000..2e6a60a --- /dev/null +++ b/public/blog/index.html?p=850.html @@ -0,0 +1,458 @@ + + + + + + + +Binding Images in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Binding Images in Better ListView

    + + + +
    +

    Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=861.html b/public/blog/index.html?p=861.html new file mode 100644 index 0000000..09c67ba --- /dev/null +++ b/public/blog/index.html?p=861.html @@ -0,0 +1,358 @@ + + + + + + + +Hot Tracking Items in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Hot Tracking Items in Better ListView

    + + + +
    +
    Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=868.html b/public/blog/index.html?p=868.html new file mode 100644 index 0000000..5eb4ce5 --- /dev/null +++ b/public/blog/index.html?p=868.html @@ -0,0 +1,362 @@ + + + + + + + +How to Make Items Fading on Edges in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    How to Make Items Fading on Edges in Better ListView

    + + + +
    +

    Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=878.html b/public/blog/index.html?p=878.html new file mode 100644 index 0000000..e90fa5c --- /dev/null +++ b/public/blog/index.html?p=878.html @@ -0,0 +1,344 @@ + + + + + + + +Custom Scroll Bar Size in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Custom Scroll Bar Size in Better ListView

    + + + +
    +
    Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    + +
    + + + + +
    + + + + + +

    4 Responses to “Custom Scroll Bar Size in Better ListView”

    + +
      +
    1. + + +
    2. +
    3. +
      +
      + Dan says:
      + + + +

      Can you change the button height as this would make it a great option for touch screen apps.

      + + +
      + +
    4. +
    + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=882.html b/public/blog/index.html?p=882.html new file mode 100644 index 0000000..73bfecf --- /dev/null +++ b/public/blog/index.html?p=882.html @@ -0,0 +1,366 @@ + + + + + + + +Search Filtering in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Search Filtering in Better ListView

    + + + +
    +
    Search Filtering

    Search Filtering with highlight

    +

    There are few ways of making searching in large list of items more convenient. For example, Better ListView provides Search Highlighting and Item Hiding features that can be used to improve searching. The above animation shows both of these features in action when searching for a word “pear” using keyboard.

    +

    The implementation is very simple and involves handling just two events: ItemSearch (raised whenever item is searched, e.g. using keyboard ) and KeyDown:

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new BetterListView();

    +

    listView.Items.AddRange(new[] { “apple”, “pear”, “pineapple”, “orange”, “grapefruit”, “cherry”, “avocado” });

    +

    listView.ItemSearch += listView_ItemSearch;
    +listView.KeyDown += listView_KeyDown;
    +[/csharp]

    +

    The ItemSearch event handler finds matching items and sets their visibility accordingly. It also updates the highlighting:

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_ItemSearch(object sender, BetterListViewItemSearchEventArgs eventArgs)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    // update item visibility according to search query string
    + foreach (var item in listView.Items)
    + {
    + bool match = item.Text.Contains(eventArgs.QueryString);

    +

    if (match)
    + {
    + item.Visible = true;

    +

    item.SearchHighlight = new BetterListViewSearchHighlight(
    + 0,
    + item.Text.IndexOf(eventArgs.QueryString, StringComparison.Ordinal),
    + eventArgs.QueryString.Length);
    + }
    + else
    + {
    + item.Visible = false;
    + }
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Finally, the KeyDown event handler resets the view when Escape key is pressed (all items are made visible and the highlight is removed):

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_KeyDown(object sender, KeyEventArgs e)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (e.KeyCode == Keys.Escape)
    + {
    + // remove search highlight
    + //NOTE: we could use BetterListView.RemoveSearchHighlight() but this applies to visible items only and some items are hidden at the time
    + foreach (var item in listView.Items)
    + {
    + item.SearchHighlight = BetterListViewSearchHighlight.Empty;
    + }

    +

    // make all items visible
    + foreach (var item in listView.Items)
    + {
    + item.Visible = true;
    + }

    +

    // mark the key as handled
    + e.Handled = true;

    +

    // suppress KeyPress event to prevent ItemSearch from happening
    + e.SuppressKeyPress = true;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    And that’s it!

    + +
    + + + + +
    + + + + + +

    2 Responses to “Search Filtering in Better ListView”

    + +
      +
    1. +
      +
      + mustafa salah says:
      + + + +

      Is this applicable for Express version?

      + + +
      + +
    2. +
    + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=888.html b/public/blog/index.html?p=888.html new file mode 100644 index 0000000..ec6f438 --- /dev/null +++ b/public/blog/index.html?p=888.html @@ -0,0 +1,282 @@ + + + + + + + +Alternating Rows in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Alternating Rows in Better ListView

    + + + +
    +
    Alternating Rows

    Alternating Rows

    +

    Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.

    +

    Simply add DrawItemBackground event handler and fill background on odd/even items:

    +

     

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    + if ((eventArgs.Item.Index & 1) == 1)
    + {
    + eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
    + }
    +}
    +[/csharp]

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=894.html b/public/blog/index.html?p=894.html new file mode 100644 index 0000000..47fb3de --- /dev/null +++ b/public/blog/index.html?p=894.html @@ -0,0 +1,315 @@ + + + + + + + +How to Add Grid Lines in Empty Space in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    How to Add Grid Lines in Empty Space in Better ListView

    + + + +
    +
    Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=901.html b/public/blog/index.html?p=901.html new file mode 100644 index 0000000..52cfe67 --- /dev/null +++ b/public/blog/index.html?p=901.html @@ -0,0 +1,275 @@ + + + + + + + +Sub-item Check Boxes in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Sub-item Check Boxes in Better ListView

    + + + +
    +
    Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=906.html b/public/blog/index.html?p=906.html new file mode 100644 index 0000000..7ac95f0 --- /dev/null +++ b/public/blog/index.html?p=906.html @@ -0,0 +1,273 @@ + + + + + + + +Centering Images in Better ListView Sub-items « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Centering Images in Better ListView Sub-items

    + + + +
    +
    Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=914.html b/public/blog/index.html?p=914.html new file mode 100644 index 0000000..b8ea19d --- /dev/null +++ b/public/blog/index.html?p=914.html @@ -0,0 +1,279 @@ + + + + + + + +BLV and Internet Explorer « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    BLV and Internet Explorer

    + + + +
    +

    As you all know we are constantly working on improving BetterListView, but once in a while you might encounter a problem which has not found its way to our documentation yet.

    +

    Today, our blog post covers an interesting case when using Internet Explorer.
    +When instantiating an ActiveX control written as a .NET assembly exposed via Interop you might get the following message:

    +

    System.IO.FileNotFoundException("Could not load file or assembly 'BetterListView, Version=3.8.2.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx' or one of its dependencies. The system cannot find the file specified.")

    +

    The solution to this problem is a fairly simple one, quoting from an MSDN article:
    +“… you can install it in the global assembly cache so that it can be activated from any COM client. If the assembly is only going to be activated by a single application, you can place it in that application’s directory.”

    +

    Concluding from this short excerpt, you are basically left you with two options:
    +1) You may register BetterListView in GAC if it is to be shared. But you should be careful with GAC because it allows holding multiple versions of the same assembly. You can make the installer remove any older versions from GAC during installation and add/keep just the newest one.
    +2) You can put your .net assembly with all third-party DLLs in one directory during installation if it is to be private.

    +

    We recommend the second solution as we reckon it to be the safer one.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=921.html b/public/blog/index.html?p=921.html new file mode 100644 index 0000000..873e871 --- /dev/null +++ b/public/blog/index.html?p=921.html @@ -0,0 +1,279 @@ + + + + + + + +The Three Main Advantages Better ListView has Over the Classic .NET Framework « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    The Three Main Advantages Better ListView has Over the Classic .NET Framework

    + + + +
    +

    Dear Readers,
    +When evaluating an alternative to replace the .NET ListView you might stumble upon the question: what sets the different solutions available apart from each other? Which one meets my demands the best?
    +Here are the three main reasons we think Better ListView is the ideal solution for you if you are planning to use a professional alternative:

    +

    1) The intuitive approach on getting started

    +

    The good thing is, you can get started right away. Due to the build-up of processes, as well as the well documented procedures you have almost no learning period. Component Owl keeps its design close to the original .NET ListView so you do not have to get acquainted to a completely new system. But still, the changes made are substantial enough to make your working routine so much easier. Whether its the inbuilt drag & drop, the sub-item images or the multi-column sorting, the processes are meant to make your life easier.

    +

    2) The fast and helpful support

    +

    As Component Owl has been on the market for quite a while now, it has been further developed and improved countless times, resulting in a detailed and meaningful FAQ which answer to the majority of your questions. In case you cannot find the answer you need, you can rely on our support system which will give you feedback on you request within 24 hours. This allows you to keep the workflow going with almost no interruptions and puts you ahead of the freeware users.

    +

    3) The possibility to customize

    +

    Just like every developer has his own style of working, Component Owl can be customized to every user needs. The many opportunities to adapt your surface to your favorite design or to arrange the necessary tools the way you need them, allows you to optimize your workflow to perform even better.

    +

    These 3 named advantages are just a few of the many that Component Owl offers you. For more infromation just check out our trial version to see for yourself.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=927.html b/public/blog/index.html?p=927.html new file mode 100644 index 0000000..5e241c5 --- /dev/null +++ b/public/blog/index.html?p=927.html @@ -0,0 +1,284 @@ + + + + + + + +Activation issues and how to solve them « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Activation issues and how to solve them

    + + + +
    +

    Dear Readers,
    +Periodically we get emails from users having problems with the activation. So we put together a check list on how to deal with the most frequent issues. In case these fixes do not help you solve your problem, please contact contact support at support@componentowl.com and we will be happy to help you out.
    +Below, you will find some obstacles we have stumbled across in the past.

    +
      +
    1. Try to rebuild the project/solution
    2. +
    3. Restart Visual Studio if rebuilding the solution did not stop the nag screen
    4. +
    5. If you use Better ListView in a Class Library project, it should be referenced and activated in both, the main project and the Class Library project.
    6. +
    7. Do the main project (executable) and all referenced projects contain the licenses.licx file within the Properties folder? If not, rebuild the main project (executable) and copy the licenses.licx file to the appropriate location in all referenced projects (Class Library or other executables).
    8. +
    9. The licenses.licx file should contain only a single reference to Better ListView with the current version number (e.g. ComponentOwl.BetterListView.BetterListView, BetterListView, Version=3.7.2.0, Culture=neutral, PublicKeyToken=e6c91a3add447be2). If there are more lines referencing Better ListView, remove the obsolete ones. You can also delete the licenses.licx file and rebuild the project to regenerate it.
    10. +
    11. Run the Activator application (installed along with the product) and check if it displays a valid license (license info should be displayed in green).
    12. +
    13. You can try to finish the activation via the Activator app and then rebuild the main project. The Activator allows custom proxy settings for activation from behind a web proxy (often present in corporate environments).
    14. +
    15. Check, if the license-blv.dat file is present in the “C:\ProgramData\Component Owl\” folder after activation. If not, please contact support at support@componentowl.com
    16. +
    17. Check, if your projects reference the same version of Better ListView as the one that is installed. Open the „Reference Properties“ window by right clicking on Better ListView reference in the Solution Explorer. Then check if there is a Specific Version property set to true. If so, remove the reference and add a new reference to Better ListView with the correct version. You can also just set Specific Version property to false.
    18. +
    19. The Better ListView has to be activated on each machine where it is built. Do not copy the license-blv.dat file because this is specific to each machine. Rather follow the activation process on each machine.
    20. +
    +

    We hope these clues can help you, in case you encounter a problem during the activation. As mentioned before, please contact support, if the issues persist.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/index.html?p=93.html b/public/blog/index.html?p=93.html new file mode 100644 index 0000000..5509898 --- /dev/null +++ b/public/blog/index.html?p=93.html @@ -0,0 +1,281 @@ + + + + + + + +Better ListView reviewed at DevProConnections.com « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Better ListView reviewed at DevProConnections.com

    + + + +
    +

    Our component got recently reviewed by Mike Riley. The review has a very positive tone. Here are some excerpts:

    +

    From the Better ListView review at DevProConnections.com:

    +

    In addition to creating a new ListView control to incorporate broader flexibility and functionality, Better ListView could also be called Fixed ListView, as it corrects a number of annoying problems with the standard ListView that Microsoft delivers to Visual Studio customers. For example, drag and drop and check boxes actually work they way one expects, and column headers and list sorting behave the way they do in the Windows Explorer and other native Windows OS applications. Likewise, improvements that go beyond the standard ListView, such as support for various image sizes and locations (in the column header or subitems, for example) further elevate Better ListView beyond Microsoft’s offering.

    +

    The review also states:

    +

    The control is very easy and intuitive to use and is well documented

    +

    The reviewer found the product obviously immensely helpful:

    +

    The enhancements I found most useful for my own projects were the automatic layout, context menus, improved drag and drop, item searching, and sorting options. Thanks to both the source code–included demos, the online documentation, and the obvious property names of the control’s “better” features, I was able to put the component to use faster than it took me to install the setup package.

    +

    The only negative thing mentioned in the review was our pricing:

    +

    Although I found using the control fast and intuitive, the one aspect that is a downer is the price. Considering that this is the era of .NET component bundles that offer hundreds of components, pricing this single .NET Windows Form control at the price ComponentOwl has is too high for my tastes.

    +

    Let me elaborate on that a bit. Although there are huge component packs for .NET, not a single one of them has a list view like our Better ListView. Most of the list view controls included in “packs” are simply not as powerful, which is only logical. Developers of these packs simply can’t focus their development just on the list view control that much, as they also have other 100 controls to develop and update.

    +

    However, the biggest drawback of list views that are part of a component packages is this: They usually implement their own class names and conventions, but what’s worse, their own custom look and behavior. These list view controls usually do not look and behave like native list view should. They can easily frustrate the user, right during the first few seconds of using them. I think that the first impression is important. So these controls are not easy drop-in replacements, but rather a whole different approach, which may be suited for some projects, but is IMHO inferior for standard Windows desktop applications, as compared to using controls that respect native look and behavior, like our Better ListView does.

    +

    Yes, we are perfectionists.

    + +
    + + + + +
    + + + + + + + + + + + +
    + +

    Leave a Reply

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/list-view-drag-and-drop-item-reorder-sort/feed/index.html b/public/blog/list-view-drag-and-drop-item-reorder-sort/feed/index.html new file mode 100644 index 0000000..ca7460c --- /dev/null +++ b/public/blog/list-view-drag-and-drop-item-reorder-sort/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: List-View Drag and Drop Item Reorder (Sort) + + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/non-selectable-items-in-better-listview/feed/index.html b/public/blog/non-selectable-items-in-better-listview/feed/index.html new file mode 100644 index 0000000..355c65a --- /dev/null +++ b/public/blog/non-selectable-items-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Non-selectable Items in Better ListView + + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/page/3/index.html b/public/blog/page/3/index.html new file mode 100644 index 0000000..c45251f --- /dev/null +++ b/public/blog/page/3/index.html @@ -0,0 +1,291 @@ + + + + + + + + Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + + + + +
    +

    Sub-item Check Boxes in Better ListView

    + + + +
    +
    Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +
    + + + +
    + + +
    +

    How to Add Grid Lines in Empty Space in Better ListView

    + + + +
    +
    Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    +
    + + + +
    + + + + + +
    + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/page/4/index.html b/public/blog/page/4/index.html new file mode 100644 index 0000000..7bee1f9 --- /dev/null +++ b/public/blog/page/4/index.html @@ -0,0 +1,315 @@ + + + + + + + + Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + + + + +
    +

    Alternating Rows in Better ListView

    + + + +
    +
    Alternating Rows

    Alternating Rows

    +

    Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.

    +

    Simply add DrawItemBackground event handler and fill background on odd/even items:

    +

     

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    + if ((eventArgs.Item.Index & 1) == 1)
    + {
    + eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
    + }
    +}
    +[/csharp]

    +
    + + + +
    + + +
    +

    Search Filtering in Better ListView

    + + + +
    +
    Search Filtering

    Search Filtering with highlight

    +

    There are few ways of making searching in large list of items more convenient. For example, Better ListView provides Search Highlighting and Item Hiding features that can be used to improve searching. The above animation shows both of these features in action when searching for a word “pear” using keyboard.

    +

    The implementation is very simple and involves handling just two events: ItemSearch (raised whenever item is searched, e.g. using keyboard ) and KeyDown:

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new BetterListView();

    +

    listView.Items.AddRange(new[] { “apple”, “pear”, “pineapple”, “orange”, “grapefruit”, “cherry”, “avocado” });

    +

    listView.ItemSearch += listView_ItemSearch;
    +listView.KeyDown += listView_KeyDown;
    +[/csharp]

    +

    The ItemSearch event handler finds matching items and sets their visibility accordingly. It also updates the highlighting:

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_ItemSearch(object sender, BetterListViewItemSearchEventArgs eventArgs)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    // update item visibility according to search query string
    + foreach (var item in listView.Items)
    + {
    + bool match = item.Text.Contains(eventArgs.QueryString);

    +

    if (match)
    + {
    + item.Visible = true;

    +

    item.SearchHighlight = new BetterListViewSearchHighlight(
    + 0,
    + item.Text.IndexOf(eventArgs.QueryString, StringComparison.Ordinal),
    + eventArgs.QueryString.Length);
    + }
    + else
    + {
    + item.Visible = false;
    + }
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Finally, the KeyDown event handler resets the view when Escape key is pressed (all items are made visible and the highlight is removed):

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_KeyDown(object sender, KeyEventArgs e)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (e.KeyCode == Keys.Escape)
    + {
    + // remove search highlight
    + //NOTE: we could use BetterListView.RemoveSearchHighlight() but this applies to visible items only and some items are hidden at the time
    + foreach (var item in listView.Items)
    + {
    + item.SearchHighlight = BetterListViewSearchHighlight.Empty;
    + }

    +

    // make all items visible
    + foreach (var item in listView.Items)
    + {
    + item.Visible = true;
    + }

    +

    // mark the key as handled
    + e.Handled = true;

    +

    // suppress KeyPress event to prevent ItemSearch from happening
    + e.SuppressKeyPress = true;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    And that’s it!

    +
    + + + +
    + + + + + +
    + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/page/5/index.html b/public/blog/page/5/index.html new file mode 100644 index 0000000..2d9f1be --- /dev/null +++ b/public/blog/page/5/index.html @@ -0,0 +1,345 @@ + + + + + + + + Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + + + + +
    +

    Custom Scroll Bar Size in Better ListView

    + + + +
    +
    Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +
    + + + +
    + + +
    +

    How to Make Items Fading on Edges in Better ListView

    + + + +
    +

    Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +
    + + + +
    + + + + + +
    + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/page/6/index.html b/public/blog/page/6/index.html new file mode 100644 index 0000000..09abe62 --- /dev/null +++ b/public/blog/page/6/index.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/read-only-mode-in-better-listview/feed/index.html b/public/blog/read-only-mode-in-better-listview/feed/index.html new file mode 100644 index 0000000..5b09623 --- /dev/null +++ b/public/blog/read-only-mode-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Read-Only Mode in Better ListView + + http://www.componentowl.com/blog/read-only-mode-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/right-aligned-images-in-better-listview/feed/index.html b/public/blog/right-aligned-images-in-better-listview/feed/index.html new file mode 100644 index 0000000..5117b6e --- /dev/null +++ b/public/blog/right-aligned-images-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Right-aligned Images in Better ListView + + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/search-filtering-in-better-listview/feed/index.html b/public/blog/search-filtering-in-better-listview/feed/index.html new file mode 100644 index 0000000..d7e8275 --- /dev/null +++ b/public/blog/search-filtering-in-better-listview/feed/index.html @@ -0,0 +1,46 @@ + + + Comments on: Search Filtering in Better ListView + + http://www.componentowl.com/blog/search-filtering-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + By: Libor Tinka + http://www.componentowl.com/blog/search-filtering-in-better-listview/#comment-1369 + + Sun, 06 Jul 2014 21:38:54 +0000 + http://www.componentowl.com/blog/?p=882#comment-1369 + + Yes, this feature is also available in Express version.

    +]]>
    +
    + + By: mustafa salah + http://www.componentowl.com/blog/search-filtering-in-better-listview/#comment-1353 + + Sat, 03 May 2014 14:52:37 +0000 + http://www.componentowl.com/blog/?p=882#comment-1353 + + Is this applicable for Express version?

    +]]>
    +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/search-filtering-in-better-listview/index.html?replytocom=1353.html b/public/blog/search-filtering-in-better-listview/index.html?replytocom=1353.html new file mode 100644 index 0000000..dc2aad0 --- /dev/null +++ b/public/blog/search-filtering-in-better-listview/index.html?replytocom=1353.html @@ -0,0 +1,367 @@ + + + + + + + +Search Filtering in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Search Filtering in Better ListView

    + + + +
    +
    Search Filtering

    Search Filtering with highlight

    +

    There are few ways of making searching in large list of items more convenient. For example, Better ListView provides Search Highlighting and Item Hiding features that can be used to improve searching. The above animation shows both of these features in action when searching for a word “pear” using keyboard.

    +

    The implementation is very simple and involves handling just two events: ItemSearch (raised whenever item is searched, e.g. using keyboard ) and KeyDown:

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new BetterListView();

    +

    listView.Items.AddRange(new[] { “apple”, “pear”, “pineapple”, “orange”, “grapefruit”, “cherry”, “avocado” });

    +

    listView.ItemSearch += listView_ItemSearch;
    +listView.KeyDown += listView_KeyDown;
    +[/csharp]

    +

    The ItemSearch event handler finds matching items and sets their visibility accordingly. It also updates the highlighting:

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_ItemSearch(object sender, BetterListViewItemSearchEventArgs eventArgs)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    // update item visibility according to search query string
    + foreach (var item in listView.Items)
    + {
    + bool match = item.Text.Contains(eventArgs.QueryString);

    +

    if (match)
    + {
    + item.Visible = true;

    +

    item.SearchHighlight = new BetterListViewSearchHighlight(
    + 0,
    + item.Text.IndexOf(eventArgs.QueryString, StringComparison.Ordinal),
    + eventArgs.QueryString.Length);
    + }
    + else
    + {
    + item.Visible = false;
    + }
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Finally, the KeyDown event handler resets the view when Escape key is pressed (all items are made visible and the highlight is removed):

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_KeyDown(object sender, KeyEventArgs e)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (e.KeyCode == Keys.Escape)
    + {
    + // remove search highlight
    + //NOTE: we could use BetterListView.RemoveSearchHighlight() but this applies to visible items only and some items are hidden at the time
    + foreach (var item in listView.Items)
    + {
    + item.SearchHighlight = BetterListViewSearchHighlight.Empty;
    + }

    +

    // make all items visible
    + foreach (var item in listView.Items)
    + {
    + item.Visible = true;
    + }

    +

    // mark the key as handled
    + e.Handled = true;

    +

    // suppress KeyPress event to prevent ItemSearch from happening
    + e.SuppressKeyPress = true;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    And that’s it!

    + +
    + + + + +
    + + + + + +

    2 Responses to “Search Filtering in Better ListView”

    + +
      +
    1. +
      +
      + mustafa salah says:
      + + + +

      Is this applicable for Express version?

      + + +
      + +
    2. +
    + + + + + +
    + +

    Leave a Reply to mustafa salah

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/search-filtering-in-better-listview/index.html?replytocom=1369.html b/public/blog/search-filtering-in-better-listview/index.html?replytocom=1369.html new file mode 100644 index 0000000..9139a8b --- /dev/null +++ b/public/blog/search-filtering-in-better-listview/index.html?replytocom=1369.html @@ -0,0 +1,367 @@ + + + + + + + +Search Filtering in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Search Filtering in Better ListView

    + + + +
    +
    Search Filtering

    Search Filtering with highlight

    +

    There are few ways of making searching in large list of items more convenient. For example, Better ListView provides Search Highlighting and Item Hiding features that can be used to improve searching. The above animation shows both of these features in action when searching for a word “pear” using keyboard.

    +

    The implementation is very simple and involves handling just two events: ItemSearch (raised whenever item is searched, e.g. using keyboard ) and KeyDown:

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new BetterListView();

    +

    listView.Items.AddRange(new[] { “apple”, “pear”, “pineapple”, “orange”, “grapefruit”, “cherry”, “avocado” });

    +

    listView.ItemSearch += listView_ItemSearch;
    +listView.KeyDown += listView_KeyDown;
    +[/csharp]

    +

    The ItemSearch event handler finds matching items and sets their visibility accordingly. It also updates the highlighting:

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_ItemSearch(object sender, BetterListViewItemSearchEventArgs eventArgs)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    // update item visibility according to search query string
    + foreach (var item in listView.Items)
    + {
    + bool match = item.Text.Contains(eventArgs.QueryString);

    +

    if (match)
    + {
    + item.Visible = true;

    +

    item.SearchHighlight = new BetterListViewSearchHighlight(
    + 0,
    + item.Text.IndexOf(eventArgs.QueryString, StringComparison.Ordinal),
    + eventArgs.QueryString.Length);
    + }
    + else
    + {
    + item.Visible = false;
    + }
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Finally, the KeyDown event handler resets the view when Escape key is pressed (all items are made visible and the highlight is removed):

    +

    [csharp gutter=”false” toolbar=”false”]
    +void listView_KeyDown(object sender, KeyEventArgs e)
    +{
    + var listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (e.KeyCode == Keys.Escape)
    + {
    + // remove search highlight
    + //NOTE: we could use BetterListView.RemoveSearchHighlight() but this applies to visible items only and some items are hidden at the time
    + foreach (var item in listView.Items)
    + {
    + item.SearchHighlight = BetterListViewSearchHighlight.Empty;
    + }

    +

    // make all items visible
    + foreach (var item in listView.Items)
    + {
    + item.Visible = true;
    + }

    +

    // mark the key as handled
    + e.Handled = true;

    +

    // suppress KeyPress event to prevent ItemSearch from happening
    + e.SuppressKeyPress = true;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    And that’s it!

    + +
    + + + + +
    + + + + + +

    2 Responses to “Search Filtering in Better ListView”

    + +
      +
    1. +
      +
      + mustafa salah says:
      + + + +

      Is this applicable for Express version?

      + + +
      + +
    2. +
    + + + + + +
    + +

    Leave a Reply to Libor Tinka

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/sub-item-check-boxes-in-better-listview/feed/index.html b/public/blog/sub-item-check-boxes-in-better-listview/feed/index.html new file mode 100644 index 0000000..a3d39e9 --- /dev/null +++ b/public/blog/sub-item-check-boxes-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Sub-item Check Boxes in Better ListView + + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/synergy-of-better-listview-and-our-applications/feed/index.html b/public/blog/synergy-of-better-listview-and-our-applications/feed/index.html new file mode 100644 index 0000000..6387e3b --- /dev/null +++ b/public/blog/synergy-of-better-listview-and-our-applications/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Synergy of Better ListView and Our Applications + + http://www.componentowl.com/blog/synergy-of-better-listview-and-our-applications/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/tag/1-52/feed/index.html b/public/blog/tag/1-52/feed/index.html new file mode 100644 index 0000000..9791874 --- /dev/null +++ b/public/blog/tag/1-52/feed/index.html @@ -0,0 +1,53 @@ + + + + 1.52 – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 1.52 released + http://www.componentowl.com/blog/better-listview-1-52-released/ + http://www.componentowl.com/blog/better-listview-1-52-released/#respond + Tue, 29 Mar 2011 16:21:14 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=213 + + Another minor release with many fixes and some new features.

    +

    See what’s new in Better ListView 1.52.

    +

    Download the new version.

    +

    We are still working on the new major features (Item hierarchy, groups) as described here. These new features are near completion.

    +]]>
    + http://www.componentowl.com/blog/better-listview-1-52-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/1-52/index.html b/public/blog/tag/1-52/index.html new file mode 100644 index 0000000..ed03cb6 --- /dev/null +++ b/public/blog/tag/1-52/index.html @@ -0,0 +1,212 @@ + + + + + + + +1.52 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/2-00/feed/index.html b/public/blog/tag/2-00/feed/index.html new file mode 100644 index 0000000..640b24d --- /dev/null +++ b/public/blog/tag/2-00/feed/index.html @@ -0,0 +1,94 @@ + + + + 2.00 – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/2-00/index.html b/public/blog/tag/2-00/index.html new file mode 100644 index 0000000..26dadc1 --- /dev/null +++ b/public/blog/tag/2-00/index.html @@ -0,0 +1,212 @@ + + + + + + + +2.00 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/2-01/feed/index.html b/public/blog/tag/2-01/feed/index.html new file mode 100644 index 0000000..5eb5ead --- /dev/null +++ b/public/blog/tag/2-01/feed/index.html @@ -0,0 +1,62 @@ + + + + 2.01 – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Hide a Column in Better ListView + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/ + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/#respond + Fri, 05 Aug 2011 11:56:31 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=330 + + The most popular view in ListView-like controls seems to be the “Details” view with columns, items and sub-items.

    +

    When someone wants to remove a column, he usually thinks of simply removing the column header from the Columns collection. Unfortunately, it’s not that simple. The sub-items get shifted and he needs to remove sub-items corresponding to the removed column for all items as well.

    +

    This is because ListView is not a control for displaying grids (a matrix of cells), but really the lists – sequences of objects, and the sub-items are not cells either, they are something like an extension of each item to support additional information about the item.

    +

    So how we neatly hide a column?

    +

    We introduced Column Hiding feature in the version 2.0.1. You can simply call Hide() on your column header instance and you’re done! There is also corresponding Show() method provided. Or you can set boolean Visible property. Now the column and all subsequent sub-items are hidden from view (although they are still present in data, of course):

    +

     

    +
    Hiding column via context menu

    Hiding column via context menu...

    +

     

    +
    The sixth column is hidden...

    ...and the sixth column gets hidden.

    +

     

    +

    Download Better ListView

    +]]>
    + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/2-01/index.html b/public/blog/tag/2-01/index.html new file mode 100644 index 0000000..70635a1 --- /dev/null +++ b/public/blog/tag/2-01/index.html @@ -0,0 +1,212 @@ + + + + + + + +2.01 « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/aero/feed/index.html b/public/blog/tag/aero/feed/index.html new file mode 100644 index 0000000..5c88e6f --- /dev/null +++ b/public/blog/tag/aero/feed/index.html @@ -0,0 +1,64 @@ + + + + aero – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Windows Theme Support in Better ListView + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/#respond + Fri, 01 Jul 2011 22:46:55 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=287 + + Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    +]]>
    + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/aero/index.html b/public/blog/tag/aero/index.html new file mode 100644 index 0000000..ff5c43f --- /dev/null +++ b/public/blog/tag/aero/index.html @@ -0,0 +1,212 @@ + + + + + + + +aero « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/align/feed/index.html b/public/blog/tag/align/feed/index.html new file mode 100644 index 0000000..75fece1 --- /dev/null +++ b/public/blog/tag/align/feed/index.html @@ -0,0 +1,93 @@ + + + + align – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Right-aligned Images in Better ListView + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/ + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/#respond + Thu, 19 Apr 2012 19:15:13 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=780 + + Better ListView 2.9.0 now supports more customizable image alignment. For example, images can be aligned on the right part of item:

    +
    Right-aligned Images

    Right-aligned Images

    +

    The alignment can be set separately on every sub-item (using AlignImageHorizontal and AlignImageVertical properties).

    +

    Moreover, the right-aligned images can be used in column headers and groups:

    +
    Group image alignment

    Group image alignment

    +

    The alignment of images is similar to that of text. Every image has its frame, which can be possibly larger than the image itself. In such case, the image needs to be further aligned within the frame. This has been done automatically by centering the image within frame, but now you have full control over the alignment.

    +]]>
    + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/align/index.html b/public/blog/tag/align/index.html new file mode 100644 index 0000000..95d3c33 --- /dev/null +++ b/public/blog/tag/align/index.html @@ -0,0 +1,214 @@ + + + + + + + +align « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/aligned/feed/index.html b/public/blog/tag/aligned/feed/index.html new file mode 100644 index 0000000..51fb30d --- /dev/null +++ b/public/blog/tag/aligned/feed/index.html @@ -0,0 +1,61 @@ + + + + aligned – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Right-aligned Images in Better ListView + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/ + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/#respond + Thu, 19 Apr 2012 19:15:13 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=780 + + Better ListView 2.9.0 now supports more customizable image alignment. For example, images can be aligned on the right part of item:

    +
    Right-aligned Images

    Right-aligned Images

    +

    The alignment can be set separately on every sub-item (using AlignImageHorizontal and AlignImageVertical properties).

    +

    Moreover, the right-aligned images can be used in column headers and groups:

    +
    Group image alignment

    Group image alignment

    +

    The alignment of images is similar to that of text. Every image has its frame, which can be possibly larger than the image itself. In such case, the image needs to be further aligned within the frame. This has been done automatically by centering the image within frame, but now you have full control over the alignment.

    +]]>
    + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/aligned/index.html b/public/blog/tag/aligned/index.html new file mode 100644 index 0000000..38e54f0 --- /dev/null +++ b/public/blog/tag/aligned/index.html @@ -0,0 +1,212 @@ + + + + + + + +aligned « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/alignment/feed/index.html b/public/blog/tag/alignment/feed/index.html new file mode 100644 index 0000000..e087e3c --- /dev/null +++ b/public/blog/tag/alignment/feed/index.html @@ -0,0 +1,104 @@ + + + + alignment – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Right-aligned Images in Better ListView + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/ + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/#respond + Thu, 19 Apr 2012 19:15:13 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=780 + + Better ListView 2.9.0 now supports more customizable image alignment. For example, images can be aligned on the right part of item:

    +
    Right-aligned Images

    Right-aligned Images

    +

    The alignment can be set separately on every sub-item (using AlignImageHorizontal and AlignImageVertical properties).

    +

    Moreover, the right-aligned images can be used in column headers and groups:

    +
    Group image alignment

    Group image alignment

    +

    The alignment of images is similar to that of text. Every image has its frame, which can be possibly larger than the image itself. In such case, the image needs to be further aligned within the frame. This has been done automatically by centering the image within frame, but now you have full control over the alignment.

    +]]>
    + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/feed/ + 0 +
    + + Vertical Alignment and Text Wrapping in Better ListView + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/ + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/#comments + Wed, 16 Nov 2011 23:57:39 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=437 + + .NET ListView supports horizontal alignment of text in columns, items, sub-items and groups. Since Better ListView adds many new features, like multi-line items and images of arbitrary size, vertical alignment comes in handy.

    +

    By default, each view has its defaults, but you can customize text alignment on every column, item, sub-item and group individually:

    +
    +
    Vertical alignments of text

    Vertical alignments of text

    +
    +
    +
    +
    +

    The vertical alignment feature is a new property of each element type. For example, .NET ListView item has a property called Align which refers to horizontal alignment. Better ListView extends this to two independent properties called AlignHorizontal and AlignVertical. The naming scheme is same for columns, items, sub-items and groups.

    +

    Better ListView also supports splitting text in column headers and items (sub-items) into multiple lines.

    +

    We extended this functionality by adding a BetterListViewItem.TextWrapping and BetterListViewSubItem.TextWrapping properties. With these, you can control how the text in sub-items will be wrapped. There are three possible values:

    +
      +
    • Layout – the text will be wrapped to multiple lines, up to value specified by MaximumTextLines property of the corresponding view (layout)
    • +
    • None – the text will not be wrapped at all
    • +
    • Space – the text will be wrapped, but only to available space (item will never get higher due to wrapping text in sub-item with this setting)
    • +
    +
    The following screenshot shows these three wrapping modes in action:
    +
    +
    Various text wrapping modes

    Various text wrapping modes

    +
    +

    The sub-item in the first column has TextWrapping set to Layout and the layout has MaximumTextLines set to 4. The sub-item text thus can be split to up to four lines. It is actually split just to three because the column is wide enough.

    +

    The sub-item in the second column has TextWrapping set to None, which means the text in this sub-item is kept on single line.

    +

    The sub-item in the third column has TextWrapping set to Space. As you can see, even if the MaximumTextLines is set to 4, the sub-item text is limited to three lines, preventing item to grow larger.

    +]]>
    + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/alignment/index.html b/public/blog/tag/alignment/index.html new file mode 100644 index 0000000..6defae3 --- /dev/null +++ b/public/blog/tag/alignment/index.html @@ -0,0 +1,214 @@ + + + + + + + +alignment « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/alternating/feed/index.html b/public/blog/tag/alternating/feed/index.html new file mode 100644 index 0000000..0a7765b --- /dev/null +++ b/public/blog/tag/alternating/feed/index.html @@ -0,0 +1,64 @@ + + + + alternating – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Alternating Rows in Better ListView + http://www.componentowl.com/blog/alternating-rows-in-better-listview/ + http://www.componentowl.com/blog/alternating-rows-in-better-listview/#respond + Tue, 22 Apr 2014 22:38:15 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=888 + + Alternating Rows

    Alternating Rows

    +

    Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.

    +

    Simply add DrawItemBackground event handler and fill background on odd/even items:

    +

     

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    + if ((eventArgs.Item.Index & 1) == 1)
    + {
    + eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
    + }
    +}
    +[/csharp]

    +]]>
    + http://www.componentowl.com/blog/alternating-rows-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/alternating/index.html b/public/blog/tag/alternating/index.html new file mode 100644 index 0000000..d253006 --- /dev/null +++ b/public/blog/tag/alternating/index.html @@ -0,0 +1,212 @@ + + + + + + + +alternating « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/backcolor/feed/index.html b/public/blog/tag/backcolor/feed/index.html new file mode 100644 index 0000000..48bc454 --- /dev/null +++ b/public/blog/tag/backcolor/feed/index.html @@ -0,0 +1,154 @@ + + + + backcolor – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/backcolor/index.html b/public/blog/tag/backcolor/index.html new file mode 100644 index 0000000..627cf3a --- /dev/null +++ b/public/blog/tag/backcolor/index.html @@ -0,0 +1,212 @@ + + + + + + + +backcolor « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/background/feed/index.html b/public/blog/tag/background/feed/index.html new file mode 100644 index 0000000..5e147d7 --- /dev/null +++ b/public/blog/tag/background/feed/index.html @@ -0,0 +1,84 @@ + + + + background – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/background/index.html b/public/blog/tag/background/index.html new file mode 100644 index 0000000..df383f2 --- /dev/null +++ b/public/blog/tag/background/index.html @@ -0,0 +1,212 @@ + + + + + + + +background « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/bars/feed/index.html b/public/blog/tag/bars/feed/index.html new file mode 100644 index 0000000..9bcd508 --- /dev/null +++ b/public/blog/tag/bars/feed/index.html @@ -0,0 +1,70 @@ + + + + bars – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/bars/index.html b/public/blog/tag/bars/index.html new file mode 100644 index 0000000..d0f8700 --- /dev/null +++ b/public/blog/tag/bars/index.html @@ -0,0 +1,212 @@ + + + + + + + +bars « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/behavior/feed/index.html b/public/blog/tag/behavior/feed/index.html new file mode 100644 index 0000000..407dc2b --- /dev/null +++ b/public/blog/tag/behavior/feed/index.html @@ -0,0 +1,90 @@ + + + + behavior – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Behavior of Group Headers in Better ListView + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/ + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/#respond + Fri, 20 Jan 2012 09:40:44 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=480 + + When developing our desktop applications, me and Jiri needed to adjust behavior of group headers in the Better ListView control.

    +

    We discovered that making group header behavior customizable would be useful not only for us, but for other developers who utilize Better ListView as well, so we implemented this feature officially in Better ListView 2.5.0.

    +

    There are two new properties: ShowDefaultGroupHeader and GroupHeaderBehavior.

    +

    Hiding the Default Group Header

    +

    The ShowDefaultGroupHeader is initially set to true. This means that the default group (the group containing items which do not have a specific group) have its header displayed:

    +
    Default group header is visible

    Default group header is visible

    +

    When ShowDefaultGroupHeader is set to false, the “Default” group header on top can be hidden:

    +
    Default group header is hidden

    Default group header is hidden

    +

    Adjusting Group Header Behavior

    +

    The group headers have two kinds of behavior. They can be focused and can cause selection of items. Both of these functions can be invoked by keyboard and mouse.

    +

    The GroupHeaderBehavior property allows changing this behavior for keyboard and mouse separately.

    +

    By default, the property is set to BetterListViewGroupHeaderBehavior.All, so that all functions of the group header are turned on.

    +

    You may want to make group headers completely non-interactive. This can be done by setting the property to BetterListViewGroupHeaderBehavior.None.

    +

    Other values of the enum can be combined to create desired behavior.

    +

    Keyboard:

    +
      +
    • Focus only
    • +
    • Focus and select items in the group
    • +
    +

    Mouse:

    +
      +
    • Focus
    • +
    • Select items in the group
    • +
    • Highligh when mouse cursor is over the group header
    • +
    +
    The expand button of group headers can still be used even if the group header has all the behaviors turned off. If you need to hide the expand button as well, set BetterListViewGroup.AllowShowExpandButton to false.
    +

    Use Case: Metadata Viewer

    +

    Here Better ListView is used for viewing image metadata tags:

    +
    Metadata View window

    Metadata View window

    +

    Only one tag can be selected at a time, so clicking on a group header has no effect on selection and need not to be highlighted.

    +

    One may still need, however, to allow focusing the group header with keyboard and mouse so that it is possible to collapse/expand the group with arrow keys. The desired behavior can be set this way:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus & BetterListViewGroupHeaderBehavior.MouseFocus);[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus And BetterListViewGroupHeaderBehavior.MouseFocus)[/vb]

    +]]>
    + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/behavior/index.html b/public/blog/tag/behavior/index.html new file mode 100644 index 0000000..4857d4f --- /dev/null +++ b/public/blog/tag/behavior/index.html @@ -0,0 +1,212 @@ + + + + + + + +behavior « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/below/feed/index.html b/public/blog/tag/below/feed/index.html new file mode 100644 index 0000000..e172faa --- /dev/null +++ b/public/blog/tag/below/feed/index.html @@ -0,0 +1,98 @@ + + + + below – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Add Grid Lines in Empty Space in Better ListView + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/#respond + Wed, 30 Apr 2014 09:51:46 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=894 + + Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    +]]>
    + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/below/index.html b/public/blog/tag/below/index.html new file mode 100644 index 0000000..350fce8 --- /dev/null +++ b/public/blog/tag/below/index.html @@ -0,0 +1,212 @@ + + + + + + + +below « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/better-listview-2/feed/index.html b/public/blog/tag/better-listview-2/feed/index.html new file mode 100644 index 0000000..3ee245f --- /dev/null +++ b/public/blog/tag/better-listview-2/feed/index.html @@ -0,0 +1,918 @@ + + + + better listview – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Alternating Rows in Better ListView + http://www.componentowl.com/blog/alternating-rows-in-better-listview/ + http://www.componentowl.com/blog/alternating-rows-in-better-listview/#respond + Tue, 22 Apr 2014 22:38:15 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=888 + + Alternating Rows

    Alternating Rows

    +

    Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.

    +

    Simply add DrawItemBackground event handler and fill background on odd/even items:

    +

     

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    + if ((eventArgs.Item.Index & 1) == 1)
    + {
    + eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
    + }
    +}
    +[/csharp]

    +]]>
    + http://www.componentowl.com/blog/alternating-rows-in-better-listview/feed/ + 0 +
    + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    + + Better ListView Tip: How to Draw Custom Selection + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/ + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/#comments + Wed, 12 Sep 2012 15:43:12 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=808 + + Customized item selection.

    Customized item selection.

    +

     

    +

    By default, Better ListView uses system theme for drawing selections.

    +

    To draw custom selection, you can use owner drawing capabilities of Better ListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +class CustomListView : BetterListView
    +{
    + protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
    + brushSelection.Dispose();
    + }
    + }

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + eventArgs.DrawSelection = false;

    +

    base.OnDrawItem(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
    + brushSelection.Dispose()
    + End If
    + End Sub

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + eventArgs.DrawSelection = False

    +

    MyBase.OnDrawItem(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
    + End If
    + End Sub
    +End Class
    +[/vb]

    +

    In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

    +

    The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

    +

    The OnDrawItem method contains two things:

    +
      +
    1. Turn off  default selection.
    2. +
    3. Draw custom selection border if the item is selected.
    4. +
    +

    Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

    +

    Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

    +

    To allow these states, considerable coding need to be done.

    +

    In case you need this level of customization, please contact us for Custom Coding support.

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/feed/ + 2 +
    + + Hiding Column Headers in Better ListView + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/#respond + Mon, 27 Aug 2012 23:11:27 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=803 + + Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    +]]>
    + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/better-listview-2/index.html b/public/blog/tag/better-listview-2/index.html new file mode 100644 index 0000000..1bc2e10 --- /dev/null +++ b/public/blog/tag/better-listview-2/index.html @@ -0,0 +1,274 @@ + + + + + + + +better listview « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + + +

    Posts Tagged ‘better listview’

    + + + + + +
    + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/tag/better/feed/index.html b/public/blog/tag/better/feed/index.html new file mode 100644 index 0000000..8ea161c --- /dev/null +++ b/public/blog/tag/better/feed/index.html @@ -0,0 +1,512 @@ + + + + better – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    + + How to Add Grid Lines in Empty Space in Better ListView + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/#respond + Wed, 30 Apr 2014 09:51:46 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=894 + + Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    +]]>
    + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/ + 0 +
    + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    + + Right-aligned Images in Better ListView + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/ + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/#respond + Thu, 19 Apr 2012 19:15:13 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=780 + + Better ListView 2.9.0 now supports more customizable image alignment. For example, images can be aligned on the right part of item:

    +
    Right-aligned Images

    Right-aligned Images

    +

    The alignment can be set separately on every sub-item (using AlignImageHorizontal and AlignImageVertical properties).

    +

    Moreover, the right-aligned images can be used in column headers and groups:

    +
    Group image alignment

    Group image alignment

    +

    The alignment of images is similar to that of text. Every image has its frame, which can be possibly larger than the image itself. In such case, the image needs to be further aligned within the frame. This has been done automatically by centering the image within frame, but now you have full control over the alignment.

    +]]>
    + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/feed/ + 0 +
    + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    + + Windows Theme Support in Better ListView + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/#respond + Fri, 01 Jul 2011 22:46:55 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=287 + + Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    +]]>
    + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/better/index.html b/public/blog/tag/better/index.html new file mode 100644 index 0000000..746f4e2 --- /dev/null +++ b/public/blog/tag/better/index.html @@ -0,0 +1,226 @@ + + + + + + + +better « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/tag/between/feed/index.html b/public/blog/tag/between/feed/index.html new file mode 100644 index 0000000..9eedada --- /dev/null +++ b/public/blog/tag/between/feed/index.html @@ -0,0 +1,59 @@ + + + + between – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Spacing between Items in Details View + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/ + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/#respond + Tue, 13 Mar 2012 22:53:09 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=753 + + Better ListView 2.6 newly supports custom spacing between items in Details view:

    +
    Custom Spacing between Items

    Custom Spacing between Items

    +

    This property has been recently available in other views, but Details view was exception since its selections needed to be treated in different way: They overlap by 1 pixel so that the double border is avoided in neighboring selections:

    +
    1 px overlap of items

    1 px overlap of items

    +

    We have resolved this to get proper behavior with custom spacings and now the spacing can be set the same way as in any other view:

    +

    Simply set LayoutItemsCurrent.ElementOuterPadding to have custom horizontal and vertical padding between items.

    +

    You can set this specifically for Details view by refering to property LayoutItemsDetails or LayoutItemsDetailsColumns (Details view with columns).

    +]]>
    + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/between/index.html b/public/blog/tag/between/index.html new file mode 100644 index 0000000..0608e44 --- /dev/null +++ b/public/blog/tag/between/index.html @@ -0,0 +1,212 @@ + + + + + + + +between « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/bind/feed/index.html b/public/blog/tag/bind/feed/index.html new file mode 100644 index 0000000..f9911cf --- /dev/null +++ b/public/blog/tag/bind/feed/index.html @@ -0,0 +1,246 @@ + + + + bind – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/bind/index.html b/public/blog/tag/bind/index.html new file mode 100644 index 0000000..d8a4351 --- /dev/null +++ b/public/blog/tag/bind/index.html @@ -0,0 +1,212 @@ + + + + + + + +bind « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/binding/feed/index.html b/public/blog/tag/binding/feed/index.html new file mode 100644 index 0000000..9e461c2 --- /dev/null +++ b/public/blog/tag/binding/feed/index.html @@ -0,0 +1,246 @@ + + + + binding – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/binding/index.html b/public/blog/tag/binding/index.html new file mode 100644 index 0000000..7dce6fc --- /dev/null +++ b/public/blog/tag/binding/index.html @@ -0,0 +1,212 @@ + + + + + + + +binding « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/borders/feed/index.html b/public/blog/tag/borders/feed/index.html new file mode 100644 index 0000000..9a30d73 --- /dev/null +++ b/public/blog/tag/borders/feed/index.html @@ -0,0 +1,151 @@ + + + + borders – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/borders/index.html b/public/blog/tag/borders/index.html new file mode 100644 index 0000000..a78199b --- /dev/null +++ b/public/blog/tag/borders/index.html @@ -0,0 +1,212 @@ + + + + + + + +borders « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/bound/feed/index.html b/public/blog/tag/bound/feed/index.html new file mode 100644 index 0000000..f70dceb --- /dev/null +++ b/public/blog/tag/bound/feed/index.html @@ -0,0 +1,311 @@ + + + + bound – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/bound/index.html b/public/blog/tag/bound/index.html new file mode 100644 index 0000000..b1735d1 --- /dev/null +++ b/public/blog/tag/bound/index.html @@ -0,0 +1,214 @@ + + + + + + + +bound « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/boundaries/feed/index.html b/public/blog/tag/boundaries/feed/index.html new file mode 100644 index 0000000..d212dfa --- /dev/null +++ b/public/blog/tag/boundaries/feed/index.html @@ -0,0 +1,151 @@ + + + + boundaries – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/boundaries/index.html b/public/blog/tag/boundaries/index.html new file mode 100644 index 0000000..e7027b8 --- /dev/null +++ b/public/blog/tag/boundaries/index.html @@ -0,0 +1,212 @@ + + + + + + + +boundaries « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/box/feed/index.html b/public/blog/tag/box/feed/index.html new file mode 100644 index 0000000..ecd6e36 --- /dev/null +++ b/public/blog/tag/box/feed/index.html @@ -0,0 +1,66 @@ + + + + box – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/box/index.html b/public/blog/tag/box/index.html new file mode 100644 index 0000000..20eee50 --- /dev/null +++ b/public/blog/tag/box/index.html @@ -0,0 +1,212 @@ + + + + + + + +box « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/boxes/feed/index.html b/public/blog/tag/boxes/feed/index.html new file mode 100644 index 0000000..3e972ce --- /dev/null +++ b/public/blog/tag/boxes/feed/index.html @@ -0,0 +1,66 @@ + + + + boxes – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/boxes/index.html b/public/blog/tag/boxes/index.html new file mode 100644 index 0000000..6ff561b --- /dev/null +++ b/public/blog/tag/boxes/index.html @@ -0,0 +1,212 @@ + + + + + + + +boxes « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/browser/feed/index.html b/public/blog/tag/browser/feed/index.html new file mode 100644 index 0000000..01de518 --- /dev/null +++ b/public/blog/tag/browser/feed/index.html @@ -0,0 +1,123 @@ + + + + browser – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    + + File Explorer with Better ListView + http://www.componentowl.com/blog/file-explorer-with-better-listview/ + http://www.componentowl.com/blog/file-explorer-with-better-listview/#respond + Tue, 09 Aug 2011 16:04:31 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=340 + + In release 2.0.2 we added a sample demonstrating how Better ListView can be used to construct folder tree and file browser to make a standalone file explorer:

    +

    File Explorer Sample

    +

    There are two controls derived from BetterListView. One for the navigation pane (folder tree on left side) and one for the file view (on the right side).

    +

    The FolderListView control allows browsing through virtual folders as well as folders on removable drives. We needed this control in our products because .NET does not provide any similar managed control (there is only FolderBrowserDialog, but we actually need a control).

    +

    You can use it for your purposes as well, it is available in Better ListView Samples source code.

    +

    Many features of Better ListView can be used to enhance file browsing, for example:

    +
      +
    • Drag and Drop – moving or copying files
    • +
    • Label Edit – renaming files
    • +
    • Thumbnails – display thumbnails of image files
    • +
    • Custom Tooltips – display extra information on each file item
    • +
    • Groups – organize files into groups (e.g. by size)
    • +
    • Check Boxes – select folders and sub-folders properly with three-state check boxes
    • +
    • Images – every file type could display different image (extracted icon)
    • +
    • Context Menus – do extra operations with files, like displaying file properties
    • +
    • Searching – doing keyboard search is very easy to search for some file
    • +
    • Sorting – sort files according to multiple properties (this is demonstrated in the sample)
    • +
    • Background Image – show that the user is located in special folder by ambient image on the background
    • +
    +]]>
    + http://www.componentowl.com/blog/file-explorer-with-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/browser/index.html b/public/blog/tag/browser/index.html new file mode 100644 index 0000000..e12f943 --- /dev/null +++ b/public/blog/tag/browser/index.html @@ -0,0 +1,214 @@ + + + + + + + +browser « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/buttons/feed/index.html b/public/blog/tag/buttons/feed/index.html new file mode 100644 index 0000000..7654965 --- /dev/null +++ b/public/blog/tag/buttons/feed/index.html @@ -0,0 +1,66 @@ + + + + buttons – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/buttons/index.html b/public/blog/tag/buttons/index.html new file mode 100644 index 0000000..ff305b0 --- /dev/null +++ b/public/blog/tag/buttons/index.html @@ -0,0 +1,212 @@ + + + + + + + +buttons « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/cell/feed/index.html b/public/blog/tag/cell/feed/index.html new file mode 100644 index 0000000..62bb8af --- /dev/null +++ b/public/blog/tag/cell/feed/index.html @@ -0,0 +1,66 @@ + + + + cell – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/cell/index.html b/public/blog/tag/cell/index.html new file mode 100644 index 0000000..e235edc --- /dev/null +++ b/public/blog/tag/cell/index.html @@ -0,0 +1,212 @@ + + + + + + + +cell « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/cells/feed/index.html b/public/blog/tag/cells/feed/index.html new file mode 100644 index 0000000..6c64ab7 --- /dev/null +++ b/public/blog/tag/cells/feed/index.html @@ -0,0 +1,66 @@ + + + + cells – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/cells/index.html b/public/blog/tag/cells/index.html new file mode 100644 index 0000000..ab7a022 --- /dev/null +++ b/public/blog/tag/cells/index.html @@ -0,0 +1,212 @@ + + + + + + + +cells « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/center/feed/index.html b/public/blog/tag/center/feed/index.html new file mode 100644 index 0000000..ecac05b --- /dev/null +++ b/public/blog/tag/center/feed/index.html @@ -0,0 +1,61 @@ + + + + center – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/center/index.html b/public/blog/tag/center/index.html new file mode 100644 index 0000000..4724e01 --- /dev/null +++ b/public/blog/tag/center/index.html @@ -0,0 +1,212 @@ + + + + + + + +center « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/changelog/feed/index.html b/public/blog/tag/changelog/feed/index.html new file mode 100644 index 0000000..90135e6 --- /dev/null +++ b/public/blog/tag/changelog/feed/index.html @@ -0,0 +1,53 @@ + + + + changelog – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 1.52 released + http://www.componentowl.com/blog/better-listview-1-52-released/ + http://www.componentowl.com/blog/better-listview-1-52-released/#respond + Tue, 29 Mar 2011 16:21:14 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=213 + + Another minor release with many fixes and some new features.

    +

    See what’s new in Better ListView 1.52.

    +

    Download the new version.

    +

    We are still working on the new major features (Item hierarchy, groups) as described here. These new features are near completion.

    +]]>
    + http://www.componentowl.com/blog/better-listview-1-52-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/changelog/index.html b/public/blog/tag/changelog/index.html new file mode 100644 index 0000000..cad408d --- /dev/null +++ b/public/blog/tag/changelog/index.html @@ -0,0 +1,212 @@ + + + + + + + +changelog « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/check/feed/index.html b/public/blog/tag/check/feed/index.html new file mode 100644 index 0000000..4342b14 --- /dev/null +++ b/public/blog/tag/check/feed/index.html @@ -0,0 +1,66 @@ + + + + check – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/check/index.html b/public/blog/tag/check/index.html new file mode 100644 index 0000000..cbece7a --- /dev/null +++ b/public/blog/tag/check/index.html @@ -0,0 +1,212 @@ + + + + + + + +check « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/checkbox/feed/index.html b/public/blog/tag/checkbox/feed/index.html new file mode 100644 index 0000000..cf316cf --- /dev/null +++ b/public/blog/tag/checkbox/feed/index.html @@ -0,0 +1,66 @@ + + + + checkbox – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/checkbox/index.html b/public/blog/tag/checkbox/index.html new file mode 100644 index 0000000..dfd577d --- /dev/null +++ b/public/blog/tag/checkbox/index.html @@ -0,0 +1,212 @@ + + + + + + + +checkbox « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/checkboxes/feed/index.html b/public/blog/tag/checkboxes/feed/index.html new file mode 100644 index 0000000..229a89d --- /dev/null +++ b/public/blog/tag/checkboxes/feed/index.html @@ -0,0 +1,66 @@ + + + + checkboxes – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/checkboxes/index.html b/public/blog/tag/checkboxes/index.html new file mode 100644 index 0000000..9dc75a9 --- /dev/null +++ b/public/blog/tag/checkboxes/index.html @@ -0,0 +1,212 @@ + + + + + + + +checkboxes « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/child-items-in-listview/feed/index.html b/public/blog/tag/child-items-in-listview/feed/index.html new file mode 100644 index 0000000..c16771f --- /dev/null +++ b/public/blog/tag/child-items-in-listview/feed/index.html @@ -0,0 +1,150 @@ + + + + child items in listview – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    + + Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more) + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/ + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/#respond + Tue, 03 May 2011 09:28:55 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=232 + groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.]]> + Hierarchical items in two groups

    Hierarchical items in two groups

    +

    We are currently working hard on finishing Better ListView version 2.0 which will add new features: Support for groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.

    +

    We expect to release this upgrade in about a month. It will be a free upgrade for current and new users.

    +

    Groups

    +

    Groups in Better ListView have comparable capabilities as other Better ListView elements (column headers, items, sub-items). For example, you can adjust the foreground/background colors, font, image – and owner drawing is possible as well.

    +

    You can even include images into group headers (as you can see in the preview above), which is not possible in .NET ListView.

    +

    Groups are collapsible by default and the expand button can be switched off on each group individually.

    +

    Here are groups combined with Tile view (the second group is collapsed):

    +
    Groups with Tile view

    Groups with Tile view

    +

    The previous figure displays vertically oriented groups, but Better ListView also support horizontally oriented groups in the List mode:

    +
    Groups with List view

    Groups with List view

    +

    We put special effort to mimic the group display and behavior of Windows Explorer. The group headers can display all of the 15 group header states available in Windows visual style and their display is governed by the same logic as in the ListView counterpart.

    +

    The group headers always look perfect and native, right out of the box. You don’t need to tweak anything.

    +

    Item Hierarchy

    +
    +
    +

    +
    Items with hierarchy

    Items with hierarchy

    +

    +
    +
    +
    +

    This works in the similar way as in the standard TreeView control. Each item (or node) has property called ChildItems which can be filled with new BetterListViewItem instances. SubItems collection can still be used in either items and child-items (child items are treated in the very same way as their parents).

    +

    Item hierarchy can be combined with Groups feature as seen in the first preview.

    +

    Multi-Line Items

    +
    Multi-line items

    Multi-line items

    +

    A simple setting of item layout (MaximumTextLines property) allows breaking item text into several lines (up to the specified value). When the text is longer than MaximumTextLines, then the default trimming method is used (one from the TextTrimming enumeration: None, TrimCharacter, TrimWord, EllipsisCharacter, EllipsisWord, EllipsisPath).

    +

    Multi-line text can be used in every view and also in column headers.

    +

    Another New Features

    +

    There are also bunch of new minor features including:

    +

    Adjustable paddings – Every element part (e.g. item check box, group image…) contains customizable spaces at each side, so the user can easily create space where he needs and customize items/column headers/group headers to the finest detail.

    +

    Focusing sub-items – Items, group headers and even sub-items can be keyfocused. User can now invoke label editing or scroll to any “cell” in the Details-with-columns view solely with keyboard.

    +

    IEnumerable implementations –  BetterListView, BetterListViewGroup and BetterListViewItem implements IEnumerable interface for iterating through the whole item hierarchy, so using recursion to traverse child items is not necessary.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/child-items-in-listview/index.html b/public/blog/tag/child-items-in-listview/index.html new file mode 100644 index 0000000..806a65f --- /dev/null +++ b/public/blog/tag/child-items-in-listview/index.html @@ -0,0 +1,214 @@ + + + + + + + +child items in listview « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/classic/feed/index.html b/public/blog/tag/classic/feed/index.html new file mode 100644 index 0000000..657eb13 --- /dev/null +++ b/public/blog/tag/classic/feed/index.html @@ -0,0 +1,64 @@ + + + + classic – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Windows Theme Support in Better ListView + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/#respond + Fri, 01 Jul 2011 22:46:55 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=287 + + Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    +]]>
    + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/classic/index.html b/public/blog/tag/classic/index.html new file mode 100644 index 0000000..2a4ef14 --- /dev/null +++ b/public/blog/tag/classic/index.html @@ -0,0 +1,212 @@ + + + + + + + +classic « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/clean-focus/feed/index.html b/public/blog/tag/clean-focus/feed/index.html new file mode 100644 index 0000000..6ebe47b --- /dev/null +++ b/public/blog/tag/clean-focus/feed/index.html @@ -0,0 +1,151 @@ + + + + clean focus – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/clean-focus/index.html b/public/blog/tag/clean-focus/index.html new file mode 100644 index 0000000..77fb6b4 --- /dev/null +++ b/public/blog/tag/clean-focus/index.html @@ -0,0 +1,212 @@ + + + + + + + +clean focus « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/coder-productivity/feed/index.html b/public/blog/tag/coder-productivity/feed/index.html new file mode 100644 index 0000000..8074936 --- /dev/null +++ b/public/blog/tag/coder-productivity/feed/index.html @@ -0,0 +1,151 @@ + + + + coder productivity – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/coder-productivity/index.html b/public/blog/tag/coder-productivity/index.html new file mode 100644 index 0000000..a80192c --- /dev/null +++ b/public/blog/tag/coder-productivity/index.html @@ -0,0 +1,212 @@ + + + + + + + +coder productivity « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/collapse/feed/index.html b/public/blog/tag/collapse/feed/index.html new file mode 100644 index 0000000..579da17 --- /dev/null +++ b/public/blog/tag/collapse/feed/index.html @@ -0,0 +1,64 @@ + + + + collapse – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Windows Theme Support in Better ListView + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/#respond + Fri, 01 Jul 2011 22:46:55 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=287 + + Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    +]]>
    + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/collapse/index.html b/public/blog/tag/collapse/index.html new file mode 100644 index 0000000..f532942 --- /dev/null +++ b/public/blog/tag/collapse/index.html @@ -0,0 +1,212 @@ + + + + + + + +collapse « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/collapsible/feed/index.html b/public/blog/tag/collapsible/feed/index.html new file mode 100644 index 0000000..a04fe2a --- /dev/null +++ b/public/blog/tag/collapsible/feed/index.html @@ -0,0 +1,64 @@ + + + + collapsible – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Windows Theme Support in Better ListView + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/#respond + Fri, 01 Jul 2011 22:46:55 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=287 + + Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    +]]>
    + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/collapsible/index.html b/public/blog/tag/collapsible/index.html new file mode 100644 index 0000000..ee10fdb --- /dev/null +++ b/public/blog/tag/collapsible/index.html @@ -0,0 +1,212 @@ + + + + + + + +collapsible « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/color/feed/index.html b/public/blog/tag/color/feed/index.html new file mode 100644 index 0000000..295f44f --- /dev/null +++ b/public/blog/tag/color/feed/index.html @@ -0,0 +1,154 @@ + + + + color – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/color/index.html b/public/blog/tag/color/index.html new file mode 100644 index 0000000..de719e3 --- /dev/null +++ b/public/blog/tag/color/index.html @@ -0,0 +1,212 @@ + + + + + + + +color « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/colored/feed/index.html b/public/blog/tag/colored/feed/index.html new file mode 100644 index 0000000..beac70e --- /dev/null +++ b/public/blog/tag/colored/feed/index.html @@ -0,0 +1,64 @@ + + + + colored – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Alternating Rows in Better ListView + http://www.componentowl.com/blog/alternating-rows-in-better-listview/ + http://www.componentowl.com/blog/alternating-rows-in-better-listview/#respond + Tue, 22 Apr 2014 22:38:15 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=888 + + Alternating Rows

    Alternating Rows

    +

    Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.

    +

    Simply add DrawItemBackground event handler and fill background on odd/even items:

    +

     

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    + if ((eventArgs.Item.Index & 1) == 1)
    + {
    + eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
    + }
    +}
    +[/csharp]

    +]]>
    + http://www.componentowl.com/blog/alternating-rows-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/colored/index.html b/public/blog/tag/colored/index.html new file mode 100644 index 0000000..6976184 --- /dev/null +++ b/public/blog/tag/colored/index.html @@ -0,0 +1,212 @@ + + + + + + + +colored « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/colors/feed/index.html b/public/blog/tag/colors/feed/index.html new file mode 100644 index 0000000..6f77481 --- /dev/null +++ b/public/blog/tag/colors/feed/index.html @@ -0,0 +1,64 @@ + + + + colors – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Alternating Rows in Better ListView + http://www.componentowl.com/blog/alternating-rows-in-better-listview/ + http://www.componentowl.com/blog/alternating-rows-in-better-listview/#respond + Tue, 22 Apr 2014 22:38:15 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=888 + + Alternating Rows

    Alternating Rows

    +

    Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.

    +

    Simply add DrawItemBackground event handler and fill background on odd/even items:

    +

     

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    + if ((eventArgs.Item.Index & 1) == 1)
    + {
    + eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
    + }
    +}
    +[/csharp]

    +]]>
    + http://www.componentowl.com/blog/alternating-rows-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/colors/index.html b/public/blog/tag/colors/index.html new file mode 100644 index 0000000..af9b223 --- /dev/null +++ b/public/blog/tag/colors/index.html @@ -0,0 +1,212 @@ + + + + + + + +colors « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/column/feed/index.html b/public/blog/tag/column/feed/index.html new file mode 100644 index 0000000..11daad6 --- /dev/null +++ b/public/blog/tag/column/feed/index.html @@ -0,0 +1,166 @@ + + + + column – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Hiding Column Headers in Better ListView + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/#respond + Mon, 27 Aug 2012 23:11:27 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=803 + + Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    +]]>
    + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/feed/ + 0 +
    + + Right-aligned Images in Better ListView + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/ + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/#respond + Thu, 19 Apr 2012 19:15:13 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=780 + + Better ListView 2.9.0 now supports more customizable image alignment. For example, images can be aligned on the right part of item:

    +
    Right-aligned Images

    Right-aligned Images

    +

    The alignment can be set separately on every sub-item (using AlignImageHorizontal and AlignImageVertical properties).

    +

    Moreover, the right-aligned images can be used in column headers and groups:

    +
    Group image alignment

    Group image alignment

    +

    The alignment of images is similar to that of text. Every image has its frame, which can be possibly larger than the image itself. In such case, the image needs to be further aligned within the frame. This has been done automatically by centering the image within frame, but now you have full control over the alignment.

    +]]>
    + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/feed/ + 0 +
    + + How to Hide a Column in Better ListView + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/ + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/#respond + Fri, 05 Aug 2011 11:56:31 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=330 + + The most popular view in ListView-like controls seems to be the “Details” view with columns, items and sub-items.

    +

    When someone wants to remove a column, he usually thinks of simply removing the column header from the Columns collection. Unfortunately, it’s not that simple. The sub-items get shifted and he needs to remove sub-items corresponding to the removed column for all items as well.

    +

    This is because ListView is not a control for displaying grids (a matrix of cells), but really the lists – sequences of objects, and the sub-items are not cells either, they are something like an extension of each item to support additional information about the item.

    +

    So how we neatly hide a column?

    +

    We introduced Column Hiding feature in the version 2.0.1. You can simply call Hide() on your column header instance and you’re done! There is also corresponding Show() method provided. Or you can set boolean Visible property. Now the column and all subsequent sub-items are hidden from view (although they are still present in data, of course):

    +

     

    +
    Hiding column via context menu

    Hiding column via context menu...

    +

     

    +
    The sixth column is hidden...

    ...and the sixth column gets hidden.

    +

     

    +

    Download Better ListView

    +]]>
    + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/column/index.html b/public/blog/tag/column/index.html new file mode 100644 index 0000000..ef358b5 --- /dev/null +++ b/public/blog/tag/column/index.html @@ -0,0 +1,218 @@ + + + + + + + +column « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/columns/feed/index.html b/public/blog/tag/columns/feed/index.html new file mode 100644 index 0000000..d103504 --- /dev/null +++ b/public/blog/tag/columns/feed/index.html @@ -0,0 +1,94 @@ + + + + columns – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + How to Hide a Column in Better ListView + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/ + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/#respond + Fri, 05 Aug 2011 11:56:31 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=330 + + The most popular view in ListView-like controls seems to be the “Details” view with columns, items and sub-items.

    +

    When someone wants to remove a column, he usually thinks of simply removing the column header from the Columns collection. Unfortunately, it’s not that simple. The sub-items get shifted and he needs to remove sub-items corresponding to the removed column for all items as well.

    +

    This is because ListView is not a control for displaying grids (a matrix of cells), but really the lists – sequences of objects, and the sub-items are not cells either, they are something like an extension of each item to support additional information about the item.

    +

    So how we neatly hide a column?

    +

    We introduced Column Hiding feature in the version 2.0.1. You can simply call Hide() on your column header instance and you’re done! There is also corresponding Show() method provided. Or you can set boolean Visible property. Now the column and all subsequent sub-items are hidden from view (although they are still present in data, of course):

    +

     

    +
    Hiding column via context menu

    Hiding column via context menu...

    +

     

    +
    The sixth column is hidden...

    ...and the sixth column gets hidden.

    +

     

    +

    Download Better ListView

    +]]>
    + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/columns/index.html b/public/blog/tag/columns/index.html new file mode 100644 index 0000000..b5dc087 --- /dev/null +++ b/public/blog/tag/columns/index.html @@ -0,0 +1,214 @@ + + + + + + + +columns « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/combined/feed/index.html b/public/blog/tag/combined/feed/index.html new file mode 100644 index 0000000..ee01476 --- /dev/null +++ b/public/blog/tag/combined/feed/index.html @@ -0,0 +1,56 @@ + + + + combined – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Combined Items in Better ListView + http://www.componentowl.com/blog/combined-items-in-better-listview/ + http://www.componentowl.com/blog/combined-items-in-better-listview/#respond + Thu, 05 Jan 2012 09:46:49 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=478 + + Hierarchical (tree-like) items can be used to support non-selectable child items in Better ListView 2.5.0 and newer. We call these Combined items as they are combined with its children to look and behave as single item:

    +
    Combined items

    Combined items

    +

    Combined item has selection ranging over all its child items. This can be seen when the combined item is selected or focused:

    +
    Combined items - selection

    Combined items - selection

    +

    Child items of the combined item are still interactive, though not focusable/selectable. They can contain further children (be expanded/collapsed with expand button as well) and can contain interactive check boxes. The visual part of combined child items is also fully available, to the child items can contain images and even sub-items.

    +

    To set-up combined items, simply set AllowSelectChildItems property to false on all items you wish to combine.

    +

    Combined items can be used in any level of item hierarchy.

    +]]>
    + http://www.componentowl.com/blog/combined-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/combined/index.html b/public/blog/tag/combined/index.html new file mode 100644 index 0000000..9e842e1 --- /dev/null +++ b/public/blog/tag/combined/index.html @@ -0,0 +1,212 @@ + + + + + + + +combined « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/coming-soon/feed/index.html b/public/blog/tag/coming-soon/feed/index.html new file mode 100644 index 0000000..6631e89 --- /dev/null +++ b/public/blog/tag/coming-soon/feed/index.html @@ -0,0 +1,118 @@ + + + + coming soon – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Coming soon: Better ListView 2.1 Optimized for Performance + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/ + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/#respond + Mon, 05 Sep 2011 16:33:45 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=348 + + Better ListView 2 comes with many hot features, like groups and item hierarchy. Great features, unfortunately, often come at the price of decreased performance. However, we want to have Better ListView both feature-rich and fast.

    +

    Some users noticed a performance drop when working with large number of items (say 10 000+). Our top priority for version 2.1 is the overall optimization of Better ListView. Several optimizations have already been made in the recent updates (column resizing and thumbnail images), but we have to go further. You can expect Better ListView to be much snappier in the upcoming 2.1 update. The optimizations will cover these areas:

    +
      +
    • Faster collection operations (adding, removing, sorting) of large number of items
    • +
    • Faster expand/collapse of groups and items
    • +
    • Faster column resizing with multi-line items
    • +
    +

    We will also take a look on smoother Visual Studio integration, so you can see Better ListView ready in toolbox just after installation (we have to deal with Visual Studio Packages, which is quite an esoteric topic). If Better ListView doesn’t currently appear in your Visual Studio toolbox automatically, you can just right-click the toolbox window, and use “Choose Items” to add the DLL file yourself.

    +

    Some background info for the more curious of you: Version 1.5 of Better ListView was very fast. It was so fast because every item in the list had precisely the same size. Some operations, like hit testing, was done in constant time and no extra measurement of individual items was necessary. The new major 2.0 version of Better ListView supports items with variable sizes, and irregular layout consisting of grouped items. However, we observed that even in complex settings, there are just few “types” of items – for example, there are only three possible item sizes when using multi-line items with up to three lines of text. Our optimizations will thus be focused on taking advantage of this to reduce most expensive operations back to constant time complexity.

    +
    photo by Michael Roper

    photo by Michael Roper

    +]]>
    + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/feed/ + 0 +
    + + Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more) + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/ + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/#respond + Tue, 03 May 2011 09:28:55 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=232 + groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.]]> + Hierarchical items in two groups

    Hierarchical items in two groups

    +

    We are currently working hard on finishing Better ListView version 2.0 which will add new features: Support for groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.

    +

    We expect to release this upgrade in about a month. It will be a free upgrade for current and new users.

    +

    Groups

    +

    Groups in Better ListView have comparable capabilities as other Better ListView elements (column headers, items, sub-items). For example, you can adjust the foreground/background colors, font, image – and owner drawing is possible as well.

    +

    You can even include images into group headers (as you can see in the preview above), which is not possible in .NET ListView.

    +

    Groups are collapsible by default and the expand button can be switched off on each group individually.

    +

    Here are groups combined with Tile view (the second group is collapsed):

    +
    Groups with Tile view

    Groups with Tile view

    +

    The previous figure displays vertically oriented groups, but Better ListView also support horizontally oriented groups in the List mode:

    +
    Groups with List view

    Groups with List view

    +

    We put special effort to mimic the group display and behavior of Windows Explorer. The group headers can display all of the 15 group header states available in Windows visual style and their display is governed by the same logic as in the ListView counterpart.

    +

    The group headers always look perfect and native, right out of the box. You don’t need to tweak anything.

    +

    Item Hierarchy

    +
    +
    +

    +
    Items with hierarchy

    Items with hierarchy

    +

    +
    +
    +
    +

    This works in the similar way as in the standard TreeView control. Each item (or node) has property called ChildItems which can be filled with new BetterListViewItem instances. SubItems collection can still be used in either items and child-items (child items are treated in the very same way as their parents).

    +

    Item hierarchy can be combined with Groups feature as seen in the first preview.

    +

    Multi-Line Items

    +
    Multi-line items

    Multi-line items

    +

    A simple setting of item layout (MaximumTextLines property) allows breaking item text into several lines (up to the specified value). When the text is longer than MaximumTextLines, then the default trimming method is used (one from the TextTrimming enumeration: None, TrimCharacter, TrimWord, EllipsisCharacter, EllipsisWord, EllipsisPath).

    +

    Multi-line text can be used in every view and also in column headers.

    +

    Another New Features

    +

    There are also bunch of new minor features including:

    +

    Adjustable paddings – Every element part (e.g. item check box, group image…) contains customizable spaces at each side, so the user can easily create space where he needs and customize items/column headers/group headers to the finest detail.

    +

    Focusing sub-items – Items, group headers and even sub-items can be keyfocused. User can now invoke label editing or scroll to any “cell” in the Details-with-columns view solely with keyboard.

    +

    IEnumerable implementations –  BetterListView, BetterListViewGroup and BetterListViewItem implements IEnumerable interface for iterating through the whole item hierarchy, so using recursion to traverse child items is not necessary.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/coming-soon/index.html b/public/blog/tag/coming-soon/index.html new file mode 100644 index 0000000..933a2a6 --- /dev/null +++ b/public/blog/tag/coming-soon/index.html @@ -0,0 +1,214 @@ + + + + + + + +coming soon « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/component/feed/index.html b/public/blog/tag/component/feed/index.html new file mode 100644 index 0000000..9148871 --- /dev/null +++ b/public/blog/tag/component/feed/index.html @@ -0,0 +1,84 @@ + + + + component – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/component/index.html b/public/blog/tag/component/index.html new file mode 100644 index 0000000..a4c0d3c --- /dev/null +++ b/public/blog/tag/component/index.html @@ -0,0 +1,212 @@ + + + + + + + +component « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/computer-work/feed/index.html b/public/blog/tag/computer-work/feed/index.html new file mode 100644 index 0000000..c390d44 --- /dev/null +++ b/public/blog/tag/computer-work/feed/index.html @@ -0,0 +1,151 @@ + + + + computer work – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/computer-work/index.html b/public/blog/tag/computer-work/index.html new file mode 100644 index 0000000..e5e748e --- /dev/null +++ b/public/blog/tag/computer-work/index.html @@ -0,0 +1,212 @@ + + + + + + + +computer work « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/content/feed/index.html b/public/blog/tag/content/feed/index.html new file mode 100644 index 0000000..da2f39b --- /dev/null +++ b/public/blog/tag/content/feed/index.html @@ -0,0 +1,125 @@ + + + + content – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Store Better ListView Content in a String (User Request) + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/ + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/#respond + Sat, 04 Aug 2012 00:03:49 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=796 + + Is it possible to store entire Better ListView content (items with hierarchy and sub-items, columns and groups) in a single string?

    +

    Better ListView already supports saving and loading its content using SaveContent and LoadContent methods. These methods support either XML or binary format.

    +

    I chose binary format for storing data in string  because it is more compact than XML. Binary representation (basically an array of bytes) can be converted to Base64 string. Loading the content from string work similarly, the steps are performed in opposite direction:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +// SAVE
    +// create MemoryStream to hold binary data
    +MemoryStream stream = new MemoryStream();
    +// store Better ListView content in memory stream
    +this.listView.SaveContentBinary(stream);
    +// copy content of MemoryStream to byte array
    +byte[] contentBinary = new byte[stream.Length];
    +stream.Seek(0, SeekOrigin.Begin);
    +// convert byte array to Base64 string
    +stream.Read(contentBinary, 0, (int)stream.Length); // move to beginning of the stream
    +string contentStringBase64 = Convert.ToBase64String(contentBinary);
    +// close stream
    +stream.Close();
    +stream.Dispose();

    +

    // CLEAR
    +this.listView.Clear();

    +

    // LOAD
    +// create MemoryStream to hold binary data
    +stream = new MemoryStream();
    +// convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64);
    +// write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length);
    +stream.Seek(0, SeekOrigin.Begin); // move to beginning of the stream
    +// load content of Better ListView from memory stream
    +this.listView.LoadContentBinary(stream);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +‘ SAVE
    +‘ create MemoryStream to hold binary data
    +Dim stream As New MemoryStream()
    +‘ store Better ListView content in memory stream
    +Me.listView.SaveContentBinary(stream)
    +‘ copy content of MemoryStream to byte array
    +Dim contentBinary As Byte() = New Byte(stream.Length – 1) {}
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ convert byte array to Base64 string
    +stream.Read(contentBinary, 0, CInt(stream.Length))
    +‘ move to beginning of the stream
    +Dim contentStringBase64 As String = Convert.ToBase64String(contentBinary)
    +‘ close stream
    +stream.Close()
    +stream.Dispose()

    +

    ‘ CLEAR
    +Me.listView.Clear()

    +

    ‘ LOAD
    +‘ create MemoryStream to hold binary data
    +stream = New MemoryStream()
    +‘ convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64)
    +‘ write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length)
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ move to beginning of the stream
    +‘ load content of Better ListView from memory stream
    +Me.listView.LoadContentBinary(stream)
    +[/vb]

    +

     

    +

    Although saving and loading data this way is convenient, please consider the following drawback:

    +
      +
    • Standard serialization mechanism of .NET is used for converting classes and structures to XML or binary representation – hence the serialized data may not be possible to deserialize on different version of Better ListView if any public members of the serialized class have been changed.
    • +
    • The generated string is very long (few kilobytes for just two items).
    • +
    • Lots of data are stored which are not related to content itself (e.g. item colors).
    • +
    • The serialized representation is considered read-only – any changes can cause problems with deserialization; if you really want flexible way of storing ListView content, consider building a model or data layer that supports storing the data you need the way you need.
    • +
    +

    On the other hand, using this way may be convenient when you want to transfer or copy ListView content between controls on even across application domain (Better ListView itself uses this mechanism to allow Drag and Drop between two applications – this “tour de force” kind of Drag and Drop is not avaiable in regular .NET ListView).

    +]]>
    + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/content/index.html b/public/blog/tag/content/index.html new file mode 100644 index 0000000..5d8f002 --- /dev/null +++ b/public/blog/tag/content/index.html @@ -0,0 +1,212 @@ + + + + + + + +content « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/control/feed/index.html b/public/blog/tag/control/feed/index.html new file mode 100644 index 0000000..98b34a5 --- /dev/null +++ b/public/blog/tag/control/feed/index.html @@ -0,0 +1,84 @@ + + + + control – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/control/index.html b/public/blog/tag/control/index.html new file mode 100644 index 0000000..6455c20 --- /dev/null +++ b/public/blog/tag/control/index.html @@ -0,0 +1,212 @@ + + + + + + + +control « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/controls/feed/index.html b/public/blog/tag/controls/feed/index.html new file mode 100644 index 0000000..6d86dbf --- /dev/null +++ b/public/blog/tag/controls/feed/index.html @@ -0,0 +1,110 @@ + + + + controls – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Customize Label Editing (Embedded) Control for Each Line in Better ListView + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/ + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/#comments + Wed, 04 Apr 2012 10:33:49 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=771 + + Embedded controls for label edit in Better ListView can be customized not only for every column, but even for every row.

    +

    This is not a new feature, but would be nice to mention that you can possibly have a different custom editing control for every cell…

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +{
    + // show editing controls in the second column
    + if (eventArgs.SubItem.Index == 1)
    + {
    + // show my custom control on the first row
    + if (eventArgs.SubItem.Item.Index == 0)
    + {
    + return (new DocumentAccessConrol());
    + }

    +

    // show my custom control on the second row
    + if (eventArgs.SubItem.Item.Index == 1)
    + {
    + return (new BetterListViewComboBoxEmbeddedControl());
    + }

    +

    // show my custom control on the third row
    + if (eventArgs.SubItem.Item.Index == 2)
    + {
    + return (new BetterListViewTextBoxEmbeddedControl());
    + }
    + }

    +

    return null;
    +}
    +[/csharp]

    +

     

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Function ListViewRequestEmbeddedControl(ByVal sender As Object, ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    + As IBetterListViewEmbeddedControl

    +

    ‘ show editing controls in the second column
    + If eventArgs.SubItem.Index = 1 Then

    +

    ‘ show my custom control on the first row
    + If eventArgs.SubItem.Item.Index = 0 Then
    + Return (New DocumentAccessConrol())
    + End If

    +

    ‘ show my custom control on the second row
    + If eventArgs.SubItem.Item.Index = 1 Then
    + Return (New BetterListViewComboBoxEmbeddedControl())
    + End If

    +

    ‘ show my custom control on the third row
    + If eventArgs.SubItem.Item.Index = 2 Then
    + Return (New BetterListViewTextBoxEmbeddedControl())
    + End If

    +

    End If

    +

    Return Nothing

    +

    End Function
    +[/vb]

    +

     

    +

    And there is the result:

    +
    Custom Embedded Control on the First Line

    Custom Embedded Control on the First Line

    +

     

    +
    TextBox Control on the Third Line

    TextBox Control on the Third Line

    +]]>
    + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/feed/ + 2 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/controls/index.html b/public/blog/tag/controls/index.html new file mode 100644 index 0000000..9ce9894 --- /dev/null +++ b/public/blog/tag/controls/index.html @@ -0,0 +1,212 @@ + + + + + + + +controls « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/crlf/feed/index.html b/public/blog/tag/crlf/feed/index.html new file mode 100644 index 0000000..c37bd1f --- /dev/null +++ b/public/blog/tag/crlf/feed/index.html @@ -0,0 +1,67 @@ + + + + CRLF – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Multi-Line Text In ListView + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/#respond + Thu, 24 Nov 2011 16:42:44 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=450 + + Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    +]]>
    + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/crlf/index.html b/public/blog/tag/crlf/index.html new file mode 100644 index 0000000..aa7f530 --- /dev/null +++ b/public/blog/tag/crlf/index.html @@ -0,0 +1,212 @@ + + + + + + + +CRLF « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/custom/feed/index.html b/public/blog/tag/custom/feed/index.html new file mode 100644 index 0000000..d6dc7d9 --- /dev/null +++ b/public/blog/tag/custom/feed/index.html @@ -0,0 +1,615 @@ + + + + custom – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    + + Better ListView Tip: How to Draw Custom Selection + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/ + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/#comments + Wed, 12 Sep 2012 15:43:12 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=808 + + Customized item selection.

    Customized item selection.

    +

     

    +

    By default, Better ListView uses system theme for drawing selections.

    +

    To draw custom selection, you can use owner drawing capabilities of Better ListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +class CustomListView : BetterListView
    +{
    + protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
    + brushSelection.Dispose();
    + }
    + }

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + eventArgs.DrawSelection = false;

    +

    base.OnDrawItem(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
    + brushSelection.Dispose()
    + End If
    + End Sub

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + eventArgs.DrawSelection = False

    +

    MyBase.OnDrawItem(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
    + End If
    + End Sub
    +End Class
    +[/vb]

    +

    In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

    +

    The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

    +

    The OnDrawItem method contains two things:

    +
      +
    1. Turn off  default selection.
    2. +
    3. Draw custom selection border if the item is selected.
    4. +
    +

    Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

    +

    Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

    +

    To allow these states, considerable coding need to be done.

    +

    In case you need this level of customization, please contact us for Custom Coding support.

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/feed/ + 2 +
    + + Customize Label Editing (Embedded) Control for Each Line in Better ListView + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/ + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/#comments + Wed, 04 Apr 2012 10:33:49 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=771 + + Embedded controls for label edit in Better ListView can be customized not only for every column, but even for every row.

    +

    This is not a new feature, but would be nice to mention that you can possibly have a different custom editing control for every cell…

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +{
    + // show editing controls in the second column
    + if (eventArgs.SubItem.Index == 1)
    + {
    + // show my custom control on the first row
    + if (eventArgs.SubItem.Item.Index == 0)
    + {
    + return (new DocumentAccessConrol());
    + }

    +

    // show my custom control on the second row
    + if (eventArgs.SubItem.Item.Index == 1)
    + {
    + return (new BetterListViewComboBoxEmbeddedControl());
    + }

    +

    // show my custom control on the third row
    + if (eventArgs.SubItem.Item.Index == 2)
    + {
    + return (new BetterListViewTextBoxEmbeddedControl());
    + }
    + }

    +

    return null;
    +}
    +[/csharp]

    +

     

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Function ListViewRequestEmbeddedControl(ByVal sender As Object, ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    + As IBetterListViewEmbeddedControl

    +

    ‘ show editing controls in the second column
    + If eventArgs.SubItem.Index = 1 Then

    +

    ‘ show my custom control on the first row
    + If eventArgs.SubItem.Item.Index = 0 Then
    + Return (New DocumentAccessConrol())
    + End If

    +

    ‘ show my custom control on the second row
    + If eventArgs.SubItem.Item.Index = 1 Then
    + Return (New BetterListViewComboBoxEmbeddedControl())
    + End If

    +

    ‘ show my custom control on the third row
    + If eventArgs.SubItem.Item.Index = 2 Then
    + Return (New BetterListViewTextBoxEmbeddedControl())
    + End If

    +

    End If

    +

    Return Nothing

    +

    End Function
    +[/vb]

    +

     

    +

    And there is the result:

    +
    Custom Embedded Control on the First Line

    Custom Embedded Control on the First Line

    +

     

    +
    TextBox Control on the Third Line

    TextBox Control on the Third Line

    +]]>
    + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/feed/ + 2 +
    + + Custom Item Height in Details View of Better ListView + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/ + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/#respond + Wed, 21 Mar 2012 15:10:52 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=760 + + Better ListView 2.7.0.0 now supports items of arbitrary height in Details view:

    +
    Items with custom height

    Items with custom height

    +

    Items with variable heights were possible in recent versions of Better ListView as well, but this adjustment was limited to heights which are multiples of text line height.

    +

    We have introduced a BetterListViewItem.CustomHeight property, which is 0 by default.

    +

    Every item has some minimum size (defined by the font and image) but it can get arbitrarily larger. The following formula explains how item height is measured in Better ListView:

    +

    height = max(minimum height, image height, text height, custom height)

    +

    Setting minimum height for all items is possible through layout properties and the latter is defined by the item itself.

    +]]>
    + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/feed/ + 0 +
    + + Custom Spacing between Items in Details View + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/ + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/#respond + Tue, 13 Mar 2012 22:53:09 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=753 + + Better ListView 2.6 newly supports custom spacing between items in Details view:

    +
    Custom Spacing between Items

    Custom Spacing between Items

    +

    This property has been recently available in other views, but Details view was exception since its selections needed to be treated in different way: They overlap by 1 pixel so that the double border is avoided in neighboring selections:

    +
    1 px overlap of items

    1 px overlap of items

    +

    We have resolved this to get proper behavior with custom spacings and now the spacing can be set the same way as in any other view:

    +

    Simply set LayoutItemsCurrent.ElementOuterPadding to have custom horizontal and vertical padding between items.

    +

    You can set this specifically for Details view by refering to property LayoutItemsDetails or LayoutItemsDetailsColumns (Details view with columns).

    +]]>
    + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/feed/ + 0 +
    + + Custom Behavior of Group Headers in Better ListView + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/ + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/#respond + Fri, 20 Jan 2012 09:40:44 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=480 + + When developing our desktop applications, me and Jiri needed to adjust behavior of group headers in the Better ListView control.

    +

    We discovered that making group header behavior customizable would be useful not only for us, but for other developers who utilize Better ListView as well, so we implemented this feature officially in Better ListView 2.5.0.

    +

    There are two new properties: ShowDefaultGroupHeader and GroupHeaderBehavior.

    +

    Hiding the Default Group Header

    +

    The ShowDefaultGroupHeader is initially set to true. This means that the default group (the group containing items which do not have a specific group) have its header displayed:

    +
    Default group header is visible

    Default group header is visible

    +

    When ShowDefaultGroupHeader is set to false, the “Default” group header on top can be hidden:

    +
    Default group header is hidden

    Default group header is hidden

    +

    Adjusting Group Header Behavior

    +

    The group headers have two kinds of behavior. They can be focused and can cause selection of items. Both of these functions can be invoked by keyboard and mouse.

    +

    The GroupHeaderBehavior property allows changing this behavior for keyboard and mouse separately.

    +

    By default, the property is set to BetterListViewGroupHeaderBehavior.All, so that all functions of the group header are turned on.

    +

    You may want to make group headers completely non-interactive. This can be done by setting the property to BetterListViewGroupHeaderBehavior.None.

    +

    Other values of the enum can be combined to create desired behavior.

    +

    Keyboard:

    +
      +
    • Focus only
    • +
    • Focus and select items in the group
    • +
    +

    Mouse:

    +
      +
    • Focus
    • +
    • Select items in the group
    • +
    • Highligh when mouse cursor is over the group header
    • +
    +
    The expand button of group headers can still be used even if the group header has all the behaviors turned off. If you need to hide the expand button as well, set BetterListViewGroup.AllowShowExpandButton to false.
    +

    Use Case: Metadata Viewer

    +

    Here Better ListView is used for viewing image metadata tags:

    +
    Metadata View window

    Metadata View window

    +

    Only one tag can be selected at a time, so clicking on a group header has no effect on selection and need not to be highlighted.

    +

    One may still need, however, to allow focusing the group header with keyboard and mouse so that it is possible to collapse/expand the group with arrow keys. The desired behavior can be set this way:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus & BetterListViewGroupHeaderBehavior.MouseFocus);[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus And BetterListViewGroupHeaderBehavior.MouseFocus)[/vb]

    +]]>
    + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/feed/ + 0 +
    + + How To: Dynamically Resize Focused Item + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/ + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/#respond + Thu, 22 Dec 2011 02:29:35 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=468 + + Better ListView 2.4.0 now supports setting MaximumTextLines property on every item and sub-item, so you can have multi-line items each with different number text lines:

    +
    Dynamic resizing of the focused item

    Dynamic resizing of the focused item

    +

    We also introduced FocusedItemChanged event, so that you can detect when focus has moved from one element (item / sub-item / group) to another.

    +

    These features can be combined to display only the focused item with more details to save space code of the FocusedItemChanged event handler may look like this:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +void ListViewFocusedItemChanged(object sender, BetterListViewFocusedItemChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (eventArgs.FocusedItemOld != null)
    + {
    + // set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1;
    + }

    +

    if (eventArgs.FocusedItemNew != null)
    + {
    + // set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Sub ListViewFocusedItemChanged(sender As Object, eventArgs As BetterListViewFocusedItemChangedEventArgs)
    + Dim ListView As BetterListView = DirectCast(sender, BetterListView)

    +

    ListView.BeginUpdate()

    +

    If eventArgs.FocusedItemOld IsNot Nothing Then
    + ‘ set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1
    + End If

    +

    If eventArgs.FocusedItemNew IsNot Nothing Then
    + ‘ set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3
    + End If

    +

    ListView.EndUpdate()
    +End Sub
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/feed/ + 0 +
    + + How to Display Items in Custom States + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/ + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/#respond + Tue, 15 Nov 2011 15:24:25 +0000 + + + + + + + + + + + http://www.componentowl.com/blog/?p=398 + + One of our customers recently asked us if it is possible in Better ListView to draw item highlighted even when the control loses focus. This is an interesting and useful feature, so we implemented it right away.

    +

    Owner drawing in Better ListView 2.3.0 and higher allows you to draw elements (column headers, items, sub-items and groups) in any state you wish (hot, selected, focused and any combination of the three).

    +

    For example, we would like to highlight several items in one Better ListView depending on hovered item in other Better ListView:

    +
    Better ListView shows multiple hot items

    Better ListView shows multiple hot items

    +

    Items can be also be drawn as if the control is focused, enabled or disabled. This feature can be applied when you wish to display items in highlighted state even if Better ListView is not focused:

    +
    Better ListView keeps selected items highlighted

    Better ListView keeps selected items highlighted

    +

    We implemented the first sample (showing mulitple hot items) by inheriting from BetterListView, making a new class called HotListView. The implementation is very simple:

    +

     

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class HotListView : BetterListView
    +{
    +public HashSet HotItems
    +{
    +get
    +{
    +return this.hotItems;
    +}
    +set
    +{
    +this.hotItems = value;

    +

    Refresh();
    +}
    +}

    +

    private HashSethotItems = new HashSet();

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    +{
    +if (this.hotItems.Contains(eventArgs.Item.Index))
    +{
    +eventArgs.ItemStateInfo = new BetterListViewItemStateInfo(
    +eventArgs.ItemStateInfo.ItemState | BetterListViewItemState.Hot,
    +eventArgs.ItemStateInfo.ExpandButtonState,
    +eventArgs.ItemStateInfo.CheckBoxState);
    +}

    +

    base.OnDrawItem(eventArgs);
    +}
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class HotListView
    +Inherits BetterListView
    +Public Property HotItems() As HashSet(Of Integer)
    +Get
    +Return Me.m_hotItems
    +End Get
    +Set
    +Me.m_hotItems = value

    +

    Refresh()
    +End Set
    +End Property

    +

    Private m_hotItems As New HashSet(Of Integer)()

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    +If Me.m_hotItems.Contains(eventArgs.Item.Index) Then
    +eventArgs.ItemStateInfo = New BetterListViewItemStateInfo(eventArgs.ItemStateInfo.ItemState Or BetterListViewItemState.Hot, eventArgs.ItemStateInfo.ExpandButtonState, eventArgs.ItemStateInfo.CheckBoxState)
    +End If

    +

    MyBase.OnDrawItem(eventArgs)
    +End Sub
    +End Class
    +[/vb]

    +

     

    +

    The HotListView contains one property called HotItems. When drawing items (OnDrawItem method), it looks whether the item is in the HotItems set. If so, item drawing state is altered so that the item will be drawn as hot.

    +

    The modified ListView for second sample is even simpler. We call it HighlightListView:

    +

     

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class HighlightListView : BetterListView
    +{
    +protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    +{
    +if ((eventArgs.ItemStateInfo.ItemState & BetterListViewItemState.Selected) == BetterListViewItemState.Selected)
    +{
    +// if the item is selected, always draw control as if it is focused
    +eventArgs.DrawFocused = true;
    +}

    +

    base.OnDrawItem(eventArgs);
    +}
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class HighlightListView
    +Inherits BetterListView
    +Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    +If (eventArgs.ItemStateInfo.ItemState And BetterListViewItemState.Selected) = BetterListViewItemState.Selected Then
    +‘ if the item is selected, always draw control as if it is focused
    +eventArgs.DrawFocused = True
    +End If

    +

    MyBase.OnDrawItem(eventArgs)
    +End Sub
    +End Class
    +[/vb]

    +

     

    +

    This modification only draws selected items as if the control is always focused.

    +

    UPDATE: From Better ListView 2.3.1, you can simply use HideSelectionMode property to keep selected items highlighted.

    +]]>
    + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/custom/index.html b/public/blog/tag/custom/index.html new file mode 100644 index 0000000..423f430 --- /dev/null +++ b/public/blog/tag/custom/index.html @@ -0,0 +1,228 @@ + + + + + + + +custom « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/tag/customize-groups-in-listview/feed/index.html b/public/blog/tag/customize-groups-in-listview/feed/index.html new file mode 100644 index 0000000..913a41a --- /dev/null +++ b/public/blog/tag/customize-groups-in-listview/feed/index.html @@ -0,0 +1,90 @@ + + + + customize groups in listview – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Behavior of Group Headers in Better ListView + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/ + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/#respond + Fri, 20 Jan 2012 09:40:44 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=480 + + When developing our desktop applications, me and Jiri needed to adjust behavior of group headers in the Better ListView control.

    +

    We discovered that making group header behavior customizable would be useful not only for us, but for other developers who utilize Better ListView as well, so we implemented this feature officially in Better ListView 2.5.0.

    +

    There are two new properties: ShowDefaultGroupHeader and GroupHeaderBehavior.

    +

    Hiding the Default Group Header

    +

    The ShowDefaultGroupHeader is initially set to true. This means that the default group (the group containing items which do not have a specific group) have its header displayed:

    +
    Default group header is visible

    Default group header is visible

    +

    When ShowDefaultGroupHeader is set to false, the “Default” group header on top can be hidden:

    +
    Default group header is hidden

    Default group header is hidden

    +

    Adjusting Group Header Behavior

    +

    The group headers have two kinds of behavior. They can be focused and can cause selection of items. Both of these functions can be invoked by keyboard and mouse.

    +

    The GroupHeaderBehavior property allows changing this behavior for keyboard and mouse separately.

    +

    By default, the property is set to BetterListViewGroupHeaderBehavior.All, so that all functions of the group header are turned on.

    +

    You may want to make group headers completely non-interactive. This can be done by setting the property to BetterListViewGroupHeaderBehavior.None.

    +

    Other values of the enum can be combined to create desired behavior.

    +

    Keyboard:

    +
      +
    • Focus only
    • +
    • Focus and select items in the group
    • +
    +

    Mouse:

    +
      +
    • Focus
    • +
    • Select items in the group
    • +
    • Highligh when mouse cursor is over the group header
    • +
    +
    The expand button of group headers can still be used even if the group header has all the behaviors turned off. If you need to hide the expand button as well, set BetterListViewGroup.AllowShowExpandButton to false.
    +

    Use Case: Metadata Viewer

    +

    Here Better ListView is used for viewing image metadata tags:

    +
    Metadata View window

    Metadata View window

    +

    Only one tag can be selected at a time, so clicking on a group header has no effect on selection and need not to be highlighted.

    +

    One may still need, however, to allow focusing the group header with keyboard and mouse so that it is possible to collapse/expand the group with arrow keys. The desired behavior can be set this way:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus & BetterListViewGroupHeaderBehavior.MouseFocus);[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus And BetterListViewGroupHeaderBehavior.MouseFocus)[/vb]

    +]]>
    + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/customize-groups-in-listview/index.html b/public/blog/tag/customize-groups-in-listview/index.html new file mode 100644 index 0000000..5af9a18 --- /dev/null +++ b/public/blog/tag/customize-groups-in-listview/index.html @@ -0,0 +1,212 @@ + + + + + + + +customize groups in listview « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/customize-list-view-group-headers/feed/index.html b/public/blog/tag/customize-list-view-group-headers/feed/index.html new file mode 100644 index 0000000..8aa316d --- /dev/null +++ b/public/blog/tag/customize-list-view-group-headers/feed/index.html @@ -0,0 +1,90 @@ + + + + customize list view group headers – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Behavior of Group Headers in Better ListView + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/ + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/#respond + Fri, 20 Jan 2012 09:40:44 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=480 + + When developing our desktop applications, me and Jiri needed to adjust behavior of group headers in the Better ListView control.

    +

    We discovered that making group header behavior customizable would be useful not only for us, but for other developers who utilize Better ListView as well, so we implemented this feature officially in Better ListView 2.5.0.

    +

    There are two new properties: ShowDefaultGroupHeader and GroupHeaderBehavior.

    +

    Hiding the Default Group Header

    +

    The ShowDefaultGroupHeader is initially set to true. This means that the default group (the group containing items which do not have a specific group) have its header displayed:

    +
    Default group header is visible

    Default group header is visible

    +

    When ShowDefaultGroupHeader is set to false, the “Default” group header on top can be hidden:

    +
    Default group header is hidden

    Default group header is hidden

    +

    Adjusting Group Header Behavior

    +

    The group headers have two kinds of behavior. They can be focused and can cause selection of items. Both of these functions can be invoked by keyboard and mouse.

    +

    The GroupHeaderBehavior property allows changing this behavior for keyboard and mouse separately.

    +

    By default, the property is set to BetterListViewGroupHeaderBehavior.All, so that all functions of the group header are turned on.

    +

    You may want to make group headers completely non-interactive. This can be done by setting the property to BetterListViewGroupHeaderBehavior.None.

    +

    Other values of the enum can be combined to create desired behavior.

    +

    Keyboard:

    +
      +
    • Focus only
    • +
    • Focus and select items in the group
    • +
    +

    Mouse:

    +
      +
    • Focus
    • +
    • Select items in the group
    • +
    • Highligh when mouse cursor is over the group header
    • +
    +
    The expand button of group headers can still be used even if the group header has all the behaviors turned off. If you need to hide the expand button as well, set BetterListViewGroup.AllowShowExpandButton to false.
    +

    Use Case: Metadata Viewer

    +

    Here Better ListView is used for viewing image metadata tags:

    +
    Metadata View window

    Metadata View window

    +

    Only one tag can be selected at a time, so clicking on a group header has no effect on selection and need not to be highlighted.

    +

    One may still need, however, to allow focusing the group header with keyboard and mouse so that it is possible to collapse/expand the group with arrow keys. The desired behavior can be set this way:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus & BetterListViewGroupHeaderBehavior.MouseFocus);[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus And BetterListViewGroupHeaderBehavior.MouseFocus)[/vb]

    +]]>
    + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/customize-list-view-group-headers/index.html b/public/blog/tag/customize-list-view-group-headers/index.html new file mode 100644 index 0000000..c0c09e0 --- /dev/null +++ b/public/blog/tag/customize-list-view-group-headers/index.html @@ -0,0 +1,212 @@ + + + + + + + +customize list view group headers « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/customized/feed/index.html b/public/blog/tag/customized/feed/index.html new file mode 100644 index 0000000..4996d1c --- /dev/null +++ b/public/blog/tag/customized/feed/index.html @@ -0,0 +1,116 @@ + + + + customized – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView Tip: How to Draw Custom Selection + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/ + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/#comments + Wed, 12 Sep 2012 15:43:12 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=808 + + Customized item selection.

    Customized item selection.

    +

     

    +

    By default, Better ListView uses system theme for drawing selections.

    +

    To draw custom selection, you can use owner drawing capabilities of Better ListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +class CustomListView : BetterListView
    +{
    + protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
    + brushSelection.Dispose();
    + }
    + }

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + eventArgs.DrawSelection = false;

    +

    base.OnDrawItem(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
    + brushSelection.Dispose()
    + End If
    + End Sub

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + eventArgs.DrawSelection = False

    +

    MyBase.OnDrawItem(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
    + End If
    + End Sub
    +End Class
    +[/vb]

    +

    In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

    +

    The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

    +

    The OnDrawItem method contains two things:

    +
      +
    1. Turn off  default selection.
    2. +
    3. Draw custom selection border if the item is selected.
    4. +
    +

    Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

    +

    Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

    +

    To allow these states, considerable coding need to be done.

    +

    In case you need this level of customization, please contact us for Custom Coding support.

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/feed/ + 2 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/customized/index.html b/public/blog/tag/customized/index.html new file mode 100644 index 0000000..0b2859b --- /dev/null +++ b/public/blog/tag/customized/index.html @@ -0,0 +1,212 @@ + + + + + + + +customized « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/data/feed/index.html b/public/blog/tag/data/feed/index.html new file mode 100644 index 0000000..5797969 --- /dev/null +++ b/public/blog/tag/data/feed/index.html @@ -0,0 +1,311 @@ + + + + data – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/data/index.html b/public/blog/tag/data/index.html new file mode 100644 index 0000000..2ee1613 --- /dev/null +++ b/public/blog/tag/data/index.html @@ -0,0 +1,214 @@ + + + + + + + +data « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/databinding/feed/index.html b/public/blog/tag/databinding/feed/index.html new file mode 100644 index 0000000..1c3f86f --- /dev/null +++ b/public/blog/tag/databinding/feed/index.html @@ -0,0 +1,311 @@ + + + + databinding – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/databinding/index.html b/public/blog/tag/databinding/index.html new file mode 100644 index 0000000..c80f54c --- /dev/null +++ b/public/blog/tag/databinding/index.html @@ -0,0 +1,214 @@ + + + + + + + +databinding « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/databound/feed/index.html b/public/blog/tag/databound/feed/index.html new file mode 100644 index 0000000..eb71ba8 --- /dev/null +++ b/public/blog/tag/databound/feed/index.html @@ -0,0 +1,246 @@ + + + + databound – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/databound/index.html b/public/blog/tag/databound/index.html new file mode 100644 index 0000000..36b259d --- /dev/null +++ b/public/blog/tag/databound/index.html @@ -0,0 +1,212 @@ + + + + + + + +databound « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/default/feed/index.html b/public/blog/tag/default/feed/index.html new file mode 100644 index 0000000..d8af493 --- /dev/null +++ b/public/blog/tag/default/feed/index.html @@ -0,0 +1,90 @@ + + + + default – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Behavior of Group Headers in Better ListView + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/ + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/#respond + Fri, 20 Jan 2012 09:40:44 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=480 + + When developing our desktop applications, me and Jiri needed to adjust behavior of group headers in the Better ListView control.

    +

    We discovered that making group header behavior customizable would be useful not only for us, but for other developers who utilize Better ListView as well, so we implemented this feature officially in Better ListView 2.5.0.

    +

    There are two new properties: ShowDefaultGroupHeader and GroupHeaderBehavior.

    +

    Hiding the Default Group Header

    +

    The ShowDefaultGroupHeader is initially set to true. This means that the default group (the group containing items which do not have a specific group) have its header displayed:

    +
    Default group header is visible

    Default group header is visible

    +

    When ShowDefaultGroupHeader is set to false, the “Default” group header on top can be hidden:

    +
    Default group header is hidden

    Default group header is hidden

    +

    Adjusting Group Header Behavior

    +

    The group headers have two kinds of behavior. They can be focused and can cause selection of items. Both of these functions can be invoked by keyboard and mouse.

    +

    The GroupHeaderBehavior property allows changing this behavior for keyboard and mouse separately.

    +

    By default, the property is set to BetterListViewGroupHeaderBehavior.All, so that all functions of the group header are turned on.

    +

    You may want to make group headers completely non-interactive. This can be done by setting the property to BetterListViewGroupHeaderBehavior.None.

    +

    Other values of the enum can be combined to create desired behavior.

    +

    Keyboard:

    +
      +
    • Focus only
    • +
    • Focus and select items in the group
    • +
    +

    Mouse:

    +
      +
    • Focus
    • +
    • Select items in the group
    • +
    • Highligh when mouse cursor is over the group header
    • +
    +
    The expand button of group headers can still be used even if the group header has all the behaviors turned off. If you need to hide the expand button as well, set BetterListViewGroup.AllowShowExpandButton to false.
    +

    Use Case: Metadata Viewer

    +

    Here Better ListView is used for viewing image metadata tags:

    +
    Metadata View window

    Metadata View window

    +

    Only one tag can be selected at a time, so clicking on a group header has no effect on selection and need not to be highlighted.

    +

    One may still need, however, to allow focusing the group header with keyboard and mouse so that it is possible to collapse/expand the group with arrow keys. The desired behavior can be set this way:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus & BetterListViewGroupHeaderBehavior.MouseFocus);[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus And BetterListViewGroupHeaderBehavior.MouseFocus)[/vb]

    +]]>
    + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/default/index.html b/public/blog/tag/default/index.html new file mode 100644 index 0000000..9fd77d5 --- /dev/null +++ b/public/blog/tag/default/index.html @@ -0,0 +1,212 @@ + + + + + + + +default « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/details/feed/index.html b/public/blog/tag/details/feed/index.html new file mode 100644 index 0000000..11b0533 --- /dev/null +++ b/public/blog/tag/details/feed/index.html @@ -0,0 +1,92 @@ + + + + details – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Spacing between Items in Details View + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/ + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/#respond + Tue, 13 Mar 2012 22:53:09 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=753 + + Better ListView 2.6 newly supports custom spacing between items in Details view:

    +
    Custom Spacing between Items

    Custom Spacing between Items

    +

    This property has been recently available in other views, but Details view was exception since its selections needed to be treated in different way: They overlap by 1 pixel so that the double border is avoided in neighboring selections:

    +
    1 px overlap of items

    1 px overlap of items

    +

    We have resolved this to get proper behavior with custom spacings and now the spacing can be set the same way as in any other view:

    +

    Simply set LayoutItemsCurrent.ElementOuterPadding to have custom horizontal and vertical padding between items.

    +

    You can set this specifically for Details view by refering to property LayoutItemsDetails or LayoutItemsDetailsColumns (Details view with columns).

    +]]>
    + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/feed/ + 0 +
    + + How to Hide a Column in Better ListView + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/ + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/#respond + Fri, 05 Aug 2011 11:56:31 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=330 + + The most popular view in ListView-like controls seems to be the “Details” view with columns, items and sub-items.

    +

    When someone wants to remove a column, he usually thinks of simply removing the column header from the Columns collection. Unfortunately, it’s not that simple. The sub-items get shifted and he needs to remove sub-items corresponding to the removed column for all items as well.

    +

    This is because ListView is not a control for displaying grids (a matrix of cells), but really the lists – sequences of objects, and the sub-items are not cells either, they are something like an extension of each item to support additional information about the item.

    +

    So how we neatly hide a column?

    +

    We introduced Column Hiding feature in the version 2.0.1. You can simply call Hide() on your column header instance and you’re done! There is also corresponding Show() method provided. Or you can set boolean Visible property. Now the column and all subsequent sub-items are hidden from view (although they are still present in data, of course):

    +

     

    +
    Hiding column via context menu

    Hiding column via context menu...

    +

     

    +
    The sixth column is hidden...

    ...and the sixth column gets hidden.

    +

     

    +

    Download Better ListView

    +]]>
    + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/details/index.html b/public/blog/tag/details/index.html new file mode 100644 index 0000000..eea114e --- /dev/null +++ b/public/blog/tag/details/index.html @@ -0,0 +1,214 @@ + + + + + + + +details « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/different/feed/index.html b/public/blog/tag/different/feed/index.html new file mode 100644 index 0000000..c3a9079 --- /dev/null +++ b/public/blog/tag/different/feed/index.html @@ -0,0 +1,110 @@ + + + + different – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Customize Label Editing (Embedded) Control for Each Line in Better ListView + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/ + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/#comments + Wed, 04 Apr 2012 10:33:49 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=771 + + Embedded controls for label edit in Better ListView can be customized not only for every column, but even for every row.

    +

    This is not a new feature, but would be nice to mention that you can possibly have a different custom editing control for every cell…

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +{
    + // show editing controls in the second column
    + if (eventArgs.SubItem.Index == 1)
    + {
    + // show my custom control on the first row
    + if (eventArgs.SubItem.Item.Index == 0)
    + {
    + return (new DocumentAccessConrol());
    + }

    +

    // show my custom control on the second row
    + if (eventArgs.SubItem.Item.Index == 1)
    + {
    + return (new BetterListViewComboBoxEmbeddedControl());
    + }

    +

    // show my custom control on the third row
    + if (eventArgs.SubItem.Item.Index == 2)
    + {
    + return (new BetterListViewTextBoxEmbeddedControl());
    + }
    + }

    +

    return null;
    +}
    +[/csharp]

    +

     

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Function ListViewRequestEmbeddedControl(ByVal sender As Object, ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    + As IBetterListViewEmbeddedControl

    +

    ‘ show editing controls in the second column
    + If eventArgs.SubItem.Index = 1 Then

    +

    ‘ show my custom control on the first row
    + If eventArgs.SubItem.Item.Index = 0 Then
    + Return (New DocumentAccessConrol())
    + End If

    +

    ‘ show my custom control on the second row
    + If eventArgs.SubItem.Item.Index = 1 Then
    + Return (New BetterListViewComboBoxEmbeddedControl())
    + End If

    +

    ‘ show my custom control on the third row
    + If eventArgs.SubItem.Item.Index = 2 Then
    + Return (New BetterListViewTextBoxEmbeddedControl())
    + End If

    +

    End If

    +

    Return Nothing

    +

    End Function
    +[/vb]

    +

     

    +

    And there is the result:

    +
    Custom Embedded Control on the First Line

    Custom Embedded Control on the First Line

    +

     

    +
    TextBox Control on the Third Line

    TextBox Control on the Third Line

    +]]>
    + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/feed/ + 2 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/different/index.html b/public/blog/tag/different/index.html new file mode 100644 index 0000000..4b11aec --- /dev/null +++ b/public/blog/tag/different/index.html @@ -0,0 +1,212 @@ + + + + + + + +different « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/disable-item-selection/feed/index.html b/public/blog/tag/disable-item-selection/feed/index.html new file mode 100644 index 0000000..766c17f --- /dev/null +++ b/public/blog/tag/disable-item-selection/feed/index.html @@ -0,0 +1,62 @@ + + + + disable item selection – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Non-selectable Items in Better ListView + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/ + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/#respond + Wed, 25 Jan 2012 12:08:17 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=476 + + One of our users asked us whether it would be possible to make specific Better ListView items to be non-selectable because he wanted to have them in “disabled” state.

    +

    We quickly realized that it might be very useful, in some cases, to have items with informative character only. Some of such non-selectable items can even be used as separators with the help of owner drawing:

    +
    Non-selectable items

    Non-selectable items

    +

    The non-selectable items behave just as their name suggests. They cannot be focused (they are skipped when jumping from item to item with arrow keys) and do not respond to drag selection:

    +
    Non-selectable items

    Non-selectable items

    +

    It is very easy to set-up such items. Simply set BetterListViewItem.Selectable property to false.

    +

    The non-selectable items are displayed in the same way as normal items. They can contain child items (which are selectable until their Selectable property is set to false) and can be interactively expanded/collapsed.

    +

    If you need to have all items non-selectable to use Better ListView for display-only, consider using the Read-only mode, which has been also introduced in version 2.5.

    +]]>
    + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/disable-item-selection/index.html b/public/blog/tag/disable-item-selection/index.html new file mode 100644 index 0000000..7c0d877 --- /dev/null +++ b/public/blog/tag/disable-item-selection/index.html @@ -0,0 +1,212 @@ + + + + + + + +disable item selection « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/disabled/feed/index.html b/public/blog/tag/disabled/feed/index.html new file mode 100644 index 0000000..8764f99 --- /dev/null +++ b/public/blog/tag/disabled/feed/index.html @@ -0,0 +1,94 @@ + + + + disabled – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Read-Only Mode in Better ListView + http://www.componentowl.com/blog/read-only-mode-in-better-listview/ + http://www.componentowl.com/blog/read-only-mode-in-better-listview/#respond + Fri, 27 Jan 2012 16:21:58 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=482 + + Better ListView 2.5 introduces a new boolean property called ReadOnly.

    +

    When set to true, the Better ListView does not respond to keyboard and mouse input. There are, however, some exceptions that make the Read-only mode different to the Disabled mode (when Enabled property is set to false).

    +

    When in Read-only mode, content of the Better ListView can be still scrolled (the scroll bars are enabled) and groups/items can be expanded/collapsed.

    +

    The difference between Disabled and Read-only can be seen on the following images:

    +
    Normal state

    Normal state

    +
    Disabled state

    Disabled state

    +
    Read-only state

    Read-only state

    +

     

    +

    As you can see, the Better ListView is displayed normally in Read-only mode, but the group header does not have a hot state (because cannot be focused). Items also cannot be focused or selected, but the expand buttons are still interactive.

    +

    The scroll bars would also be enabled and can be used, which is different from Disabled mode where everything is grayed and cannot be used.

    +]]>
    + http://www.componentowl.com/blog/read-only-mode-in-better-listview/feed/ + 0 +
    + + Non-selectable Items in Better ListView + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/ + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/#respond + Wed, 25 Jan 2012 12:08:17 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=476 + + One of our users asked us whether it would be possible to make specific Better ListView items to be non-selectable because he wanted to have them in “disabled” state.

    +

    We quickly realized that it might be very useful, in some cases, to have items with informative character only. Some of such non-selectable items can even be used as separators with the help of owner drawing:

    +
    Non-selectable items

    Non-selectable items

    +

    The non-selectable items behave just as their name suggests. They cannot be focused (they are skipped when jumping from item to item with arrow keys) and do not respond to drag selection:

    +
    Non-selectable items

    Non-selectable items

    +

    It is very easy to set-up such items. Simply set BetterListViewItem.Selectable property to false.

    +

    The non-selectable items are displayed in the same way as normal items. They can contain child items (which are selectable until their Selectable property is set to false) and can be interactively expanded/collapsed.

    +

    If you need to have all items non-selectable to use Better ListView for display-only, consider using the Read-only mode, which has been also introduced in version 2.5.

    +]]>
    + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/disabled/index.html b/public/blog/tag/disabled/index.html new file mode 100644 index 0000000..d04bdc9 --- /dev/null +++ b/public/blog/tag/disabled/index.html @@ -0,0 +1,214 @@ + + + + + + + +disabled « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/display-multiline/feed/index.html b/public/blog/tag/display-multiline/feed/index.html new file mode 100644 index 0000000..1a649b5 --- /dev/null +++ b/public/blog/tag/display-multiline/feed/index.html @@ -0,0 +1,67 @@ + + + + display multiline – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Multi-Line Text In ListView + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/#respond + Thu, 24 Nov 2011 16:42:44 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=450 + + Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    +]]>
    + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/display-multiline/index.html b/public/blog/tag/display-multiline/index.html new file mode 100644 index 0000000..1ec8bdb --- /dev/null +++ b/public/blog/tag/display-multiline/index.html @@ -0,0 +1,212 @@ + + + + + + + +display multiline « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/display/feed/index.html b/public/blog/tag/display/feed/index.html new file mode 100644 index 0000000..78924e2 --- /dev/null +++ b/public/blog/tag/display/feed/index.html @@ -0,0 +1,91 @@ + + + + display – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How To: Dynamically Resize Focused Item + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/ + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/#respond + Thu, 22 Dec 2011 02:29:35 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=468 + + Better ListView 2.4.0 now supports setting MaximumTextLines property on every item and sub-item, so you can have multi-line items each with different number text lines:

    +
    Dynamic resizing of the focused item

    Dynamic resizing of the focused item

    +

    We also introduced FocusedItemChanged event, so that you can detect when focus has moved from one element (item / sub-item / group) to another.

    +

    These features can be combined to display only the focused item with more details to save space code of the FocusedItemChanged event handler may look like this:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +void ListViewFocusedItemChanged(object sender, BetterListViewFocusedItemChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (eventArgs.FocusedItemOld != null)
    + {
    + // set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1;
    + }

    +

    if (eventArgs.FocusedItemNew != null)
    + {
    + // set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Sub ListViewFocusedItemChanged(sender As Object, eventArgs As BetterListViewFocusedItemChangedEventArgs)
    + Dim ListView As BetterListView = DirectCast(sender, BetterListView)

    +

    ListView.BeginUpdate()

    +

    If eventArgs.FocusedItemOld IsNot Nothing Then
    + ‘ set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1
    + End If

    +

    If eventArgs.FocusedItemNew IsNot Nothing Then
    + ‘ set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3
    + End If

    +

    ListView.EndUpdate()
    +End Sub
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/display/index.html b/public/blog/tag/display/index.html new file mode 100644 index 0000000..6b0eaec --- /dev/null +++ b/public/blog/tag/display/index.html @@ -0,0 +1,212 @@ + + + + + + + +display « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/distraction-junkie/feed/index.html b/public/blog/tag/distraction-junkie/feed/index.html new file mode 100644 index 0000000..c182b7e --- /dev/null +++ b/public/blog/tag/distraction-junkie/feed/index.html @@ -0,0 +1,151 @@ + + + + distraction junkie – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/distraction-junkie/index.html b/public/blog/tag/distraction-junkie/index.html new file mode 100644 index 0000000..4ddf726 --- /dev/null +++ b/public/blog/tag/distraction-junkie/index.html @@ -0,0 +1,212 @@ + + + + + + + +distraction junkie « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/distractions/feed/index.html b/public/blog/tag/distractions/feed/index.html new file mode 100644 index 0000000..603f935 --- /dev/null +++ b/public/blog/tag/distractions/feed/index.html @@ -0,0 +1,151 @@ + + + + distractions – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/distractions/index.html b/public/blog/tag/distractions/index.html new file mode 100644 index 0000000..5d75e01 --- /dev/null +++ b/public/blog/tag/distractions/index.html @@ -0,0 +1,212 @@ + + + + + + + +distractions « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/documentation/feed/index.html b/public/blog/tag/documentation/feed/index.html new file mode 100644 index 0000000..39f02dd --- /dev/null +++ b/public/blog/tag/documentation/feed/index.html @@ -0,0 +1,73 @@ + + + + documentation – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.10 released + http://www.componentowl.com/blog/better-listview-2-10-released/ + http://www.componentowl.com/blog/better-listview-2-10-released/#respond + Fri, 14 Oct 2011 16:57:54 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=373 + + A new version with major improvements, optimizations and fixes has been released! It addresses many suggestions provided by you, our valued customers.

    +

    Improved Performance

    +

    We put a considerable effort into optimizing Better ListView 2 to provide advanced features (e.g. hierarchical and multi-line items, collapsible groups) while still being swift and responsive.

    +

    The overall performance has greatly improved. Better ListView 2.1 can easily handle 10.000 items while still being very fast. The parts where improvements are best seen are:

    +
    +
      +
    • Adding many items to the list
    • +
    • Expanding/collapsing of hierarchical items
    • +
    • Resizing a column
    • +
    +
    We also added new options in the Performance property group, so you can easily switch between fast and powerful options.
    +
    +

    Samples in both C# and Visual Basic

    +

    We added easy to understand samples for both C# and Visual Basic.

    +

    You can simply follow a link from start menu to open the Visual Studio project for your favourite language, and play with all the features of Better ListView.

    +
    C# and VB Samples projects in Solution Explorer

    C# and VB Samples projects in Solution Explorer

    +

     

    +

    Extended Documentation

    +

    We added a Quick Start Tutorial to help you with setup, activation and integration of Better ListView in your projects, as well as many entirely new chapters in the documentation.

    +

    All code samples are from now on provided in both C# and Visual Basic to be easy to understand to both C# and VB.net developers.

    +

    Smoother migration from .NET ListView to Better ListView

    +

    Better ListView now contains all the constructor/method overloads and properties of the regular .NET ListView, so that for each member of .NET ListView there is an easily discoverable equivalent in Better ListView.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-10-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/documentation/index.html b/public/blog/tag/documentation/index.html new file mode 100644 index 0000000..8a3169e --- /dev/null +++ b/public/blog/tag/documentation/index.html @@ -0,0 +1,212 @@ + + + + + + + +documentation « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/drag-and-drop-item-reordering/feed/index.html b/public/blog/tag/drag-and-drop-item-reordering/feed/index.html new file mode 100644 index 0000000..d0f82a0 --- /dev/null +++ b/public/blog/tag/drag-and-drop-item-reordering/feed/index.html @@ -0,0 +1,69 @@ + + + + drag and drop item reordering – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + List-View Drag and Drop Item Reorder (Sort) + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/ + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/#respond + Tue, 07 Jun 2011 11:29:04 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=260 + + Reordering items in list view control using drag and drop is very tricky. Implementation of item reorder requires multiple issues to be solved:

    +
      +
    • Initialization of the drag & drop
    • +
    • Insertion mark that previews where will be the dragged item moved
    • +
    • The actual reordering of the items (custom code might be needed)
    • +
    • Support of multiple drag drop effects (copy, move, link)
    • +
    • It should not interfere with external drag and drop outside of the listview control
    • +
    • It should not interfere with internal drag and drop into items.
    • +
    • Reorder of multiple items (including non-continuous selection)
    • +
    +

    Our Better ListView control supports drag and drop item reordering out of the box. Zero code is needed – all you have to do is to set the property BetterListViewItemReorderMode to Enabled.

    +

    It works just like this:

    +

    Item drag and drop reorder

    +

    Item drag and drop reorder

    +

    You can just download and install Better ListView, and start using it right away. It can do everything the regular .NET listview component can, and much more.

    +

    See more in the Drag Drop Sample that is included with Better ListView. It includes source code.

    +]]>
    + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/drag-and-drop-item-reordering/index.html b/public/blog/tag/drag-and-drop-item-reordering/index.html new file mode 100644 index 0000000..c6fd9a0 --- /dev/null +++ b/public/blog/tag/drag-and-drop-item-reordering/index.html @@ -0,0 +1,212 @@ + + + + + + + +drag and drop item reordering « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/drag-and-drop-item-sort/feed/index.html b/public/blog/tag/drag-and-drop-item-sort/feed/index.html new file mode 100644 index 0000000..acf6cb4 --- /dev/null +++ b/public/blog/tag/drag-and-drop-item-sort/feed/index.html @@ -0,0 +1,69 @@ + + + + drag and drop item sort – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + List-View Drag and Drop Item Reorder (Sort) + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/ + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/#respond + Tue, 07 Jun 2011 11:29:04 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=260 + + Reordering items in list view control using drag and drop is very tricky. Implementation of item reorder requires multiple issues to be solved:

    +
      +
    • Initialization of the drag & drop
    • +
    • Insertion mark that previews where will be the dragged item moved
    • +
    • The actual reordering of the items (custom code might be needed)
    • +
    • Support of multiple drag drop effects (copy, move, link)
    • +
    • It should not interfere with external drag and drop outside of the listview control
    • +
    • It should not interfere with internal drag and drop into items.
    • +
    • Reorder of multiple items (including non-continuous selection)
    • +
    +

    Our Better ListView control supports drag and drop item reordering out of the box. Zero code is needed – all you have to do is to set the property BetterListViewItemReorderMode to Enabled.

    +

    It works just like this:

    +

    Item drag and drop reorder

    +

    Item drag and drop reorder

    +

    You can just download and install Better ListView, and start using it right away. It can do everything the regular .NET listview component can, and much more.

    +

    See more in the Drag Drop Sample that is included with Better ListView. It includes source code.

    +]]>
    + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/drag-and-drop-item-sort/index.html b/public/blog/tag/drag-and-drop-item-sort/index.html new file mode 100644 index 0000000..5b41d04 --- /dev/null +++ b/public/blog/tag/drag-and-drop-item-sort/index.html @@ -0,0 +1,212 @@ + + + + + + + +drag and drop item sort « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/drag-and-drop-reordering/feed/index.html b/public/blog/tag/drag-and-drop-reordering/feed/index.html new file mode 100644 index 0000000..f00e6ce --- /dev/null +++ b/public/blog/tag/drag-and-drop-reordering/feed/index.html @@ -0,0 +1,69 @@ + + + + drag and drop reordering – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + List-View Drag and Drop Item Reorder (Sort) + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/ + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/#respond + Tue, 07 Jun 2011 11:29:04 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=260 + + Reordering items in list view control using drag and drop is very tricky. Implementation of item reorder requires multiple issues to be solved:

    +
      +
    • Initialization of the drag & drop
    • +
    • Insertion mark that previews where will be the dragged item moved
    • +
    • The actual reordering of the items (custom code might be needed)
    • +
    • Support of multiple drag drop effects (copy, move, link)
    • +
    • It should not interfere with external drag and drop outside of the listview control
    • +
    • It should not interfere with internal drag and drop into items.
    • +
    • Reorder of multiple items (including non-continuous selection)
    • +
    +

    Our Better ListView control supports drag and drop item reordering out of the box. Zero code is needed – all you have to do is to set the property BetterListViewItemReorderMode to Enabled.

    +

    It works just like this:

    +

    Item drag and drop reorder

    +

    Item drag and drop reorder

    +

    You can just download and install Better ListView, and start using it right away. It can do everything the regular .NET listview component can, and much more.

    +

    See more in the Drag Drop Sample that is included with Better ListView. It includes source code.

    +]]>
    + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/drag-and-drop-reordering/index.html b/public/blog/tag/drag-and-drop-reordering/index.html new file mode 100644 index 0000000..3ec792f --- /dev/null +++ b/public/blog/tag/drag-and-drop-reordering/index.html @@ -0,0 +1,212 @@ + + + + + + + +drag and drop reordering « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/draw/feed/index.html b/public/blog/tag/draw/feed/index.html new file mode 100644 index 0000000..f5852fa --- /dev/null +++ b/public/blog/tag/draw/feed/index.html @@ -0,0 +1,145 @@ + + + + draw – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Display Items in Custom States + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/ + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/#respond + Tue, 15 Nov 2011 15:24:25 +0000 + + + + + + + + + + + http://www.componentowl.com/blog/?p=398 + + One of our customers recently asked us if it is possible in Better ListView to draw item highlighted even when the control loses focus. This is an interesting and useful feature, so we implemented it right away.

    +

    Owner drawing in Better ListView 2.3.0 and higher allows you to draw elements (column headers, items, sub-items and groups) in any state you wish (hot, selected, focused and any combination of the three).

    +

    For example, we would like to highlight several items in one Better ListView depending on hovered item in other Better ListView:

    +
    Better ListView shows multiple hot items

    Better ListView shows multiple hot items

    +

    Items can be also be drawn as if the control is focused, enabled or disabled. This feature can be applied when you wish to display items in highlighted state even if Better ListView is not focused:

    +
    Better ListView keeps selected items highlighted

    Better ListView keeps selected items highlighted

    +

    We implemented the first sample (showing mulitple hot items) by inheriting from BetterListView, making a new class called HotListView. The implementation is very simple:

    +

     

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class HotListView : BetterListView
    +{
    +public HashSet HotItems
    +{
    +get
    +{
    +return this.hotItems;
    +}
    +set
    +{
    +this.hotItems = value;

    +

    Refresh();
    +}
    +}

    +

    private HashSethotItems = new HashSet();

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    +{
    +if (this.hotItems.Contains(eventArgs.Item.Index))
    +{
    +eventArgs.ItemStateInfo = new BetterListViewItemStateInfo(
    +eventArgs.ItemStateInfo.ItemState | BetterListViewItemState.Hot,
    +eventArgs.ItemStateInfo.ExpandButtonState,
    +eventArgs.ItemStateInfo.CheckBoxState);
    +}

    +

    base.OnDrawItem(eventArgs);
    +}
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class HotListView
    +Inherits BetterListView
    +Public Property HotItems() As HashSet(Of Integer)
    +Get
    +Return Me.m_hotItems
    +End Get
    +Set
    +Me.m_hotItems = value

    +

    Refresh()
    +End Set
    +End Property

    +

    Private m_hotItems As New HashSet(Of Integer)()

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    +If Me.m_hotItems.Contains(eventArgs.Item.Index) Then
    +eventArgs.ItemStateInfo = New BetterListViewItemStateInfo(eventArgs.ItemStateInfo.ItemState Or BetterListViewItemState.Hot, eventArgs.ItemStateInfo.ExpandButtonState, eventArgs.ItemStateInfo.CheckBoxState)
    +End If

    +

    MyBase.OnDrawItem(eventArgs)
    +End Sub
    +End Class
    +[/vb]

    +

     

    +

    The HotListView contains one property called HotItems. When drawing items (OnDrawItem method), it looks whether the item is in the HotItems set. If so, item drawing state is altered so that the item will be drawn as hot.

    +

    The modified ListView for second sample is even simpler. We call it HighlightListView:

    +

     

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class HighlightListView : BetterListView
    +{
    +protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    +{
    +if ((eventArgs.ItemStateInfo.ItemState & BetterListViewItemState.Selected) == BetterListViewItemState.Selected)
    +{
    +// if the item is selected, always draw control as if it is focused
    +eventArgs.DrawFocused = true;
    +}

    +

    base.OnDrawItem(eventArgs);
    +}
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class HighlightListView
    +Inherits BetterListView
    +Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    +If (eventArgs.ItemStateInfo.ItemState And BetterListViewItemState.Selected) = BetterListViewItemState.Selected Then
    +‘ if the item is selected, always draw control as if it is focused
    +eventArgs.DrawFocused = True
    +End If

    +

    MyBase.OnDrawItem(eventArgs)
    +End Sub
    +End Class
    +[/vb]

    +

     

    +

    This modification only draws selected items as if the control is always focused.

    +

    UPDATE: From Better ListView 2.3.1, you can simply use HideSelectionMode property to keep selected items highlighted.

    +]]>
    + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/draw/index.html b/public/blog/tag/draw/index.html new file mode 100644 index 0000000..7049e84 --- /dev/null +++ b/public/blog/tag/draw/index.html @@ -0,0 +1,212 @@ + + + + + + + +draw « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/drawing/feed/index.html b/public/blog/tag/drawing/feed/index.html new file mode 100644 index 0000000..ce0ec16 --- /dev/null +++ b/public/blog/tag/drawing/feed/index.html @@ -0,0 +1,392 @@ + + + + drawing – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    + + Better ListView Tip: How to Draw Custom Selection + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/ + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/#comments + Wed, 12 Sep 2012 15:43:12 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=808 + + Customized item selection.

    Customized item selection.

    +

     

    +

    By default, Better ListView uses system theme for drawing selections.

    +

    To draw custom selection, you can use owner drawing capabilities of Better ListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +class CustomListView : BetterListView
    +{
    + protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
    + brushSelection.Dispose();
    + }
    + }

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + eventArgs.DrawSelection = false;

    +

    base.OnDrawItem(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
    + brushSelection.Dispose()
    + End If
    + End Sub

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + eventArgs.DrawSelection = False

    +

    MyBase.OnDrawItem(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
    + End If
    + End Sub
    +End Class
    +[/vb]

    +

    In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

    +

    The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

    +

    The OnDrawItem method contains two things:

    +
      +
    1. Turn off  default selection.
    2. +
    3. Draw custom selection border if the item is selected.
    4. +
    +

    Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

    +

    Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

    +

    To allow these states, considerable coding need to be done.

    +

    In case you need this level of customization, please contact us for Custom Coding support.

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/feed/ + 2 +
    + + Hiding Items in Better ListView + http://www.componentowl.com/blog/hiding-items-in-better-listview/ + http://www.componentowl.com/blog/hiding-items-in-better-listview/#respond + Mon, 06 Feb 2012 16:23:15 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=546 + + We currently introduced a BetterListViewItem.Visible property to allow hiding items visually, but keeping then in the Items collection:

    +
    Making items invisible

    Making items invisible

    +

    The above image shows two groups of items. The first groups uses hiding of items with the Visible property, while the second group simply turns off drawing of ceratin items.

    +

    The first approach is useful when you need to hide item as if it is removed, but keep it actually within Items collection.

    +

    The second approach need to create new control inheriting from BetterListView, overrride the OnDrawItem method and set properties like BetterListViewDrawItemEventArgs.DrawImage to false or simply not call the base implementation of OnDrawItem.

    +

    The second (owner drawing) approach is useful when you need just to switch off display of item without changing the item layout.

    +]]>
    + http://www.componentowl.com/blog/hiding-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/drawing/index.html b/public/blog/tag/drawing/index.html new file mode 100644 index 0000000..cadc877 --- /dev/null +++ b/public/blog/tag/drawing/index.html @@ -0,0 +1,218 @@ + + + + + + + +drawing « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/drawn/feed/index.html b/public/blog/tag/drawn/feed/index.html new file mode 100644 index 0000000..9558fdf --- /dev/null +++ b/public/blog/tag/drawn/feed/index.html @@ -0,0 +1,363 @@ + + + + drawn – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    + + Better ListView Tip: How to Draw Custom Selection + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/ + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/#comments + Wed, 12 Sep 2012 15:43:12 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=808 + + Customized item selection.

    Customized item selection.

    +

     

    +

    By default, Better ListView uses system theme for drawing selections.

    +

    To draw custom selection, you can use owner drawing capabilities of Better ListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +class CustomListView : BetterListView
    +{
    + protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
    + brushSelection.Dispose();
    + }
    + }

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + eventArgs.DrawSelection = false;

    +

    base.OnDrawItem(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
    + brushSelection.Dispose()
    + End If
    + End Sub

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + eventArgs.DrawSelection = False

    +

    MyBase.OnDrawItem(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
    + End If
    + End Sub
    +End Class
    +[/vb]

    +

    In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

    +

    The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

    +

    The OnDrawItem method contains two things:

    +
      +
    1. Turn off  default selection.
    2. +
    3. Draw custom selection border if the item is selected.
    4. +
    +

    Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

    +

    Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

    +

    To allow these states, considerable coding need to be done.

    +

    In case you need this level of customization, please contact us for Custom Coding support.

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/feed/ + 2 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/drawn/index.html b/public/blog/tag/drawn/index.html new file mode 100644 index 0000000..274a9ec --- /dev/null +++ b/public/blog/tag/drawn/index.html @@ -0,0 +1,216 @@ + + + + + + + +drawn « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/drop-shadow/feed/index.html b/public/blog/tag/drop-shadow/feed/index.html new file mode 100644 index 0000000..a9dbcb2 --- /dev/null +++ b/public/blog/tag/drop-shadow/feed/index.html @@ -0,0 +1,75 @@ + + + + drop shadow – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Thumbnails with Borders and Shadows + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/ + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/#respond + Mon, 14 Feb 2011 19:17:14 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=103 + + We’ve just released Better ListView version 1.50 with some new features – thumbnails view, image borders support (inc. shadows), and more.

    +

    Our great inspiration for designing Better ListView is nothing less than the mighty Windows Explorer. This file manager uses obviously much more powerful control that the regular .NET list-view alone is.

    +

    It supports some extra views, line Contents and Extra Large Icons. It is also possible to adjust image size by rolling a mouse wheel while holding Control key.

    +

    Better ListView has the capability of displaying item icons with arbitrary sizes, but we also extended it with one extra view: Thumbnails:

    +
    Thumbnails Sample

    Thumbnails Sample

    +

    This view aligns items in the center while keeping constant spacing between items. Thumbnails also keep just single line of text for compactness. On the other hand, LargeIcon view varies horizontal space between items to fill client area evenly and breaks long text into several lines.

    +

    The constant spacing is inspired by various photo managers, where image thumbnails are better viewed side-by-side (and the view looks also more organized).

    +

    Image thumbnails also look better with some kind border or frame. We added this new feature in Better ListView 1.5 and it works in all views. There are several pre-defined types of borders, but user can draw his own:

    +
      +
    • None – simply no border at all
    • +
    • Single – single line border
    • +
    • SingleOffset – single line with a spacing between image and the border
    • +
    • SymmetricShadow – smooth shadow around image
    • +
    • DropShadow – smooth shadow on the right bottom part of the image
    • +
    +

    Thumbnails use DropShadow by default, but it can be adjusted for every view separately. One can also adjust thickness of the border/shadow and define custom spacing around image.

    +

    Take a look at one possible setting:

    +
    Image Borders

    Image Borders

    +

    This is SingleOffset border of width 3 pixels. Notice that also column header images can have its borders (these are SymmetricShadow).

    +

    When the border is defined and image size should be kept the same, some spacing have to be added around image. You can adjust this spacing to draw you own borders or any additional graphics (such as overlay icons). Here is an example –

    +
    Thumbnail with Extra Icons

    Thumbnail with Extra Icons

    +

    Download Better ListView

    +

    You can download Better ListView and play with it yourself.

    +]]>
    + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/drop-shadow/index.html b/public/blog/tag/drop-shadow/index.html new file mode 100644 index 0000000..ae6deaa --- /dev/null +++ b/public/blog/tag/drop-shadow/index.html @@ -0,0 +1,212 @@ + + + + + + + +drop shadow « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/dropdown/feed/index.html b/public/blog/tag/dropdown/feed/index.html new file mode 100644 index 0000000..ca08514 --- /dev/null +++ b/public/blog/tag/dropdown/feed/index.html @@ -0,0 +1,56 @@ + + + + dropdown – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Combined Items in Better ListView + http://www.componentowl.com/blog/combined-items-in-better-listview/ + http://www.componentowl.com/blog/combined-items-in-better-listview/#respond + Thu, 05 Jan 2012 09:46:49 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=478 + + Hierarchical (tree-like) items can be used to support non-selectable child items in Better ListView 2.5.0 and newer. We call these Combined items as they are combined with its children to look and behave as single item:

    +
    Combined items

    Combined items

    +

    Combined item has selection ranging over all its child items. This can be seen when the combined item is selected or focused:

    +
    Combined items - selection

    Combined items - selection

    +

    Child items of the combined item are still interactive, though not focusable/selectable. They can contain further children (be expanded/collapsed with expand button as well) and can contain interactive check boxes. The visual part of combined child items is also fully available, to the child items can contain images and even sub-items.

    +

    To set-up combined items, simply set AllowSelectChildItems property to false on all items you wish to combine.

    +

    Combined items can be used in any level of item hierarchy.

    +]]>
    + http://www.componentowl.com/blog/combined-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/dropdown/index.html b/public/blog/tag/dropdown/index.html new file mode 100644 index 0000000..03288e0 --- /dev/null +++ b/public/blog/tag/dropdown/index.html @@ -0,0 +1,212 @@ + + + + + + + +dropdown « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/dynamic/feed/index.html b/public/blog/tag/dynamic/feed/index.html new file mode 100644 index 0000000..2f9fb4c --- /dev/null +++ b/public/blog/tag/dynamic/feed/index.html @@ -0,0 +1,91 @@ + + + + dynamic – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How To: Dynamically Resize Focused Item + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/ + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/#respond + Thu, 22 Dec 2011 02:29:35 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=468 + + Better ListView 2.4.0 now supports setting MaximumTextLines property on every item and sub-item, so you can have multi-line items each with different number text lines:

    +
    Dynamic resizing of the focused item

    Dynamic resizing of the focused item

    +

    We also introduced FocusedItemChanged event, so that you can detect when focus has moved from one element (item / sub-item / group) to another.

    +

    These features can be combined to display only the focused item with more details to save space code of the FocusedItemChanged event handler may look like this:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +void ListViewFocusedItemChanged(object sender, BetterListViewFocusedItemChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (eventArgs.FocusedItemOld != null)
    + {
    + // set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1;
    + }

    +

    if (eventArgs.FocusedItemNew != null)
    + {
    + // set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Sub ListViewFocusedItemChanged(sender As Object, eventArgs As BetterListViewFocusedItemChangedEventArgs)
    + Dim ListView As BetterListView = DirectCast(sender, BetterListView)

    +

    ListView.BeginUpdate()

    +

    If eventArgs.FocusedItemOld IsNot Nothing Then
    + ‘ set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1
    + End If

    +

    If eventArgs.FocusedItemNew IsNot Nothing Then
    + ‘ set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3
    + End If

    +

    ListView.EndUpdate()
    +End Sub
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/dynamic/index.html b/public/blog/tag/dynamic/index.html new file mode 100644 index 0000000..8896396 --- /dev/null +++ b/public/blog/tag/dynamic/index.html @@ -0,0 +1,212 @@ + + + + + + + +dynamic « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/edge/feed/index.html b/public/blog/tag/edge/feed/index.html new file mode 100644 index 0000000..75e5ff2 --- /dev/null +++ b/public/blog/tag/edge/feed/index.html @@ -0,0 +1,151 @@ + + + + edge – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/edge/index.html b/public/blog/tag/edge/index.html new file mode 100644 index 0000000..ee9fadd --- /dev/null +++ b/public/blog/tag/edge/index.html @@ -0,0 +1,212 @@ + + + + + + + +edge « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/edges/feed/index.html b/public/blog/tag/edges/feed/index.html new file mode 100644 index 0000000..bd47ba6 --- /dev/null +++ b/public/blog/tag/edges/feed/index.html @@ -0,0 +1,151 @@ + + + + edges – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/edges/index.html b/public/blog/tag/edges/index.html new file mode 100644 index 0000000..3f9a2cf --- /dev/null +++ b/public/blog/tag/edges/index.html @@ -0,0 +1,212 @@ + + + + + + + +edges « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/edit/feed/index.html b/public/blog/tag/edit/feed/index.html new file mode 100644 index 0000000..fff51e8 --- /dev/null +++ b/public/blog/tag/edit/feed/index.html @@ -0,0 +1,188 @@ + + + + edit – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    + + Customize Label Editing (Embedded) Control for Each Line in Better ListView + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/ + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/#comments + Wed, 04 Apr 2012 10:33:49 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=771 + + Embedded controls for label edit in Better ListView can be customized not only for every column, but even for every row.

    +

    This is not a new feature, but would be nice to mention that you can possibly have a different custom editing control for every cell…

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +{
    + // show editing controls in the second column
    + if (eventArgs.SubItem.Index == 1)
    + {
    + // show my custom control on the first row
    + if (eventArgs.SubItem.Item.Index == 0)
    + {
    + return (new DocumentAccessConrol());
    + }

    +

    // show my custom control on the second row
    + if (eventArgs.SubItem.Item.Index == 1)
    + {
    + return (new BetterListViewComboBoxEmbeddedControl());
    + }

    +

    // show my custom control on the third row
    + if (eventArgs.SubItem.Item.Index == 2)
    + {
    + return (new BetterListViewTextBoxEmbeddedControl());
    + }
    + }

    +

    return null;
    +}
    +[/csharp]

    +

     

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Function ListViewRequestEmbeddedControl(ByVal sender As Object, ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    + As IBetterListViewEmbeddedControl

    +

    ‘ show editing controls in the second column
    + If eventArgs.SubItem.Index = 1 Then

    +

    ‘ show my custom control on the first row
    + If eventArgs.SubItem.Item.Index = 0 Then
    + Return (New DocumentAccessConrol())
    + End If

    +

    ‘ show my custom control on the second row
    + If eventArgs.SubItem.Item.Index = 1 Then
    + Return (New BetterListViewComboBoxEmbeddedControl())
    + End If

    +

    ‘ show my custom control on the third row
    + If eventArgs.SubItem.Item.Index = 2 Then
    + Return (New BetterListViewTextBoxEmbeddedControl())
    + End If

    +

    End If

    +

    Return Nothing

    +

    End Function
    +[/vb]

    +

     

    +

    And there is the result:

    +
    Custom Embedded Control on the First Line

    Custom Embedded Control on the First Line

    +

     

    +
    TextBox Control on the Third Line

    TextBox Control on the Third Line

    +]]>
    + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/feed/ + 2 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/edit/index.html b/public/blog/tag/edit/index.html new file mode 100644 index 0000000..6fcad4d --- /dev/null +++ b/public/blog/tag/edit/index.html @@ -0,0 +1,214 @@ + + + + + + + +edit « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/editing/feed/index.html b/public/blog/tag/editing/feed/index.html new file mode 100644 index 0000000..6d76dc6 --- /dev/null +++ b/public/blog/tag/editing/feed/index.html @@ -0,0 +1,110 @@ + + + + editing – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Customize Label Editing (Embedded) Control for Each Line in Better ListView + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/ + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/#comments + Wed, 04 Apr 2012 10:33:49 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=771 + + Embedded controls for label edit in Better ListView can be customized not only for every column, but even for every row.

    +

    This is not a new feature, but would be nice to mention that you can possibly have a different custom editing control for every cell…

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +{
    + // show editing controls in the second column
    + if (eventArgs.SubItem.Index == 1)
    + {
    + // show my custom control on the first row
    + if (eventArgs.SubItem.Item.Index == 0)
    + {
    + return (new DocumentAccessConrol());
    + }

    +

    // show my custom control on the second row
    + if (eventArgs.SubItem.Item.Index == 1)
    + {
    + return (new BetterListViewComboBoxEmbeddedControl());
    + }

    +

    // show my custom control on the third row
    + if (eventArgs.SubItem.Item.Index == 2)
    + {
    + return (new BetterListViewTextBoxEmbeddedControl());
    + }
    + }

    +

    return null;
    +}
    +[/csharp]

    +

     

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Function ListViewRequestEmbeddedControl(ByVal sender As Object, ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    + As IBetterListViewEmbeddedControl

    +

    ‘ show editing controls in the second column
    + If eventArgs.SubItem.Index = 1 Then

    +

    ‘ show my custom control on the first row
    + If eventArgs.SubItem.Item.Index = 0 Then
    + Return (New DocumentAccessConrol())
    + End If

    +

    ‘ show my custom control on the second row
    + If eventArgs.SubItem.Item.Index = 1 Then
    + Return (New BetterListViewComboBoxEmbeddedControl())
    + End If

    +

    ‘ show my custom control on the third row
    + If eventArgs.SubItem.Item.Index = 2 Then
    + Return (New BetterListViewTextBoxEmbeddedControl())
    + End If

    +

    End If

    +

    Return Nothing

    +

    End Function
    +[/vb]

    +

     

    +

    And there is the result:

    +
    Custom Embedded Control on the First Line

    Custom Embedded Control on the First Line

    +

     

    +
    TextBox Control on the Third Line

    TextBox Control on the Third Line

    +]]>
    + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/feed/ + 2 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/editing/index.html b/public/blog/tag/editing/index.html new file mode 100644 index 0000000..0a80922 --- /dev/null +++ b/public/blog/tag/editing/index.html @@ -0,0 +1,212 @@ + + + + + + + +editing « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/efficient-work-on-computer/feed/index.html b/public/blog/tag/efficient-work-on-computer/feed/index.html new file mode 100644 index 0000000..fae0b53 --- /dev/null +++ b/public/blog/tag/efficient-work-on-computer/feed/index.html @@ -0,0 +1,151 @@ + + + + efficient work on computer – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/efficient-work-on-computer/index.html b/public/blog/tag/efficient-work-on-computer/index.html new file mode 100644 index 0000000..a6e60c1 --- /dev/null +++ b/public/blog/tag/efficient-work-on-computer/index.html @@ -0,0 +1,212 @@ + + + + + + + +efficient work on computer « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/embedded/feed/index.html b/public/blog/tag/embedded/feed/index.html new file mode 100644 index 0000000..524de08 --- /dev/null +++ b/public/blog/tag/embedded/feed/index.html @@ -0,0 +1,110 @@ + + + + embedded – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Customize Label Editing (Embedded) Control for Each Line in Better ListView + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/ + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/#comments + Wed, 04 Apr 2012 10:33:49 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=771 + + Embedded controls for label edit in Better ListView can be customized not only for every column, but even for every row.

    +

    This is not a new feature, but would be nice to mention that you can possibly have a different custom editing control for every cell…

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +{
    + // show editing controls in the second column
    + if (eventArgs.SubItem.Index == 1)
    + {
    + // show my custom control on the first row
    + if (eventArgs.SubItem.Item.Index == 0)
    + {
    + return (new DocumentAccessConrol());
    + }

    +

    // show my custom control on the second row
    + if (eventArgs.SubItem.Item.Index == 1)
    + {
    + return (new BetterListViewComboBoxEmbeddedControl());
    + }

    +

    // show my custom control on the third row
    + if (eventArgs.SubItem.Item.Index == 2)
    + {
    + return (new BetterListViewTextBoxEmbeddedControl());
    + }
    + }

    +

    return null;
    +}
    +[/csharp]

    +

     

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Function ListViewRequestEmbeddedControl(ByVal sender As Object, ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    + As IBetterListViewEmbeddedControl

    +

    ‘ show editing controls in the second column
    + If eventArgs.SubItem.Index = 1 Then

    +

    ‘ show my custom control on the first row
    + If eventArgs.SubItem.Item.Index = 0 Then
    + Return (New DocumentAccessConrol())
    + End If

    +

    ‘ show my custom control on the second row
    + If eventArgs.SubItem.Item.Index = 1 Then
    + Return (New BetterListViewComboBoxEmbeddedControl())
    + End If

    +

    ‘ show my custom control on the third row
    + If eventArgs.SubItem.Item.Index = 2 Then
    + Return (New BetterListViewTextBoxEmbeddedControl())
    + End If

    +

    End If

    +

    Return Nothing

    +

    End Function
    +[/vb]

    +

     

    +

    And there is the result:

    +
    Custom Embedded Control on the First Line

    Custom Embedded Control on the First Line

    +

     

    +
    TextBox Control on the Third Line

    TextBox Control on the Third Line

    +]]>
    + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/feed/ + 2 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/embedded/index.html b/public/blog/tag/embedded/index.html new file mode 100644 index 0000000..c244056 --- /dev/null +++ b/public/blog/tag/embedded/index.html @@ -0,0 +1,212 @@ + + + + + + + +embedded « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/empty/feed/index.html b/public/blog/tag/empty/feed/index.html new file mode 100644 index 0000000..ee8185f --- /dev/null +++ b/public/blog/tag/empty/feed/index.html @@ -0,0 +1,98 @@ + + + + empty – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Add Grid Lines in Empty Space in Better ListView + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/#respond + Wed, 30 Apr 2014 09:51:46 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=894 + + Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    +]]>
    + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/empty/index.html b/public/blog/tag/empty/index.html new file mode 100644 index 0000000..fbea33e --- /dev/null +++ b/public/blog/tag/empty/index.html @@ -0,0 +1,212 @@ + + + + + + + +empty « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/enabled/feed/index.html b/public/blog/tag/enabled/feed/index.html new file mode 100644 index 0000000..cfb66d2 --- /dev/null +++ b/public/blog/tag/enabled/feed/index.html @@ -0,0 +1,61 @@ + + + + enabled – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Read-Only Mode in Better ListView + http://www.componentowl.com/blog/read-only-mode-in-better-listview/ + http://www.componentowl.com/blog/read-only-mode-in-better-listview/#respond + Fri, 27 Jan 2012 16:21:58 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=482 + + Better ListView 2.5 introduces a new boolean property called ReadOnly.

    +

    When set to true, the Better ListView does not respond to keyboard and mouse input. There are, however, some exceptions that make the Read-only mode different to the Disabled mode (when Enabled property is set to false).

    +

    When in Read-only mode, content of the Better ListView can be still scrolled (the scroll bars are enabled) and groups/items can be expanded/collapsed.

    +

    The difference between Disabled and Read-only can be seen on the following images:

    +
    Normal state

    Normal state

    +
    Disabled state

    Disabled state

    +
    Read-only state

    Read-only state

    +

     

    +

    As you can see, the Better ListView is displayed normally in Read-only mode, but the group header does not have a hot state (because cannot be focused). Items also cannot be focused or selected, but the expand buttons are still interactive.

    +

    The scroll bars would also be enabled and can be used, which is different from Disabled mode where everything is grayed and cannot be used.

    +]]>
    + http://www.componentowl.com/blog/read-only-mode-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/enabled/index.html b/public/blog/tag/enabled/index.html new file mode 100644 index 0000000..250b751 --- /dev/null +++ b/public/blog/tag/enabled/index.html @@ -0,0 +1,212 @@ + + + + + + + +enabled « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/even/feed/index.html b/public/blog/tag/even/feed/index.html new file mode 100644 index 0000000..d96258c --- /dev/null +++ b/public/blog/tag/even/feed/index.html @@ -0,0 +1,64 @@ + + + + even – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Alternating Rows in Better ListView + http://www.componentowl.com/blog/alternating-rows-in-better-listview/ + http://www.componentowl.com/blog/alternating-rows-in-better-listview/#respond + Tue, 22 Apr 2014 22:38:15 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=888 + + Alternating Rows

    Alternating Rows

    +

    Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.

    +

    Simply add DrawItemBackground event handler and fill background on odd/even items:

    +

     

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    + if ((eventArgs.Item.Index & 1) == 1)
    + {
    + eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
    + }
    +}
    +[/csharp]

    +]]>
    + http://www.componentowl.com/blog/alternating-rows-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/even/index.html b/public/blog/tag/even/index.html new file mode 100644 index 0000000..3340414 --- /dev/null +++ b/public/blog/tag/even/index.html @@ -0,0 +1,212 @@ + + + + + + + +even « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/explorer/feed/index.html b/public/blog/tag/explorer/feed/index.html new file mode 100644 index 0000000..b9997b5 --- /dev/null +++ b/public/blog/tag/explorer/feed/index.html @@ -0,0 +1,188 @@ + + + + explorer – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    + + File Explorer with Better ListView + http://www.componentowl.com/blog/file-explorer-with-better-listview/ + http://www.componentowl.com/blog/file-explorer-with-better-listview/#respond + Tue, 09 Aug 2011 16:04:31 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=340 + + In release 2.0.2 we added a sample demonstrating how Better ListView can be used to construct folder tree and file browser to make a standalone file explorer:

    +

    File Explorer Sample

    +

    There are two controls derived from BetterListView. One for the navigation pane (folder tree on left side) and one for the file view (on the right side).

    +

    The FolderListView control allows browsing through virtual folders as well as folders on removable drives. We needed this control in our products because .NET does not provide any similar managed control (there is only FolderBrowserDialog, but we actually need a control).

    +

    You can use it for your purposes as well, it is available in Better ListView Samples source code.

    +

    Many features of Better ListView can be used to enhance file browsing, for example:

    +
      +
    • Drag and Drop – moving or copying files
    • +
    • Label Edit – renaming files
    • +
    • Thumbnails – display thumbnails of image files
    • +
    • Custom Tooltips – display extra information on each file item
    • +
    • Groups – organize files into groups (e.g. by size)
    • +
    • Check Boxes – select folders and sub-folders properly with three-state check boxes
    • +
    • Images – every file type could display different image (extracted icon)
    • +
    • Context Menus – do extra operations with files, like displaying file properties
    • +
    • Searching – doing keyboard search is very easy to search for some file
    • +
    • Sorting – sort files according to multiple properties (this is demonstrated in the sample)
    • +
    • Background Image – show that the user is located in special folder by ambient image on the background
    • +
    +]]>
    + http://www.componentowl.com/blog/file-explorer-with-better-listview/feed/ + 0 +
    + + Work in Progress: “Groups” / “Item Hierarchy” Features + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond + Fri, 25 Mar 2011 23:11:00 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=204 + + We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    +]]>
    + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/explorer/index.html b/public/blog/tag/explorer/index.html new file mode 100644 index 0000000..816a968 --- /dev/null +++ b/public/blog/tag/explorer/index.html @@ -0,0 +1,216 @@ + + + + + + + +explorer « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/extension/feed/index.html b/public/blog/tag/extension/feed/index.html new file mode 100644 index 0000000..43ec2b9 --- /dev/null +++ b/public/blog/tag/extension/feed/index.html @@ -0,0 +1,107 @@ + + + + extension – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/extension/index.html b/public/blog/tag/extension/index.html new file mode 100644 index 0000000..383ea9a --- /dev/null +++ b/public/blog/tag/extension/index.html @@ -0,0 +1,212 @@ + + + + + + + +extension « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/extensions/feed/index.html b/public/blog/tag/extensions/feed/index.html new file mode 100644 index 0000000..cfc77ab --- /dev/null +++ b/public/blog/tag/extensions/feed/index.html @@ -0,0 +1,107 @@ + + + + extensions – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/extensions/index.html b/public/blog/tag/extensions/index.html new file mode 100644 index 0000000..42a33fc --- /dev/null +++ b/public/blog/tag/extensions/index.html @@ -0,0 +1,212 @@ + + + + + + + +extensions « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/fading/feed/index.html b/public/blog/tag/fading/feed/index.html new file mode 100644 index 0000000..4b03828 --- /dev/null +++ b/public/blog/tag/fading/feed/index.html @@ -0,0 +1,151 @@ + + + + fading – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/fading/index.html b/public/blog/tag/fading/index.html new file mode 100644 index 0000000..a26b2f6 --- /dev/null +++ b/public/blog/tag/fading/index.html @@ -0,0 +1,212 @@ + + + + + + + +fading « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/fast-listview/feed/index.html b/public/blog/tag/fast-listview/feed/index.html new file mode 100644 index 0000000..eea71ec --- /dev/null +++ b/public/blog/tag/fast-listview/feed/index.html @@ -0,0 +1,73 @@ + + + + fast listview – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.10 released + http://www.componentowl.com/blog/better-listview-2-10-released/ + http://www.componentowl.com/blog/better-listview-2-10-released/#respond + Fri, 14 Oct 2011 16:57:54 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=373 + + A new version with major improvements, optimizations and fixes has been released! It addresses many suggestions provided by you, our valued customers.

    +

    Improved Performance

    +

    We put a considerable effort into optimizing Better ListView 2 to provide advanced features (e.g. hierarchical and multi-line items, collapsible groups) while still being swift and responsive.

    +

    The overall performance has greatly improved. Better ListView 2.1 can easily handle 10.000 items while still being very fast. The parts where improvements are best seen are:

    +
    +
      +
    • Adding many items to the list
    • +
    • Expanding/collapsing of hierarchical items
    • +
    • Resizing a column
    • +
    +
    We also added new options in the Performance property group, so you can easily switch between fast and powerful options.
    +
    +

    Samples in both C# and Visual Basic

    +

    We added easy to understand samples for both C# and Visual Basic.

    +

    You can simply follow a link from start menu to open the Visual Studio project for your favourite language, and play with all the features of Better ListView.

    +
    C# and VB Samples projects in Solution Explorer

    C# and VB Samples projects in Solution Explorer

    +

     

    +

    Extended Documentation

    +

    We added a Quick Start Tutorial to help you with setup, activation and integration of Better ListView in your projects, as well as many entirely new chapters in the documentation.

    +

    All code samples are from now on provided in both C# and Visual Basic to be easy to understand to both C# and VB.net developers.

    +

    Smoother migration from .NET ListView to Better ListView

    +

    Better ListView now contains all the constructor/method overloads and properties of the regular .NET ListView, so that for each member of .NET ListView there is an easily discoverable equivalent in Better ListView.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-10-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/fast-listview/index.html b/public/blog/tag/fast-listview/index.html new file mode 100644 index 0000000..c0586e0 --- /dev/null +++ b/public/blog/tag/fast-listview/index.html @@ -0,0 +1,212 @@ + + + + + + + +fast listview « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/fast/feed/index.html b/public/blog/tag/fast/feed/index.html new file mode 100644 index 0000000..0f15bd2 --- /dev/null +++ b/public/blog/tag/fast/feed/index.html @@ -0,0 +1,62 @@ + + + + fast – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Coming soon: Better ListView 2.1 Optimized for Performance + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/ + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/#respond + Mon, 05 Sep 2011 16:33:45 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=348 + + Better ListView 2 comes with many hot features, like groups and item hierarchy. Great features, unfortunately, often come at the price of decreased performance. However, we want to have Better ListView both feature-rich and fast.

    +

    Some users noticed a performance drop when working with large number of items (say 10 000+). Our top priority for version 2.1 is the overall optimization of Better ListView. Several optimizations have already been made in the recent updates (column resizing and thumbnail images), but we have to go further. You can expect Better ListView to be much snappier in the upcoming 2.1 update. The optimizations will cover these areas:

    +
      +
    • Faster collection operations (adding, removing, sorting) of large number of items
    • +
    • Faster expand/collapse of groups and items
    • +
    • Faster column resizing with multi-line items
    • +
    +

    We will also take a look on smoother Visual Studio integration, so you can see Better ListView ready in toolbox just after installation (we have to deal with Visual Studio Packages, which is quite an esoteric topic). If Better ListView doesn’t currently appear in your Visual Studio toolbox automatically, you can just right-click the toolbox window, and use “Choose Items” to add the DLL file yourself.

    +

    Some background info for the more curious of you: Version 1.5 of Better ListView was very fast. It was so fast because every item in the list had precisely the same size. Some operations, like hit testing, was done in constant time and no extra measurement of individual items was necessary. The new major 2.0 version of Better ListView supports items with variable sizes, and irregular layout consisting of grouped items. However, we observed that even in complex settings, there are just few “types” of items – for example, there are only three possible item sizes when using multi-line items with up to three lines of text. Our optimizations will thus be focused on taking advantage of this to reduce most expensive operations back to constant time complexity.

    +
    photo by Michael Roper

    photo by Michael Roper

    +]]>
    + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/fast/index.html b/public/blog/tag/fast/index.html new file mode 100644 index 0000000..4ba5730 --- /dev/null +++ b/public/blog/tag/fast/index.html @@ -0,0 +1,212 @@ + + + + + + + +fast « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/faster/feed/index.html b/public/blog/tag/faster/feed/index.html new file mode 100644 index 0000000..bc39d9b --- /dev/null +++ b/public/blog/tag/faster/feed/index.html @@ -0,0 +1,62 @@ + + + + faster – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Coming soon: Better ListView 2.1 Optimized for Performance + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/ + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/#respond + Mon, 05 Sep 2011 16:33:45 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=348 + + Better ListView 2 comes with many hot features, like groups and item hierarchy. Great features, unfortunately, often come at the price of decreased performance. However, we want to have Better ListView both feature-rich and fast.

    +

    Some users noticed a performance drop when working with large number of items (say 10 000+). Our top priority for version 2.1 is the overall optimization of Better ListView. Several optimizations have already been made in the recent updates (column resizing and thumbnail images), but we have to go further. You can expect Better ListView to be much snappier in the upcoming 2.1 update. The optimizations will cover these areas:

    +
      +
    • Faster collection operations (adding, removing, sorting) of large number of items
    • +
    • Faster expand/collapse of groups and items
    • +
    • Faster column resizing with multi-line items
    • +
    +

    We will also take a look on smoother Visual Studio integration, so you can see Better ListView ready in toolbox just after installation (we have to deal with Visual Studio Packages, which is quite an esoteric topic). If Better ListView doesn’t currently appear in your Visual Studio toolbox automatically, you can just right-click the toolbox window, and use “Choose Items” to add the DLL file yourself.

    +

    Some background info for the more curious of you: Version 1.5 of Better ListView was very fast. It was so fast because every item in the list had precisely the same size. Some operations, like hit testing, was done in constant time and no extra measurement of individual items was necessary. The new major 2.0 version of Better ListView supports items with variable sizes, and irregular layout consisting of grouped items. However, we observed that even in complex settings, there are just few “types” of items – for example, there are only three possible item sizes when using multi-line items with up to three lines of text. Our optimizations will thus be focused on taking advantage of this to reduce most expensive operations back to constant time complexity.

    +
    photo by Michael Roper

    photo by Michael Roper

    +]]>
    + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/faster/index.html b/public/blog/tag/faster/index.html new file mode 100644 index 0000000..c38b70a --- /dev/null +++ b/public/blog/tag/faster/index.html @@ -0,0 +1,212 @@ + + + + + + + +faster « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/features/feed/index.html b/public/blog/tag/features/feed/index.html new file mode 100644 index 0000000..72d5382 --- /dev/null +++ b/public/blog/tag/features/feed/index.html @@ -0,0 +1,85 @@ + + + + features – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more) + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/ + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/#respond + Tue, 03 May 2011 09:28:55 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=232 + groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.]]> + Hierarchical items in two groups

    Hierarchical items in two groups

    +

    We are currently working hard on finishing Better ListView version 2.0 which will add new features: Support for groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.

    +

    We expect to release this upgrade in about a month. It will be a free upgrade for current and new users.

    +

    Groups

    +

    Groups in Better ListView have comparable capabilities as other Better ListView elements (column headers, items, sub-items). For example, you can adjust the foreground/background colors, font, image – and owner drawing is possible as well.

    +

    You can even include images into group headers (as you can see in the preview above), which is not possible in .NET ListView.

    +

    Groups are collapsible by default and the expand button can be switched off on each group individually.

    +

    Here are groups combined with Tile view (the second group is collapsed):

    +
    Groups with Tile view

    Groups with Tile view

    +

    The previous figure displays vertically oriented groups, but Better ListView also support horizontally oriented groups in the List mode:

    +
    Groups with List view

    Groups with List view

    +

    We put special effort to mimic the group display and behavior of Windows Explorer. The group headers can display all of the 15 group header states available in Windows visual style and their display is governed by the same logic as in the ListView counterpart.

    +

    The group headers always look perfect and native, right out of the box. You don’t need to tweak anything.

    +

    Item Hierarchy

    +
    +
    +

    +
    Items with hierarchy

    Items with hierarchy

    +

    +
    +
    +
    +

    This works in the similar way as in the standard TreeView control. Each item (or node) has property called ChildItems which can be filled with new BetterListViewItem instances. SubItems collection can still be used in either items and child-items (child items are treated in the very same way as their parents).

    +

    Item hierarchy can be combined with Groups feature as seen in the first preview.

    +

    Multi-Line Items

    +
    Multi-line items

    Multi-line items

    +

    A simple setting of item layout (MaximumTextLines property) allows breaking item text into several lines (up to the specified value). When the text is longer than MaximumTextLines, then the default trimming method is used (one from the TextTrimming enumeration: None, TrimCharacter, TrimWord, EllipsisCharacter, EllipsisWord, EllipsisPath).

    +

    Multi-line text can be used in every view and also in column headers.

    +

    Another New Features

    +

    There are also bunch of new minor features including:

    +

    Adjustable paddings – Every element part (e.g. item check box, group image…) contains customizable spaces at each side, so the user can easily create space where he needs and customize items/column headers/group headers to the finest detail.

    +

    Focusing sub-items – Items, group headers and even sub-items can be keyfocused. User can now invoke label editing or scroll to any “cell” in the Details-with-columns view solely with keyboard.

    +

    IEnumerable implementations –  BetterListView, BetterListViewGroup and BetterListViewItem implements IEnumerable interface for iterating through the whole item hierarchy, so using recursion to traverse child items is not necessary.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/features/index.html b/public/blog/tag/features/index.html new file mode 100644 index 0000000..d4042a8 --- /dev/null +++ b/public/blog/tag/features/index.html @@ -0,0 +1,212 @@ + + + + + + + +features « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/feed/feed/index.html b/public/blog/tag/feed/feed/index.html new file mode 100644 index 0000000..ff1a261 --- /dev/null +++ b/public/blog/tag/feed/feed/index.html @@ -0,0 +1,212 @@ + + + + + + + +feed « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/file/feed/index.html b/public/blog/tag/file/feed/index.html new file mode 100644 index 0000000..03c506e --- /dev/null +++ b/public/blog/tag/file/feed/index.html @@ -0,0 +1,146 @@ + + + + file – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    + + File Explorer with Better ListView + http://www.componentowl.com/blog/file-explorer-with-better-listview/ + http://www.componentowl.com/blog/file-explorer-with-better-listview/#respond + Tue, 09 Aug 2011 16:04:31 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=340 + + In release 2.0.2 we added a sample demonstrating how Better ListView can be used to construct folder tree and file browser to make a standalone file explorer:

    +

    File Explorer Sample

    +

    There are two controls derived from BetterListView. One for the navigation pane (folder tree on left side) and one for the file view (on the right side).

    +

    The FolderListView control allows browsing through virtual folders as well as folders on removable drives. We needed this control in our products because .NET does not provide any similar managed control (there is only FolderBrowserDialog, but we actually need a control).

    +

    You can use it for your purposes as well, it is available in Better ListView Samples source code.

    +

    Many features of Better ListView can be used to enhance file browsing, for example:

    +
      +
    • Drag and Drop – moving or copying files
    • +
    • Label Edit – renaming files
    • +
    • Thumbnails – display thumbnails of image files
    • +
    • Custom Tooltips – display extra information on each file item
    • +
    • Groups – organize files into groups (e.g. by size)
    • +
    • Check Boxes – select folders and sub-folders properly with three-state check boxes
    • +
    • Images – every file type could display different image (extracted icon)
    • +
    • Context Menus – do extra operations with files, like displaying file properties
    • +
    • Searching – doing keyboard search is very easy to search for some file
    • +
    • Sorting – sort files according to multiple properties (this is demonstrated in the sample)
    • +
    • Background Image – show that the user is located in special folder by ambient image on the background
    • +
    +]]>
    + http://www.componentowl.com/blog/file-explorer-with-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/file/index.html b/public/blog/tag/file/index.html new file mode 100644 index 0000000..06689a9 --- /dev/null +++ b/public/blog/tag/file/index.html @@ -0,0 +1,214 @@ + + + + + + + +file « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/filename/feed/index.html b/public/blog/tag/filename/feed/index.html new file mode 100644 index 0000000..ed6311a --- /dev/null +++ b/public/blog/tag/filename/feed/index.html @@ -0,0 +1,107 @@ + + + + filename – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/filename/index.html b/public/blog/tag/filename/index.html new file mode 100644 index 0000000..ebb2493 --- /dev/null +++ b/public/blog/tag/filename/index.html @@ -0,0 +1,212 @@ + + + + + + + +filename « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/files/feed/index.html b/public/blog/tag/files/feed/index.html new file mode 100644 index 0000000..a8d275d --- /dev/null +++ b/public/blog/tag/files/feed/index.html @@ -0,0 +1,107 @@ + + + + files – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/files/index.html b/public/blog/tag/files/index.html new file mode 100644 index 0000000..6e1054e --- /dev/null +++ b/public/blog/tag/files/index.html @@ -0,0 +1,212 @@ + + + + + + + +files « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/focus/feed/index.html b/public/blog/tag/focus/feed/index.html new file mode 100644 index 0000000..13ba2a7 --- /dev/null +++ b/public/blog/tag/focus/feed/index.html @@ -0,0 +1,151 @@ + + + + focus – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/focus/index.html b/public/blog/tag/focus/index.html new file mode 100644 index 0000000..ee269fc --- /dev/null +++ b/public/blog/tag/focus/index.html @@ -0,0 +1,212 @@ + + + + + + + +focus « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/focused/feed/index.html b/public/blog/tag/focused/feed/index.html new file mode 100644 index 0000000..765dff9 --- /dev/null +++ b/public/blog/tag/focused/feed/index.html @@ -0,0 +1,91 @@ + + + + focused – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How To: Dynamically Resize Focused Item + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/ + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/#respond + Thu, 22 Dec 2011 02:29:35 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=468 + + Better ListView 2.4.0 now supports setting MaximumTextLines property on every item and sub-item, so you can have multi-line items each with different number text lines:

    +
    Dynamic resizing of the focused item

    Dynamic resizing of the focused item

    +

    We also introduced FocusedItemChanged event, so that you can detect when focus has moved from one element (item / sub-item / group) to another.

    +

    These features can be combined to display only the focused item with more details to save space code of the FocusedItemChanged event handler may look like this:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +void ListViewFocusedItemChanged(object sender, BetterListViewFocusedItemChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (eventArgs.FocusedItemOld != null)
    + {
    + // set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1;
    + }

    +

    if (eventArgs.FocusedItemNew != null)
    + {
    + // set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Sub ListViewFocusedItemChanged(sender As Object, eventArgs As BetterListViewFocusedItemChangedEventArgs)
    + Dim ListView As BetterListView = DirectCast(sender, BetterListView)

    +

    ListView.BeginUpdate()

    +

    If eventArgs.FocusedItemOld IsNot Nothing Then
    + ‘ set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1
    + End If

    +

    If eventArgs.FocusedItemNew IsNot Nothing Then
    + ‘ set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3
    + End If

    +

    ListView.EndUpdate()
    +End Sub
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/focused/index.html b/public/blog/tag/focused/index.html new file mode 100644 index 0000000..bc4a2d3 --- /dev/null +++ b/public/blog/tag/focused/index.html @@ -0,0 +1,212 @@ + + + + + + + +focused « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/folder/feed/index.html b/public/blog/tag/folder/feed/index.html new file mode 100644 index 0000000..c872da9 --- /dev/null +++ b/public/blog/tag/folder/feed/index.html @@ -0,0 +1,123 @@ + + + + folder – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    + + File Explorer with Better ListView + http://www.componentowl.com/blog/file-explorer-with-better-listview/ + http://www.componentowl.com/blog/file-explorer-with-better-listview/#respond + Tue, 09 Aug 2011 16:04:31 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=340 + + In release 2.0.2 we added a sample demonstrating how Better ListView can be used to construct folder tree and file browser to make a standalone file explorer:

    +

    File Explorer Sample

    +

    There are two controls derived from BetterListView. One for the navigation pane (folder tree on left side) and one for the file view (on the right side).

    +

    The FolderListView control allows browsing through virtual folders as well as folders on removable drives. We needed this control in our products because .NET does not provide any similar managed control (there is only FolderBrowserDialog, but we actually need a control).

    +

    You can use it for your purposes as well, it is available in Better ListView Samples source code.

    +

    Many features of Better ListView can be used to enhance file browsing, for example:

    +
      +
    • Drag and Drop – moving or copying files
    • +
    • Label Edit – renaming files
    • +
    • Thumbnails – display thumbnails of image files
    • +
    • Custom Tooltips – display extra information on each file item
    • +
    • Groups – organize files into groups (e.g. by size)
    • +
    • Check Boxes – select folders and sub-folders properly with three-state check boxes
    • +
    • Images – every file type could display different image (extracted icon)
    • +
    • Context Menus – do extra operations with files, like displaying file properties
    • +
    • Searching – doing keyboard search is very easy to search for some file
    • +
    • Sorting – sort files according to multiple properties (this is demonstrated in the sample)
    • +
    • Background Image – show that the user is located in special folder by ambient image on the background
    • +
    +]]>
    + http://www.componentowl.com/blog/file-explorer-with-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/folder/index.html b/public/blog/tag/folder/index.html new file mode 100644 index 0000000..f1af70d --- /dev/null +++ b/public/blog/tag/folder/index.html @@ -0,0 +1,214 @@ + + + + + + + +folder « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/font/feed/index.html b/public/blog/tag/font/feed/index.html new file mode 100644 index 0000000..ac248d2 --- /dev/null +++ b/public/blog/tag/font/feed/index.html @@ -0,0 +1,154 @@ + + + + font – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/font/index.html b/public/blog/tag/font/index.html new file mode 100644 index 0000000..26e78cb --- /dev/null +++ b/public/blog/tag/font/index.html @@ -0,0 +1,212 @@ + + + + + + + +font « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/gradient/feed/index.html b/public/blog/tag/gradient/feed/index.html new file mode 100644 index 0000000..3674d81 --- /dev/null +++ b/public/blog/tag/gradient/feed/index.html @@ -0,0 +1,151 @@ + + + + gradient – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/gradient/index.html b/public/blog/tag/gradient/index.html new file mode 100644 index 0000000..cad4996 --- /dev/null +++ b/public/blog/tag/gradient/index.html @@ -0,0 +1,212 @@ + + + + + + + +gradient « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/grid/feed/index.html b/public/blog/tag/grid/feed/index.html new file mode 100644 index 0000000..b2da185 --- /dev/null +++ b/public/blog/tag/grid/feed/index.html @@ -0,0 +1,98 @@ + + + + grid – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Add Grid Lines in Empty Space in Better ListView + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/#respond + Wed, 30 Apr 2014 09:51:46 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=894 + + Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    +]]>
    + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/grid/index.html b/public/blog/tag/grid/index.html new file mode 100644 index 0000000..c0ab6a9 --- /dev/null +++ b/public/blog/tag/grid/index.html @@ -0,0 +1,212 @@ + + + + + + + +grid « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/gridlines/feed/index.html b/public/blog/tag/gridlines/feed/index.html new file mode 100644 index 0000000..a03ef93 --- /dev/null +++ b/public/blog/tag/gridlines/feed/index.html @@ -0,0 +1,98 @@ + + + + gridlines – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Add Grid Lines in Empty Space in Better ListView + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/#respond + Wed, 30 Apr 2014 09:51:46 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=894 + + Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    +]]>
    + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/gridlines/index.html b/public/blog/tag/gridlines/index.html new file mode 100644 index 0000000..d710946 --- /dev/null +++ b/public/blog/tag/gridlines/index.html @@ -0,0 +1,212 @@ + + + + + + + +gridlines « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/group-header/feed/index.html b/public/blog/tag/group-header/feed/index.html new file mode 100644 index 0000000..1267ab7 --- /dev/null +++ b/public/blog/tag/group-header/feed/index.html @@ -0,0 +1,90 @@ + + + + group header – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Behavior of Group Headers in Better ListView + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/ + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/#respond + Fri, 20 Jan 2012 09:40:44 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=480 + + When developing our desktop applications, me and Jiri needed to adjust behavior of group headers in the Better ListView control.

    +

    We discovered that making group header behavior customizable would be useful not only for us, but for other developers who utilize Better ListView as well, so we implemented this feature officially in Better ListView 2.5.0.

    +

    There are two new properties: ShowDefaultGroupHeader and GroupHeaderBehavior.

    +

    Hiding the Default Group Header

    +

    The ShowDefaultGroupHeader is initially set to true. This means that the default group (the group containing items which do not have a specific group) have its header displayed:

    +
    Default group header is visible

    Default group header is visible

    +

    When ShowDefaultGroupHeader is set to false, the “Default” group header on top can be hidden:

    +
    Default group header is hidden

    Default group header is hidden

    +

    Adjusting Group Header Behavior

    +

    The group headers have two kinds of behavior. They can be focused and can cause selection of items. Both of these functions can be invoked by keyboard and mouse.

    +

    The GroupHeaderBehavior property allows changing this behavior for keyboard and mouse separately.

    +

    By default, the property is set to BetterListViewGroupHeaderBehavior.All, so that all functions of the group header are turned on.

    +

    You may want to make group headers completely non-interactive. This can be done by setting the property to BetterListViewGroupHeaderBehavior.None.

    +

    Other values of the enum can be combined to create desired behavior.

    +

    Keyboard:

    +
      +
    • Focus only
    • +
    • Focus and select items in the group
    • +
    +

    Mouse:

    +
      +
    • Focus
    • +
    • Select items in the group
    • +
    • Highligh when mouse cursor is over the group header
    • +
    +
    The expand button of group headers can still be used even if the group header has all the behaviors turned off. If you need to hide the expand button as well, set BetterListViewGroup.AllowShowExpandButton to false.
    +

    Use Case: Metadata Viewer

    +

    Here Better ListView is used for viewing image metadata tags:

    +
    Metadata View window

    Metadata View window

    +

    Only one tag can be selected at a time, so clicking on a group header has no effect on selection and need not to be highlighted.

    +

    One may still need, however, to allow focusing the group header with keyboard and mouse so that it is possible to collapse/expand the group with arrow keys. The desired behavior can be set this way:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus & BetterListViewGroupHeaderBehavior.MouseFocus);[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus And BetterListViewGroupHeaderBehavior.MouseFocus)[/vb]

    +]]>
    + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/group-header/index.html b/public/blog/tag/group-header/index.html new file mode 100644 index 0000000..20edfd6 --- /dev/null +++ b/public/blog/tag/group-header/index.html @@ -0,0 +1,212 @@ + + + + + + + +group header « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/group/feed/index.html b/public/blog/tag/group/feed/index.html new file mode 100644 index 0000000..142bd60 --- /dev/null +++ b/public/blog/tag/group/feed/index.html @@ -0,0 +1,90 @@ + + + + group – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Behavior of Group Headers in Better ListView + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/ + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/#respond + Fri, 20 Jan 2012 09:40:44 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=480 + + When developing our desktop applications, me and Jiri needed to adjust behavior of group headers in the Better ListView control.

    +

    We discovered that making group header behavior customizable would be useful not only for us, but for other developers who utilize Better ListView as well, so we implemented this feature officially in Better ListView 2.5.0.

    +

    There are two new properties: ShowDefaultGroupHeader and GroupHeaderBehavior.

    +

    Hiding the Default Group Header

    +

    The ShowDefaultGroupHeader is initially set to true. This means that the default group (the group containing items which do not have a specific group) have its header displayed:

    +
    Default group header is visible

    Default group header is visible

    +

    When ShowDefaultGroupHeader is set to false, the “Default” group header on top can be hidden:

    +
    Default group header is hidden

    Default group header is hidden

    +

    Adjusting Group Header Behavior

    +

    The group headers have two kinds of behavior. They can be focused and can cause selection of items. Both of these functions can be invoked by keyboard and mouse.

    +

    The GroupHeaderBehavior property allows changing this behavior for keyboard and mouse separately.

    +

    By default, the property is set to BetterListViewGroupHeaderBehavior.All, so that all functions of the group header are turned on.

    +

    You may want to make group headers completely non-interactive. This can be done by setting the property to BetterListViewGroupHeaderBehavior.None.

    +

    Other values of the enum can be combined to create desired behavior.

    +

    Keyboard:

    +
      +
    • Focus only
    • +
    • Focus and select items in the group
    • +
    +

    Mouse:

    +
      +
    • Focus
    • +
    • Select items in the group
    • +
    • Highligh when mouse cursor is over the group header
    • +
    +
    The expand button of group headers can still be used even if the group header has all the behaviors turned off. If you need to hide the expand button as well, set BetterListViewGroup.AllowShowExpandButton to false.
    +

    Use Case: Metadata Viewer

    +

    Here Better ListView is used for viewing image metadata tags:

    +
    Metadata View window

    Metadata View window

    +

    Only one tag can be selected at a time, so clicking on a group header has no effect on selection and need not to be highlighted.

    +

    One may still need, however, to allow focusing the group header with keyboard and mouse so that it is possible to collapse/expand the group with arrow keys. The desired behavior can be set this way:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus & BetterListViewGroupHeaderBehavior.MouseFocus);[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus And BetterListViewGroupHeaderBehavior.MouseFocus)[/vb]

    +]]>
    + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/group/index.html b/public/blog/tag/group/index.html new file mode 100644 index 0000000..932c369 --- /dev/null +++ b/public/blog/tag/group/index.html @@ -0,0 +1,212 @@ + + + + + + + +group « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/groups/feed/index.html b/public/blog/tag/groups/feed/index.html new file mode 100644 index 0000000..8fdb6b3 --- /dev/null +++ b/public/blog/tag/groups/feed/index.html @@ -0,0 +1,227 @@ + + + + groups – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    + + Windows Theme Support in Better ListView + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/#respond + Fri, 01 Jul 2011 22:46:55 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=287 + + Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    +]]>
    + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/feed/ + 0 +
    + + Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more) + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/ + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/#respond + Tue, 03 May 2011 09:28:55 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=232 + groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.]]> + Hierarchical items in two groups

    Hierarchical items in two groups

    +

    We are currently working hard on finishing Better ListView version 2.0 which will add new features: Support for groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.

    +

    We expect to release this upgrade in about a month. It will be a free upgrade for current and new users.

    +

    Groups

    +

    Groups in Better ListView have comparable capabilities as other Better ListView elements (column headers, items, sub-items). For example, you can adjust the foreground/background colors, font, image – and owner drawing is possible as well.

    +

    You can even include images into group headers (as you can see in the preview above), which is not possible in .NET ListView.

    +

    Groups are collapsible by default and the expand button can be switched off on each group individually.

    +

    Here are groups combined with Tile view (the second group is collapsed):

    +
    Groups with Tile view

    Groups with Tile view

    +

    The previous figure displays vertically oriented groups, but Better ListView also support horizontally oriented groups in the List mode:

    +
    Groups with List view

    Groups with List view

    +

    We put special effort to mimic the group display and behavior of Windows Explorer. The group headers can display all of the 15 group header states available in Windows visual style and their display is governed by the same logic as in the ListView counterpart.

    +

    The group headers always look perfect and native, right out of the box. You don’t need to tweak anything.

    +

    Item Hierarchy

    +
    +
    +

    +
    Items with hierarchy

    Items with hierarchy

    +

    +
    +
    +
    +

    This works in the similar way as in the standard TreeView control. Each item (or node) has property called ChildItems which can be filled with new BetterListViewItem instances. SubItems collection can still be used in either items and child-items (child items are treated in the very same way as their parents).

    +

    Item hierarchy can be combined with Groups feature as seen in the first preview.

    +

    Multi-Line Items

    +
    Multi-line items

    Multi-line items

    +

    A simple setting of item layout (MaximumTextLines property) allows breaking item text into several lines (up to the specified value). When the text is longer than MaximumTextLines, then the default trimming method is used (one from the TextTrimming enumeration: None, TrimCharacter, TrimWord, EllipsisCharacter, EllipsisWord, EllipsisPath).

    +

    Multi-line text can be used in every view and also in column headers.

    +

    Another New Features

    +

    There are also bunch of new minor features including:

    +

    Adjustable paddings – Every element part (e.g. item check box, group image…) contains customizable spaces at each side, so the user can easily create space where he needs and customize items/column headers/group headers to the finest detail.

    +

    Focusing sub-items – Items, group headers and even sub-items can be keyfocused. User can now invoke label editing or scroll to any “cell” in the Details-with-columns view solely with keyboard.

    +

    IEnumerable implementations –  BetterListView, BetterListViewGroup and BetterListViewItem implements IEnumerable interface for iterating through the whole item hierarchy, so using recursion to traverse child items is not necessary.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/feed/ + 0 +
    + + Work in Progress: “Groups” / “Item Hierarchy” Features + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond + Fri, 25 Mar 2011 23:11:00 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=204 + + We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    +]]>
    + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/groups/index.html b/public/blog/tag/groups/index.html new file mode 100644 index 0000000..850af34 --- /dev/null +++ b/public/blog/tag/groups/index.html @@ -0,0 +1,218 @@ + + + + + + + +groups « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/header/feed/index.html b/public/blog/tag/header/feed/index.html new file mode 100644 index 0000000..2e2ede1 --- /dev/null +++ b/public/blog/tag/header/feed/index.html @@ -0,0 +1,162 @@ + + + + header – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Hiding Column Headers in Better ListView + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/#respond + Mon, 27 Aug 2012 23:11:27 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=803 + + Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    +]]>
    + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/feed/ + 0 +
    + + Custom Behavior of Group Headers in Better ListView + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/ + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/#respond + Fri, 20 Jan 2012 09:40:44 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=480 + + When developing our desktop applications, me and Jiri needed to adjust behavior of group headers in the Better ListView control.

    +

    We discovered that making group header behavior customizable would be useful not only for us, but for other developers who utilize Better ListView as well, so we implemented this feature officially in Better ListView 2.5.0.

    +

    There are two new properties: ShowDefaultGroupHeader and GroupHeaderBehavior.

    +

    Hiding the Default Group Header

    +

    The ShowDefaultGroupHeader is initially set to true. This means that the default group (the group containing items which do not have a specific group) have its header displayed:

    +
    Default group header is visible

    Default group header is visible

    +

    When ShowDefaultGroupHeader is set to false, the “Default” group header on top can be hidden:

    +
    Default group header is hidden

    Default group header is hidden

    +

    Adjusting Group Header Behavior

    +

    The group headers have two kinds of behavior. They can be focused and can cause selection of items. Both of these functions can be invoked by keyboard and mouse.

    +

    The GroupHeaderBehavior property allows changing this behavior for keyboard and mouse separately.

    +

    By default, the property is set to BetterListViewGroupHeaderBehavior.All, so that all functions of the group header are turned on.

    +

    You may want to make group headers completely non-interactive. This can be done by setting the property to BetterListViewGroupHeaderBehavior.None.

    +

    Other values of the enum can be combined to create desired behavior.

    +

    Keyboard:

    +
      +
    • Focus only
    • +
    • Focus and select items in the group
    • +
    +

    Mouse:

    +
      +
    • Focus
    • +
    • Select items in the group
    • +
    • Highligh when mouse cursor is over the group header
    • +
    +
    The expand button of group headers can still be used even if the group header has all the behaviors turned off. If you need to hide the expand button as well, set BetterListViewGroup.AllowShowExpandButton to false.
    +

    Use Case: Metadata Viewer

    +

    Here Better ListView is used for viewing image metadata tags:

    +
    Metadata View window

    Metadata View window

    +

    Only one tag can be selected at a time, so clicking on a group header has no effect on selection and need not to be highlighted.

    +

    One may still need, however, to allow focusing the group header with keyboard and mouse so that it is possible to collapse/expand the group with arrow keys. The desired behavior can be set this way:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus & BetterListViewGroupHeaderBehavior.MouseFocus);[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus And BetterListViewGroupHeaderBehavior.MouseFocus)[/vb]

    +]]>
    + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/header/index.html b/public/blog/tag/header/index.html new file mode 100644 index 0000000..a31466a --- /dev/null +++ b/public/blog/tag/header/index.html @@ -0,0 +1,216 @@ + + + + + + + +header « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/headers/feed/index.html b/public/blog/tag/headers/feed/index.html new file mode 100644 index 0000000..cd03190 --- /dev/null +++ b/public/blog/tag/headers/feed/index.html @@ -0,0 +1,69 @@ + + + + headers – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hiding Column Headers in Better ListView + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/#respond + Mon, 27 Aug 2012 23:11:27 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=803 + + Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    +]]>
    + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/headers/index.html b/public/blog/tag/headers/index.html new file mode 100644 index 0000000..9c5bc43 --- /dev/null +++ b/public/blog/tag/headers/index.html @@ -0,0 +1,212 @@ + + + + + + + +headers « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/height/feed/index.html b/public/blog/tag/height/feed/index.html new file mode 100644 index 0000000..f6bba86 --- /dev/null +++ b/public/blog/tag/height/feed/index.html @@ -0,0 +1,100 @@ + + + + height – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    + + Custom Item Height in Details View of Better ListView + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/ + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/#respond + Wed, 21 Mar 2012 15:10:52 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=760 + + Better ListView 2.7.0.0 now supports items of arbitrary height in Details view:

    +
    Items with custom height

    Items with custom height

    +

    Items with variable heights were possible in recent versions of Better ListView as well, but this adjustment was limited to heights which are multiples of text line height.

    +

    We have introduced a BetterListViewItem.CustomHeight property, which is 0 by default.

    +

    Every item has some minimum size (defined by the font and image) but it can get arbitrarily larger. The following formula explains how item height is measured in Better ListView:

    +

    height = max(minimum height, image height, text height, custom height)

    +

    Setting minimum height for all items is possible through layout properties and the latter is defined by the item itself.

    +]]>
    + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/height/index.html b/public/blog/tag/height/index.html new file mode 100644 index 0000000..c9ef068 --- /dev/null +++ b/public/blog/tag/height/index.html @@ -0,0 +1,214 @@ + + + + + + + +height « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/hide/feed/index.html b/public/blog/tag/hide/feed/index.html new file mode 100644 index 0000000..1e1e80c --- /dev/null +++ b/public/blog/tag/hide/feed/index.html @@ -0,0 +1,192 @@ + + + + hide – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hiding Column Headers in Better ListView + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/#respond + Mon, 27 Aug 2012 23:11:27 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=803 + + Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    +]]>
    + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/feed/ + 0 +
    + + Hiding Items in Better ListView + http://www.componentowl.com/blog/hiding-items-in-better-listview/ + http://www.componentowl.com/blog/hiding-items-in-better-listview/#respond + Mon, 06 Feb 2012 16:23:15 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=546 + + We currently introduced a BetterListViewItem.Visible property to allow hiding items visually, but keeping then in the Items collection:

    +
    Making items invisible

    Making items invisible

    +

    The above image shows two groups of items. The first groups uses hiding of items with the Visible property, while the second group simply turns off drawing of ceratin items.

    +

    The first approach is useful when you need to hide item as if it is removed, but keep it actually within Items collection.

    +

    The second approach need to create new control inheriting from BetterListView, overrride the OnDrawItem method and set properties like BetterListViewDrawItemEventArgs.DrawImage to false or simply not call the base implementation of OnDrawItem.

    +

    The second (owner drawing) approach is useful when you need just to switch off display of item without changing the item layout.

    +]]>
    + http://www.componentowl.com/blog/hiding-items-in-better-listview/feed/ + 0 +
    + + Custom Behavior of Group Headers in Better ListView + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/ + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/#respond + Fri, 20 Jan 2012 09:40:44 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=480 + + When developing our desktop applications, me and Jiri needed to adjust behavior of group headers in the Better ListView control.

    +

    We discovered that making group header behavior customizable would be useful not only for us, but for other developers who utilize Better ListView as well, so we implemented this feature officially in Better ListView 2.5.0.

    +

    There are two new properties: ShowDefaultGroupHeader and GroupHeaderBehavior.

    +

    Hiding the Default Group Header

    +

    The ShowDefaultGroupHeader is initially set to true. This means that the default group (the group containing items which do not have a specific group) have its header displayed:

    +
    Default group header is visible

    Default group header is visible

    +

    When ShowDefaultGroupHeader is set to false, the “Default” group header on top can be hidden:

    +
    Default group header is hidden

    Default group header is hidden

    +

    Adjusting Group Header Behavior

    +

    The group headers have two kinds of behavior. They can be focused and can cause selection of items. Both of these functions can be invoked by keyboard and mouse.

    +

    The GroupHeaderBehavior property allows changing this behavior for keyboard and mouse separately.

    +

    By default, the property is set to BetterListViewGroupHeaderBehavior.All, so that all functions of the group header are turned on.

    +

    You may want to make group headers completely non-interactive. This can be done by setting the property to BetterListViewGroupHeaderBehavior.None.

    +

    Other values of the enum can be combined to create desired behavior.

    +

    Keyboard:

    +
      +
    • Focus only
    • +
    • Focus and select items in the group
    • +
    +

    Mouse:

    +
      +
    • Focus
    • +
    • Select items in the group
    • +
    • Highligh when mouse cursor is over the group header
    • +
    +
    The expand button of group headers can still be used even if the group header has all the behaviors turned off. If you need to hide the expand button as well, set BetterListViewGroup.AllowShowExpandButton to false.
    +

    Use Case: Metadata Viewer

    +

    Here Better ListView is used for viewing image metadata tags:

    +
    Metadata View window

    Metadata View window

    +

    Only one tag can be selected at a time, so clicking on a group header has no effect on selection and need not to be highlighted.

    +

    One may still need, however, to allow focusing the group header with keyboard and mouse so that it is possible to collapse/expand the group with arrow keys. The desired behavior can be set this way:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus & BetterListViewGroupHeaderBehavior.MouseFocus);[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus And BetterListViewGroupHeaderBehavior.MouseFocus)[/vb]

    +]]>
    + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/feed/ + 0 +
    + + How to Hide a Column in Better ListView + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/ + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/#respond + Fri, 05 Aug 2011 11:56:31 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=330 + + The most popular view in ListView-like controls seems to be the “Details” view with columns, items and sub-items.

    +

    When someone wants to remove a column, he usually thinks of simply removing the column header from the Columns collection. Unfortunately, it’s not that simple. The sub-items get shifted and he needs to remove sub-items corresponding to the removed column for all items as well.

    +

    This is because ListView is not a control for displaying grids (a matrix of cells), but really the lists – sequences of objects, and the sub-items are not cells either, they are something like an extension of each item to support additional information about the item.

    +

    So how we neatly hide a column?

    +

    We introduced Column Hiding feature in the version 2.0.1. You can simply call Hide() on your column header instance and you’re done! There is also corresponding Show() method provided. Or you can set boolean Visible property. Now the column and all subsequent sub-items are hidden from view (although they are still present in data, of course):

    +

     

    +
    Hiding column via context menu

    Hiding column via context menu...

    +

     

    +
    The sixth column is hidden...

    ...and the sixth column gets hidden.

    +

     

    +

    Download Better ListView

    +]]>
    + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/hide/index.html b/public/blog/tag/hide/index.html new file mode 100644 index 0000000..9cb0db0 --- /dev/null +++ b/public/blog/tag/hide/index.html @@ -0,0 +1,218 @@ + + + + + + + +hide « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/hiding/feed/index.html b/public/blog/tag/hiding/feed/index.html new file mode 100644 index 0000000..0fe93b6 --- /dev/null +++ b/public/blog/tag/hiding/feed/index.html @@ -0,0 +1,131 @@ + + + + hiding – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hiding Column Headers in Better ListView + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/#respond + Mon, 27 Aug 2012 23:11:27 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=803 + + Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    +]]>
    + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/feed/ + 0 +
    + + Hiding Items in Better ListView + http://www.componentowl.com/blog/hiding-items-in-better-listview/ + http://www.componentowl.com/blog/hiding-items-in-better-listview/#respond + Mon, 06 Feb 2012 16:23:15 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=546 + + We currently introduced a BetterListViewItem.Visible property to allow hiding items visually, but keeping then in the Items collection:

    +
    Making items invisible

    Making items invisible

    +

    The above image shows two groups of items. The first groups uses hiding of items with the Visible property, while the second group simply turns off drawing of ceratin items.

    +

    The first approach is useful when you need to hide item as if it is removed, but keep it actually within Items collection.

    +

    The second approach need to create new control inheriting from BetterListView, overrride the OnDrawItem method and set properties like BetterListViewDrawItemEventArgs.DrawImage to false or simply not call the base implementation of OnDrawItem.

    +

    The second (owner drawing) approach is useful when you need just to switch off display of item without changing the item layout.

    +]]>
    + http://www.componentowl.com/blog/hiding-items-in-better-listview/feed/ + 0 +
    + + How to Hide a Column in Better ListView + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/ + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/#respond + Fri, 05 Aug 2011 11:56:31 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=330 + + The most popular view in ListView-like controls seems to be the “Details” view with columns, items and sub-items.

    +

    When someone wants to remove a column, he usually thinks of simply removing the column header from the Columns collection. Unfortunately, it’s not that simple. The sub-items get shifted and he needs to remove sub-items corresponding to the removed column for all items as well.

    +

    This is because ListView is not a control for displaying grids (a matrix of cells), but really the lists – sequences of objects, and the sub-items are not cells either, they are something like an extension of each item to support additional information about the item.

    +

    So how we neatly hide a column?

    +

    We introduced Column Hiding feature in the version 2.0.1. You can simply call Hide() on your column header instance and you’re done! There is also corresponding Show() method provided. Or you can set boolean Visible property. Now the column and all subsequent sub-items are hidden from view (although they are still present in data, of course):

    +

     

    +
    Hiding column via context menu

    Hiding column via context menu...

    +

     

    +
    The sixth column is hidden...

    ...and the sixth column gets hidden.

    +

     

    +

    Download Better ListView

    +]]>
    + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/hiding/index.html b/public/blog/tag/hiding/index.html new file mode 100644 index 0000000..734b7ba --- /dev/null +++ b/public/blog/tag/hiding/index.html @@ -0,0 +1,216 @@ + + + + + + + +hiding « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/hierarchy/feed/index.html b/public/blog/tag/hierarchy/feed/index.html new file mode 100644 index 0000000..86db249 --- /dev/null +++ b/public/blog/tag/hierarchy/feed/index.html @@ -0,0 +1,136 @@ + + + + hierarchy – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    + + Work in Progress: “Groups” / “Item Hierarchy” Features + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond + Fri, 25 Mar 2011 23:11:00 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=204 + + We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    +]]>
    + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/hierarchy/index.html b/public/blog/tag/hierarchy/index.html new file mode 100644 index 0000000..906e131 --- /dev/null +++ b/public/blog/tag/hierarchy/index.html @@ -0,0 +1,214 @@ + + + + + + + +hierarchy « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/highlight/feed/index.html b/public/blog/tag/highlight/feed/index.html new file mode 100644 index 0000000..5c0b9fa --- /dev/null +++ b/public/blog/tag/highlight/feed/index.html @@ -0,0 +1,141 @@ + + + + highlight – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/highlight/index.html b/public/blog/tag/highlight/index.html new file mode 100644 index 0000000..44ce530 --- /dev/null +++ b/public/blog/tag/highlight/index.html @@ -0,0 +1,212 @@ + + + + + + + +highlight « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/highlighting/feed/index.html b/public/blog/tag/highlighting/feed/index.html new file mode 100644 index 0000000..aed1d88 --- /dev/null +++ b/public/blog/tag/highlighting/feed/index.html @@ -0,0 +1,141 @@ + + + + highlighting – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/highlighting/index.html b/public/blog/tag/highlighting/index.html new file mode 100644 index 0000000..2766339 --- /dev/null +++ b/public/blog/tag/highlighting/index.html @@ -0,0 +1,212 @@ + + + + + + + +highlighting « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/hot/feed/index.html b/public/blog/tag/hot/feed/index.html new file mode 100644 index 0000000..2376831 --- /dev/null +++ b/public/blog/tag/hot/feed/index.html @@ -0,0 +1,331 @@ + + + + hot – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    + + Custom Behavior of Group Headers in Better ListView + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/ + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/#respond + Fri, 20 Jan 2012 09:40:44 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=480 + + When developing our desktop applications, me and Jiri needed to adjust behavior of group headers in the Better ListView control.

    +

    We discovered that making group header behavior customizable would be useful not only for us, but for other developers who utilize Better ListView as well, so we implemented this feature officially in Better ListView 2.5.0.

    +

    There are two new properties: ShowDefaultGroupHeader and GroupHeaderBehavior.

    +

    Hiding the Default Group Header

    +

    The ShowDefaultGroupHeader is initially set to true. This means that the default group (the group containing items which do not have a specific group) have its header displayed:

    +
    Default group header is visible

    Default group header is visible

    +

    When ShowDefaultGroupHeader is set to false, the “Default” group header on top can be hidden:

    +
    Default group header is hidden

    Default group header is hidden

    +

    Adjusting Group Header Behavior

    +

    The group headers have two kinds of behavior. They can be focused and can cause selection of items. Both of these functions can be invoked by keyboard and mouse.

    +

    The GroupHeaderBehavior property allows changing this behavior for keyboard and mouse separately.

    +

    By default, the property is set to BetterListViewGroupHeaderBehavior.All, so that all functions of the group header are turned on.

    +

    You may want to make group headers completely non-interactive. This can be done by setting the property to BetterListViewGroupHeaderBehavior.None.

    +

    Other values of the enum can be combined to create desired behavior.

    +

    Keyboard:

    +
      +
    • Focus only
    • +
    • Focus and select items in the group
    • +
    +

    Mouse:

    +
      +
    • Focus
    • +
    • Select items in the group
    • +
    • Highligh when mouse cursor is over the group header
    • +
    +
    The expand button of group headers can still be used even if the group header has all the behaviors turned off. If you need to hide the expand button as well, set BetterListViewGroup.AllowShowExpandButton to false.
    +

    Use Case: Metadata Viewer

    +

    Here Better ListView is used for viewing image metadata tags:

    +
    Metadata View window

    Metadata View window

    +

    Only one tag can be selected at a time, so clicking on a group header has no effect on selection and need not to be highlighted.

    +

    One may still need, however, to allow focusing the group header with keyboard and mouse so that it is possible to collapse/expand the group with arrow keys. The desired behavior can be set this way:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus & BetterListViewGroupHeaderBehavior.MouseFocus);[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus And BetterListViewGroupHeaderBehavior.MouseFocus)[/vb]

    +]]>
    + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/feed/ + 0 +
    + + How to Display Items in Custom States + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/ + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/#respond + Tue, 15 Nov 2011 15:24:25 +0000 + + + + + + + + + + + http://www.componentowl.com/blog/?p=398 + + One of our customers recently asked us if it is possible in Better ListView to draw item highlighted even when the control loses focus. This is an interesting and useful feature, so we implemented it right away.

    +

    Owner drawing in Better ListView 2.3.0 and higher allows you to draw elements (column headers, items, sub-items and groups) in any state you wish (hot, selected, focused and any combination of the three).

    +

    For example, we would like to highlight several items in one Better ListView depending on hovered item in other Better ListView:

    +
    Better ListView shows multiple hot items

    Better ListView shows multiple hot items

    +

    Items can be also be drawn as if the control is focused, enabled or disabled. This feature can be applied when you wish to display items in highlighted state even if Better ListView is not focused:

    +
    Better ListView keeps selected items highlighted

    Better ListView keeps selected items highlighted

    +

    We implemented the first sample (showing mulitple hot items) by inheriting from BetterListView, making a new class called HotListView. The implementation is very simple:

    +

     

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class HotListView : BetterListView
    +{
    +public HashSet HotItems
    +{
    +get
    +{
    +return this.hotItems;
    +}
    +set
    +{
    +this.hotItems = value;

    +

    Refresh();
    +}
    +}

    +

    private HashSethotItems = new HashSet();

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    +{
    +if (this.hotItems.Contains(eventArgs.Item.Index))
    +{
    +eventArgs.ItemStateInfo = new BetterListViewItemStateInfo(
    +eventArgs.ItemStateInfo.ItemState | BetterListViewItemState.Hot,
    +eventArgs.ItemStateInfo.ExpandButtonState,
    +eventArgs.ItemStateInfo.CheckBoxState);
    +}

    +

    base.OnDrawItem(eventArgs);
    +}
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class HotListView
    +Inherits BetterListView
    +Public Property HotItems() As HashSet(Of Integer)
    +Get
    +Return Me.m_hotItems
    +End Get
    +Set
    +Me.m_hotItems = value

    +

    Refresh()
    +End Set
    +End Property

    +

    Private m_hotItems As New HashSet(Of Integer)()

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    +If Me.m_hotItems.Contains(eventArgs.Item.Index) Then
    +eventArgs.ItemStateInfo = New BetterListViewItemStateInfo(eventArgs.ItemStateInfo.ItemState Or BetterListViewItemState.Hot, eventArgs.ItemStateInfo.ExpandButtonState, eventArgs.ItemStateInfo.CheckBoxState)
    +End If

    +

    MyBase.OnDrawItem(eventArgs)
    +End Sub
    +End Class
    +[/vb]

    +

     

    +

    The HotListView contains one property called HotItems. When drawing items (OnDrawItem method), it looks whether the item is in the HotItems set. If so, item drawing state is altered so that the item will be drawn as hot.

    +

    The modified ListView for second sample is even simpler. We call it HighlightListView:

    +

     

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class HighlightListView : BetterListView
    +{
    +protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    +{
    +if ((eventArgs.ItemStateInfo.ItemState & BetterListViewItemState.Selected) == BetterListViewItemState.Selected)
    +{
    +// if the item is selected, always draw control as if it is focused
    +eventArgs.DrawFocused = true;
    +}

    +

    base.OnDrawItem(eventArgs);
    +}
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class HighlightListView
    +Inherits BetterListView
    +Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    +If (eventArgs.ItemStateInfo.ItemState And BetterListViewItemState.Selected) = BetterListViewItemState.Selected Then
    +‘ if the item is selected, always draw control as if it is focused
    +eventArgs.DrawFocused = True
    +End If

    +

    MyBase.OnDrawItem(eventArgs)
    +End Sub
    +End Class
    +[/vb]

    +

     

    +

    This modification only draws selected items as if the control is always focused.

    +

    UPDATE: From Better ListView 2.3.1, you can simply use HideSelectionMode property to keep selected items highlighted.

    +]]>
    + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/hot/index.html b/public/blog/tag/hot/index.html new file mode 100644 index 0000000..c44542a --- /dev/null +++ b/public/blog/tag/hot/index.html @@ -0,0 +1,216 @@ + + + + + + + +hot « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/hottrack/feed/index.html b/public/blog/tag/hottrack/feed/index.html new file mode 100644 index 0000000..cf62146 --- /dev/null +++ b/public/blog/tag/hottrack/feed/index.html @@ -0,0 +1,154 @@ + + + + hottrack – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/hottrack/index.html b/public/blog/tag/hottrack/index.html new file mode 100644 index 0000000..fce9fea --- /dev/null +++ b/public/blog/tag/hottrack/index.html @@ -0,0 +1,212 @@ + + + + + + + +hottrack « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/hottracking/feed/index.html b/public/blog/tag/hottracking/feed/index.html new file mode 100644 index 0000000..6a768da --- /dev/null +++ b/public/blog/tag/hottracking/feed/index.html @@ -0,0 +1,154 @@ + + + + hottracking – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/hottracking/index.html b/public/blog/tag/hottracking/index.html new file mode 100644 index 0000000..50df6fa --- /dev/null +++ b/public/blog/tag/hottracking/index.html @@ -0,0 +1,212 @@ + + + + + + + +hottracking « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/hover/feed/index.html b/public/blog/tag/hover/feed/index.html new file mode 100644 index 0000000..6628751 --- /dev/null +++ b/public/blog/tag/hover/feed/index.html @@ -0,0 +1,154 @@ + + + + hover – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/hover/index.html b/public/blog/tag/hover/index.html new file mode 100644 index 0000000..17ecff3 --- /dev/null +++ b/public/blog/tag/hover/index.html @@ -0,0 +1,212 @@ + + + + + + + +hover « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/hovers/feed/index.html b/public/blog/tag/hovers/feed/index.html new file mode 100644 index 0000000..decb668 --- /dev/null +++ b/public/blog/tag/hovers/feed/index.html @@ -0,0 +1,154 @@ + + + + hovers – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/hovers/index.html b/public/blog/tag/hovers/index.html new file mode 100644 index 0000000..6bad1a0 --- /dev/null +++ b/public/blog/tag/hovers/index.html @@ -0,0 +1,212 @@ + + + + + + + +hovers « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/how-to/feed/index.html b/public/blog/tag/how-to/feed/index.html new file mode 100644 index 0000000..2778abb --- /dev/null +++ b/public/blog/tag/how-to/feed/index.html @@ -0,0 +1,55 @@ + + + + how to – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Change List View Mouse Wheel Scroll Speed + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/ + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/#respond + Fri, 18 Mar 2011 18:22:44 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=189 + + Did you know that you can change the mouse wheel scroll speed of Better ListView?

    +

    Better ListView has property MouseWheelScrollExtent which is defined as “relative number of items to scroll for a single mouse wheel detent“.

    +

    What does it mean? Well, it basically defines by how many items will the list view scroll when you move the mouse wheel up or down. The default value of this property in version 1.51 is 2, so whenever you scroll up or down with your mouse wheel, the list view will move two items up or down.

    +

    You can set the MouseWheelScrollExtent to a larger value for faster scrolling, just like this:

    +

    BetterListView.MouseWheelScrollExtent := 3;

    +

    Now, every time you scroll, the list view will move by 3 items (which is similar to Windows Explorer, which usually moves by 3 items in the Details view).

    +]]>
    + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/how-to/index.html b/public/blog/tag/how-to/index.html new file mode 100644 index 0000000..06e5946 --- /dev/null +++ b/public/blog/tag/how-to/index.html @@ -0,0 +1,212 @@ + + + + + + + +how to « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/hyperlink/feed/index.html b/public/blog/tag/hyperlink/feed/index.html new file mode 100644 index 0000000..be35273 --- /dev/null +++ b/public/blog/tag/hyperlink/feed/index.html @@ -0,0 +1,154 @@ + + + + hyperlink – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/hyperlink/index.html b/public/blog/tag/hyperlink/index.html new file mode 100644 index 0000000..306ca2c --- /dev/null +++ b/public/blog/tag/hyperlink/index.html @@ -0,0 +1,212 @@ + + + + + + + +hyperlink « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/hyperlinks/feed/index.html b/public/blog/tag/hyperlinks/feed/index.html new file mode 100644 index 0000000..0cf969f --- /dev/null +++ b/public/blog/tag/hyperlinks/feed/index.html @@ -0,0 +1,154 @@ + + + + hyperlinks – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/hyperlinks/index.html b/public/blog/tag/hyperlinks/index.html new file mode 100644 index 0000000..7aa58ff --- /dev/null +++ b/public/blog/tag/hyperlinks/index.html @@ -0,0 +1,212 @@ + + + + + + + +hyperlinks « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/icon/feed/index.html b/public/blog/tag/icon/feed/index.html new file mode 100644 index 0000000..7b6837d --- /dev/null +++ b/public/blog/tag/icon/feed/index.html @@ -0,0 +1,246 @@ + + + + icon – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/icon/index.html b/public/blog/tag/icon/index.html new file mode 100644 index 0000000..dd07d72 --- /dev/null +++ b/public/blog/tag/icon/index.html @@ -0,0 +1,212 @@ + + + + + + + +icon « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/icons/feed/index.html b/public/blog/tag/icons/feed/index.html new file mode 100644 index 0000000..198eb45 --- /dev/null +++ b/public/blog/tag/icons/feed/index.html @@ -0,0 +1,246 @@ + + + + icons – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/icons/index.html b/public/blog/tag/icons/index.html new file mode 100644 index 0000000..79599db --- /dev/null +++ b/public/blog/tag/icons/index.html @@ -0,0 +1,212 @@ + + + + + + + +icons « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/image-borders/feed/index.html b/public/blog/tag/image-borders/feed/index.html new file mode 100644 index 0000000..015d0e4 --- /dev/null +++ b/public/blog/tag/image-borders/feed/index.html @@ -0,0 +1,75 @@ + + + + image borders – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Thumbnails with Borders and Shadows + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/ + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/#respond + Mon, 14 Feb 2011 19:17:14 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=103 + + We’ve just released Better ListView version 1.50 with some new features – thumbnails view, image borders support (inc. shadows), and more.

    +

    Our great inspiration for designing Better ListView is nothing less than the mighty Windows Explorer. This file manager uses obviously much more powerful control that the regular .NET list-view alone is.

    +

    It supports some extra views, line Contents and Extra Large Icons. It is also possible to adjust image size by rolling a mouse wheel while holding Control key.

    +

    Better ListView has the capability of displaying item icons with arbitrary sizes, but we also extended it with one extra view: Thumbnails:

    +
    Thumbnails Sample

    Thumbnails Sample

    +

    This view aligns items in the center while keeping constant spacing between items. Thumbnails also keep just single line of text for compactness. On the other hand, LargeIcon view varies horizontal space between items to fill client area evenly and breaks long text into several lines.

    +

    The constant spacing is inspired by various photo managers, where image thumbnails are better viewed side-by-side (and the view looks also more organized).

    +

    Image thumbnails also look better with some kind border or frame. We added this new feature in Better ListView 1.5 and it works in all views. There are several pre-defined types of borders, but user can draw his own:

    +
      +
    • None – simply no border at all
    • +
    • Single – single line border
    • +
    • SingleOffset – single line with a spacing between image and the border
    • +
    • SymmetricShadow – smooth shadow around image
    • +
    • DropShadow – smooth shadow on the right bottom part of the image
    • +
    +

    Thumbnails use DropShadow by default, but it can be adjusted for every view separately. One can also adjust thickness of the border/shadow and define custom spacing around image.

    +

    Take a look at one possible setting:

    +
    Image Borders

    Image Borders

    +

    This is SingleOffset border of width 3 pixels. Notice that also column header images can have its borders (these are SymmetricShadow).

    +

    When the border is defined and image size should be kept the same, some spacing have to be added around image. You can adjust this spacing to draw you own borders or any additional graphics (such as overlay icons). Here is an example –

    +
    Thumbnail with Extra Icons

    Thumbnail with Extra Icons

    +

    Download Better ListView

    +

    You can download Better ListView and play with it yourself.

    +]]>
    + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/image-borders/index.html b/public/blog/tag/image-borders/index.html new file mode 100644 index 0000000..c84effe --- /dev/null +++ b/public/blog/tag/image-borders/index.html @@ -0,0 +1,212 @@ + + + + + + + +image borders « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/image/feed/index.html b/public/blog/tag/image/feed/index.html new file mode 100644 index 0000000..85e372e --- /dev/null +++ b/public/blog/tag/image/feed/index.html @@ -0,0 +1,116 @@ + + + + image – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/image/index.html b/public/blog/tag/image/index.html new file mode 100644 index 0000000..c7e566a --- /dev/null +++ b/public/blog/tag/image/index.html @@ -0,0 +1,214 @@ + + + + + + + +image « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/imagekey/feed/index.html b/public/blog/tag/imagekey/feed/index.html new file mode 100644 index 0000000..7e4c75a --- /dev/null +++ b/public/blog/tag/imagekey/feed/index.html @@ -0,0 +1,246 @@ + + + + imagekey – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/imagekey/index.html b/public/blog/tag/imagekey/index.html new file mode 100644 index 0000000..49f2522 --- /dev/null +++ b/public/blog/tag/imagekey/index.html @@ -0,0 +1,212 @@ + + + + + + + +imagekey « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/imagelist/feed/index.html b/public/blog/tag/imagelist/feed/index.html new file mode 100644 index 0000000..3d5ee53 --- /dev/null +++ b/public/blog/tag/imagelist/feed/index.html @@ -0,0 +1,246 @@ + + + + imagelist – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/imagelist/index.html b/public/blog/tag/imagelist/index.html new file mode 100644 index 0000000..e9e7319 --- /dev/null +++ b/public/blog/tag/imagelist/index.html @@ -0,0 +1,212 @@ + + + + + + + +imagelist « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/images/feed/index.html b/public/blog/tag/images/feed/index.html new file mode 100644 index 0000000..e8af09a --- /dev/null +++ b/public/blog/tag/images/feed/index.html @@ -0,0 +1,310 @@ + + + + images – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Binding Images in Better ListView + http://www.componentowl.com/blog/binding-images-in-better-listview/ + http://www.componentowl.com/blog/binding-images-in-better-listview/#respond + Mon, 28 Jan 2013 03:54:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=850 + + Better ListView 3.5 have improved data binding functionality. You can adjust how the data rows will be converted to items/sub-items and vice versa. For example, you can show images based on the bound data:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Say you have a simple Server type:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class Server
    +{
    + public string ServerName
    + {
    + get;
    + set;
    + }

    +

    public int ServerStatus
    + {
    + get;
    + set;
    + }

    +

    public Server(string name, int status)
    + {
    + ServerName = name;
    + ServerStatus = status;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class Server

    +

    Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    + End Property

    +

    Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    + End Property

    +

    Private m_ServerName As String
    + Private m_ServerStatus As Integer

    +

    Public Sub New(name As String, status As Integer)
    + ServerName = name
    + ServerStatus = status
    + End Sub

    +

    End Class
    +[/vb]

    +

    This class contains two properties representing server name and its status. The server name is a textual property and one would like this mapped to item label as usual. However, the server status is a numerical value which have no meaning to the user even when converted to string. In fact, the numerical value can be 0 (offline), 1 (idle) or 2 (running). You may like to display color icons instead of plain strings or numbers. What if we would like to even highlight some items or change other properties during data binding? This is possible through Better ListView data binding customization.

    +

    First, let’s create a list of Server objects and bind this to a Better ListView. We would like to have columns auto-generated, so we set DataBindColumns to true:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +Server[] servers = new[]
    +{
    + new Server(“Andromeda”, 2),
    + new Server(“Taurus”, 1),
    + new Server(“Himalia”, 2),
    + new Server(“Nanda”, 2),
    + new Server(“Elara”, 0),
    + new Server(“Perseus”, 2),
    + new Server(“Titan”, 1)
    +};

    +

    ImageList imageList = new ImageList();

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit;
    +imageList.ImageSize = new Size(16, 16);
    +imageList.Images.AddStrip(Image.FromFile(“status.png”));

    +

    BetterListView listView = new CustomListView();

    +

    listView.DataBindColumns = true;
    +listView.DataSource = servers;
    +listView.ImageList = imageList;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim servers As Server() = New () {New Server(“Andromeda”, 2), New Server(“Taurus”, 1), New Server(“Himalia”, 2), New Server(“Nanda”, 2), New Server(“Elara”, 0), New Server(“Perseus”, 2), _
    + New Server(“Titan”, 1)}

    +

    Dim imageList As New ImageList()

    +

    imageList.ColorDepth = ColorDepth.Depth32Bit
    +imageList.ImageSize = New Size(16, 16)
    +imageList.Images.AddStrip(Image.FromFile(“status.png”))

    +

    Dim listView As BetterListView = New CustomListView()

    +

    listView.DataBindColumns = True
    +listView.DataSource = servers
    +listView.ImageList = imageList
    +[/vb]

    +

    Let’s take a look on the result:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

     

    +

    The columns were auto-generated and Server properties properly converted to item and sub-item labels. The generated column header labels are just names of the corresponding properties (ServerName, ServerStatus). You can make the names more convenient by providing DisplayNameAttribute on the respective properties:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +…

    +

    [DisplayName(“Server Name”)]
    +public string ServerName
    +{
    + get;
    + set;
    +}

    +

    [DisplayName(“Status”)]
    +public int ServerStatus
    +{
    + get;
    + set;
    +}

    +


    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +…

    +

    _
    +Public Property ServerName() As String
    + Get
    + Return m_ServerName
    + End Get
    + Set
    + m_ServerName = Value
    + End Set
    +End Property

    +

    _
    +Public Property ServerStatus() As Integer
    + Get
    + Return m_ServerStatus
    + End Get
    + Set
    + m_ServerStatus = Value
    + End Set
    +End Property

    +


    +[/vb]

    +

    Now the column names are more user friendly:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    We will finally add state images (instead of the numbers) and highlight some items. To do that, we have to override DataCreateItem method in a class derived from BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class CustomListView : BetterListView
    +{
    + protected override BetterListViewItem DataCreateItem(
    + CurrencyManager currentDataManager,
    + BindingMemberInfo[] currentDisplayMembers,
    + int index)
    + {
    + // create item using the base implementation
    + BetterListViewItem item = base.DataCreateItem(
    + currentDataManager,
    + currentDisplayMembers,
    + index);

    +

    // get server status from the current Server object
    + int serverStatus = ((Server)currentDataManager.List[index]).ServerStatus;

    +

    if (serverStatus == 0)
    + {
    + // bold item when server status is 0
    + item.IsBold = true;
    + }

    +

    // get sub-item corresponding to server status
    + BetterListViewSubItem subItemStatus = item.SubItems[1];

    +

    subItemStatus.ImageIndex = serverStatus; // set image for the sub-item
    + subItemStatus.Text = “”; // clear sub-item text

    +

    return item;
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView

    +

    Protected Overrides Function DataCreateItem(currentDataManager As CurrencyManager, currentDisplayMembers As BindingMemberInfo(), index As Integer) As BetterListViewItem

    +

    ‘ create item using the base implementation
    + Dim item As BetterListViewItem = MyBase.DataCreateItem(currentDataManager, currentDisplayMembers, index)

    +

    ‘ get server status from the current Server object
    + Dim serverStatus As Integer = DirectCast(currentDataManager.List(index), Server).ServerStatus

    +

    If serverStatus = 0 Then
    + ‘ bold item when server status is 0
    + item.IsBold = True
    + End If

    +

    ‘ get sub-item corresponding to server status
    + Dim subItemStatus As BetterListViewSubItem = item.SubItems(1)

    +

    subItemStatus.ImageIndex = serverStatus
    + ‘ set image for the sub-item
    + subItemStatus.Text = “”
    + ‘ clear sub-item text
    + Return item

    +

    End Function

    +

    End Class
    +[/vb]

    +

    Now the control displays adjusted images and a highlighted item:

    +
    Better ListView with bound list

    Better ListView with bound list

    +

    Note that you can customize data binding the other way as well by overriding the DataUpdateSubItemToSource method. This method is responsible for updating the bound data source when item/sub-item value have been modified.

    +]]>
    + http://www.componentowl.com/blog/binding-images-in-better-listview/feed/ + 0 +
    + + Right-aligned Images in Better ListView + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/ + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/#respond + Thu, 19 Apr 2012 19:15:13 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=780 + + Better ListView 2.9.0 now supports more customizable image alignment. For example, images can be aligned on the right part of item:

    +
    Right-aligned Images

    Right-aligned Images

    +

    The alignment can be set separately on every sub-item (using AlignImageHorizontal and AlignImageVertical properties).

    +

    Moreover, the right-aligned images can be used in column headers and groups:

    +
    Group image alignment

    Group image alignment

    +

    The alignment of images is similar to that of text. Every image has its frame, which can be possibly larger than the image itself. In such case, the image needs to be further aligned within the frame. This has been done automatically by centering the image within frame, but now you have full control over the alignment.

    +]]>
    + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/images/index.html b/public/blog/tag/images/index.html new file mode 100644 index 0000000..1196378 --- /dev/null +++ b/public/blog/tag/images/index.html @@ -0,0 +1,216 @@ + + + + + + + +images « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/internet-addiction/feed/index.html b/public/blog/tag/internet-addiction/feed/index.html new file mode 100644 index 0000000..e532d01 --- /dev/null +++ b/public/blog/tag/internet-addiction/feed/index.html @@ -0,0 +1,151 @@ + + + + internet addiction – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/internet-addiction/index.html b/public/blog/tag/internet-addiction/index.html new file mode 100644 index 0000000..993f0c6 --- /dev/null +++ b/public/blog/tag/internet-addiction/index.html @@ -0,0 +1,212 @@ + + + + + + + +internet addiction « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/invisible/feed/index.html b/public/blog/tag/invisible/feed/index.html new file mode 100644 index 0000000..5d50820 --- /dev/null +++ b/public/blog/tag/invisible/feed/index.html @@ -0,0 +1,98 @@ + + + + invisible – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hiding Column Headers in Better ListView + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/#respond + Mon, 27 Aug 2012 23:11:27 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=803 + + Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    +]]>
    + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/feed/ + 0 +
    + + Hiding Items in Better ListView + http://www.componentowl.com/blog/hiding-items-in-better-listview/ + http://www.componentowl.com/blog/hiding-items-in-better-listview/#respond + Mon, 06 Feb 2012 16:23:15 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=546 + + We currently introduced a BetterListViewItem.Visible property to allow hiding items visually, but keeping then in the Items collection:

    +
    Making items invisible

    Making items invisible

    +

    The above image shows two groups of items. The first groups uses hiding of items with the Visible property, while the second group simply turns off drawing of ceratin items.

    +

    The first approach is useful when you need to hide item as if it is removed, but keep it actually within Items collection.

    +

    The second approach need to create new control inheriting from BetterListView, overrride the OnDrawItem method and set properties like BetterListViewDrawItemEventArgs.DrawImage to false or simply not call the base implementation of OnDrawItem.

    +

    The second (owner drawing) approach is useful when you need just to switch off display of item without changing the item layout.

    +]]>
    + http://www.componentowl.com/blog/hiding-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/invisible/index.html b/public/blog/tag/invisible/index.html new file mode 100644 index 0000000..e647f3d --- /dev/null +++ b/public/blog/tag/invisible/index.html @@ -0,0 +1,214 @@ + + + + + + + +invisible « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/item-height-in-list-view/feed/index.html b/public/blog/tag/item-height-in-list-view/feed/index.html new file mode 100644 index 0000000..e5a3926 --- /dev/null +++ b/public/blog/tag/item-height-in-list-view/feed/index.html @@ -0,0 +1,59 @@ + + + + item height in list-view – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Item Height in Details View of Better ListView + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/ + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/#respond + Wed, 21 Mar 2012 15:10:52 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=760 + + Better ListView 2.7.0.0 now supports items of arbitrary height in Details view:

    +
    Items with custom height

    Items with custom height

    +

    Items with variable heights were possible in recent versions of Better ListView as well, but this adjustment was limited to heights which are multiples of text line height.

    +

    We have introduced a BetterListViewItem.CustomHeight property, which is 0 by default.

    +

    Every item has some minimum size (defined by the font and image) but it can get arbitrarily larger. The following formula explains how item height is measured in Better ListView:

    +

    height = max(minimum height, image height, text height, custom height)

    +

    Setting minimum height for all items is possible through layout properties and the latter is defined by the item itself.

    +]]>
    + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/item-height-in-list-view/index.html b/public/blog/tag/item-height-in-list-view/index.html new file mode 100644 index 0000000..5cfaf7c --- /dev/null +++ b/public/blog/tag/item-height-in-list-view/index.html @@ -0,0 +1,212 @@ + + + + + + + +item height in list-view « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/item-height/feed/index.html b/public/blog/tag/item-height/feed/index.html new file mode 100644 index 0000000..faad9df --- /dev/null +++ b/public/blog/tag/item-height/feed/index.html @@ -0,0 +1,59 @@ + + + + item height – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Item Height in Details View of Better ListView + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/ + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/#respond + Wed, 21 Mar 2012 15:10:52 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=760 + + Better ListView 2.7.0.0 now supports items of arbitrary height in Details view:

    +
    Items with custom height

    Items with custom height

    +

    Items with variable heights were possible in recent versions of Better ListView as well, but this adjustment was limited to heights which are multiples of text line height.

    +

    We have introduced a BetterListViewItem.CustomHeight property, which is 0 by default.

    +

    Every item has some minimum size (defined by the font and image) but it can get arbitrarily larger. The following formula explains how item height is measured in Better ListView:

    +

    height = max(minimum height, image height, text height, custom height)

    +

    Setting minimum height for all items is possible through layout properties and the latter is defined by the item itself.

    +]]>
    + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/item-height/index.html b/public/blog/tag/item-height/index.html new file mode 100644 index 0000000..6022b7b --- /dev/null +++ b/public/blog/tag/item-height/index.html @@ -0,0 +1,212 @@ + + + + + + + +item height « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/item-hierarchy/feed/index.html b/public/blog/tag/item-hierarchy/feed/index.html new file mode 100644 index 0000000..df7ef80 --- /dev/null +++ b/public/blog/tag/item-hierarchy/feed/index.html @@ -0,0 +1,150 @@ + + + + item hierarchy – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    + + Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more) + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/ + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/#respond + Tue, 03 May 2011 09:28:55 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=232 + groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.]]> + Hierarchical items in two groups

    Hierarchical items in two groups

    +

    We are currently working hard on finishing Better ListView version 2.0 which will add new features: Support for groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.

    +

    We expect to release this upgrade in about a month. It will be a free upgrade for current and new users.

    +

    Groups

    +

    Groups in Better ListView have comparable capabilities as other Better ListView elements (column headers, items, sub-items). For example, you can adjust the foreground/background colors, font, image – and owner drawing is possible as well.

    +

    You can even include images into group headers (as you can see in the preview above), which is not possible in .NET ListView.

    +

    Groups are collapsible by default and the expand button can be switched off on each group individually.

    +

    Here are groups combined with Tile view (the second group is collapsed):

    +
    Groups with Tile view

    Groups with Tile view

    +

    The previous figure displays vertically oriented groups, but Better ListView also support horizontally oriented groups in the List mode:

    +
    Groups with List view

    Groups with List view

    +

    We put special effort to mimic the group display and behavior of Windows Explorer. The group headers can display all of the 15 group header states available in Windows visual style and their display is governed by the same logic as in the ListView counterpart.

    +

    The group headers always look perfect and native, right out of the box. You don’t need to tweak anything.

    +

    Item Hierarchy

    +
    +
    +

    +
    Items with hierarchy

    Items with hierarchy

    +

    +
    +
    +
    +

    This works in the similar way as in the standard TreeView control. Each item (or node) has property called ChildItems which can be filled with new BetterListViewItem instances. SubItems collection can still be used in either items and child-items (child items are treated in the very same way as their parents).

    +

    Item hierarchy can be combined with Groups feature as seen in the first preview.

    +

    Multi-Line Items

    +
    Multi-line items

    Multi-line items

    +

    A simple setting of item layout (MaximumTextLines property) allows breaking item text into several lines (up to the specified value). When the text is longer than MaximumTextLines, then the default trimming method is used (one from the TextTrimming enumeration: None, TrimCharacter, TrimWord, EllipsisCharacter, EllipsisWord, EllipsisPath).

    +

    Multi-line text can be used in every view and also in column headers.

    +

    Another New Features

    +

    There are also bunch of new minor features including:

    +

    Adjustable paddings – Every element part (e.g. item check box, group image…) contains customizable spaces at each side, so the user can easily create space where he needs and customize items/column headers/group headers to the finest detail.

    +

    Focusing sub-items – Items, group headers and even sub-items can be keyfocused. User can now invoke label editing or scroll to any “cell” in the Details-with-columns view solely with keyboard.

    +

    IEnumerable implementations –  BetterListView, BetterListViewGroup and BetterListViewItem implements IEnumerable interface for iterating through the whole item hierarchy, so using recursion to traverse child items is not necessary.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/item-hierarchy/index.html b/public/blog/tag/item-hierarchy/index.html new file mode 100644 index 0000000..de7b8a8 --- /dev/null +++ b/public/blog/tag/item-hierarchy/index.html @@ -0,0 +1,214 @@ + + + + + + + +item hierarchy « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/item-reorder/feed/index.html b/public/blog/tag/item-reorder/feed/index.html new file mode 100644 index 0000000..c7bcf67 --- /dev/null +++ b/public/blog/tag/item-reorder/feed/index.html @@ -0,0 +1,69 @@ + + + + item reorder – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + List-View Drag and Drop Item Reorder (Sort) + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/ + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/#respond + Tue, 07 Jun 2011 11:29:04 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=260 + + Reordering items in list view control using drag and drop is very tricky. Implementation of item reorder requires multiple issues to be solved:

    +
      +
    • Initialization of the drag & drop
    • +
    • Insertion mark that previews where will be the dragged item moved
    • +
    • The actual reordering of the items (custom code might be needed)
    • +
    • Support of multiple drag drop effects (copy, move, link)
    • +
    • It should not interfere with external drag and drop outside of the listview control
    • +
    • It should not interfere with internal drag and drop into items.
    • +
    • Reorder of multiple items (including non-continuous selection)
    • +
    +

    Our Better ListView control supports drag and drop item reordering out of the box. Zero code is needed – all you have to do is to set the property BetterListViewItemReorderMode to Enabled.

    +

    It works just like this:

    +

    Item drag and drop reorder

    +

    Item drag and drop reorder

    +

    You can just download and install Better ListView, and start using it right away. It can do everything the regular .NET listview component can, and much more.

    +

    See more in the Drag Drop Sample that is included with Better ListView. It includes source code.

    +]]>
    + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/item-reorder/index.html b/public/blog/tag/item-reorder/index.html new file mode 100644 index 0000000..582f164 --- /dev/null +++ b/public/blog/tag/item-reorder/index.html @@ -0,0 +1,212 @@ + + + + + + + +item reorder « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/item-sort/feed/index.html b/public/blog/tag/item-sort/feed/index.html new file mode 100644 index 0000000..4b49788 --- /dev/null +++ b/public/blog/tag/item-sort/feed/index.html @@ -0,0 +1,69 @@ + + + + item sort – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + List-View Drag and Drop Item Reorder (Sort) + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/ + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/#respond + Tue, 07 Jun 2011 11:29:04 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=260 + + Reordering items in list view control using drag and drop is very tricky. Implementation of item reorder requires multiple issues to be solved:

    +
      +
    • Initialization of the drag & drop
    • +
    • Insertion mark that previews where will be the dragged item moved
    • +
    • The actual reordering of the items (custom code might be needed)
    • +
    • Support of multiple drag drop effects (copy, move, link)
    • +
    • It should not interfere with external drag and drop outside of the listview control
    • +
    • It should not interfere with internal drag and drop into items.
    • +
    • Reorder of multiple items (including non-continuous selection)
    • +
    +

    Our Better ListView control supports drag and drop item reordering out of the box. Zero code is needed – all you have to do is to set the property BetterListViewItemReorderMode to Enabled.

    +

    It works just like this:

    +

    Item drag and drop reorder

    +

    Item drag and drop reorder

    +

    You can just download and install Better ListView, and start using it right away. It can do everything the regular .NET listview component can, and much more.

    +

    See more in the Drag Drop Sample that is included with Better ListView. It includes source code.

    +]]>
    + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/item-sort/index.html b/public/blog/tag/item-sort/index.html new file mode 100644 index 0000000..1742f24 --- /dev/null +++ b/public/blog/tag/item-sort/index.html @@ -0,0 +1,212 @@ + + + + + + + +item sort « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/item/feed/index.html b/public/blog/tag/item/feed/index.html new file mode 100644 index 0000000..179724e --- /dev/null +++ b/public/blog/tag/item/feed/index.html @@ -0,0 +1,345 @@ + + + + item – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    + + Better ListView Tip: How to Draw Custom Selection + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/ + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/#comments + Wed, 12 Sep 2012 15:43:12 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=808 + + Customized item selection.

    Customized item selection.

    +

     

    +

    By default, Better ListView uses system theme for drawing selections.

    +

    To draw custom selection, you can use owner drawing capabilities of Better ListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +class CustomListView : BetterListView
    +{
    + protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
    + brushSelection.Dispose();
    + }
    + }

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + eventArgs.DrawSelection = false;

    +

    base.OnDrawItem(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
    + brushSelection.Dispose()
    + End If
    + End Sub

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + eventArgs.DrawSelection = False

    +

    MyBase.OnDrawItem(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
    + End If
    + End Sub
    +End Class
    +[/vb]

    +

    In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

    +

    The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

    +

    The OnDrawItem method contains two things:

    +
      +
    1. Turn off  default selection.
    2. +
    3. Draw custom selection border if the item is selected.
    4. +
    +

    Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

    +

    Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

    +

    To allow these states, considerable coding need to be done.

    +

    In case you need this level of customization, please contact us for Custom Coding support.

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/feed/ + 2 +
    + + How To: Dynamically Resize Focused Item + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/ + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/#respond + Thu, 22 Dec 2011 02:29:35 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=468 + + Better ListView 2.4.0 now supports setting MaximumTextLines property on every item and sub-item, so you can have multi-line items each with different number text lines:

    +
    Dynamic resizing of the focused item

    Dynamic resizing of the focused item

    +

    We also introduced FocusedItemChanged event, so that you can detect when focus has moved from one element (item / sub-item / group) to another.

    +

    These features can be combined to display only the focused item with more details to save space code of the FocusedItemChanged event handler may look like this:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +void ListViewFocusedItemChanged(object sender, BetterListViewFocusedItemChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (eventArgs.FocusedItemOld != null)
    + {
    + // set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1;
    + }

    +

    if (eventArgs.FocusedItemNew != null)
    + {
    + // set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Sub ListViewFocusedItemChanged(sender As Object, eventArgs As BetterListViewFocusedItemChangedEventArgs)
    + Dim ListView As BetterListView = DirectCast(sender, BetterListView)

    +

    ListView.BeginUpdate()

    +

    If eventArgs.FocusedItemOld IsNot Nothing Then
    + ‘ set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1
    + End If

    +

    If eventArgs.FocusedItemNew IsNot Nothing Then
    + ‘ set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3
    + End If

    +

    ListView.EndUpdate()
    +End Sub
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/feed/ + 0 +
    + + Work in Progress: “Groups” / “Item Hierarchy” Features + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond + Fri, 25 Mar 2011 23:11:00 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=204 + + We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    +]]>
    + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/item/index.html b/public/blog/tag/item/index.html new file mode 100644 index 0000000..2c093ab --- /dev/null +++ b/public/blog/tag/item/index.html @@ -0,0 +1,218 @@ + + + + + + + +item « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/items/feed/index.html b/public/blog/tag/items/feed/index.html new file mode 100644 index 0000000..ccd716f --- /dev/null +++ b/public/blog/tag/items/feed/index.html @@ -0,0 +1,778 @@ + + + + items – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    + + Better ListView Tip: How to Draw Custom Selection + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/ + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/#comments + Wed, 12 Sep 2012 15:43:12 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=808 + + Customized item selection.

    Customized item selection.

    +

     

    +

    By default, Better ListView uses system theme for drawing selections.

    +

    To draw custom selection, you can use owner drawing capabilities of Better ListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +class CustomListView : BetterListView
    +{
    + protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
    + brushSelection.Dispose();
    + }
    + }

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + eventArgs.DrawSelection = false;

    +

    base.OnDrawItem(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
    + brushSelection.Dispose()
    + End If
    + End Sub

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + eventArgs.DrawSelection = False

    +

    MyBase.OnDrawItem(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
    + End If
    + End Sub
    +End Class
    +[/vb]

    +

    In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

    +

    The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

    +

    The OnDrawItem method contains two things:

    +
      +
    1. Turn off  default selection.
    2. +
    3. Draw custom selection border if the item is selected.
    4. +
    +

    Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

    +

    Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

    +

    To allow these states, considerable coding need to be done.

    +

    In case you need this level of customization, please contact us for Custom Coding support.

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/feed/ + 2 +
    + + Hiding Column Headers in Better ListView + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/#respond + Mon, 27 Aug 2012 23:11:27 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=803 + + Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    +]]>
    + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/feed/ + 0 +
    + + How to Store Better ListView Content in a String (User Request) + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/ + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/#respond + Sat, 04 Aug 2012 00:03:49 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=796 + + Is it possible to store entire Better ListView content (items with hierarchy and sub-items, columns and groups) in a single string?

    +

    Better ListView already supports saving and loading its content using SaveContent and LoadContent methods. These methods support either XML or binary format.

    +

    I chose binary format for storing data in string  because it is more compact than XML. Binary representation (basically an array of bytes) can be converted to Base64 string. Loading the content from string work similarly, the steps are performed in opposite direction:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +// SAVE
    +// create MemoryStream to hold binary data
    +MemoryStream stream = new MemoryStream();
    +// store Better ListView content in memory stream
    +this.listView.SaveContentBinary(stream);
    +// copy content of MemoryStream to byte array
    +byte[] contentBinary = new byte[stream.Length];
    +stream.Seek(0, SeekOrigin.Begin);
    +// convert byte array to Base64 string
    +stream.Read(contentBinary, 0, (int)stream.Length); // move to beginning of the stream
    +string contentStringBase64 = Convert.ToBase64String(contentBinary);
    +// close stream
    +stream.Close();
    +stream.Dispose();

    +

    // CLEAR
    +this.listView.Clear();

    +

    // LOAD
    +// create MemoryStream to hold binary data
    +stream = new MemoryStream();
    +// convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64);
    +// write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length);
    +stream.Seek(0, SeekOrigin.Begin); // move to beginning of the stream
    +// load content of Better ListView from memory stream
    +this.listView.LoadContentBinary(stream);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +‘ SAVE
    +‘ create MemoryStream to hold binary data
    +Dim stream As New MemoryStream()
    +‘ store Better ListView content in memory stream
    +Me.listView.SaveContentBinary(stream)
    +‘ copy content of MemoryStream to byte array
    +Dim contentBinary As Byte() = New Byte(stream.Length – 1) {}
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ convert byte array to Base64 string
    +stream.Read(contentBinary, 0, CInt(stream.Length))
    +‘ move to beginning of the stream
    +Dim contentStringBase64 As String = Convert.ToBase64String(contentBinary)
    +‘ close stream
    +stream.Close()
    +stream.Dispose()

    +

    ‘ CLEAR
    +Me.listView.Clear()

    +

    ‘ LOAD
    +‘ create MemoryStream to hold binary data
    +stream = New MemoryStream()
    +‘ convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64)
    +‘ write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length)
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ move to beginning of the stream
    +‘ load content of Better ListView from memory stream
    +Me.listView.LoadContentBinary(stream)
    +[/vb]

    +

     

    +

    Although saving and loading data this way is convenient, please consider the following drawback:

    +
      +
    • Standard serialization mechanism of .NET is used for converting classes and structures to XML or binary representation – hence the serialized data may not be possible to deserialize on different version of Better ListView if any public members of the serialized class have been changed.
    • +
    • The generated string is very long (few kilobytes for just two items).
    • +
    • Lots of data are stored which are not related to content itself (e.g. item colors).
    • +
    • The serialized representation is considered read-only – any changes can cause problems with deserialization; if you really want flexible way of storing ListView content, consider building a model or data layer that supports storing the data you need the way you need.
    • +
    +

    On the other hand, using this way may be convenient when you want to transfer or copy ListView content between controls on even across application domain (Better ListView itself uses this mechanism to allow Drag and Drop between two applications – this “tour de force” kind of Drag and Drop is not avaiable in regular .NET ListView).

    +]]>
    + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/feed/ + 0 +
    + + Custom Item Height in Details View of Better ListView + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/ + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/#respond + Wed, 21 Mar 2012 15:10:52 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=760 + + Better ListView 2.7.0.0 now supports items of arbitrary height in Details view:

    +
    Items with custom height

    Items with custom height

    +

    Items with variable heights were possible in recent versions of Better ListView as well, but this adjustment was limited to heights which are multiples of text line height.

    +

    We have introduced a BetterListViewItem.CustomHeight property, which is 0 by default.

    +

    Every item has some minimum size (defined by the font and image) but it can get arbitrarily larger. The following formula explains how item height is measured in Better ListView:

    +

    height = max(minimum height, image height, text height, custom height)

    +

    Setting minimum height for all items is possible through layout properties and the latter is defined by the item itself.

    +]]>
    + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/feed/ + 0 +
    + + Custom Spacing between Items in Details View + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/ + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/#respond + Tue, 13 Mar 2012 22:53:09 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=753 + + Better ListView 2.6 newly supports custom spacing between items in Details view:

    +
    Custom Spacing between Items

    Custom Spacing between Items

    +

    This property has been recently available in other views, but Details view was exception since its selections needed to be treated in different way: They overlap by 1 pixel so that the double border is avoided in neighboring selections:

    +
    1 px overlap of items

    1 px overlap of items

    +

    We have resolved this to get proper behavior with custom spacings and now the spacing can be set the same way as in any other view:

    +

    Simply set LayoutItemsCurrent.ElementOuterPadding to have custom horizontal and vertical padding between items.

    +

    You can set this specifically for Details view by refering to property LayoutItemsDetails or LayoutItemsDetailsColumns (Details view with columns).

    +]]>
    + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/feed/ + 0 +
    + + Hiding Items in Better ListView + http://www.componentowl.com/blog/hiding-items-in-better-listview/ + http://www.componentowl.com/blog/hiding-items-in-better-listview/#respond + Mon, 06 Feb 2012 16:23:15 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=546 + + We currently introduced a BetterListViewItem.Visible property to allow hiding items visually, but keeping then in the Items collection:

    +
    Making items invisible

    Making items invisible

    +

    The above image shows two groups of items. The first groups uses hiding of items with the Visible property, while the second group simply turns off drawing of ceratin items.

    +

    The first approach is useful when you need to hide item as if it is removed, but keep it actually within Items collection.

    +

    The second approach need to create new control inheriting from BetterListView, overrride the OnDrawItem method and set properties like BetterListViewDrawItemEventArgs.DrawImage to false or simply not call the base implementation of OnDrawItem.

    +

    The second (owner drawing) approach is useful when you need just to switch off display of item without changing the item layout.

    +]]>
    + http://www.componentowl.com/blog/hiding-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/items/index.html b/public/blog/tag/items/index.html new file mode 100644 index 0000000..4744140 --- /dev/null +++ b/public/blog/tag/items/index.html @@ -0,0 +1,238 @@ + + + + + + + +items « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/tag/label/feed/index.html b/public/blog/tag/label/feed/index.html new file mode 100644 index 0000000..e200ee3 --- /dev/null +++ b/public/blog/tag/label/feed/index.html @@ -0,0 +1,188 @@ + + + + label – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    + + Customize Label Editing (Embedded) Control for Each Line in Better ListView + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/ + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/#comments + Wed, 04 Apr 2012 10:33:49 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=771 + + Embedded controls for label edit in Better ListView can be customized not only for every column, but even for every row.

    +

    This is not a new feature, but would be nice to mention that you can possibly have a different custom editing control for every cell…

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +{
    + // show editing controls in the second column
    + if (eventArgs.SubItem.Index == 1)
    + {
    + // show my custom control on the first row
    + if (eventArgs.SubItem.Item.Index == 0)
    + {
    + return (new DocumentAccessConrol());
    + }

    +

    // show my custom control on the second row
    + if (eventArgs.SubItem.Item.Index == 1)
    + {
    + return (new BetterListViewComboBoxEmbeddedControl());
    + }

    +

    // show my custom control on the third row
    + if (eventArgs.SubItem.Item.Index == 2)
    + {
    + return (new BetterListViewTextBoxEmbeddedControl());
    + }
    + }

    +

    return null;
    +}
    +[/csharp]

    +

     

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Function ListViewRequestEmbeddedControl(ByVal sender As Object, ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    + As IBetterListViewEmbeddedControl

    +

    ‘ show editing controls in the second column
    + If eventArgs.SubItem.Index = 1 Then

    +

    ‘ show my custom control on the first row
    + If eventArgs.SubItem.Item.Index = 0 Then
    + Return (New DocumentAccessConrol())
    + End If

    +

    ‘ show my custom control on the second row
    + If eventArgs.SubItem.Item.Index = 1 Then
    + Return (New BetterListViewComboBoxEmbeddedControl())
    + End If

    +

    ‘ show my custom control on the third row
    + If eventArgs.SubItem.Item.Index = 2 Then
    + Return (New BetterListViewTextBoxEmbeddedControl())
    + End If

    +

    End If

    +

    Return Nothing

    +

    End Function
    +[/vb]

    +

     

    +

    And there is the result:

    +
    Custom Embedded Control on the First Line

    Custom Embedded Control on the First Line

    +

     

    +
    TextBox Control on the Third Line

    TextBox Control on the Third Line

    +]]>
    + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/feed/ + 2 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/label/index.html b/public/blog/tag/label/index.html new file mode 100644 index 0000000..0ca3255 --- /dev/null +++ b/public/blog/tag/label/index.html @@ -0,0 +1,214 @@ + + + + + + + +label « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/labeledit/feed/index.html b/public/blog/tag/labeledit/feed/index.html new file mode 100644 index 0000000..a47d914 --- /dev/null +++ b/public/blog/tag/labeledit/feed/index.html @@ -0,0 +1,107 @@ + + + + labeledit – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/labeledit/index.html b/public/blog/tag/labeledit/index.html new file mode 100644 index 0000000..85dbea5 --- /dev/null +++ b/public/blog/tag/labeledit/index.html @@ -0,0 +1,212 @@ + + + + + + + +labeledit « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/large/feed/index.html b/public/blog/tag/large/feed/index.html new file mode 100644 index 0000000..235ba17 --- /dev/null +++ b/public/blog/tag/large/feed/index.html @@ -0,0 +1,70 @@ + + + + large – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/large/index.html b/public/blog/tag/large/index.html new file mode 100644 index 0000000..d065808 --- /dev/null +++ b/public/blog/tag/large/index.html @@ -0,0 +1,212 @@ + + + + + + + +large « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/larger/feed/index.html b/public/blog/tag/larger/feed/index.html new file mode 100644 index 0000000..c4b60ab --- /dev/null +++ b/public/blog/tag/larger/feed/index.html @@ -0,0 +1,70 @@ + + + + larger – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/larger/index.html b/public/blog/tag/larger/index.html new file mode 100644 index 0000000..546e636 --- /dev/null +++ b/public/blog/tag/larger/index.html @@ -0,0 +1,212 @@ + + + + + + + +larger « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/layout/feed/index.html b/public/blog/tag/layout/feed/index.html new file mode 100644 index 0000000..c21b777 --- /dev/null +++ b/public/blog/tag/layout/feed/index.html @@ -0,0 +1,61 @@ + + + + layout – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/layout/index.html b/public/blog/tag/layout/index.html new file mode 100644 index 0000000..5c8b797 --- /dev/null +++ b/public/blog/tag/layout/index.html @@ -0,0 +1,212 @@ + + + + + + + +layout « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/lf/feed/index.html b/public/blog/tag/lf/feed/index.html new file mode 100644 index 0000000..29d0ca4 --- /dev/null +++ b/public/blog/tag/lf/feed/index.html @@ -0,0 +1,67 @@ + + + + LF – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Multi-Line Text In ListView + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/#respond + Thu, 24 Nov 2011 16:42:44 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=450 + + Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    +]]>
    + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/lf/index.html b/public/blog/tag/lf/index.html new file mode 100644 index 0000000..62d14f9 --- /dev/null +++ b/public/blog/tag/lf/index.html @@ -0,0 +1,212 @@ + + + + + + + +LF « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/line/feed/index.html b/public/blog/tag/line/feed/index.html new file mode 100644 index 0000000..5b2122f --- /dev/null +++ b/public/blog/tag/line/feed/index.html @@ -0,0 +1,67 @@ + + + + line – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Multi-Line Text In ListView + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/#respond + Thu, 24 Nov 2011 16:42:44 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=450 + + Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    +]]>
    + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/line/index.html b/public/blog/tag/line/index.html new file mode 100644 index 0000000..4ff2b80 --- /dev/null +++ b/public/blog/tag/line/index.html @@ -0,0 +1,212 @@ + + + + + + + +line « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/linefeed/feed/index.html b/public/blog/tag/linefeed/feed/index.html new file mode 100644 index 0000000..ea481da --- /dev/null +++ b/public/blog/tag/linefeed/feed/index.html @@ -0,0 +1,67 @@ + + + + linefeed – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Multi-Line Text In ListView + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/#respond + Thu, 24 Nov 2011 16:42:44 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=450 + + Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    +]]>
    + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/linefeed/index.html b/public/blog/tag/linefeed/index.html new file mode 100644 index 0000000..8ac1dd6 --- /dev/null +++ b/public/blog/tag/linefeed/index.html @@ -0,0 +1,212 @@ + + + + + + + +linefeed « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/lines/feed/index.html b/public/blog/tag/lines/feed/index.html new file mode 100644 index 0000000..9eb362b --- /dev/null +++ b/public/blog/tag/lines/feed/index.html @@ -0,0 +1,98 @@ + + + + lines – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Add Grid Lines in Empty Space in Better ListView + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/#respond + Wed, 30 Apr 2014 09:51:46 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=894 + + Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    +]]>
    + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/lines/index.html b/public/blog/tag/lines/index.html new file mode 100644 index 0000000..f32853f --- /dev/null +++ b/public/blog/tag/lines/index.html @@ -0,0 +1,212 @@ + + + + + + + +lines « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/links/feed/index.html b/public/blog/tag/links/feed/index.html new file mode 100644 index 0000000..d19d314 --- /dev/null +++ b/public/blog/tag/links/feed/index.html @@ -0,0 +1,154 @@ + + + + links – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/links/index.html b/public/blog/tag/links/index.html new file mode 100644 index 0000000..5eb36a6 --- /dev/null +++ b/public/blog/tag/links/index.html @@ -0,0 +1,212 @@ + + + + + + + +links « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/list-view-group-headers/feed/index.html b/public/blog/tag/list-view-group-headers/feed/index.html new file mode 100644 index 0000000..9fea38f --- /dev/null +++ b/public/blog/tag/list-view-group-headers/feed/index.html @@ -0,0 +1,90 @@ + + + + list view group headers – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Behavior of Group Headers in Better ListView + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/ + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/#respond + Fri, 20 Jan 2012 09:40:44 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=480 + + When developing our desktop applications, me and Jiri needed to adjust behavior of group headers in the Better ListView control.

    +

    We discovered that making group header behavior customizable would be useful not only for us, but for other developers who utilize Better ListView as well, so we implemented this feature officially in Better ListView 2.5.0.

    +

    There are two new properties: ShowDefaultGroupHeader and GroupHeaderBehavior.

    +

    Hiding the Default Group Header

    +

    The ShowDefaultGroupHeader is initially set to true. This means that the default group (the group containing items which do not have a specific group) have its header displayed:

    +
    Default group header is visible

    Default group header is visible

    +

    When ShowDefaultGroupHeader is set to false, the “Default” group header on top can be hidden:

    +
    Default group header is hidden

    Default group header is hidden

    +

    Adjusting Group Header Behavior

    +

    The group headers have two kinds of behavior. They can be focused and can cause selection of items. Both of these functions can be invoked by keyboard and mouse.

    +

    The GroupHeaderBehavior property allows changing this behavior for keyboard and mouse separately.

    +

    By default, the property is set to BetterListViewGroupHeaderBehavior.All, so that all functions of the group header are turned on.

    +

    You may want to make group headers completely non-interactive. This can be done by setting the property to BetterListViewGroupHeaderBehavior.None.

    +

    Other values of the enum can be combined to create desired behavior.

    +

    Keyboard:

    +
      +
    • Focus only
    • +
    • Focus and select items in the group
    • +
    +

    Mouse:

    +
      +
    • Focus
    • +
    • Select items in the group
    • +
    • Highligh when mouse cursor is over the group header
    • +
    +
    The expand button of group headers can still be used even if the group header has all the behaviors turned off. If you need to hide the expand button as well, set BetterListViewGroup.AllowShowExpandButton to false.
    +

    Use Case: Metadata Viewer

    +

    Here Better ListView is used for viewing image metadata tags:

    +
    Metadata View window

    Metadata View window

    +

    Only one tag can be selected at a time, so clicking on a group header has no effect on selection and need not to be highlighted.

    +

    One may still need, however, to allow focusing the group header with keyboard and mouse so that it is possible to collapse/expand the group with arrow keys. The desired behavior can be set this way:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus & BetterListViewGroupHeaderBehavior.MouseFocus);[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]listView.GroupHeaderBehavior = (BetterListViewGroupHeaderBehavior.KeyboardFocus And BetterListViewGroupHeaderBehavior.MouseFocus)[/vb]

    +]]>
    + http://www.componentowl.com/blog/custom-behavior-of-group-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/list-view-group-headers/index.html b/public/blog/tag/list-view-group-headers/index.html new file mode 100644 index 0000000..b9ef468 --- /dev/null +++ b/public/blog/tag/list-view-group-headers/index.html @@ -0,0 +1,212 @@ + + + + + + + +list view group headers « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/list/feed/index.html b/public/blog/tag/list/feed/index.html new file mode 100644 index 0000000..cd48ff0 --- /dev/null +++ b/public/blog/tag/list/feed/index.html @@ -0,0 +1,141 @@ + + + + list – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/list/index.html b/public/blog/tag/list/index.html new file mode 100644 index 0000000..eb8db83 --- /dev/null +++ b/public/blog/tag/list/index.html @@ -0,0 +1,212 @@ + + + + + + + +list « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/listview-tree/feed/index.html b/public/blog/tag/listview-tree/feed/index.html new file mode 100644 index 0000000..56d8886 --- /dev/null +++ b/public/blog/tag/listview-tree/feed/index.html @@ -0,0 +1,85 @@ + + + + listview tree – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more) + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/ + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/#respond + Tue, 03 May 2011 09:28:55 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=232 + groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.]]> + Hierarchical items in two groups

    Hierarchical items in two groups

    +

    We are currently working hard on finishing Better ListView version 2.0 which will add new features: Support for groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.

    +

    We expect to release this upgrade in about a month. It will be a free upgrade for current and new users.

    +

    Groups

    +

    Groups in Better ListView have comparable capabilities as other Better ListView elements (column headers, items, sub-items). For example, you can adjust the foreground/background colors, font, image – and owner drawing is possible as well.

    +

    You can even include images into group headers (as you can see in the preview above), which is not possible in .NET ListView.

    +

    Groups are collapsible by default and the expand button can be switched off on each group individually.

    +

    Here are groups combined with Tile view (the second group is collapsed):

    +
    Groups with Tile view

    Groups with Tile view

    +

    The previous figure displays vertically oriented groups, but Better ListView also support horizontally oriented groups in the List mode:

    +
    Groups with List view

    Groups with List view

    +

    We put special effort to mimic the group display and behavior of Windows Explorer. The group headers can display all of the 15 group header states available in Windows visual style and their display is governed by the same logic as in the ListView counterpart.

    +

    The group headers always look perfect and native, right out of the box. You don’t need to tweak anything.

    +

    Item Hierarchy

    +
    +
    +

    +
    Items with hierarchy

    Items with hierarchy

    +

    +
    +
    +
    +

    This works in the similar way as in the standard TreeView control. Each item (or node) has property called ChildItems which can be filled with new BetterListViewItem instances. SubItems collection can still be used in either items and child-items (child items are treated in the very same way as their parents).

    +

    Item hierarchy can be combined with Groups feature as seen in the first preview.

    +

    Multi-Line Items

    +
    Multi-line items

    Multi-line items

    +

    A simple setting of item layout (MaximumTextLines property) allows breaking item text into several lines (up to the specified value). When the text is longer than MaximumTextLines, then the default trimming method is used (one from the TextTrimming enumeration: None, TrimCharacter, TrimWord, EllipsisCharacter, EllipsisWord, EllipsisPath).

    +

    Multi-line text can be used in every view and also in column headers.

    +

    Another New Features

    +

    There are also bunch of new minor features including:

    +

    Adjustable paddings – Every element part (e.g. item check box, group image…) contains customizable spaces at each side, so the user can easily create space where he needs and customize items/column headers/group headers to the finest detail.

    +

    Focusing sub-items – Items, group headers and even sub-items can be keyfocused. User can now invoke label editing or scroll to any “cell” in the Details-with-columns view solely with keyboard.

    +

    IEnumerable implementations –  BetterListView, BetterListViewGroup and BetterListViewItem implements IEnumerable interface for iterating through the whole item hierarchy, so using recursion to traverse child items is not necessary.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/listview-tree/index.html b/public/blog/tag/listview-tree/index.html new file mode 100644 index 0000000..1585e61 --- /dev/null +++ b/public/blog/tag/listview-tree/index.html @@ -0,0 +1,212 @@ + + + + + + + +listview tree « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/listview/feed/index.html b/public/blog/tag/listview/feed/index.html new file mode 100644 index 0000000..c9d91e4 --- /dev/null +++ b/public/blog/tag/listview/feed/index.html @@ -0,0 +1,580 @@ + + + + listview – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    + + How to Add Grid Lines in Empty Space in Better ListView + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/#respond + Wed, 30 Apr 2014 09:51:46 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=894 + + Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    +]]>
    + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/ + 0 +
    + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    + + Right-aligned Images in Better ListView + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/ + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/#respond + Thu, 19 Apr 2012 19:15:13 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=780 + + Better ListView 2.9.0 now supports more customizable image alignment. For example, images can be aligned on the right part of item:

    +
    Right-aligned Images

    Right-aligned Images

    +

    The alignment can be set separately on every sub-item (using AlignImageHorizontal and AlignImageVertical properties).

    +

    Moreover, the right-aligned images can be used in column headers and groups:

    +
    Group image alignment

    Group image alignment

    +

    The alignment of images is similar to that of text. Every image has its frame, which can be possibly larger than the image itself. In such case, the image needs to be further aligned within the frame. This has been done automatically by centering the image within frame, but now you have full control over the alignment.

    +]]>
    + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/feed/ + 0 +
    + + Read-Only Mode in Better ListView + http://www.componentowl.com/blog/read-only-mode-in-better-listview/ + http://www.componentowl.com/blog/read-only-mode-in-better-listview/#respond + Fri, 27 Jan 2012 16:21:58 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=482 + + Better ListView 2.5 introduces a new boolean property called ReadOnly.

    +

    When set to true, the Better ListView does not respond to keyboard and mouse input. There are, however, some exceptions that make the Read-only mode different to the Disabled mode (when Enabled property is set to false).

    +

    When in Read-only mode, content of the Better ListView can be still scrolled (the scroll bars are enabled) and groups/items can be expanded/collapsed.

    +

    The difference between Disabled and Read-only can be seen on the following images:

    +
    Normal state

    Normal state

    +
    Disabled state

    Disabled state

    +
    Read-only state

    Read-only state

    +

     

    +

    As you can see, the Better ListView is displayed normally in Read-only mode, but the group header does not have a hot state (because cannot be focused). Items also cannot be focused or selected, but the expand buttons are still interactive.

    +

    The scroll bars would also be enabled and can be used, which is different from Disabled mode where everything is grayed and cannot be used.

    +]]>
    + http://www.componentowl.com/blog/read-only-mode-in-better-listview/feed/ + 0 +
    + + Displaying Multi-Line Text In ListView + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/#respond + Thu, 24 Nov 2011 16:42:44 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=450 + + Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    +]]>
    + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/feed/ + 0 +
    + + Coming soon: Better ListView 2.1 Optimized for Performance + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/ + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/#respond + Mon, 05 Sep 2011 16:33:45 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=348 + + Better ListView 2 comes with many hot features, like groups and item hierarchy. Great features, unfortunately, often come at the price of decreased performance. However, we want to have Better ListView both feature-rich and fast.

    +

    Some users noticed a performance drop when working with large number of items (say 10 000+). Our top priority for version 2.1 is the overall optimization of Better ListView. Several optimizations have already been made in the recent updates (column resizing and thumbnail images), but we have to go further. You can expect Better ListView to be much snappier in the upcoming 2.1 update. The optimizations will cover these areas:

    +
      +
    • Faster collection operations (adding, removing, sorting) of large number of items
    • +
    • Faster expand/collapse of groups and items
    • +
    • Faster column resizing with multi-line items
    • +
    +

    We will also take a look on smoother Visual Studio integration, so you can see Better ListView ready in toolbox just after installation (we have to deal with Visual Studio Packages, which is quite an esoteric topic). If Better ListView doesn’t currently appear in your Visual Studio toolbox automatically, you can just right-click the toolbox window, and use “Choose Items” to add the DLL file yourself.

    +

    Some background info for the more curious of you: Version 1.5 of Better ListView was very fast. It was so fast because every item in the list had precisely the same size. Some operations, like hit testing, was done in constant time and no extra measurement of individual items was necessary. The new major 2.0 version of Better ListView supports items with variable sizes, and irregular layout consisting of grouped items. However, we observed that even in complex settings, there are just few “types” of items – for example, there are only three possible item sizes when using multi-line items with up to three lines of text. Our optimizations will thus be focused on taking advantage of this to reduce most expensive operations back to constant time complexity.

    +
    photo by Michael Roper

    photo by Michael Roper

    +]]>
    + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/feed/ + 0 +
    + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/listview/index.html b/public/blog/tag/listview/index.html new file mode 100644 index 0000000..2a13ca2 --- /dev/null +++ b/public/blog/tag/listview/index.html @@ -0,0 +1,232 @@ + + + + + + + +listview « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/tag/load/feed/index.html b/public/blog/tag/load/feed/index.html new file mode 100644 index 0000000..72807b6 --- /dev/null +++ b/public/blog/tag/load/feed/index.html @@ -0,0 +1,180 @@ + + + + load – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    + + How to Store Better ListView Content in a String (User Request) + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/ + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/#respond + Sat, 04 Aug 2012 00:03:49 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=796 + + Is it possible to store entire Better ListView content (items with hierarchy and sub-items, columns and groups) in a single string?

    +

    Better ListView already supports saving and loading its content using SaveContent and LoadContent methods. These methods support either XML or binary format.

    +

    I chose binary format for storing data in string  because it is more compact than XML. Binary representation (basically an array of bytes) can be converted to Base64 string. Loading the content from string work similarly, the steps are performed in opposite direction:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +// SAVE
    +// create MemoryStream to hold binary data
    +MemoryStream stream = new MemoryStream();
    +// store Better ListView content in memory stream
    +this.listView.SaveContentBinary(stream);
    +// copy content of MemoryStream to byte array
    +byte[] contentBinary = new byte[stream.Length];
    +stream.Seek(0, SeekOrigin.Begin);
    +// convert byte array to Base64 string
    +stream.Read(contentBinary, 0, (int)stream.Length); // move to beginning of the stream
    +string contentStringBase64 = Convert.ToBase64String(contentBinary);
    +// close stream
    +stream.Close();
    +stream.Dispose();

    +

    // CLEAR
    +this.listView.Clear();

    +

    // LOAD
    +// create MemoryStream to hold binary data
    +stream = new MemoryStream();
    +// convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64);
    +// write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length);
    +stream.Seek(0, SeekOrigin.Begin); // move to beginning of the stream
    +// load content of Better ListView from memory stream
    +this.listView.LoadContentBinary(stream);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +‘ SAVE
    +‘ create MemoryStream to hold binary data
    +Dim stream As New MemoryStream()
    +‘ store Better ListView content in memory stream
    +Me.listView.SaveContentBinary(stream)
    +‘ copy content of MemoryStream to byte array
    +Dim contentBinary As Byte() = New Byte(stream.Length – 1) {}
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ convert byte array to Base64 string
    +stream.Read(contentBinary, 0, CInt(stream.Length))
    +‘ move to beginning of the stream
    +Dim contentStringBase64 As String = Convert.ToBase64String(contentBinary)
    +‘ close stream
    +stream.Close()
    +stream.Dispose()

    +

    ‘ CLEAR
    +Me.listView.Clear()

    +

    ‘ LOAD
    +‘ create MemoryStream to hold binary data
    +stream = New MemoryStream()
    +‘ convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64)
    +‘ write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length)
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ move to beginning of the stream
    +‘ load content of Better ListView from memory stream
    +Me.listView.LoadContentBinary(stream)
    +[/vb]

    +

     

    +

    Although saving and loading data this way is convenient, please consider the following drawback:

    +
      +
    • Standard serialization mechanism of .NET is used for converting classes and structures to XML or binary representation – hence the serialized data may not be possible to deserialize on different version of Better ListView if any public members of the serialized class have been changed.
    • +
    • The generated string is very long (few kilobytes for just two items).
    • +
    • Lots of data are stored which are not related to content itself (e.g. item colors).
    • +
    • The serialized representation is considered read-only – any changes can cause problems with deserialization; if you really want flexible way of storing ListView content, consider building a model or data layer that supports storing the data you need the way you need.
    • +
    +

    On the other hand, using this way may be convenient when you want to transfer or copy ListView content between controls on even across application domain (Better ListView itself uses this mechanism to allow Drag and Drop between two applications – this “tour de force” kind of Drag and Drop is not avaiable in regular .NET ListView).

    +]]>
    + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/load/index.html b/public/blog/tag/load/index.html new file mode 100644 index 0000000..c7401ed --- /dev/null +++ b/public/blog/tag/load/index.html @@ -0,0 +1,214 @@ + + + + + + + +load « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/loading/feed/index.html b/public/blog/tag/loading/feed/index.html new file mode 100644 index 0000000..c6ef28a --- /dev/null +++ b/public/blog/tag/loading/feed/index.html @@ -0,0 +1,84 @@ + + + + loading – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/loading/index.html b/public/blog/tag/loading/index.html new file mode 100644 index 0000000..5aebf63 --- /dev/null +++ b/public/blog/tag/loading/index.html @@ -0,0 +1,212 @@ + + + + + + + +loading « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/luna/feed/index.html b/public/blog/tag/luna/feed/index.html new file mode 100644 index 0000000..5a2b808 --- /dev/null +++ b/public/blog/tag/luna/feed/index.html @@ -0,0 +1,64 @@ + + + + luna – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Windows Theme Support in Better ListView + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/#respond + Fri, 01 Jul 2011 22:46:55 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=287 + + Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    +]]>
    + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/luna/index.html b/public/blog/tag/luna/index.html new file mode 100644 index 0000000..008acd0 --- /dev/null +++ b/public/blog/tag/luna/index.html @@ -0,0 +1,212 @@ + + + + + + + +luna « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/mark/feed/index.html b/public/blog/tag/mark/feed/index.html new file mode 100644 index 0000000..769d867 --- /dev/null +++ b/public/blog/tag/mark/feed/index.html @@ -0,0 +1,141 @@ + + + + mark – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/mark/index.html b/public/blog/tag/mark/index.html new file mode 100644 index 0000000..4a91924 --- /dev/null +++ b/public/blog/tag/mark/index.html @@ -0,0 +1,212 @@ + + + + + + + +mark « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/matched/feed/index.html b/public/blog/tag/matched/feed/index.html new file mode 100644 index 0000000..1dd0a7c --- /dev/null +++ b/public/blog/tag/matched/feed/index.html @@ -0,0 +1,141 @@ + + + + matched – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/matched/index.html b/public/blog/tag/matched/index.html new file mode 100644 index 0000000..85dda2f --- /dev/null +++ b/public/blog/tag/matched/index.html @@ -0,0 +1,212 @@ + + + + + + + +matched « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/mental-work/feed/index.html b/public/blog/tag/mental-work/feed/index.html new file mode 100644 index 0000000..04804c1 --- /dev/null +++ b/public/blog/tag/mental-work/feed/index.html @@ -0,0 +1,151 @@ + + + + mental work – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/mental-work/index.html b/public/blog/tag/mental-work/index.html new file mode 100644 index 0000000..00efe3d --- /dev/null +++ b/public/blog/tag/mental-work/index.html @@ -0,0 +1,212 @@ + + + + + + + +mental work « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/migration/feed/index.html b/public/blog/tag/migration/feed/index.html new file mode 100644 index 0000000..a67225a --- /dev/null +++ b/public/blog/tag/migration/feed/index.html @@ -0,0 +1,73 @@ + + + + migration – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.10 released + http://www.componentowl.com/blog/better-listview-2-10-released/ + http://www.componentowl.com/blog/better-listview-2-10-released/#respond + Fri, 14 Oct 2011 16:57:54 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=373 + + A new version with major improvements, optimizations and fixes has been released! It addresses many suggestions provided by you, our valued customers.

    +

    Improved Performance

    +

    We put a considerable effort into optimizing Better ListView 2 to provide advanced features (e.g. hierarchical and multi-line items, collapsible groups) while still being swift and responsive.

    +

    The overall performance has greatly improved. Better ListView 2.1 can easily handle 10.000 items while still being very fast. The parts where improvements are best seen are:

    +
    +
      +
    • Adding many items to the list
    • +
    • Expanding/collapsing of hierarchical items
    • +
    • Resizing a column
    • +
    +
    We also added new options in the Performance property group, so you can easily switch between fast and powerful options.
    +
    +

    Samples in both C# and Visual Basic

    +

    We added easy to understand samples for both C# and Visual Basic.

    +

    You can simply follow a link from start menu to open the Visual Studio project for your favourite language, and play with all the features of Better ListView.

    +
    C# and VB Samples projects in Solution Explorer

    C# and VB Samples projects in Solution Explorer

    +

     

    +

    Extended Documentation

    +

    We added a Quick Start Tutorial to help you with setup, activation and integration of Better ListView in your projects, as well as many entirely new chapters in the documentation.

    +

    All code samples are from now on provided in both C# and Visual Basic to be easy to understand to both C# and VB.net developers.

    +

    Smoother migration from .NET ListView to Better ListView

    +

    Better ListView now contains all the constructor/method overloads and properties of the regular .NET ListView, so that for each member of .NET ListView there is an easily discoverable equivalent in Better ListView.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-10-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/migration/index.html b/public/blog/tag/migration/index.html new file mode 100644 index 0000000..da792d5 --- /dev/null +++ b/public/blog/tag/migration/index.html @@ -0,0 +1,212 @@ + + + + + + + +migration « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/mode/feed/index.html b/public/blog/tag/mode/feed/index.html new file mode 100644 index 0000000..34818a1 --- /dev/null +++ b/public/blog/tag/mode/feed/index.html @@ -0,0 +1,61 @@ + + + + mode – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Read-Only Mode in Better ListView + http://www.componentowl.com/blog/read-only-mode-in-better-listview/ + http://www.componentowl.com/blog/read-only-mode-in-better-listview/#respond + Fri, 27 Jan 2012 16:21:58 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=482 + + Better ListView 2.5 introduces a new boolean property called ReadOnly.

    +

    When set to true, the Better ListView does not respond to keyboard and mouse input. There are, however, some exceptions that make the Read-only mode different to the Disabled mode (when Enabled property is set to false).

    +

    When in Read-only mode, content of the Better ListView can be still scrolled (the scroll bars are enabled) and groups/items can be expanded/collapsed.

    +

    The difference between Disabled and Read-only can be seen on the following images:

    +
    Normal state

    Normal state

    +
    Disabled state

    Disabled state

    +
    Read-only state

    Read-only state

    +

     

    +

    As you can see, the Better ListView is displayed normally in Read-only mode, but the group header does not have a hot state (because cannot be focused). Items also cannot be focused or selected, but the expand buttons are still interactive.

    +

    The scroll bars would also be enabled and can be used, which is different from Disabled mode where everything is grayed and cannot be used.

    +]]>
    + http://www.componentowl.com/blog/read-only-mode-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/mode/index.html b/public/blog/tag/mode/index.html new file mode 100644 index 0000000..6c2e8e6 --- /dev/null +++ b/public/blog/tag/mode/index.html @@ -0,0 +1,212 @@ + + + + + + + +mode « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/mouse-wheel/feed/index.html b/public/blog/tag/mouse-wheel/feed/index.html new file mode 100644 index 0000000..ee5ebec --- /dev/null +++ b/public/blog/tag/mouse-wheel/feed/index.html @@ -0,0 +1,55 @@ + + + + mouse wheel – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Change List View Mouse Wheel Scroll Speed + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/ + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/#respond + Fri, 18 Mar 2011 18:22:44 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=189 + + Did you know that you can change the mouse wheel scroll speed of Better ListView?

    +

    Better ListView has property MouseWheelScrollExtent which is defined as “relative number of items to scroll for a single mouse wheel detent“.

    +

    What does it mean? Well, it basically defines by how many items will the list view scroll when you move the mouse wheel up or down. The default value of this property in version 1.51 is 2, so whenever you scroll up or down with your mouse wheel, the list view will move two items up or down.

    +

    You can set the MouseWheelScrollExtent to a larger value for faster scrolling, just like this:

    +

    BetterListView.MouseWheelScrollExtent := 3;

    +

    Now, every time you scroll, the list view will move by 3 items (which is similar to Windows Explorer, which usually moves by 3 items in the Details view).

    +]]>
    + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/mouse-wheel/index.html b/public/blog/tag/mouse-wheel/index.html new file mode 100644 index 0000000..2e0c9db --- /dev/null +++ b/public/blog/tag/mouse-wheel/index.html @@ -0,0 +1,212 @@ + + + + + + + +mouse wheel « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/mouse/feed/index.html b/public/blog/tag/mouse/feed/index.html new file mode 100644 index 0000000..77d1217 --- /dev/null +++ b/public/blog/tag/mouse/feed/index.html @@ -0,0 +1,180 @@ + + + + mouse – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    + + How to Change List View Mouse Wheel Scroll Speed + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/ + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/#respond + Fri, 18 Mar 2011 18:22:44 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=189 + + Did you know that you can change the mouse wheel scroll speed of Better ListView?

    +

    Better ListView has property MouseWheelScrollExtent which is defined as “relative number of items to scroll for a single mouse wheel detent“.

    +

    What does it mean? Well, it basically defines by how many items will the list view scroll when you move the mouse wheel up or down. The default value of this property in version 1.51 is 2, so whenever you scroll up or down with your mouse wheel, the list view will move two items up or down.

    +

    You can set the MouseWheelScrollExtent to a larger value for faster scrolling, just like this:

    +

    BetterListView.MouseWheelScrollExtent := 3;

    +

    Now, every time you scroll, the list view will move by 3 items (which is similar to Windows Explorer, which usually moves by 3 items in the Details view).

    +]]>
    + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/mouse/index.html b/public/blog/tag/mouse/index.html new file mode 100644 index 0000000..c4aea93 --- /dev/null +++ b/public/blog/tag/mouse/index.html @@ -0,0 +1,214 @@ + + + + + + + +mouse « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/multi-line/feed/index.html b/public/blog/tag/multi-line/feed/index.html new file mode 100644 index 0000000..79720f6 --- /dev/null +++ b/public/blog/tag/multi-line/feed/index.html @@ -0,0 +1,156 @@ + + + + multi-line – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How To: Dynamically Resize Focused Item + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/ + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/#respond + Thu, 22 Dec 2011 02:29:35 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=468 + + Better ListView 2.4.0 now supports setting MaximumTextLines property on every item and sub-item, so you can have multi-line items each with different number text lines:

    +
    Dynamic resizing of the focused item

    Dynamic resizing of the focused item

    +

    We also introduced FocusedItemChanged event, so that you can detect when focus has moved from one element (item / sub-item / group) to another.

    +

    These features can be combined to display only the focused item with more details to save space code of the FocusedItemChanged event handler may look like this:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +void ListViewFocusedItemChanged(object sender, BetterListViewFocusedItemChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (eventArgs.FocusedItemOld != null)
    + {
    + // set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1;
    + }

    +

    if (eventArgs.FocusedItemNew != null)
    + {
    + // set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Sub ListViewFocusedItemChanged(sender As Object, eventArgs As BetterListViewFocusedItemChangedEventArgs)
    + Dim ListView As BetterListView = DirectCast(sender, BetterListView)

    +

    ListView.BeginUpdate()

    +

    If eventArgs.FocusedItemOld IsNot Nothing Then
    + ‘ set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1
    + End If

    +

    If eventArgs.FocusedItemNew IsNot Nothing Then
    + ‘ set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3
    + End If

    +

    ListView.EndUpdate()
    +End Sub
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/feed/ + 0 +
    + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/multi-line/index.html b/public/blog/tag/multi-line/index.html new file mode 100644 index 0000000..b2133c3 --- /dev/null +++ b/public/blog/tag/multi-line/index.html @@ -0,0 +1,214 @@ + + + + + + + +multi-line « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/multi/feed/index.html b/public/blog/tag/multi/feed/index.html new file mode 100644 index 0000000..448bf90 --- /dev/null +++ b/public/blog/tag/multi/feed/index.html @@ -0,0 +1,67 @@ + + + + multi – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Multi-Line Text In ListView + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/#respond + Thu, 24 Nov 2011 16:42:44 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=450 + + Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    +]]>
    + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/multi/index.html b/public/blog/tag/multi/index.html new file mode 100644 index 0000000..b257c82 --- /dev/null +++ b/public/blog/tag/multi/index.html @@ -0,0 +1,212 @@ + + + + + + + +multi « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/multiline-items/feed/index.html b/public/blog/tag/multiline-items/feed/index.html new file mode 100644 index 0000000..b1ad393 --- /dev/null +++ b/public/blog/tag/multiline-items/feed/index.html @@ -0,0 +1,67 @@ + + + + multiline items – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Multi-Line Text In ListView + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/#respond + Thu, 24 Nov 2011 16:42:44 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=450 + + Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    +]]>
    + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/multiline-items/index.html b/public/blog/tag/multiline-items/index.html new file mode 100644 index 0000000..4019da2 --- /dev/null +++ b/public/blog/tag/multiline-items/index.html @@ -0,0 +1,212 @@ + + + + + + + +multiline items « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/multiline/feed/index.html b/public/blog/tag/multiline/feed/index.html new file mode 100644 index 0000000..bb9e2e4 --- /dev/null +++ b/public/blog/tag/multiline/feed/index.html @@ -0,0 +1,194 @@ + + + + multiline – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How To: Dynamically Resize Focused Item + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/ + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/#respond + Thu, 22 Dec 2011 02:29:35 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=468 + + Better ListView 2.4.0 now supports setting MaximumTextLines property on every item and sub-item, so you can have multi-line items each with different number text lines:

    +
    Dynamic resizing of the focused item

    Dynamic resizing of the focused item

    +

    We also introduced FocusedItemChanged event, so that you can detect when focus has moved from one element (item / sub-item / group) to another.

    +

    These features can be combined to display only the focused item with more details to save space code of the FocusedItemChanged event handler may look like this:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +void ListViewFocusedItemChanged(object sender, BetterListViewFocusedItemChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    listView.BeginUpdate();

    +

    if (eventArgs.FocusedItemOld != null)
    + {
    + // set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1;
    + }

    +

    if (eventArgs.FocusedItemNew != null)
    + {
    + // set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3;
    + }

    +

    listView.EndUpdate();
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Sub ListViewFocusedItemChanged(sender As Object, eventArgs As BetterListViewFocusedItemChangedEventArgs)
    + Dim ListView As BetterListView = DirectCast(sender, BetterListView)

    +

    ListView.BeginUpdate()

    +

    If eventArgs.FocusedItemOld IsNot Nothing Then
    + ‘ set single line of text for currenly unfocused item
    + eventArgs.FocusedItemOld.MaximumTextLines = 1
    + End If

    +

    If eventArgs.FocusedItemNew IsNot Nothing Then
    + ‘ set three lines of text for currenly focused item
    + eventArgs.FocusedItemNew.MaximumTextLines = 3
    + End If

    +

    ListView.EndUpdate()
    +End Sub
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-dynamically-resize-focused-item/feed/ + 0 +
    + + Displaying Multi-Line Text In ListView + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/#respond + Thu, 24 Nov 2011 16:42:44 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=450 + + Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    +]]>
    + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/feed/ + 0 +
    + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/multiline/index.html b/public/blog/tag/multiline/index.html new file mode 100644 index 0000000..220d06a --- /dev/null +++ b/public/blog/tag/multiline/index.html @@ -0,0 +1,216 @@ + + + + + + + +multiline « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/native-look/feed/index.html b/public/blog/tag/native-look/feed/index.html new file mode 100644 index 0000000..de9676f --- /dev/null +++ b/public/blog/tag/native-look/feed/index.html @@ -0,0 +1,71 @@ + + + + native look – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Work in Progress: “Groups” / “Item Hierarchy” Features + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond + Fri, 25 Mar 2011 23:11:00 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=204 + + We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    +]]>
    + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/native-look/index.html b/public/blog/tag/native-look/index.html new file mode 100644 index 0000000..277bc5b --- /dev/null +++ b/public/blog/tag/native-look/index.html @@ -0,0 +1,212 @@ + + + + + + + +native look « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/new-release/feed/index.html b/public/blog/tag/new-release/feed/index.html new file mode 100644 index 0000000..800f759 --- /dev/null +++ b/public/blog/tag/new-release/feed/index.html @@ -0,0 +1,53 @@ + + + + new release – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 1.52 released + http://www.componentowl.com/blog/better-listview-1-52-released/ + http://www.componentowl.com/blog/better-listview-1-52-released/#respond + Tue, 29 Mar 2011 16:21:14 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=213 + + Another minor release with many fixes and some new features.

    +

    See what’s new in Better ListView 1.52.

    +

    Download the new version.

    +

    We are still working on the new major features (Item hierarchy, groups) as described here. These new features are near completion.

    +]]>
    + http://www.componentowl.com/blog/better-listview-1-52-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/new-release/index.html b/public/blog/tag/new-release/index.html new file mode 100644 index 0000000..396922b --- /dev/null +++ b/public/blog/tag/new-release/index.html @@ -0,0 +1,212 @@ + + + + + + + +new release « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/newline/feed/index.html b/public/blog/tag/newline/feed/index.html new file mode 100644 index 0000000..ceda9b9 --- /dev/null +++ b/public/blog/tag/newline/feed/index.html @@ -0,0 +1,67 @@ + + + + newline – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Multi-Line Text In ListView + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/#respond + Thu, 24 Nov 2011 16:42:44 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=450 + + Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    +]]>
    + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/newline/index.html b/public/blog/tag/newline/index.html new file mode 100644 index 0000000..c4a07bf --- /dev/null +++ b/public/blog/tag/newline/index.html @@ -0,0 +1,212 @@ + + + + + + + +newline « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/newlines/feed/index.html b/public/blog/tag/newlines/feed/index.html new file mode 100644 index 0000000..68c1a8f --- /dev/null +++ b/public/blog/tag/newlines/feed/index.html @@ -0,0 +1,67 @@ + + + + newlines – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Multi-Line Text In ListView + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/#respond + Thu, 24 Nov 2011 16:42:44 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=450 + + Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    +]]>
    + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/newlines/index.html b/public/blog/tag/newlines/index.html new file mode 100644 index 0000000..47b4ab8 --- /dev/null +++ b/public/blog/tag/newlines/index.html @@ -0,0 +1,212 @@ + + + + + + + +newlines « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/nodes/feed/index.html b/public/blog/tag/nodes/feed/index.html new file mode 100644 index 0000000..88535e8 --- /dev/null +++ b/public/blog/tag/nodes/feed/index.html @@ -0,0 +1,94 @@ + + + + nodes – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/nodes/index.html b/public/blog/tag/nodes/index.html new file mode 100644 index 0000000..c4f3973 --- /dev/null +++ b/public/blog/tag/nodes/index.html @@ -0,0 +1,212 @@ + + + + + + + +nodes « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/non-selectable-list-view-items/feed/index.html b/public/blog/tag/non-selectable-list-view-items/feed/index.html new file mode 100644 index 0000000..d0f6c29 --- /dev/null +++ b/public/blog/tag/non-selectable-list-view-items/feed/index.html @@ -0,0 +1,62 @@ + + + + non-selectable list view items – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Non-selectable Items in Better ListView + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/ + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/#respond + Wed, 25 Jan 2012 12:08:17 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=476 + + One of our users asked us whether it would be possible to make specific Better ListView items to be non-selectable because he wanted to have them in “disabled” state.

    +

    We quickly realized that it might be very useful, in some cases, to have items with informative character only. Some of such non-selectable items can even be used as separators with the help of owner drawing:

    +
    Non-selectable items

    Non-selectable items

    +

    The non-selectable items behave just as their name suggests. They cannot be focused (they are skipped when jumping from item to item with arrow keys) and do not respond to drag selection:

    +
    Non-selectable items

    Non-selectable items

    +

    It is very easy to set-up such items. Simply set BetterListViewItem.Selectable property to false.

    +

    The non-selectable items are displayed in the same way as normal items. They can contain child items (which are selectable until their Selectable property is set to false) and can be interactively expanded/collapsed.

    +

    If you need to have all items non-selectable to use Better ListView for display-only, consider using the Read-only mode, which has been also introduced in version 2.5.

    +]]>
    + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/non-selectable-list-view-items/index.html b/public/blog/tag/non-selectable-list-view-items/index.html new file mode 100644 index 0000000..7908688 --- /dev/null +++ b/public/blog/tag/non-selectable-list-view-items/index.html @@ -0,0 +1,212 @@ + + + + + + + +non-selectable list view items « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/non-selectable/feed/index.html b/public/blog/tag/non-selectable/feed/index.html new file mode 100644 index 0000000..d9b8b62 --- /dev/null +++ b/public/blog/tag/non-selectable/feed/index.html @@ -0,0 +1,89 @@ + + + + non-selectable – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Non-selectable Items in Better ListView + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/ + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/#respond + Wed, 25 Jan 2012 12:08:17 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=476 + + One of our users asked us whether it would be possible to make specific Better ListView items to be non-selectable because he wanted to have them in “disabled” state.

    +

    We quickly realized that it might be very useful, in some cases, to have items with informative character only. Some of such non-selectable items can even be used as separators with the help of owner drawing:

    +
    Non-selectable items

    Non-selectable items

    +

    The non-selectable items behave just as their name suggests. They cannot be focused (they are skipped when jumping from item to item with arrow keys) and do not respond to drag selection:

    +
    Non-selectable items

    Non-selectable items

    +

    It is very easy to set-up such items. Simply set BetterListViewItem.Selectable property to false.

    +

    The non-selectable items are displayed in the same way as normal items. They can contain child items (which are selectable until their Selectable property is set to false) and can be interactively expanded/collapsed.

    +

    If you need to have all items non-selectable to use Better ListView for display-only, consider using the Read-only mode, which has been also introduced in version 2.5.

    +]]>
    + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/feed/ + 0 +
    + + Combined Items in Better ListView + http://www.componentowl.com/blog/combined-items-in-better-listview/ + http://www.componentowl.com/blog/combined-items-in-better-listview/#respond + Thu, 05 Jan 2012 09:46:49 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=478 + + Hierarchical (tree-like) items can be used to support non-selectable child items in Better ListView 2.5.0 and newer. We call these Combined items as they are combined with its children to look and behave as single item:

    +
    Combined items

    Combined items

    +

    Combined item has selection ranging over all its child items. This can be seen when the combined item is selected or focused:

    +
    Combined items - selection

    Combined items - selection

    +

    Child items of the combined item are still interactive, though not focusable/selectable. They can contain further children (be expanded/collapsed with expand button as well) and can contain interactive check boxes. The visual part of combined child items is also fully available, to the child items can contain images and even sub-items.

    +

    To set-up combined items, simply set AllowSelectChildItems property to false on all items you wish to combine.

    +

    Combined items can be used in any level of item hierarchy.

    +]]>
    + http://www.componentowl.com/blog/combined-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/non-selectable/index.html b/public/blog/tag/non-selectable/index.html new file mode 100644 index 0000000..b710009 --- /dev/null +++ b/public/blog/tag/non-selectable/index.html @@ -0,0 +1,214 @@ + + + + + + + +non-selectable « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/nonselectable/feed/index.html b/public/blog/tag/nonselectable/feed/index.html new file mode 100644 index 0000000..16d5c6f --- /dev/null +++ b/public/blog/tag/nonselectable/feed/index.html @@ -0,0 +1,89 @@ + + + + nonselectable – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Non-selectable Items in Better ListView + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/ + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/#respond + Wed, 25 Jan 2012 12:08:17 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=476 + + One of our users asked us whether it would be possible to make specific Better ListView items to be non-selectable because he wanted to have them in “disabled” state.

    +

    We quickly realized that it might be very useful, in some cases, to have items with informative character only. Some of such non-selectable items can even be used as separators with the help of owner drawing:

    +
    Non-selectable items

    Non-selectable items

    +

    The non-selectable items behave just as their name suggests. They cannot be focused (they are skipped when jumping from item to item with arrow keys) and do not respond to drag selection:

    +
    Non-selectable items

    Non-selectable items

    +

    It is very easy to set-up such items. Simply set BetterListViewItem.Selectable property to false.

    +

    The non-selectable items are displayed in the same way as normal items. They can contain child items (which are selectable until their Selectable property is set to false) and can be interactively expanded/collapsed.

    +

    If you need to have all items non-selectable to use Better ListView for display-only, consider using the Read-only mode, which has been also introduced in version 2.5.

    +]]>
    + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/feed/ + 0 +
    + + Combined Items in Better ListView + http://www.componentowl.com/blog/combined-items-in-better-listview/ + http://www.componentowl.com/blog/combined-items-in-better-listview/#respond + Thu, 05 Jan 2012 09:46:49 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=478 + + Hierarchical (tree-like) items can be used to support non-selectable child items in Better ListView 2.5.0 and newer. We call these Combined items as they are combined with its children to look and behave as single item:

    +
    Combined items

    Combined items

    +

    Combined item has selection ranging over all its child items. This can be seen when the combined item is selected or focused:

    +
    Combined items - selection

    Combined items - selection

    +

    Child items of the combined item are still interactive, though not focusable/selectable. They can contain further children (be expanded/collapsed with expand button as well) and can contain interactive check boxes. The visual part of combined child items is also fully available, to the child items can contain images and even sub-items.

    +

    To set-up combined items, simply set AllowSelectChildItems property to false on all items you wish to combine.

    +

    Combined items can be used in any level of item hierarchy.

    +]]>
    + http://www.componentowl.com/blog/combined-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/nonselectable/index.html b/public/blog/tag/nonselectable/index.html new file mode 100644 index 0000000..27675a8 --- /dev/null +++ b/public/blog/tag/nonselectable/index.html @@ -0,0 +1,214 @@ + + + + + + + +nonselectable « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/odd/feed/index.html b/public/blog/tag/odd/feed/index.html new file mode 100644 index 0000000..e47ea09 --- /dev/null +++ b/public/blog/tag/odd/feed/index.html @@ -0,0 +1,64 @@ + + + + odd – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Alternating Rows in Better ListView + http://www.componentowl.com/blog/alternating-rows-in-better-listview/ + http://www.componentowl.com/blog/alternating-rows-in-better-listview/#respond + Tue, 22 Apr 2014 22:38:15 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=888 + + Alternating Rows

    Alternating Rows

    +

    Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.

    +

    Simply add DrawItemBackground event handler and fill background on odd/even items:

    +

     

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    + if ((eventArgs.Item.Index & 1) == 1)
    + {
    + eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
    + }
    +}
    +[/csharp]

    +]]>
    + http://www.componentowl.com/blog/alternating-rows-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/odd/index.html b/public/blog/tag/odd/index.html new file mode 100644 index 0000000..8c38875 --- /dev/null +++ b/public/blog/tag/odd/index.html @@ -0,0 +1,212 @@ + + + + + + + +odd « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/optimization/feed/index.html b/public/blog/tag/optimization/feed/index.html new file mode 100644 index 0000000..18fd57b --- /dev/null +++ b/public/blog/tag/optimization/feed/index.html @@ -0,0 +1,62 @@ + + + + optimization – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Coming soon: Better ListView 2.1 Optimized for Performance + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/ + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/#respond + Mon, 05 Sep 2011 16:33:45 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=348 + + Better ListView 2 comes with many hot features, like groups and item hierarchy. Great features, unfortunately, often come at the price of decreased performance. However, we want to have Better ListView both feature-rich and fast.

    +

    Some users noticed a performance drop when working with large number of items (say 10 000+). Our top priority for version 2.1 is the overall optimization of Better ListView. Several optimizations have already been made in the recent updates (column resizing and thumbnail images), but we have to go further. You can expect Better ListView to be much snappier in the upcoming 2.1 update. The optimizations will cover these areas:

    +
      +
    • Faster collection operations (adding, removing, sorting) of large number of items
    • +
    • Faster expand/collapse of groups and items
    • +
    • Faster column resizing with multi-line items
    • +
    +

    We will also take a look on smoother Visual Studio integration, so you can see Better ListView ready in toolbox just after installation (we have to deal with Visual Studio Packages, which is quite an esoteric topic). If Better ListView doesn’t currently appear in your Visual Studio toolbox automatically, you can just right-click the toolbox window, and use “Choose Items” to add the DLL file yourself.

    +

    Some background info for the more curious of you: Version 1.5 of Better ListView was very fast. It was so fast because every item in the list had precisely the same size. Some operations, like hit testing, was done in constant time and no extra measurement of individual items was necessary. The new major 2.0 version of Better ListView supports items with variable sizes, and irregular layout consisting of grouped items. However, we observed that even in complex settings, there are just few “types” of items – for example, there are only three possible item sizes when using multi-line items with up to three lines of text. Our optimizations will thus be focused on taking advantage of this to reduce most expensive operations back to constant time complexity.

    +
    photo by Michael Roper

    photo by Michael Roper

    +]]>
    + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/optimization/index.html b/public/blog/tag/optimization/index.html new file mode 100644 index 0000000..2a65455 --- /dev/null +++ b/public/blog/tag/optimization/index.html @@ -0,0 +1,212 @@ + + + + + + + +optimization « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/over/feed/index.html b/public/blog/tag/over/feed/index.html new file mode 100644 index 0000000..8f3e53b --- /dev/null +++ b/public/blog/tag/over/feed/index.html @@ -0,0 +1,151 @@ + + + + over – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/over/index.html b/public/blog/tag/over/index.html new file mode 100644 index 0000000..6a6142f --- /dev/null +++ b/public/blog/tag/over/index.html @@ -0,0 +1,212 @@ + + + + + + + +over « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/owner/feed/index.html b/public/blog/tag/owner/feed/index.html new file mode 100644 index 0000000..225bd9a --- /dev/null +++ b/public/blog/tag/owner/feed/index.html @@ -0,0 +1,508 @@ + + + + owner – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    + + Better ListView Tip: How to Draw Custom Selection + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/ + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/#comments + Wed, 12 Sep 2012 15:43:12 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=808 + + Customized item selection.

    Customized item selection.

    +

     

    +

    By default, Better ListView uses system theme for drawing selections.

    +

    To draw custom selection, you can use owner drawing capabilities of Better ListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +class CustomListView : BetterListView
    +{
    + protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
    + brushSelection.Dispose();
    + }
    + }

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + eventArgs.DrawSelection = false;

    +

    base.OnDrawItem(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
    + brushSelection.Dispose()
    + End If
    + End Sub

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + eventArgs.DrawSelection = False

    +

    MyBase.OnDrawItem(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
    + End If
    + End Sub
    +End Class
    +[/vb]

    +

    In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

    +

    The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

    +

    The OnDrawItem method contains two things:

    +
      +
    1. Turn off  default selection.
    2. +
    3. Draw custom selection border if the item is selected.
    4. +
    +

    Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

    +

    Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

    +

    To allow these states, considerable coding need to be done.

    +

    In case you need this level of customization, please contact us for Custom Coding support.

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/feed/ + 2 +
    + + Hiding Items in Better ListView + http://www.componentowl.com/blog/hiding-items-in-better-listview/ + http://www.componentowl.com/blog/hiding-items-in-better-listview/#respond + Mon, 06 Feb 2012 16:23:15 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=546 + + We currently introduced a BetterListViewItem.Visible property to allow hiding items visually, but keeping then in the Items collection:

    +
    Making items invisible

    Making items invisible

    +

    The above image shows two groups of items. The first groups uses hiding of items with the Visible property, while the second group simply turns off drawing of ceratin items.

    +

    The first approach is useful when you need to hide item as if it is removed, but keep it actually within Items collection.

    +

    The second approach need to create new control inheriting from BetterListView, overrride the OnDrawItem method and set properties like BetterListViewDrawItemEventArgs.DrawImage to false or simply not call the base implementation of OnDrawItem.

    +

    The second (owner drawing) approach is useful when you need just to switch off display of item without changing the item layout.

    +]]>
    + http://www.componentowl.com/blog/hiding-items-in-better-listview/feed/ + 0 +
    + + How to Display Items in Custom States + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/ + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/#respond + Tue, 15 Nov 2011 15:24:25 +0000 + + + + + + + + + + + http://www.componentowl.com/blog/?p=398 + + One of our customers recently asked us if it is possible in Better ListView to draw item highlighted even when the control loses focus. This is an interesting and useful feature, so we implemented it right away.

    +

    Owner drawing in Better ListView 2.3.0 and higher allows you to draw elements (column headers, items, sub-items and groups) in any state you wish (hot, selected, focused and any combination of the three).

    +

    For example, we would like to highlight several items in one Better ListView depending on hovered item in other Better ListView:

    +
    Better ListView shows multiple hot items

    Better ListView shows multiple hot items

    +

    Items can be also be drawn as if the control is focused, enabled or disabled. This feature can be applied when you wish to display items in highlighted state even if Better ListView is not focused:

    +
    Better ListView keeps selected items highlighted

    Better ListView keeps selected items highlighted

    +

    We implemented the first sample (showing mulitple hot items) by inheriting from BetterListView, making a new class called HotListView. The implementation is very simple:

    +

     

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class HotListView : BetterListView
    +{
    +public HashSet HotItems
    +{
    +get
    +{
    +return this.hotItems;
    +}
    +set
    +{
    +this.hotItems = value;

    +

    Refresh();
    +}
    +}

    +

    private HashSethotItems = new HashSet();

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    +{
    +if (this.hotItems.Contains(eventArgs.Item.Index))
    +{
    +eventArgs.ItemStateInfo = new BetterListViewItemStateInfo(
    +eventArgs.ItemStateInfo.ItemState | BetterListViewItemState.Hot,
    +eventArgs.ItemStateInfo.ExpandButtonState,
    +eventArgs.ItemStateInfo.CheckBoxState);
    +}

    +

    base.OnDrawItem(eventArgs);
    +}
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class HotListView
    +Inherits BetterListView
    +Public Property HotItems() As HashSet(Of Integer)
    +Get
    +Return Me.m_hotItems
    +End Get
    +Set
    +Me.m_hotItems = value

    +

    Refresh()
    +End Set
    +End Property

    +

    Private m_hotItems As New HashSet(Of Integer)()

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    +If Me.m_hotItems.Contains(eventArgs.Item.Index) Then
    +eventArgs.ItemStateInfo = New BetterListViewItemStateInfo(eventArgs.ItemStateInfo.ItemState Or BetterListViewItemState.Hot, eventArgs.ItemStateInfo.ExpandButtonState, eventArgs.ItemStateInfo.CheckBoxState)
    +End If

    +

    MyBase.OnDrawItem(eventArgs)
    +End Sub
    +End Class
    +[/vb]

    +

     

    +

    The HotListView contains one property called HotItems. When drawing items (OnDrawItem method), it looks whether the item is in the HotItems set. If so, item drawing state is altered so that the item will be drawn as hot.

    +

    The modified ListView for second sample is even simpler. We call it HighlightListView:

    +

     

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class HighlightListView : BetterListView
    +{
    +protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    +{
    +if ((eventArgs.ItemStateInfo.ItemState & BetterListViewItemState.Selected) == BetterListViewItemState.Selected)
    +{
    +// if the item is selected, always draw control as if it is focused
    +eventArgs.DrawFocused = true;
    +}

    +

    base.OnDrawItem(eventArgs);
    +}
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class HighlightListView
    +Inherits BetterListView
    +Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    +If (eventArgs.ItemStateInfo.ItemState And BetterListViewItemState.Selected) = BetterListViewItemState.Selected Then
    +‘ if the item is selected, always draw control as if it is focused
    +eventArgs.DrawFocused = True
    +End If

    +

    MyBase.OnDrawItem(eventArgs)
    +End Sub
    +End Class
    +[/vb]

    +

     

    +

    This modification only draws selected items as if the control is always focused.

    +

    UPDATE: From Better ListView 2.3.1, you can simply use HideSelectionMode property to keep selected items highlighted.

    +]]>
    + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/owner/index.html b/public/blog/tag/owner/index.html new file mode 100644 index 0000000..297c21d --- /dev/null +++ b/public/blog/tag/owner/index.html @@ -0,0 +1,220 @@ + + + + + + + +owner « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + + +

    Posts Tagged ‘owner’

    + + + + + +
    + + + +
    +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/tag/ownerdraw/feed/index.html b/public/blog/tag/ownerdraw/feed/index.html new file mode 100644 index 0000000..2d6857a --- /dev/null +++ b/public/blog/tag/ownerdraw/feed/index.html @@ -0,0 +1,183 @@ + + + + ownerdraw – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    + + Hiding Items in Better ListView + http://www.componentowl.com/blog/hiding-items-in-better-listview/ + http://www.componentowl.com/blog/hiding-items-in-better-listview/#respond + Mon, 06 Feb 2012 16:23:15 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=546 + + We currently introduced a BetterListViewItem.Visible property to allow hiding items visually, but keeping then in the Items collection:

    +
    Making items invisible

    Making items invisible

    +

    The above image shows two groups of items. The first groups uses hiding of items with the Visible property, while the second group simply turns off drawing of ceratin items.

    +

    The first approach is useful when you need to hide item as if it is removed, but keep it actually within Items collection.

    +

    The second approach need to create new control inheriting from BetterListView, overrride the OnDrawItem method and set properties like BetterListViewDrawItemEventArgs.DrawImage to false or simply not call the base implementation of OnDrawItem.

    +

    The second (owner drawing) approach is useful when you need just to switch off display of item without changing the item layout.

    +]]>
    + http://www.componentowl.com/blog/hiding-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/ownerdraw/index.html b/public/blog/tag/ownerdraw/index.html new file mode 100644 index 0000000..32bfdc7 --- /dev/null +++ b/public/blog/tag/ownerdraw/index.html @@ -0,0 +1,214 @@ + + + + + + + +ownerdraw « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/ownerdrawing/feed/index.html b/public/blog/tag/ownerdrawing/feed/index.html new file mode 100644 index 0000000..639d7ad --- /dev/null +++ b/public/blog/tag/ownerdrawing/feed/index.html @@ -0,0 +1,151 @@ + + + + ownerdrawing – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/ownerdrawing/index.html b/public/blog/tag/ownerdrawing/index.html new file mode 100644 index 0000000..f62978e --- /dev/null +++ b/public/blog/tag/ownerdrawing/index.html @@ -0,0 +1,212 @@ + + + + + + + +ownerdrawing « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/ownerdrawn/feed/index.html b/public/blog/tag/ownerdrawn/feed/index.html new file mode 100644 index 0000000..17bcae5 --- /dev/null +++ b/public/blog/tag/ownerdrawn/feed/index.html @@ -0,0 +1,238 @@ + + + + ownerdrawn – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Make Items Fading on Edges in Better ListView + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond + Tue, 05 Mar 2013 15:45:22 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=868 + + Fading Edges in Better ListView

    +

    I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.

    +

    You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class FadedListView : BetterListView
    +{
    + ///

    + + /// Default size of the fading gradient.
    + ///
    +

    private const int FadingSize = 64;

    +

    public CustomListView()
    + {
    + // this is required because we will draw outside item boundaries
    + OptimizedInvalidation = false;
    + }

    +

    protected override void DrawingRedrawCore(Graphics graphics)
    + {
    + base.DrawingRedrawCore(graphics);

    +

    // get boundaries of items (this excludes column headers and scroll bars)
    + Rectangle rectContent = BoundsContent;

    +

    // get size of the gradient
    + int fadingSize = Math.Min(
    + FadingSize,
    + rectContent.Height >> 1);

    +

    // get boundaries of the gradents
    + Rectangle rectFadingTop = new Rectangle(
    + rectContent.Left,
    + rectContent.Top,
    + rectContent.Width,
    + fadingSize);

    +

    Rectangle rectFadingBottom = new Rectangle(
    + rectContent.Left,
    + rectContent.Bottom – fadingSize,
    + rectContent.Width,
    + fadingSize);

    +

    // make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1);
    + rectFadingBottom.Inflate(1, 1);

    +

    Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
    + Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);

    +

    // deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1);
    + rectFadingBottom.Inflate(-1, -1);

    +

    // draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop);
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom);

    +

    // cleanup
    + brushFadingTop.Dispose();
    + brushFadingBottom.Dispose();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class CustomListView
    + Inherits BetterListView
    + ”’

    + + ”’ Default size of the fading gradient.
    + ”’
    +

    Private Const FadingSize As Integer = 64

    +

    Public Sub New()
    + ‘ this is required because we will draw outside item boundaries
    + OptimizedInvalidation = False
    + End Sub

    +

    Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
    + MyBase.DrawingRedrawCore(graphics)

    +

    ‘ get boundaries of items (this excludes column headers and scroll bars)
    + Dim rectContent As Rectangle = BoundsContent

    +

    ‘ get size of the gradient
    + Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)

    +

    ‘ get boundaries of the gradents
    + Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)

    +

    Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)

    +

    ‘ make boundaries larger to avoid rounding errors in gradient brushes
    + rectFadingTop.Inflate(1, 1)
    + rectFadingBottom.Inflate(1, 1)

    +

    Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
    + Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)

    +

    ‘ deflate the gradient boundaries back
    + rectFadingTop.Inflate(-1, -1)
    + rectFadingBottom.Inflate(-1, -1)

    +

    ‘ draw the gradients
    + graphics.FillRectangle(brushFadingTop, rectFadingTop)
    + graphics.FillRectangle(brushFadingBottom, rectFadingBottom)

    +

    ‘ cleanup
    + brushFadingTop.Dispose()
    + brushFadingBottom.Dispose()
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ + 0 +
    + + Better ListView Tip: How to Draw Custom Selection + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/ + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/#comments + Wed, 12 Sep 2012 15:43:12 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=808 + + Customized item selection.

    Customized item selection.

    +

     

    +

    By default, Better ListView uses system theme for drawing selections.

    +

    To draw custom selection, you can use owner drawing capabilities of Better ListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +class CustomListView : BetterListView
    +{
    + protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
    + brushSelection.Dispose();
    + }
    + }

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + eventArgs.DrawSelection = false;

    +

    base.OnDrawItem(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
    + brushSelection.Dispose()
    + End If
    + End Sub

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + eventArgs.DrawSelection = False

    +

    MyBase.OnDrawItem(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
    + End If
    + End Sub
    +End Class
    +[/vb]

    +

    In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

    +

    The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

    +

    The OnDrawItem method contains two things:

    +
      +
    1. Turn off  default selection.
    2. +
    3. Draw custom selection border if the item is selected.
    4. +
    +

    Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

    +

    Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

    +

    To allow these states, considerable coding need to be done.

    +

    In case you need this level of customization, please contact us for Custom Coding support.

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/feed/ + 2 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/ownerdrawn/index.html b/public/blog/tag/ownerdrawn/index.html new file mode 100644 index 0000000..d788c5a --- /dev/null +++ b/public/blog/tag/ownerdrawn/index.html @@ -0,0 +1,214 @@ + + + + + + + +ownerdrawn « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/padding/feed/index.html b/public/blog/tag/padding/feed/index.html new file mode 100644 index 0000000..f52735f --- /dev/null +++ b/public/blog/tag/padding/feed/index.html @@ -0,0 +1,105 @@ + + + + padding – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Spacing between Items in Details View + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/ + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/#respond + Tue, 13 Mar 2012 22:53:09 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=753 + + Better ListView 2.6 newly supports custom spacing between items in Details view:

    +
    Custom Spacing between Items

    Custom Spacing between Items

    +

    This property has been recently available in other views, but Details view was exception since its selections needed to be treated in different way: They overlap by 1 pixel so that the double border is avoided in neighboring selections:

    +
    1 px overlap of items

    1 px overlap of items

    +

    We have resolved this to get proper behavior with custom spacings and now the spacing can be set the same way as in any other view:

    +

    Simply set LayoutItemsCurrent.ElementOuterPadding to have custom horizontal and vertical padding between items.

    +

    You can set this specifically for Details view by refering to property LayoutItemsDetails or LayoutItemsDetailsColumns (Details view with columns).

    +]]>
    + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/feed/ + 0 +
    + + Displaying Thumbnails with Borders and Shadows + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/ + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/#respond + Mon, 14 Feb 2011 19:17:14 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=103 + + We’ve just released Better ListView version 1.50 with some new features – thumbnails view, image borders support (inc. shadows), and more.

    +

    Our great inspiration for designing Better ListView is nothing less than the mighty Windows Explorer. This file manager uses obviously much more powerful control that the regular .NET list-view alone is.

    +

    It supports some extra views, line Contents and Extra Large Icons. It is also possible to adjust image size by rolling a mouse wheel while holding Control key.

    +

    Better ListView has the capability of displaying item icons with arbitrary sizes, but we also extended it with one extra view: Thumbnails:

    +
    Thumbnails Sample

    Thumbnails Sample

    +

    This view aligns items in the center while keeping constant spacing between items. Thumbnails also keep just single line of text for compactness. On the other hand, LargeIcon view varies horizontal space between items to fill client area evenly and breaks long text into several lines.

    +

    The constant spacing is inspired by various photo managers, where image thumbnails are better viewed side-by-side (and the view looks also more organized).

    +

    Image thumbnails also look better with some kind border or frame. We added this new feature in Better ListView 1.5 and it works in all views. There are several pre-defined types of borders, but user can draw his own:

    +
      +
    • None – simply no border at all
    • +
    • Single – single line border
    • +
    • SingleOffset – single line with a spacing between image and the border
    • +
    • SymmetricShadow – smooth shadow around image
    • +
    • DropShadow – smooth shadow on the right bottom part of the image
    • +
    +

    Thumbnails use DropShadow by default, but it can be adjusted for every view separately. One can also adjust thickness of the border/shadow and define custom spacing around image.

    +

    Take a look at one possible setting:

    +
    Image Borders

    Image Borders

    +

    This is SingleOffset border of width 3 pixels. Notice that also column header images can have its borders (these are SymmetricShadow).

    +

    When the border is defined and image size should be kept the same, some spacing have to be added around image. You can adjust this spacing to draw you own borders or any additional graphics (such as overlay icons). Here is an example –

    +
    Thumbnail with Extra Icons

    Thumbnail with Extra Icons

    +

    Download Better ListView

    +

    You can download Better ListView and play with it yourself.

    +]]>
    + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/padding/index.html b/public/blog/tag/padding/index.html new file mode 100644 index 0000000..3c2e005 --- /dev/null +++ b/public/blog/tag/padding/index.html @@ -0,0 +1,214 @@ + + + + + + + +padding « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/per-line/feed/index.html b/public/blog/tag/per-line/feed/index.html new file mode 100644 index 0000000..868d65a --- /dev/null +++ b/public/blog/tag/per-line/feed/index.html @@ -0,0 +1,110 @@ + + + + per-line – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Customize Label Editing (Embedded) Control for Each Line in Better ListView + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/ + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/#comments + Wed, 04 Apr 2012 10:33:49 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=771 + + Embedded controls for label edit in Better ListView can be customized not only for every column, but even for every row.

    +

    This is not a new feature, but would be nice to mention that you can possibly have a different custom editing control for every cell…

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +{
    + // show editing controls in the second column
    + if (eventArgs.SubItem.Index == 1)
    + {
    + // show my custom control on the first row
    + if (eventArgs.SubItem.Item.Index == 0)
    + {
    + return (new DocumentAccessConrol());
    + }

    +

    // show my custom control on the second row
    + if (eventArgs.SubItem.Item.Index == 1)
    + {
    + return (new BetterListViewComboBoxEmbeddedControl());
    + }

    +

    // show my custom control on the third row
    + if (eventArgs.SubItem.Item.Index == 2)
    + {
    + return (new BetterListViewTextBoxEmbeddedControl());
    + }
    + }

    +

    return null;
    +}
    +[/csharp]

    +

     

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Function ListViewRequestEmbeddedControl(ByVal sender As Object, ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    + As IBetterListViewEmbeddedControl

    +

    ‘ show editing controls in the second column
    + If eventArgs.SubItem.Index = 1 Then

    +

    ‘ show my custom control on the first row
    + If eventArgs.SubItem.Item.Index = 0 Then
    + Return (New DocumentAccessConrol())
    + End If

    +

    ‘ show my custom control on the second row
    + If eventArgs.SubItem.Item.Index = 1 Then
    + Return (New BetterListViewComboBoxEmbeddedControl())
    + End If

    +

    ‘ show my custom control on the third row
    + If eventArgs.SubItem.Item.Index = 2 Then
    + Return (New BetterListViewTextBoxEmbeddedControl())
    + End If

    +

    End If

    +

    Return Nothing

    +

    End Function
    +[/vb]

    +

     

    +

    And there is the result:

    +
    Custom Embedded Control on the First Line

    Custom Embedded Control on the First Line

    +

     

    +
    TextBox Control on the Third Line

    TextBox Control on the Third Line

    +]]>
    + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/feed/ + 2 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/per-line/index.html b/public/blog/tag/per-line/index.html new file mode 100644 index 0000000..9c10447 --- /dev/null +++ b/public/blog/tag/per-line/index.html @@ -0,0 +1,212 @@ + + + + + + + +per-line « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/performance/feed/index.html b/public/blog/tag/performance/feed/index.html new file mode 100644 index 0000000..f8cefa9 --- /dev/null +++ b/public/blog/tag/performance/feed/index.html @@ -0,0 +1,106 @@ + + + + performance – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.10 released + http://www.componentowl.com/blog/better-listview-2-10-released/ + http://www.componentowl.com/blog/better-listview-2-10-released/#respond + Fri, 14 Oct 2011 16:57:54 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=373 + + A new version with major improvements, optimizations and fixes has been released! It addresses many suggestions provided by you, our valued customers.

    +

    Improved Performance

    +

    We put a considerable effort into optimizing Better ListView 2 to provide advanced features (e.g. hierarchical and multi-line items, collapsible groups) while still being swift and responsive.

    +

    The overall performance has greatly improved. Better ListView 2.1 can easily handle 10.000 items while still being very fast. The parts where improvements are best seen are:

    +
    +
      +
    • Adding many items to the list
    • +
    • Expanding/collapsing of hierarchical items
    • +
    • Resizing a column
    • +
    +
    We also added new options in the Performance property group, so you can easily switch between fast and powerful options.
    +
    +

    Samples in both C# and Visual Basic

    +

    We added easy to understand samples for both C# and Visual Basic.

    +

    You can simply follow a link from start menu to open the Visual Studio project for your favourite language, and play with all the features of Better ListView.

    +
    C# and VB Samples projects in Solution Explorer

    C# and VB Samples projects in Solution Explorer

    +

     

    +

    Extended Documentation

    +

    We added a Quick Start Tutorial to help you with setup, activation and integration of Better ListView in your projects, as well as many entirely new chapters in the documentation.

    +

    All code samples are from now on provided in both C# and Visual Basic to be easy to understand to both C# and VB.net developers.

    +

    Smoother migration from .NET ListView to Better ListView

    +

    Better ListView now contains all the constructor/method overloads and properties of the regular .NET ListView, so that for each member of .NET ListView there is an easily discoverable equivalent in Better ListView.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-10-released/feed/ + 0 +
    + + Coming soon: Better ListView 2.1 Optimized for Performance + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/ + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/#respond + Mon, 05 Sep 2011 16:33:45 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=348 + + Better ListView 2 comes with many hot features, like groups and item hierarchy. Great features, unfortunately, often come at the price of decreased performance. However, we want to have Better ListView both feature-rich and fast.

    +

    Some users noticed a performance drop when working with large number of items (say 10 000+). Our top priority for version 2.1 is the overall optimization of Better ListView. Several optimizations have already been made in the recent updates (column resizing and thumbnail images), but we have to go further. You can expect Better ListView to be much snappier in the upcoming 2.1 update. The optimizations will cover these areas:

    +
      +
    • Faster collection operations (adding, removing, sorting) of large number of items
    • +
    • Faster expand/collapse of groups and items
    • +
    • Faster column resizing with multi-line items
    • +
    +

    We will also take a look on smoother Visual Studio integration, so you can see Better ListView ready in toolbox just after installation (we have to deal with Visual Studio Packages, which is quite an esoteric topic). If Better ListView doesn’t currently appear in your Visual Studio toolbox automatically, you can just right-click the toolbox window, and use “Choose Items” to add the DLL file yourself.

    +

    Some background info for the more curious of you: Version 1.5 of Better ListView was very fast. It was so fast because every item in the list had precisely the same size. Some operations, like hit testing, was done in constant time and no extra measurement of individual items was necessary. The new major 2.0 version of Better ListView supports items with variable sizes, and irregular layout consisting of grouped items. However, we observed that even in complex settings, there are just few “types” of items – for example, there are only three possible item sizes when using multi-line items with up to three lines of text. Our optimizations will thus be focused on taking advantage of this to reduce most expensive operations back to constant time complexity.

    +
    photo by Michael Roper

    photo by Michael Roper

    +]]>
    + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/performance/index.html b/public/blog/tag/performance/index.html new file mode 100644 index 0000000..61cee00 --- /dev/null +++ b/public/blog/tag/performance/index.html @@ -0,0 +1,214 @@ + + + + + + + +performance « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/prevent-item-selection-in-list-view/feed/index.html b/public/blog/tag/prevent-item-selection-in-list-view/feed/index.html new file mode 100644 index 0000000..0986ef3 --- /dev/null +++ b/public/blog/tag/prevent-item-selection-in-list-view/feed/index.html @@ -0,0 +1,62 @@ + + + + prevent item selection in list view – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Non-selectable Items in Better ListView + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/ + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/#respond + Wed, 25 Jan 2012 12:08:17 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=476 + + One of our users asked us whether it would be possible to make specific Better ListView items to be non-selectable because he wanted to have them in “disabled” state.

    +

    We quickly realized that it might be very useful, in some cases, to have items with informative character only. Some of such non-selectable items can even be used as separators with the help of owner drawing:

    +
    Non-selectable items

    Non-selectable items

    +

    The non-selectable items behave just as their name suggests. They cannot be focused (they are skipped when jumping from item to item with arrow keys) and do not respond to drag selection:

    +
    Non-selectable items

    Non-selectable items

    +

    It is very easy to set-up such items. Simply set BetterListViewItem.Selectable property to false.

    +

    The non-selectable items are displayed in the same way as normal items. They can contain child items (which are selectable until their Selectable property is set to false) and can be interactively expanded/collapsed.

    +

    If you need to have all items non-selectable to use Better ListView for display-only, consider using the Read-only mode, which has been also introduced in version 2.5.

    +]]>
    + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/prevent-item-selection-in-list-view/index.html b/public/blog/tag/prevent-item-selection-in-list-view/index.html new file mode 100644 index 0000000..a83059e --- /dev/null +++ b/public/blog/tag/prevent-item-selection-in-list-view/index.html @@ -0,0 +1,212 @@ + + + + + + + +prevent item selection in list view « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/preview/feed/index.html b/public/blog/tag/preview/feed/index.html new file mode 100644 index 0000000..8e40117 --- /dev/null +++ b/public/blog/tag/preview/feed/index.html @@ -0,0 +1,85 @@ + + + + preview – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more) + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/ + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/#respond + Tue, 03 May 2011 09:28:55 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=232 + groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.]]> + Hierarchical items in two groups

    Hierarchical items in two groups

    +

    We are currently working hard on finishing Better ListView version 2.0 which will add new features: Support for groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.

    +

    We expect to release this upgrade in about a month. It will be a free upgrade for current and new users.

    +

    Groups

    +

    Groups in Better ListView have comparable capabilities as other Better ListView elements (column headers, items, sub-items). For example, you can adjust the foreground/background colors, font, image – and owner drawing is possible as well.

    +

    You can even include images into group headers (as you can see in the preview above), which is not possible in .NET ListView.

    +

    Groups are collapsible by default and the expand button can be switched off on each group individually.

    +

    Here are groups combined with Tile view (the second group is collapsed):

    +
    Groups with Tile view

    Groups with Tile view

    +

    The previous figure displays vertically oriented groups, but Better ListView also support horizontally oriented groups in the List mode:

    +
    Groups with List view

    Groups with List view

    +

    We put special effort to mimic the group display and behavior of Windows Explorer. The group headers can display all of the 15 group header states available in Windows visual style and their display is governed by the same logic as in the ListView counterpart.

    +

    The group headers always look perfect and native, right out of the box. You don’t need to tweak anything.

    +

    Item Hierarchy

    +
    +
    +

    +
    Items with hierarchy

    Items with hierarchy

    +

    +
    +
    +
    +

    This works in the similar way as in the standard TreeView control. Each item (or node) has property called ChildItems which can be filled with new BetterListViewItem instances. SubItems collection can still be used in either items and child-items (child items are treated in the very same way as their parents).

    +

    Item hierarchy can be combined with Groups feature as seen in the first preview.

    +

    Multi-Line Items

    +
    Multi-line items

    Multi-line items

    +

    A simple setting of item layout (MaximumTextLines property) allows breaking item text into several lines (up to the specified value). When the text is longer than MaximumTextLines, then the default trimming method is used (one from the TextTrimming enumeration: None, TrimCharacter, TrimWord, EllipsisCharacter, EllipsisWord, EllipsisPath).

    +

    Multi-line text can be used in every view and also in column headers.

    +

    Another New Features

    +

    There are also bunch of new minor features including:

    +

    Adjustable paddings – Every element part (e.g. item check box, group image…) contains customizable spaces at each side, so the user can easily create space where he needs and customize items/column headers/group headers to the finest detail.

    +

    Focusing sub-items – Items, group headers and even sub-items can be keyfocused. User can now invoke label editing or scroll to any “cell” in the Details-with-columns view solely with keyboard.

    +

    IEnumerable implementations –  BetterListView, BetterListViewGroup and BetterListViewItem implements IEnumerable interface for iterating through the whole item hierarchy, so using recursion to traverse child items is not necessary.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/preview/index.html b/public/blog/tag/preview/index.html new file mode 100644 index 0000000..2b583a0 --- /dev/null +++ b/public/blog/tag/preview/index.html @@ -0,0 +1,212 @@ + + + + + + + +preview « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/productivity/feed/index.html b/public/blog/tag/productivity/feed/index.html new file mode 100644 index 0000000..95c7c7e --- /dev/null +++ b/public/blog/tag/productivity/feed/index.html @@ -0,0 +1,151 @@ + + + + productivity – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/productivity/index.html b/public/blog/tag/productivity/index.html new file mode 100644 index 0000000..eaa175d --- /dev/null +++ b/public/blog/tag/productivity/index.html @@ -0,0 +1,212 @@ + + + + + + + +productivity « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/programming-productivity/feed/index.html b/public/blog/tag/programming-productivity/feed/index.html new file mode 100644 index 0000000..6e7f015 --- /dev/null +++ b/public/blog/tag/programming-productivity/feed/index.html @@ -0,0 +1,151 @@ + + + + programming productivity – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/programming-productivity/index.html b/public/blog/tag/programming-productivity/index.html new file mode 100644 index 0000000..d152ece --- /dev/null +++ b/public/blog/tag/programming-productivity/index.html @@ -0,0 +1,212 @@ + + + + + + + +programming productivity « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/progress/feed/index.html b/public/blog/tag/progress/feed/index.html new file mode 100644 index 0000000..e69f37a --- /dev/null +++ b/public/blog/tag/progress/feed/index.html @@ -0,0 +1,104 @@ + + + + progress – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Coming soon: Better ListView 2.1 Optimized for Performance + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/ + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/#respond + Mon, 05 Sep 2011 16:33:45 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=348 + + Better ListView 2 comes with many hot features, like groups and item hierarchy. Great features, unfortunately, often come at the price of decreased performance. However, we want to have Better ListView both feature-rich and fast.

    +

    Some users noticed a performance drop when working with large number of items (say 10 000+). Our top priority for version 2.1 is the overall optimization of Better ListView. Several optimizations have already been made in the recent updates (column resizing and thumbnail images), but we have to go further. You can expect Better ListView to be much snappier in the upcoming 2.1 update. The optimizations will cover these areas:

    +
      +
    • Faster collection operations (adding, removing, sorting) of large number of items
    • +
    • Faster expand/collapse of groups and items
    • +
    • Faster column resizing with multi-line items
    • +
    +

    We will also take a look on smoother Visual Studio integration, so you can see Better ListView ready in toolbox just after installation (we have to deal with Visual Studio Packages, which is quite an esoteric topic). If Better ListView doesn’t currently appear in your Visual Studio toolbox automatically, you can just right-click the toolbox window, and use “Choose Items” to add the DLL file yourself.

    +

    Some background info for the more curious of you: Version 1.5 of Better ListView was very fast. It was so fast because every item in the list had precisely the same size. Some operations, like hit testing, was done in constant time and no extra measurement of individual items was necessary. The new major 2.0 version of Better ListView supports items with variable sizes, and irregular layout consisting of grouped items. However, we observed that even in complex settings, there are just few “types” of items – for example, there are only three possible item sizes when using multi-line items with up to three lines of text. Our optimizations will thus be focused on taking advantage of this to reduce most expensive operations back to constant time complexity.

    +
    photo by Michael Roper

    photo by Michael Roper

    +]]>
    + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/feed/ + 0 +
    + + Work in Progress: “Groups” / “Item Hierarchy” Features + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond + Fri, 25 Mar 2011 23:11:00 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=204 + + We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    +]]>
    + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/progress/index.html b/public/blog/tag/progress/index.html new file mode 100644 index 0000000..578eeb5 --- /dev/null +++ b/public/blog/tag/progress/index.html @@ -0,0 +1,214 @@ + + + + + + + +progress « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/radio/feed/index.html b/public/blog/tag/radio/feed/index.html new file mode 100644 index 0000000..43c4066 --- /dev/null +++ b/public/blog/tag/radio/feed/index.html @@ -0,0 +1,66 @@ + + + + radio – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/radio/index.html b/public/blog/tag/radio/index.html new file mode 100644 index 0000000..94f0a37 --- /dev/null +++ b/public/blog/tag/radio/index.html @@ -0,0 +1,212 @@ + + + + + + + +radio « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/radios/feed/index.html b/public/blog/tag/radios/feed/index.html new file mode 100644 index 0000000..88a894f --- /dev/null +++ b/public/blog/tag/radios/feed/index.html @@ -0,0 +1,66 @@ + + + + radios – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/radios/index.html b/public/blog/tag/radios/index.html new file mode 100644 index 0000000..38c2ce4 --- /dev/null +++ b/public/blog/tag/radios/index.html @@ -0,0 +1,212 @@ + + + + + + + +radios « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/read-only/feed/index.html b/public/blog/tag/read-only/feed/index.html new file mode 100644 index 0000000..6efc01c --- /dev/null +++ b/public/blog/tag/read-only/feed/index.html @@ -0,0 +1,94 @@ + + + + read-only – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Read-Only Mode in Better ListView + http://www.componentowl.com/blog/read-only-mode-in-better-listview/ + http://www.componentowl.com/blog/read-only-mode-in-better-listview/#respond + Fri, 27 Jan 2012 16:21:58 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=482 + + Better ListView 2.5 introduces a new boolean property called ReadOnly.

    +

    When set to true, the Better ListView does not respond to keyboard and mouse input. There are, however, some exceptions that make the Read-only mode different to the Disabled mode (when Enabled property is set to false).

    +

    When in Read-only mode, content of the Better ListView can be still scrolled (the scroll bars are enabled) and groups/items can be expanded/collapsed.

    +

    The difference between Disabled and Read-only can be seen on the following images:

    +
    Normal state

    Normal state

    +
    Disabled state

    Disabled state

    +
    Read-only state

    Read-only state

    +

     

    +

    As you can see, the Better ListView is displayed normally in Read-only mode, but the group header does not have a hot state (because cannot be focused). Items also cannot be focused or selected, but the expand buttons are still interactive.

    +

    The scroll bars would also be enabled and can be used, which is different from Disabled mode where everything is grayed and cannot be used.

    +]]>
    + http://www.componentowl.com/blog/read-only-mode-in-better-listview/feed/ + 0 +
    + + Non-selectable Items in Better ListView + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/ + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/#respond + Wed, 25 Jan 2012 12:08:17 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=476 + + One of our users asked us whether it would be possible to make specific Better ListView items to be non-selectable because he wanted to have them in “disabled” state.

    +

    We quickly realized that it might be very useful, in some cases, to have items with informative character only. Some of such non-selectable items can even be used as separators with the help of owner drawing:

    +
    Non-selectable items

    Non-selectable items

    +

    The non-selectable items behave just as their name suggests. They cannot be focused (they are skipped when jumping from item to item with arrow keys) and do not respond to drag selection:

    +
    Non-selectable items

    Non-selectable items

    +

    It is very easy to set-up such items. Simply set BetterListViewItem.Selectable property to false.

    +

    The non-selectable items are displayed in the same way as normal items. They can contain child items (which are selectable until their Selectable property is set to false) and can be interactively expanded/collapsed.

    +

    If you need to have all items non-selectable to use Better ListView for display-only, consider using the Read-only mode, which has been also introduced in version 2.5.

    +]]>
    + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/read-only/index.html b/public/blog/tag/read-only/index.html new file mode 100644 index 0000000..a19970b --- /dev/null +++ b/public/blog/tag/read-only/index.html @@ -0,0 +1,214 @@ + + + + + + + +read-only « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/readonly/feed/index.html b/public/blog/tag/readonly/feed/index.html new file mode 100644 index 0000000..3554df4 --- /dev/null +++ b/public/blog/tag/readonly/feed/index.html @@ -0,0 +1,94 @@ + + + + readonly – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Read-Only Mode in Better ListView + http://www.componentowl.com/blog/read-only-mode-in-better-listview/ + http://www.componentowl.com/blog/read-only-mode-in-better-listview/#respond + Fri, 27 Jan 2012 16:21:58 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=482 + + Better ListView 2.5 introduces a new boolean property called ReadOnly.

    +

    When set to true, the Better ListView does not respond to keyboard and mouse input. There are, however, some exceptions that make the Read-only mode different to the Disabled mode (when Enabled property is set to false).

    +

    When in Read-only mode, content of the Better ListView can be still scrolled (the scroll bars are enabled) and groups/items can be expanded/collapsed.

    +

    The difference between Disabled and Read-only can be seen on the following images:

    +
    Normal state

    Normal state

    +
    Disabled state

    Disabled state

    +
    Read-only state

    Read-only state

    +

     

    +

    As you can see, the Better ListView is displayed normally in Read-only mode, but the group header does not have a hot state (because cannot be focused). Items also cannot be focused or selected, but the expand buttons are still interactive.

    +

    The scroll bars would also be enabled and can be used, which is different from Disabled mode where everything is grayed and cannot be used.

    +]]>
    + http://www.componentowl.com/blog/read-only-mode-in-better-listview/feed/ + 0 +
    + + Non-selectable Items in Better ListView + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/ + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/#respond + Wed, 25 Jan 2012 12:08:17 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=476 + + One of our users asked us whether it would be possible to make specific Better ListView items to be non-selectable because he wanted to have them in “disabled” state.

    +

    We quickly realized that it might be very useful, in some cases, to have items with informative character only. Some of such non-selectable items can even be used as separators with the help of owner drawing:

    +
    Non-selectable items

    Non-selectable items

    +

    The non-selectable items behave just as their name suggests. They cannot be focused (they are skipped when jumping from item to item with arrow keys) and do not respond to drag selection:

    +
    Non-selectable items

    Non-selectable items

    +

    It is very easy to set-up such items. Simply set BetterListViewItem.Selectable property to false.

    +

    The non-selectable items are displayed in the same way as normal items. They can contain child items (which are selectable until their Selectable property is set to false) and can be interactively expanded/collapsed.

    +

    If you need to have all items non-selectable to use Better ListView for display-only, consider using the Read-only mode, which has been also introduced in version 2.5.

    +]]>
    + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/readonly/index.html b/public/blog/tag/readonly/index.html new file mode 100644 index 0000000..d04b578 --- /dev/null +++ b/public/blog/tag/readonly/index.html @@ -0,0 +1,214 @@ + + + + + + + +readonly « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/refresh/feed/index.html b/public/blog/tag/refresh/feed/index.html new file mode 100644 index 0000000..4e6141c --- /dev/null +++ b/public/blog/tag/refresh/feed/index.html @@ -0,0 +1,64 @@ + + + + refresh – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Windows Theme Support in Better ListView + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/#respond + Fri, 01 Jul 2011 22:46:55 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=287 + + Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    +]]>
    + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/refresh/index.html b/public/blog/tag/refresh/index.html new file mode 100644 index 0000000..49b227f --- /dev/null +++ b/public/blog/tag/refresh/index.html @@ -0,0 +1,212 @@ + + + + + + + +refresh « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/relaxing-when-working-on-computer/feed/index.html b/public/blog/tag/relaxing-when-working-on-computer/feed/index.html new file mode 100644 index 0000000..749ef09 --- /dev/null +++ b/public/blog/tag/relaxing-when-working-on-computer/feed/index.html @@ -0,0 +1,151 @@ + + + + relaxing when working on computer – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/relaxing-when-working-on-computer/index.html b/public/blog/tag/relaxing-when-working-on-computer/index.html new file mode 100644 index 0000000..c4f315f --- /dev/null +++ b/public/blog/tag/relaxing-when-working-on-computer/index.html @@ -0,0 +1,212 @@ + + + + + + + +relaxing when working on computer « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/rename/feed/index.html b/public/blog/tag/rename/feed/index.html new file mode 100644 index 0000000..8b1ce2f --- /dev/null +++ b/public/blog/tag/rename/feed/index.html @@ -0,0 +1,107 @@ + + + + rename – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom label edit: How to rename file names without extension in Better ListView + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/ + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/#respond + Thu, 20 Dec 2012 17:42:14 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=831 + +

    +

    Let’s suppose you want to display files with extensions in Better ListView, but allow user to rename just the file name, leaving the file extension intact after the editing.

    +

    The code for this is very simple. Just turn on label editing and handle two events: BeforeLabelEdit and AfterLabelEditCancel:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +betterListView.LabelEdit = true;

    +

    betterListView.BeforeLabelEdit += BetterListViewBeforeLabelEdit;
    +betterListView.AfterLabelEditCancel += BetterListViewAfterLabelEditCancel;

    +

    +

    void BetterListViewBeforeLabelEdit(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // keep only file name in the modified label
    + string labelNew = Path.GetFileNameWithoutExtension(labelOriginal);

    +

    eventArgs.Label = labelNew;
    +}

    +

    void BetterListViewAfterLabelEditCancel(object sender, BetterListViewLabelEditCancelEventArgs eventArgs)
    +{
    + string labelOriginal = eventArgs.Label;

    +

    // add extension when editing is complete
    + string labelNew = String.Concat(
    + labelOriginal,
    + Path.GetExtension(eventArgs.SubItem.Text));

    +

    eventArgs.Label = labelNew;
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +BetterListView.LabelEdit = True

    +

    AddHandler Me.betterListView.BeforeLabelEdit, AddressOf BetterListViewBeforeLabelEdit
    +AddHandler Me.betterListView.AfterLabelEditCancel, AddressOf BetterListViewAfterLabelEditCancel

    +

    +

    Private Sub BetterListViewBeforeLabelEdit(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ keep only file name in the modified label
    + Dim labelNew As String = Path.GetFileNameWithoutExtension(labelOriginal)

    +

    eventArgs.Label = labelNew
    +End Sub

    +

    Private Sub BetterListViewAfterLabelEditCancel(sender As Object, eventArgs As BetterListViewLabelEditCancelEventArgs)
    + Dim labelOriginal As String = eventArgs.Label

    +

    ‘ add extension when editing is complete
    + Dim labelNew As String = [String].Concat(labelOriginal, Path.GetExtension(eventArgs.SubItem.Text))

    +

    eventArgs.Label = labelNew
    +End Sub
    +[/vb]

    +

    Naturally, this feature can be used not only for file names, but whenever you would like to edit different view on the data then the displayed one.

    +

    Full version of Better ListView supports even custom embedded editing controls and you have complete control over the label editing process.

    +]]>
    + http://www.componentowl.com/blog/custom-label-edit-how-to-rename-file-names-without-extension-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/rename/index.html b/public/blog/tag/rename/index.html new file mode 100644 index 0000000..a151600 --- /dev/null +++ b/public/blog/tag/rename/index.html @@ -0,0 +1,212 @@ + + + + + + + +rename « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/reorder/feed/index.html b/public/blog/tag/reorder/feed/index.html new file mode 100644 index 0000000..d7996d2 --- /dev/null +++ b/public/blog/tag/reorder/feed/index.html @@ -0,0 +1,69 @@ + + + + reorder – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + List-View Drag and Drop Item Reorder (Sort) + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/ + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/#respond + Tue, 07 Jun 2011 11:29:04 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=260 + + Reordering items in list view control using drag and drop is very tricky. Implementation of item reorder requires multiple issues to be solved:

    +
      +
    • Initialization of the drag & drop
    • +
    • Insertion mark that previews where will be the dragged item moved
    • +
    • The actual reordering of the items (custom code might be needed)
    • +
    • Support of multiple drag drop effects (copy, move, link)
    • +
    • It should not interfere with external drag and drop outside of the listview control
    • +
    • It should not interfere with internal drag and drop into items.
    • +
    • Reorder of multiple items (including non-continuous selection)
    • +
    +

    Our Better ListView control supports drag and drop item reordering out of the box. Zero code is needed – all you have to do is to set the property BetterListViewItemReorderMode to Enabled.

    +

    It works just like this:

    +

    Item drag and drop reorder

    +

    Item drag and drop reorder

    +

    You can just download and install Better ListView, and start using it right away. It can do everything the regular .NET listview component can, and much more.

    +

    See more in the Drag Drop Sample that is included with Better ListView. It includes source code.

    +]]>
    + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/reorder/index.html b/public/blog/tag/reorder/index.html new file mode 100644 index 0000000..495b2fb --- /dev/null +++ b/public/blog/tag/reorder/index.html @@ -0,0 +1,212 @@ + + + + + + + +reorder « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/reordering/feed/index.html b/public/blog/tag/reordering/feed/index.html new file mode 100644 index 0000000..6adeaf0 --- /dev/null +++ b/public/blog/tag/reordering/feed/index.html @@ -0,0 +1,69 @@ + + + + reordering – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + List-View Drag and Drop Item Reorder (Sort) + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/ + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/#respond + Tue, 07 Jun 2011 11:29:04 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=260 + + Reordering items in list view control using drag and drop is very tricky. Implementation of item reorder requires multiple issues to be solved:

    +
      +
    • Initialization of the drag & drop
    • +
    • Insertion mark that previews where will be the dragged item moved
    • +
    • The actual reordering of the items (custom code might be needed)
    • +
    • Support of multiple drag drop effects (copy, move, link)
    • +
    • It should not interfere with external drag and drop outside of the listview control
    • +
    • It should not interfere with internal drag and drop into items.
    • +
    • Reorder of multiple items (including non-continuous selection)
    • +
    +

    Our Better ListView control supports drag and drop item reordering out of the box. Zero code is needed – all you have to do is to set the property BetterListViewItemReorderMode to Enabled.

    +

    It works just like this:

    +

    Item drag and drop reorder

    +

    Item drag and drop reorder

    +

    You can just download and install Better ListView, and start using it right away. It can do everything the regular .NET listview component can, and much more.

    +

    See more in the Drag Drop Sample that is included with Better ListView. It includes source code.

    +]]>
    + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/reordering/index.html b/public/blog/tag/reordering/index.html new file mode 100644 index 0000000..b2ededb --- /dev/null +++ b/public/blog/tag/reordering/index.html @@ -0,0 +1,212 @@ + + + + + + + +reordering « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/right/feed/index.html b/public/blog/tag/right/feed/index.html new file mode 100644 index 0000000..214af5a --- /dev/null +++ b/public/blog/tag/right/feed/index.html @@ -0,0 +1,61 @@ + + + + right – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Right-aligned Images in Better ListView + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/ + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/#respond + Thu, 19 Apr 2012 19:15:13 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=780 + + Better ListView 2.9.0 now supports more customizable image alignment. For example, images can be aligned on the right part of item:

    +
    Right-aligned Images

    Right-aligned Images

    +

    The alignment can be set separately on every sub-item (using AlignImageHorizontal and AlignImageVertical properties).

    +

    Moreover, the right-aligned images can be used in column headers and groups:

    +
    Group image alignment

    Group image alignment

    +

    The alignment of images is similar to that of text. Every image has its frame, which can be possibly larger than the image itself. In such case, the image needs to be further aligned within the frame. This has been done automatically by centering the image within frame, but now you have full control over the alignment.

    +]]>
    + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/right/index.html b/public/blog/tag/right/index.html new file mode 100644 index 0000000..3311ac6 --- /dev/null +++ b/public/blog/tag/right/index.html @@ -0,0 +1,212 @@ + + + + + + + +right « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/rows/feed/index.html b/public/blog/tag/rows/feed/index.html new file mode 100644 index 0000000..0c62fe2 --- /dev/null +++ b/public/blog/tag/rows/feed/index.html @@ -0,0 +1,64 @@ + + + + rows – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Alternating Rows in Better ListView + http://www.componentowl.com/blog/alternating-rows-in-better-listview/ + http://www.componentowl.com/blog/alternating-rows-in-better-listview/#respond + Tue, 22 Apr 2014 22:38:15 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=888 + + Alternating Rows

    Alternating Rows

    +

    Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.

    +

    Simply add DrawItemBackground event handler and fill background on odd/even items:

    +

     

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    + if ((eventArgs.Item.Index & 1) == 1)
    + {
    + eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
    + }
    +}
    +[/csharp]

    +]]>
    + http://www.componentowl.com/blog/alternating-rows-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/rows/index.html b/public/blog/tag/rows/index.html new file mode 100644 index 0000000..1fce0ae --- /dev/null +++ b/public/blog/tag/rows/index.html @@ -0,0 +1,212 @@ + + + + + + + +rows « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/runtime/feed/index.html b/public/blog/tag/runtime/feed/index.html new file mode 100644 index 0000000..8bebb9d --- /dev/null +++ b/public/blog/tag/runtime/feed/index.html @@ -0,0 +1,64 @@ + + + + runtime – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Windows Theme Support in Better ListView + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/#respond + Fri, 01 Jul 2011 22:46:55 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=287 + + Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    +]]>
    + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/runtime/index.html b/public/blog/tag/runtime/index.html new file mode 100644 index 0000000..34956ed --- /dev/null +++ b/public/blog/tag/runtime/index.html @@ -0,0 +1,212 @@ + + + + + + + +runtime « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/save/feed/index.html b/public/blog/tag/save/feed/index.html new file mode 100644 index 0000000..2b99115 --- /dev/null +++ b/public/blog/tag/save/feed/index.html @@ -0,0 +1,125 @@ + + + + save – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Store Better ListView Content in a String (User Request) + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/ + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/#respond + Sat, 04 Aug 2012 00:03:49 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=796 + + Is it possible to store entire Better ListView content (items with hierarchy and sub-items, columns and groups) in a single string?

    +

    Better ListView already supports saving and loading its content using SaveContent and LoadContent methods. These methods support either XML or binary format.

    +

    I chose binary format for storing data in string  because it is more compact than XML. Binary representation (basically an array of bytes) can be converted to Base64 string. Loading the content from string work similarly, the steps are performed in opposite direction:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +// SAVE
    +// create MemoryStream to hold binary data
    +MemoryStream stream = new MemoryStream();
    +// store Better ListView content in memory stream
    +this.listView.SaveContentBinary(stream);
    +// copy content of MemoryStream to byte array
    +byte[] contentBinary = new byte[stream.Length];
    +stream.Seek(0, SeekOrigin.Begin);
    +// convert byte array to Base64 string
    +stream.Read(contentBinary, 0, (int)stream.Length); // move to beginning of the stream
    +string contentStringBase64 = Convert.ToBase64String(contentBinary);
    +// close stream
    +stream.Close();
    +stream.Dispose();

    +

    // CLEAR
    +this.listView.Clear();

    +

    // LOAD
    +// create MemoryStream to hold binary data
    +stream = new MemoryStream();
    +// convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64);
    +// write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length);
    +stream.Seek(0, SeekOrigin.Begin); // move to beginning of the stream
    +// load content of Better ListView from memory stream
    +this.listView.LoadContentBinary(stream);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +‘ SAVE
    +‘ create MemoryStream to hold binary data
    +Dim stream As New MemoryStream()
    +‘ store Better ListView content in memory stream
    +Me.listView.SaveContentBinary(stream)
    +‘ copy content of MemoryStream to byte array
    +Dim contentBinary As Byte() = New Byte(stream.Length – 1) {}
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ convert byte array to Base64 string
    +stream.Read(contentBinary, 0, CInt(stream.Length))
    +‘ move to beginning of the stream
    +Dim contentStringBase64 As String = Convert.ToBase64String(contentBinary)
    +‘ close stream
    +stream.Close()
    +stream.Dispose()

    +

    ‘ CLEAR
    +Me.listView.Clear()

    +

    ‘ LOAD
    +‘ create MemoryStream to hold binary data
    +stream = New MemoryStream()
    +‘ convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64)
    +‘ write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length)
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ move to beginning of the stream
    +‘ load content of Better ListView from memory stream
    +Me.listView.LoadContentBinary(stream)
    +[/vb]

    +

     

    +

    Although saving and loading data this way is convenient, please consider the following drawback:

    +
      +
    • Standard serialization mechanism of .NET is used for converting classes and structures to XML or binary representation – hence the serialized data may not be possible to deserialize on different version of Better ListView if any public members of the serialized class have been changed.
    • +
    • The generated string is very long (few kilobytes for just two items).
    • +
    • Lots of data are stored which are not related to content itself (e.g. item colors).
    • +
    • The serialized representation is considered read-only – any changes can cause problems with deserialization; if you really want flexible way of storing ListView content, consider building a model or data layer that supports storing the data you need the way you need.
    • +
    +

    On the other hand, using this way may be convenient when you want to transfer or copy ListView content between controls on even across application domain (Better ListView itself uses this mechanism to allow Drag and Drop between two applications – this “tour de force” kind of Drag and Drop is not avaiable in regular .NET ListView).

    +]]>
    + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/save/index.html b/public/blog/tag/save/index.html new file mode 100644 index 0000000..9164942 --- /dev/null +++ b/public/blog/tag/save/index.html @@ -0,0 +1,212 @@ + + + + + + + +save « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/scroll/feed/index.html b/public/blog/tag/scroll/feed/index.html new file mode 100644 index 0000000..49d39a8 --- /dev/null +++ b/public/blog/tag/scroll/feed/index.html @@ -0,0 +1,70 @@ + + + + scroll – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/scroll/index.html b/public/blog/tag/scroll/index.html new file mode 100644 index 0000000..dc000c8 --- /dev/null +++ b/public/blog/tag/scroll/index.html @@ -0,0 +1,212 @@ + + + + + + + +scroll « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/scrollbar/feed/index.html b/public/blog/tag/scrollbar/feed/index.html new file mode 100644 index 0000000..276b8ae --- /dev/null +++ b/public/blog/tag/scrollbar/feed/index.html @@ -0,0 +1,70 @@ + + + + scrollbar – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/scrollbar/index.html b/public/blog/tag/scrollbar/index.html new file mode 100644 index 0000000..73387dc --- /dev/null +++ b/public/blog/tag/scrollbar/index.html @@ -0,0 +1,212 @@ + + + + + + + +scrollbar « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/scrollbars/feed/index.html b/public/blog/tag/scrollbars/feed/index.html new file mode 100644 index 0000000..2d906c5 --- /dev/null +++ b/public/blog/tag/scrollbars/feed/index.html @@ -0,0 +1,70 @@ + + + + scrollbars – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/scrollbars/index.html b/public/blog/tag/scrollbars/index.html new file mode 100644 index 0000000..ccb80a9 --- /dev/null +++ b/public/blog/tag/scrollbars/index.html @@ -0,0 +1,212 @@ + + + + + + + +scrollbars « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/scrolling/feed/index.html b/public/blog/tag/scrolling/feed/index.html new file mode 100644 index 0000000..06c55bf --- /dev/null +++ b/public/blog/tag/scrolling/feed/index.html @@ -0,0 +1,55 @@ + + + + scrolling – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Change List View Mouse Wheel Scroll Speed + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/ + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/#respond + Fri, 18 Mar 2011 18:22:44 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=189 + + Did you know that you can change the mouse wheel scroll speed of Better ListView?

    +

    Better ListView has property MouseWheelScrollExtent which is defined as “relative number of items to scroll for a single mouse wheel detent“.

    +

    What does it mean? Well, it basically defines by how many items will the list view scroll when you move the mouse wheel up or down. The default value of this property in version 1.51 is 2, so whenever you scroll up or down with your mouse wheel, the list view will move two items up or down.

    +

    You can set the MouseWheelScrollExtent to a larger value for faster scrolling, just like this:

    +

    BetterListView.MouseWheelScrollExtent := 3;

    +

    Now, every time you scroll, the list view will move by 3 items (which is similar to Windows Explorer, which usually moves by 3 items in the Details view).

    +]]>
    + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/scrolling/index.html b/public/blog/tag/scrolling/index.html new file mode 100644 index 0000000..43205f9 --- /dev/null +++ b/public/blog/tag/scrolling/index.html @@ -0,0 +1,212 @@ + + + + + + + +scrolling « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/search/feed/index.html b/public/blog/tag/search/feed/index.html new file mode 100644 index 0000000..6ed707f --- /dev/null +++ b/public/blog/tag/search/feed/index.html @@ -0,0 +1,141 @@ + + + + search – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/search/index.html b/public/blog/tag/search/index.html new file mode 100644 index 0000000..626d48c --- /dev/null +++ b/public/blog/tag/search/index.html @@ -0,0 +1,212 @@ + + + + + + + +search « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/searching/feed/index.html b/public/blog/tag/searching/feed/index.html new file mode 100644 index 0000000..51304fe --- /dev/null +++ b/public/blog/tag/searching/feed/index.html @@ -0,0 +1,141 @@ + + + + searching – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Enabling Search Highlight in Better ListView + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/ + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/#comments + Fri, 11 Jan 2013 02:00:17 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=843 + + We have improved item searching capabilities of Better ListView by introducing Search Highlight feature. This feature automatically shows search matches and works out of the box with both searching by typing and searching from code (e.g. using search box):

    +
    Search Highlight Feature

    Search Highlight Feature

    +

     

    +

    To enable the highlight, simply add UpdateSearchHighlight option in the search settings:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +listView.SearchSettings = new BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options | BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +ListView.SearchSettings = New BetterListViewSearchSettings(
    + listView.SearchSettings.Mode,
    + listView.SearchSettings.Options Or BetterListViewSearchOptions.UpdateSearchHighlight,
    + listView.SearchSettings.SubItemIndices)
    +[/vb]

    +

    Every item contains information about the match in the BetterListViewItem.SearchHighlight property. When BetterListViewItem.SearchHighlight.IsEmpty is true, the item was not matched by the search. Otherwise it contains information about the matched substring: its index and number of characters.

    +

    Highlight colors can be adjusted by three properties: ColorSearchHighlightColorSearchHighlightBorder and ColorSearchHighlightText:

    +
    Search Highlight Properties

    Search Highlight Properties

    +

    The display can be adjusted even further with owner drawing:

    +
    Customized Search Highlight Feature

    Customized Search Highlight Feature

    +

    Here we have used ellipses drawn on item background by modifying OnDrawItem and OnDrawItemBackground methods of BetterListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +using System.Drawing;
    +using System.Drawing.Drawing2D;

    +

    using BetterListView;

    +

    internal sealed class CustomListView : BetterListView
    +{
    + protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + // do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = false;

    +

    base.OnDrawItem(eventArgs);
    + }

    +

    protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    // draw custom search highlight on item background
    + BetterListViewSearchHighlight searchHighlight = eventArgs.Item.SearchHighlight;

    +

    if (searchHighlight.IsEmpty == false)
    + {
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;

    +

    Rectangle rectHighlight = eventArgs.ItemBounds.SubItemBounds[searchHighlight.ColumnIndex].BoundsSearchHighlight;

    +

    Brush brushHighlight = new SolidBrush(Color.FromArgb(128, Color.MediumPurple));
    + Pen penHighlight = new Pen(Color.Purple, 1.0f);

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight);
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight);

    +

    brushHighlight.Dispose();
    + penHighlight.Dispose();
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Imports System.Drawing
    +Imports System.Drawing.Drawing2D

    +

    Imports BetterListView

    +

    Friend NotInheritable Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + ‘ do not draw search highlight because we will draw our own
    + eventArgs.DrawSearchHighlight = False

    +

    MyBase.OnDrawItem(eventArgs)
    + End Sub

    +

    Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    ‘ draw custom search highlight on item background
    + Dim searchHighlight As BetterListViewSearchHighlight = eventArgs.Item.SearchHighlight

    +

    If searchHighlight.IsEmpty = False Then
    + eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality

    +

    Dim rectHighlight As Rectangle = eventArgs.ItemBounds.SubItemBounds(searchHighlight.ColumnIndex).BoundsSearchHighlight

    +

    Dim brushHighlight As Brush = New SolidBrush(Color.FromArgb(128, Color.MediumPurple))
    + Dim penHighlight As New Pen(Color.Purple, 1F)

    +

    eventArgs.Graphics.FillEllipse(brushHighlight, rectHighlight)
    + eventArgs.Graphics.DrawEllipse(penHighlight, rectHighlight)

    +

    brushHighlight.Dispose()
    + penHighlight.Dispose()
    + End If
    + End Sub
    +End Class
    +[/vb]

    +]]>
    + http://www.componentowl.com/blog/enabling-search-highlight-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/searching/index.html b/public/blog/tag/searching/index.html new file mode 100644 index 0000000..201df09 --- /dev/null +++ b/public/blog/tag/searching/index.html @@ -0,0 +1,212 @@ + + + + + + + +searching « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/selection/feed/index.html b/public/blog/tag/selection/feed/index.html new file mode 100644 index 0000000..109e7c3 --- /dev/null +++ b/public/blog/tag/selection/feed/index.html @@ -0,0 +1,116 @@ + + + + selection – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView Tip: How to Draw Custom Selection + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/ + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/#comments + Wed, 12 Sep 2012 15:43:12 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=808 + + Customized item selection.

    Customized item selection.

    +

     

    +

    By default, Better ListView uses system theme for drawing selections.

    +

    To draw custom selection, you can use owner drawing capabilities of Better ListView:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +class CustomListView : BetterListView
    +{
    + protected override void OnDrawItemBackground(BetterListViewDrawItemBackgroundEventArgs eventArgs)
    + {
    + base.OnDrawItemBackground(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + Brush brushSelection = new SolidBrush(Color.FromArgb(128, Color.LightGreen));
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection);
    + brushSelection.Dispose();
    + }
    + }

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    + {
    + eventArgs.DrawSelection = false;

    +

    base.OnDrawItem(eventArgs);

    +

    if (eventArgs.Item.Selected)
    + {
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection);
    + }
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Class CustomListView
    + Inherits BetterListView
    + Protected Overrides Sub OnDrawItemBackground(eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    + MyBase.OnDrawItemBackground(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + Dim brushSelection As Brush = New SolidBrush(Color.FromArgb(128, Color.LightGreen))
    + eventArgs.Graphics.FillRectangle(brushSelection, eventArgs.ItemBounds.BoundsSelection)
    + brushSelection.Dispose()
    + End If
    + End Sub

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    + eventArgs.DrawSelection = False

    +

    MyBase.OnDrawItem(eventArgs)

    +

    If eventArgs.Item.Selected Then
    + eventArgs.Graphics.DrawRectangle(Pens.DarkGreen, eventArgs.ItemBounds.BoundsSelection)
    + End If
    + End Sub
    +End Class
    +[/vb]

    +

    In the above code, we have created class CustomListView that inherits from BetterListView. We override OnDrawItemBackground and OnDrawItem methods to customize item background and item foreground drawing, respectively.

    +

    The OnDrawItemBackground method contains only check for whether the item is selected. If so, we draw selection background (filled rectangle in selection area).

    +

    The OnDrawItem method contains two things:

    +
      +
    1. Turn off  default selection.
    2. +
    3. Draw custom selection border if the item is selected.
    4. +
    +

    Drawbacks of drawing custom selections like this include using non-system theme, which can look ugly on various color schemes. By default, Better ListView always use the system theme, so the color consistency is ensured. You can, however, still use classes like SystemColors or SystemBrushes to ensure good look.

    +

    Another drawback is that you handle only two states of selection, i.e. selected and unselected state. This is sufficient for Classic Windows theme but there are several more states used on Windows Aero Theme, like “hot”, “focused and hot” or “hot and pressed”.

    +

    To allow these states, considerable coding need to be done.

    +

    In case you need this level of customization, please contact us for Custom Coding support.

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-listview-tip-how-to-draw-custom-selection/feed/ + 2 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/selection/index.html b/public/blog/tag/selection/index.html new file mode 100644 index 0000000..5456a4f --- /dev/null +++ b/public/blog/tag/selection/index.html @@ -0,0 +1,212 @@ + + + + + + + +selection « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/separators/feed/index.html b/public/blog/tag/separators/feed/index.html new file mode 100644 index 0000000..2c04a22 --- /dev/null +++ b/public/blog/tag/separators/feed/index.html @@ -0,0 +1,62 @@ + + + + separators – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Non-selectable Items in Better ListView + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/ + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/#respond + Wed, 25 Jan 2012 12:08:17 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=476 + + One of our users asked us whether it would be possible to make specific Better ListView items to be non-selectable because he wanted to have them in “disabled” state.

    +

    We quickly realized that it might be very useful, in some cases, to have items with informative character only. Some of such non-selectable items can even be used as separators with the help of owner drawing:

    +
    Non-selectable items

    Non-selectable items

    +

    The non-selectable items behave just as their name suggests. They cannot be focused (they are skipped when jumping from item to item with arrow keys) and do not respond to drag selection:

    +
    Non-selectable items

    Non-selectable items

    +

    It is very easy to set-up such items. Simply set BetterListViewItem.Selectable property to false.

    +

    The non-selectable items are displayed in the same way as normal items. They can contain child items (which are selectable until their Selectable property is set to false) and can be interactively expanded/collapsed.

    +

    If you need to have all items non-selectable to use Better ListView for display-only, consider using the Read-only mode, which has been also introduced in version 2.5.

    +]]>
    + http://www.componentowl.com/blog/non-selectable-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/separators/index.html b/public/blog/tag/separators/index.html new file mode 100644 index 0000000..da09831 --- /dev/null +++ b/public/blog/tag/separators/index.html @@ -0,0 +1,212 @@ + + + + + + + +separators « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/serialization/feed/index.html b/public/blog/tag/serialization/feed/index.html new file mode 100644 index 0000000..fb120af --- /dev/null +++ b/public/blog/tag/serialization/feed/index.html @@ -0,0 +1,125 @@ + + + + serialization – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Store Better ListView Content in a String (User Request) + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/ + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/#respond + Sat, 04 Aug 2012 00:03:49 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=796 + + Is it possible to store entire Better ListView content (items with hierarchy and sub-items, columns and groups) in a single string?

    +

    Better ListView already supports saving and loading its content using SaveContent and LoadContent methods. These methods support either XML or binary format.

    +

    I chose binary format for storing data in string  because it is more compact than XML. Binary representation (basically an array of bytes) can be converted to Base64 string. Loading the content from string work similarly, the steps are performed in opposite direction:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +// SAVE
    +// create MemoryStream to hold binary data
    +MemoryStream stream = new MemoryStream();
    +// store Better ListView content in memory stream
    +this.listView.SaveContentBinary(stream);
    +// copy content of MemoryStream to byte array
    +byte[] contentBinary = new byte[stream.Length];
    +stream.Seek(0, SeekOrigin.Begin);
    +// convert byte array to Base64 string
    +stream.Read(contentBinary, 0, (int)stream.Length); // move to beginning of the stream
    +string contentStringBase64 = Convert.ToBase64String(contentBinary);
    +// close stream
    +stream.Close();
    +stream.Dispose();

    +

    // CLEAR
    +this.listView.Clear();

    +

    // LOAD
    +// create MemoryStream to hold binary data
    +stream = new MemoryStream();
    +// convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64);
    +// write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length);
    +stream.Seek(0, SeekOrigin.Begin); // move to beginning of the stream
    +// load content of Better ListView from memory stream
    +this.listView.LoadContentBinary(stream);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +‘ SAVE
    +‘ create MemoryStream to hold binary data
    +Dim stream As New MemoryStream()
    +‘ store Better ListView content in memory stream
    +Me.listView.SaveContentBinary(stream)
    +‘ copy content of MemoryStream to byte array
    +Dim contentBinary As Byte() = New Byte(stream.Length – 1) {}
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ convert byte array to Base64 string
    +stream.Read(contentBinary, 0, CInt(stream.Length))
    +‘ move to beginning of the stream
    +Dim contentStringBase64 As String = Convert.ToBase64String(contentBinary)
    +‘ close stream
    +stream.Close()
    +stream.Dispose()

    +

    ‘ CLEAR
    +Me.listView.Clear()

    +

    ‘ LOAD
    +‘ create MemoryStream to hold binary data
    +stream = New MemoryStream()
    +‘ convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64)
    +‘ write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length)
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ move to beginning of the stream
    +‘ load content of Better ListView from memory stream
    +Me.listView.LoadContentBinary(stream)
    +[/vb]

    +

     

    +

    Although saving and loading data this way is convenient, please consider the following drawback:

    +
      +
    • Standard serialization mechanism of .NET is used for converting classes and structures to XML or binary representation – hence the serialized data may not be possible to deserialize on different version of Better ListView if any public members of the serialized class have been changed.
    • +
    • The generated string is very long (few kilobytes for just two items).
    • +
    • Lots of data are stored which are not related to content itself (e.g. item colors).
    • +
    • The serialized representation is considered read-only – any changes can cause problems with deserialization; if you really want flexible way of storing ListView content, consider building a model or data layer that supports storing the data you need the way you need.
    • +
    +

    On the other hand, using this way may be convenient when you want to transfer or copy ListView content between controls on even across application domain (Better ListView itself uses this mechanism to allow Drag and Drop between two applications – this “tour de force” kind of Drag and Drop is not avaiable in regular .NET ListView).

    +]]>
    + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/serialization/index.html b/public/blog/tag/serialization/index.html new file mode 100644 index 0000000..d6c4f16 --- /dev/null +++ b/public/blog/tag/serialization/index.html @@ -0,0 +1,212 @@ + + + + + + + +serialization « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/serialize/feed/index.html b/public/blog/tag/serialize/feed/index.html new file mode 100644 index 0000000..8f10cb3 --- /dev/null +++ b/public/blog/tag/serialize/feed/index.html @@ -0,0 +1,125 @@ + + + + serialize – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Store Better ListView Content in a String (User Request) + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/ + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/#respond + Sat, 04 Aug 2012 00:03:49 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=796 + + Is it possible to store entire Better ListView content (items with hierarchy and sub-items, columns and groups) in a single string?

    +

    Better ListView already supports saving and loading its content using SaveContent and LoadContent methods. These methods support either XML or binary format.

    +

    I chose binary format for storing data in string  because it is more compact than XML. Binary representation (basically an array of bytes) can be converted to Base64 string. Loading the content from string work similarly, the steps are performed in opposite direction:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +// SAVE
    +// create MemoryStream to hold binary data
    +MemoryStream stream = new MemoryStream();
    +// store Better ListView content in memory stream
    +this.listView.SaveContentBinary(stream);
    +// copy content of MemoryStream to byte array
    +byte[] contentBinary = new byte[stream.Length];
    +stream.Seek(0, SeekOrigin.Begin);
    +// convert byte array to Base64 string
    +stream.Read(contentBinary, 0, (int)stream.Length); // move to beginning of the stream
    +string contentStringBase64 = Convert.ToBase64String(contentBinary);
    +// close stream
    +stream.Close();
    +stream.Dispose();

    +

    // CLEAR
    +this.listView.Clear();

    +

    // LOAD
    +// create MemoryStream to hold binary data
    +stream = new MemoryStream();
    +// convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64);
    +// write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length);
    +stream.Seek(0, SeekOrigin.Begin); // move to beginning of the stream
    +// load content of Better ListView from memory stream
    +this.listView.LoadContentBinary(stream);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +‘ SAVE
    +‘ create MemoryStream to hold binary data
    +Dim stream As New MemoryStream()
    +‘ store Better ListView content in memory stream
    +Me.listView.SaveContentBinary(stream)
    +‘ copy content of MemoryStream to byte array
    +Dim contentBinary As Byte() = New Byte(stream.Length – 1) {}
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ convert byte array to Base64 string
    +stream.Read(contentBinary, 0, CInt(stream.Length))
    +‘ move to beginning of the stream
    +Dim contentStringBase64 As String = Convert.ToBase64String(contentBinary)
    +‘ close stream
    +stream.Close()
    +stream.Dispose()

    +

    ‘ CLEAR
    +Me.listView.Clear()

    +

    ‘ LOAD
    +‘ create MemoryStream to hold binary data
    +stream = New MemoryStream()
    +‘ convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64)
    +‘ write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length)
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ move to beginning of the stream
    +‘ load content of Better ListView from memory stream
    +Me.listView.LoadContentBinary(stream)
    +[/vb]

    +

     

    +

    Although saving and loading data this way is convenient, please consider the following drawback:

    +
      +
    • Standard serialization mechanism of .NET is used for converting classes and structures to XML or binary representation – hence the serialized data may not be possible to deserialize on different version of Better ListView if any public members of the serialized class have been changed.
    • +
    • The generated string is very long (few kilobytes for just two items).
    • +
    • Lots of data are stored which are not related to content itself (e.g. item colors).
    • +
    • The serialized representation is considered read-only – any changes can cause problems with deserialization; if you really want flexible way of storing ListView content, consider building a model or data layer that supports storing the data you need the way you need.
    • +
    +

    On the other hand, using this way may be convenient when you want to transfer or copy ListView content between controls on even across application domain (Better ListView itself uses this mechanism to allow Drag and Drop between two applications – this “tour de force” kind of Drag and Drop is not avaiable in regular .NET ListView).

    +]]>
    + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/serialize/index.html b/public/blog/tag/serialize/index.html new file mode 100644 index 0000000..fd0a14e --- /dev/null +++ b/public/blog/tag/serialize/index.html @@ -0,0 +1,212 @@ + + + + + + + +serialize « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/shadows/feed/index.html b/public/blog/tag/shadows/feed/index.html new file mode 100644 index 0000000..c734f7f --- /dev/null +++ b/public/blog/tag/shadows/feed/index.html @@ -0,0 +1,75 @@ + + + + shadows – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Thumbnails with Borders and Shadows + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/ + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/#respond + Mon, 14 Feb 2011 19:17:14 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=103 + + We’ve just released Better ListView version 1.50 with some new features – thumbnails view, image borders support (inc. shadows), and more.

    +

    Our great inspiration for designing Better ListView is nothing less than the mighty Windows Explorer. This file manager uses obviously much more powerful control that the regular .NET list-view alone is.

    +

    It supports some extra views, line Contents and Extra Large Icons. It is also possible to adjust image size by rolling a mouse wheel while holding Control key.

    +

    Better ListView has the capability of displaying item icons with arbitrary sizes, but we also extended it with one extra view: Thumbnails:

    +
    Thumbnails Sample

    Thumbnails Sample

    +

    This view aligns items in the center while keeping constant spacing between items. Thumbnails also keep just single line of text for compactness. On the other hand, LargeIcon view varies horizontal space between items to fill client area evenly and breaks long text into several lines.

    +

    The constant spacing is inspired by various photo managers, where image thumbnails are better viewed side-by-side (and the view looks also more organized).

    +

    Image thumbnails also look better with some kind border or frame. We added this new feature in Better ListView 1.5 and it works in all views. There are several pre-defined types of borders, but user can draw his own:

    +
      +
    • None – simply no border at all
    • +
    • Single – single line border
    • +
    • SingleOffset – single line with a spacing between image and the border
    • +
    • SymmetricShadow – smooth shadow around image
    • +
    • DropShadow – smooth shadow on the right bottom part of the image
    • +
    +

    Thumbnails use DropShadow by default, but it can be adjusted for every view separately. One can also adjust thickness of the border/shadow and define custom spacing around image.

    +

    Take a look at one possible setting:

    +
    Image Borders

    Image Borders

    +

    This is SingleOffset border of width 3 pixels. Notice that also column header images can have its borders (these are SymmetricShadow).

    +

    When the border is defined and image size should be kept the same, some spacing have to be added around image. You can adjust this spacing to draw you own borders or any additional graphics (such as overlay icons). Here is an example –

    +
    Thumbnail with Extra Icons

    Thumbnail with Extra Icons

    +

    Download Better ListView

    +

    You can download Better ListView and play with it yourself.

    +]]>
    + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/shadows/index.html b/public/blog/tag/shadows/index.html new file mode 100644 index 0000000..386c8f0 --- /dev/null +++ b/public/blog/tag/shadows/index.html @@ -0,0 +1,212 @@ + + + + + + + +shadows « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/size/feed/index.html b/public/blog/tag/size/feed/index.html new file mode 100644 index 0000000..ae792d5 --- /dev/null +++ b/public/blog/tag/size/feed/index.html @@ -0,0 +1,100 @@ + + + + size – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    + + Custom Item Height in Details View of Better ListView + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/ + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/#respond + Wed, 21 Mar 2012 15:10:52 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=760 + + Better ListView 2.7.0.0 now supports items of arbitrary height in Details view:

    +
    Items with custom height

    Items with custom height

    +

    Items with variable heights were possible in recent versions of Better ListView as well, but this adjustment was limited to heights which are multiples of text line height.

    +

    We have introduced a BetterListViewItem.CustomHeight property, which is 0 by default.

    +

    Every item has some minimum size (defined by the font and image) but it can get arbitrarily larger. The following formula explains how item height is measured in Better ListView:

    +

    height = max(minimum height, image height, text height, custom height)

    +

    Setting minimum height for all items is possible through layout properties and the latter is defined by the item itself.

    +]]>
    + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/size/index.html b/public/blog/tag/size/index.html new file mode 100644 index 0000000..37aa0cb --- /dev/null +++ b/public/blog/tag/size/index.html @@ -0,0 +1,214 @@ + + + + + + + +size « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/sizes/feed/index.html b/public/blog/tag/sizes/feed/index.html new file mode 100644 index 0000000..0ea5357 --- /dev/null +++ b/public/blog/tag/sizes/feed/index.html @@ -0,0 +1,70 @@ + + + + sizes – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/sizes/index.html b/public/blog/tag/sizes/index.html new file mode 100644 index 0000000..4a45f85 --- /dev/null +++ b/public/blog/tag/sizes/index.html @@ -0,0 +1,212 @@ + + + + + + + +sizes « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/sort/feed/index.html b/public/blog/tag/sort/feed/index.html new file mode 100644 index 0000000..6ec754e --- /dev/null +++ b/public/blog/tag/sort/feed/index.html @@ -0,0 +1,69 @@ + + + + sort – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + List-View Drag and Drop Item Reorder (Sort) + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/ + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/#respond + Tue, 07 Jun 2011 11:29:04 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=260 + + Reordering items in list view control using drag and drop is very tricky. Implementation of item reorder requires multiple issues to be solved:

    +
      +
    • Initialization of the drag & drop
    • +
    • Insertion mark that previews where will be the dragged item moved
    • +
    • The actual reordering of the items (custom code might be needed)
    • +
    • Support of multiple drag drop effects (copy, move, link)
    • +
    • It should not interfere with external drag and drop outside of the listview control
    • +
    • It should not interfere with internal drag and drop into items.
    • +
    • Reorder of multiple items (including non-continuous selection)
    • +
    +

    Our Better ListView control supports drag and drop item reordering out of the box. Zero code is needed – all you have to do is to set the property BetterListViewItemReorderMode to Enabled.

    +

    It works just like this:

    +

    Item drag and drop reorder

    +

    Item drag and drop reorder

    +

    You can just download and install Better ListView, and start using it right away. It can do everything the regular .NET listview component can, and much more.

    +

    See more in the Drag Drop Sample that is included with Better ListView. It includes source code.

    +]]>
    + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/sort/index.html b/public/blog/tag/sort/index.html new file mode 100644 index 0000000..7af3ac6 --- /dev/null +++ b/public/blog/tag/sort/index.html @@ -0,0 +1,212 @@ + + + + + + + +sort « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/sorting/feed/index.html b/public/blog/tag/sorting/feed/index.html new file mode 100644 index 0000000..6e85972 --- /dev/null +++ b/public/blog/tag/sorting/feed/index.html @@ -0,0 +1,69 @@ + + + + sorting – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + List-View Drag and Drop Item Reorder (Sort) + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/ + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/#respond + Tue, 07 Jun 2011 11:29:04 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=260 + + Reordering items in list view control using drag and drop is very tricky. Implementation of item reorder requires multiple issues to be solved:

    +
      +
    • Initialization of the drag & drop
    • +
    • Insertion mark that previews where will be the dragged item moved
    • +
    • The actual reordering of the items (custom code might be needed)
    • +
    • Support of multiple drag drop effects (copy, move, link)
    • +
    • It should not interfere with external drag and drop outside of the listview control
    • +
    • It should not interfere with internal drag and drop into items.
    • +
    • Reorder of multiple items (including non-continuous selection)
    • +
    +

    Our Better ListView control supports drag and drop item reordering out of the box. Zero code is needed – all you have to do is to set the property BetterListViewItemReorderMode to Enabled.

    +

    It works just like this:

    +

    Item drag and drop reorder

    +

    Item drag and drop reorder

    +

    You can just download and install Better ListView, and start using it right away. It can do everything the regular .NET listview component can, and much more.

    +

    See more in the Drag Drop Sample that is included with Better ListView. It includes source code.

    +]]>
    + http://www.componentowl.com/blog/list-view-drag-and-drop-item-reorder-sort/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/sorting/index.html b/public/blog/tag/sorting/index.html new file mode 100644 index 0000000..90ae4f0 --- /dev/null +++ b/public/blog/tag/sorting/index.html @@ -0,0 +1,212 @@ + + + + + + + +sorting « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/space/feed/index.html b/public/blog/tag/space/feed/index.html new file mode 100644 index 0000000..0065a00 --- /dev/null +++ b/public/blog/tag/space/feed/index.html @@ -0,0 +1,158 @@ + + + + space – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Add Grid Lines in Empty Space in Better ListView + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/#respond + Wed, 30 Apr 2014 09:51:46 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=894 + + Default list without grid lines below items

    Default list without grid lines below items

    +
    List with grid lines added

    List with grid lines added

    +

    +

    Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:

    +
      +
    • None – grid lines are hidden
    • +
    • Horizontal – only horizontal lines are displayed
    • +
    • Vertical – only vertical lines are displayed
    • +
    • Grid – both horizontal and vertical lines are displayed, forming a grid
    • +
    +

    None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.

    +

    To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
    +{
    + BetterListView listView = (BetterListView)sender;

    +

    // get last visible item
    + var item = listView.BottomItem;

    +

    if (item == null)
    + {
    + return;
    + }

    +

    // measure row height
    + var bounds = listView.GetItemBounds(item);
    + int rowHeight = bounds.BoundsOuterExtended.Height;

    +

    // draw additional lines
    + Rectangle rectClient = listView.ClientRectangleInner;
    + Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);

    +

    int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);

    +

    while (y < rectClient.Bottom) + { + eventArgs.Graphics.DrawLine( + penGridLines, + rectClient.Left, + y, + rectClient.Right - 1, + y); + + y += rowHeight; + } + + penGridLines.Dispose(); +} +[/csharp] + +What this code does is getting the last visible item using BottomItem property. It is important  to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color  (ColorGridLines property) until reaching the bottom of the view.

    +]]>
    + http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/ + 0 +
    + + Custom Item Height in Details View of Better ListView + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/ + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/#respond + Wed, 21 Mar 2012 15:10:52 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=760 + + Better ListView 2.7.0.0 now supports items of arbitrary height in Details view:

    +
    Items with custom height

    Items with custom height

    +

    Items with variable heights were possible in recent versions of Better ListView as well, but this adjustment was limited to heights which are multiples of text line height.

    +

    We have introduced a BetterListViewItem.CustomHeight property, which is 0 by default.

    +

    Every item has some minimum size (defined by the font and image) but it can get arbitrarily larger. The following formula explains how item height is measured in Better ListView:

    +

    height = max(minimum height, image height, text height, custom height)

    +

    Setting minimum height for all items is possible through layout properties and the latter is defined by the item itself.

    +]]>
    + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/feed/ + 0 +
    + + Custom Spacing between Items in Details View + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/ + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/#respond + Tue, 13 Mar 2012 22:53:09 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=753 + + Better ListView 2.6 newly supports custom spacing between items in Details view:

    +
    Custom Spacing between Items

    Custom Spacing between Items

    +

    This property has been recently available in other views, but Details view was exception since its selections needed to be treated in different way: They overlap by 1 pixel so that the double border is avoided in neighboring selections:

    +
    1 px overlap of items

    1 px overlap of items

    +

    We have resolved this to get proper behavior with custom spacings and now the spacing can be set the same way as in any other view:

    +

    Simply set LayoutItemsCurrent.ElementOuterPadding to have custom horizontal and vertical padding between items.

    +

    You can set this specifically for Details view by refering to property LayoutItemsDetails or LayoutItemsDetailsColumns (Details view with columns).

    +]]>
    + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/space/index.html b/public/blog/tag/space/index.html new file mode 100644 index 0000000..75c9adc --- /dev/null +++ b/public/blog/tag/space/index.html @@ -0,0 +1,216 @@ + + + + + + + +space « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/spacing/feed/index.html b/public/blog/tag/spacing/feed/index.html new file mode 100644 index 0000000..c287a7b --- /dev/null +++ b/public/blog/tag/spacing/feed/index.html @@ -0,0 +1,105 @@ + + + + spacing – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Spacing between Items in Details View + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/ + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/#respond + Tue, 13 Mar 2012 22:53:09 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=753 + + Better ListView 2.6 newly supports custom spacing between items in Details view:

    +
    Custom Spacing between Items

    Custom Spacing between Items

    +

    This property has been recently available in other views, but Details view was exception since its selections needed to be treated in different way: They overlap by 1 pixel so that the double border is avoided in neighboring selections:

    +
    1 px overlap of items

    1 px overlap of items

    +

    We have resolved this to get proper behavior with custom spacings and now the spacing can be set the same way as in any other view:

    +

    Simply set LayoutItemsCurrent.ElementOuterPadding to have custom horizontal and vertical padding between items.

    +

    You can set this specifically for Details view by refering to property LayoutItemsDetails or LayoutItemsDetailsColumns (Details view with columns).

    +]]>
    + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/feed/ + 0 +
    + + Displaying Thumbnails with Borders and Shadows + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/ + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/#respond + Mon, 14 Feb 2011 19:17:14 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=103 + + We’ve just released Better ListView version 1.50 with some new features – thumbnails view, image borders support (inc. shadows), and more.

    +

    Our great inspiration for designing Better ListView is nothing less than the mighty Windows Explorer. This file manager uses obviously much more powerful control that the regular .NET list-view alone is.

    +

    It supports some extra views, line Contents and Extra Large Icons. It is also possible to adjust image size by rolling a mouse wheel while holding Control key.

    +

    Better ListView has the capability of displaying item icons with arbitrary sizes, but we also extended it with one extra view: Thumbnails:

    +
    Thumbnails Sample

    Thumbnails Sample

    +

    This view aligns items in the center while keeping constant spacing between items. Thumbnails also keep just single line of text for compactness. On the other hand, LargeIcon view varies horizontal space between items to fill client area evenly and breaks long text into several lines.

    +

    The constant spacing is inspired by various photo managers, where image thumbnails are better viewed side-by-side (and the view looks also more organized).

    +

    Image thumbnails also look better with some kind border or frame. We added this new feature in Better ListView 1.5 and it works in all views. There are several pre-defined types of borders, but user can draw his own:

    +
      +
    • None – simply no border at all
    • +
    • Single – single line border
    • +
    • SingleOffset – single line with a spacing between image and the border
    • +
    • SymmetricShadow – smooth shadow around image
    • +
    • DropShadow – smooth shadow on the right bottom part of the image
    • +
    +

    Thumbnails use DropShadow by default, but it can be adjusted for every view separately. One can also adjust thickness of the border/shadow and define custom spacing around image.

    +

    Take a look at one possible setting:

    +
    Image Borders

    Image Borders

    +

    This is SingleOffset border of width 3 pixels. Notice that also column header images can have its borders (these are SymmetricShadow).

    +

    When the border is defined and image size should be kept the same, some spacing have to be added around image. You can adjust this spacing to draw you own borders or any additional graphics (such as overlay icons). Here is an example –

    +
    Thumbnail with Extra Icons

    Thumbnail with Extra Icons

    +

    Download Better ListView

    +

    You can download Better ListView and play with it yourself.

    +]]>
    + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/spacing/index.html b/public/blog/tag/spacing/index.html new file mode 100644 index 0000000..a9a83f0 --- /dev/null +++ b/public/blog/tag/spacing/index.html @@ -0,0 +1,214 @@ + + + + + + + +spacing « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/specific/feed/index.html b/public/blog/tag/specific/feed/index.html new file mode 100644 index 0000000..67e0dc0 --- /dev/null +++ b/public/blog/tag/specific/feed/index.html @@ -0,0 +1,110 @@ + + + + specific – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Customize Label Editing (Embedded) Control for Each Line in Better ListView + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/ + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/#comments + Wed, 04 Apr 2012 10:33:49 +0000 + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=771 + + Embedded controls for label edit in Better ListView can be customized not only for every column, but even for every row.

    +

    This is not a new feature, but would be nice to mention that you can possibly have a different custom editing control for every cell…

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +{
    + // show editing controls in the second column
    + if (eventArgs.SubItem.Index == 1)
    + {
    + // show my custom control on the first row
    + if (eventArgs.SubItem.Item.Index == 0)
    + {
    + return (new DocumentAccessConrol());
    + }

    +

    // show my custom control on the second row
    + if (eventArgs.SubItem.Item.Index == 1)
    + {
    + return (new BetterListViewComboBoxEmbeddedControl());
    + }

    +

    // show my custom control on the third row
    + if (eventArgs.SubItem.Item.Index == 2)
    + {
    + return (new BetterListViewTextBoxEmbeddedControl());
    + }
    + }

    +

    return null;
    +}
    +[/csharp]

    +

     

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Function ListViewRequestEmbeddedControl(ByVal sender As Object, ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    + As IBetterListViewEmbeddedControl

    +

    ‘ show editing controls in the second column
    + If eventArgs.SubItem.Index = 1 Then

    +

    ‘ show my custom control on the first row
    + If eventArgs.SubItem.Item.Index = 0 Then
    + Return (New DocumentAccessConrol())
    + End If

    +

    ‘ show my custom control on the second row
    + If eventArgs.SubItem.Item.Index = 1 Then
    + Return (New BetterListViewComboBoxEmbeddedControl())
    + End If

    +

    ‘ show my custom control on the third row
    + If eventArgs.SubItem.Item.Index = 2 Then
    + Return (New BetterListViewTextBoxEmbeddedControl())
    + End If

    +

    End If

    +

    Return Nothing

    +

    End Function
    +[/vb]

    +

     

    +

    And there is the result:

    +
    Custom Embedded Control on the First Line

    Custom Embedded Control on the First Line

    +

     

    +
    TextBox Control on the Third Line

    TextBox Control on the Third Line

    +]]>
    + http://www.componentowl.com/blog/customize-label-editing-embedded-control-for-each-line-in-better-listview/feed/ + 2 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/specific/index.html b/public/blog/tag/specific/index.html new file mode 100644 index 0000000..3b34f26 --- /dev/null +++ b/public/blog/tag/specific/index.html @@ -0,0 +1,212 @@ + + + + + + + +specific « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/state/feed/index.html b/public/blog/tag/state/feed/index.html new file mode 100644 index 0000000..6ce270b --- /dev/null +++ b/public/blog/tag/state/feed/index.html @@ -0,0 +1,177 @@ + + + + state – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Read-Only Mode in Better ListView + http://www.componentowl.com/blog/read-only-mode-in-better-listview/ + http://www.componentowl.com/blog/read-only-mode-in-better-listview/#respond + Fri, 27 Jan 2012 16:21:58 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=482 + + Better ListView 2.5 introduces a new boolean property called ReadOnly.

    +

    When set to true, the Better ListView does not respond to keyboard and mouse input. There are, however, some exceptions that make the Read-only mode different to the Disabled mode (when Enabled property is set to false).

    +

    When in Read-only mode, content of the Better ListView can be still scrolled (the scroll bars are enabled) and groups/items can be expanded/collapsed.

    +

    The difference between Disabled and Read-only can be seen on the following images:

    +
    Normal state

    Normal state

    +
    Disabled state

    Disabled state

    +
    Read-only state

    Read-only state

    +

     

    +

    As you can see, the Better ListView is displayed normally in Read-only mode, but the group header does not have a hot state (because cannot be focused). Items also cannot be focused or selected, but the expand buttons are still interactive.

    +

    The scroll bars would also be enabled and can be used, which is different from Disabled mode where everything is grayed and cannot be used.

    +]]>
    + http://www.componentowl.com/blog/read-only-mode-in-better-listview/feed/ + 0 +
    + + How to Display Items in Custom States + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/ + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/#respond + Tue, 15 Nov 2011 15:24:25 +0000 + + + + + + + + + + + http://www.componentowl.com/blog/?p=398 + + One of our customers recently asked us if it is possible in Better ListView to draw item highlighted even when the control loses focus. This is an interesting and useful feature, so we implemented it right away.

    +

    Owner drawing in Better ListView 2.3.0 and higher allows you to draw elements (column headers, items, sub-items and groups) in any state you wish (hot, selected, focused and any combination of the three).

    +

    For example, we would like to highlight several items in one Better ListView depending on hovered item in other Better ListView:

    +
    Better ListView shows multiple hot items

    Better ListView shows multiple hot items

    +

    Items can be also be drawn as if the control is focused, enabled or disabled. This feature can be applied when you wish to display items in highlighted state even if Better ListView is not focused:

    +
    Better ListView keeps selected items highlighted

    Better ListView keeps selected items highlighted

    +

    We implemented the first sample (showing mulitple hot items) by inheriting from BetterListView, making a new class called HotListView. The implementation is very simple:

    +

     

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class HotListView : BetterListView
    +{
    +public HashSet HotItems
    +{
    +get
    +{
    +return this.hotItems;
    +}
    +set
    +{
    +this.hotItems = value;

    +

    Refresh();
    +}
    +}

    +

    private HashSethotItems = new HashSet();

    +

    protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    +{
    +if (this.hotItems.Contains(eventArgs.Item.Index))
    +{
    +eventArgs.ItemStateInfo = new BetterListViewItemStateInfo(
    +eventArgs.ItemStateInfo.ItemState | BetterListViewItemState.Hot,
    +eventArgs.ItemStateInfo.ExpandButtonState,
    +eventArgs.ItemStateInfo.CheckBoxState);
    +}

    +

    base.OnDrawItem(eventArgs);
    +}
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class HotListView
    +Inherits BetterListView
    +Public Property HotItems() As HashSet(Of Integer)
    +Get
    +Return Me.m_hotItems
    +End Get
    +Set
    +Me.m_hotItems = value

    +

    Refresh()
    +End Set
    +End Property

    +

    Private m_hotItems As New HashSet(Of Integer)()

    +

    Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    +If Me.m_hotItems.Contains(eventArgs.Item.Index) Then
    +eventArgs.ItemStateInfo = New BetterListViewItemStateInfo(eventArgs.ItemStateInfo.ItemState Or BetterListViewItemState.Hot, eventArgs.ItemStateInfo.ExpandButtonState, eventArgs.ItemStateInfo.CheckBoxState)
    +End If

    +

    MyBase.OnDrawItem(eventArgs)
    +End Sub
    +End Class
    +[/vb]

    +

     

    +

    The HotListView contains one property called HotItems. When drawing items (OnDrawItem method), it looks whether the item is in the HotItems set. If so, item drawing state is altered so that the item will be drawn as hot.

    +

    The modified ListView for second sample is even simpler. We call it HighlightListView:

    +

     

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +public class HighlightListView : BetterListView
    +{
    +protected override void OnDrawItem(BetterListViewDrawItemEventArgs eventArgs)
    +{
    +if ((eventArgs.ItemStateInfo.ItemState & BetterListViewItemState.Selected) == BetterListViewItemState.Selected)
    +{
    +// if the item is selected, always draw control as if it is focused
    +eventArgs.DrawFocused = true;
    +}

    +

    base.OnDrawItem(eventArgs);
    +}
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Public Class HighlightListView
    +Inherits BetterListView
    +Protected Overrides Sub OnDrawItem(eventArgs As BetterListViewDrawItemEventArgs)
    +If (eventArgs.ItemStateInfo.ItemState And BetterListViewItemState.Selected) = BetterListViewItemState.Selected Then
    +‘ if the item is selected, always draw control as if it is focused
    +eventArgs.DrawFocused = True
    +End If

    +

    MyBase.OnDrawItem(eventArgs)
    +End Sub
    +End Class
    +[/vb]

    +

     

    +

    This modification only draws selected items as if the control is always focused.

    +

    UPDATE: From Better ListView 2.3.1, you can simply use HideSelectionMode property to keep selected items highlighted.

    +]]>
    + http://www.componentowl.com/blog/how-to-display-items-in-custom-states/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/state/index.html b/public/blog/tag/state/index.html new file mode 100644 index 0000000..c281514 --- /dev/null +++ b/public/blog/tag/state/index.html @@ -0,0 +1,214 @@ + + + + + + + +state « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/store/feed/index.html b/public/blog/tag/store/feed/index.html new file mode 100644 index 0000000..f9f2196 --- /dev/null +++ b/public/blog/tag/store/feed/index.html @@ -0,0 +1,125 @@ + + + + store – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Store Better ListView Content in a String (User Request) + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/ + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/#respond + Sat, 04 Aug 2012 00:03:49 +0000 + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=796 + + Is it possible to store entire Better ListView content (items with hierarchy and sub-items, columns and groups) in a single string?

    +

    Better ListView already supports saving and loading its content using SaveContent and LoadContent methods. These methods support either XML or binary format.

    +

    I chose binary format for storing data in string  because it is more compact than XML. Binary representation (basically an array of bytes) can be converted to Base64 string. Loading the content from string work similarly, the steps are performed in opposite direction:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +// SAVE
    +// create MemoryStream to hold binary data
    +MemoryStream stream = new MemoryStream();
    +// store Better ListView content in memory stream
    +this.listView.SaveContentBinary(stream);
    +// copy content of MemoryStream to byte array
    +byte[] contentBinary = new byte[stream.Length];
    +stream.Seek(0, SeekOrigin.Begin);
    +// convert byte array to Base64 string
    +stream.Read(contentBinary, 0, (int)stream.Length); // move to beginning of the stream
    +string contentStringBase64 = Convert.ToBase64String(contentBinary);
    +// close stream
    +stream.Close();
    +stream.Dispose();

    +

    // CLEAR
    +this.listView.Clear();

    +

    // LOAD
    +// create MemoryStream to hold binary data
    +stream = new MemoryStream();
    +// convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64);
    +// write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length);
    +stream.Seek(0, SeekOrigin.Begin); // move to beginning of the stream
    +// load content of Better ListView from memory stream
    +this.listView.LoadContentBinary(stream);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +‘ SAVE
    +‘ create MemoryStream to hold binary data
    +Dim stream As New MemoryStream()
    +‘ store Better ListView content in memory stream
    +Me.listView.SaveContentBinary(stream)
    +‘ copy content of MemoryStream to byte array
    +Dim contentBinary As Byte() = New Byte(stream.Length – 1) {}
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ convert byte array to Base64 string
    +stream.Read(contentBinary, 0, CInt(stream.Length))
    +‘ move to beginning of the stream
    +Dim contentStringBase64 As String = Convert.ToBase64String(contentBinary)
    +‘ close stream
    +stream.Close()
    +stream.Dispose()

    +

    ‘ CLEAR
    +Me.listView.Clear()

    +

    ‘ LOAD
    +‘ create MemoryStream to hold binary data
    +stream = New MemoryStream()
    +‘ convert Base64 string to byte array
    +contentBinary = Convert.FromBase64String(contentStringBase64)
    +‘ write byte array to stream
    +stream.Write(contentBinary, 0, contentBinary.Length)
    +stream.Seek(0, SeekOrigin.Begin)
    +‘ move to beginning of the stream
    +‘ load content of Better ListView from memory stream
    +Me.listView.LoadContentBinary(stream)
    +[/vb]

    +

     

    +

    Although saving and loading data this way is convenient, please consider the following drawback:

    +
      +
    • Standard serialization mechanism of .NET is used for converting classes and structures to XML or binary representation – hence the serialized data may not be possible to deserialize on different version of Better ListView if any public members of the serialized class have been changed.
    • +
    • The generated string is very long (few kilobytes for just two items).
    • +
    • Lots of data are stored which are not related to content itself (e.g. item colors).
    • +
    • The serialized representation is considered read-only – any changes can cause problems with deserialization; if you really want flexible way of storing ListView content, consider building a model or data layer that supports storing the data you need the way you need.
    • +
    +

    On the other hand, using this way may be convenient when you want to transfer or copy ListView content between controls on even across application domain (Better ListView itself uses this mechanism to allow Drag and Drop between two applications – this “tour de force” kind of Drag and Drop is not avaiable in regular .NET ListView).

    +]]>
    + http://www.componentowl.com/blog/how-to-store-better-listview-content-in-a-string-user-request/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/store/index.html b/public/blog/tag/store/index.html new file mode 100644 index 0000000..9a3a237 --- /dev/null +++ b/public/blog/tag/store/index.html @@ -0,0 +1,212 @@ + + + + + + + +store « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/styles/feed/index.html b/public/blog/tag/styles/feed/index.html new file mode 100644 index 0000000..52640dc --- /dev/null +++ b/public/blog/tag/styles/feed/index.html @@ -0,0 +1,71 @@ + + + + styles – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Work in Progress: “Groups” / “Item Hierarchy” Features + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond + Fri, 25 Mar 2011 23:11:00 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=204 + + We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    +]]>
    + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/styles/index.html b/public/blog/tag/styles/index.html new file mode 100644 index 0000000..9b39a20 --- /dev/null +++ b/public/blog/tag/styles/index.html @@ -0,0 +1,212 @@ + + + + + + + +styles « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/sub-item/feed/index.html b/public/blog/tag/sub-item/feed/index.html new file mode 100644 index 0000000..d80b52e --- /dev/null +++ b/public/blog/tag/sub-item/feed/index.html @@ -0,0 +1,173 @@ + + + + sub-item – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    + + Right-aligned Images in Better ListView + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/ + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/#respond + Thu, 19 Apr 2012 19:15:13 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=780 + + Better ListView 2.9.0 now supports more customizable image alignment. For example, images can be aligned on the right part of item:

    +
    Right-aligned Images

    Right-aligned Images

    +

    The alignment can be set separately on every sub-item (using AlignImageHorizontal and AlignImageVertical properties).

    +

    Moreover, the right-aligned images can be used in column headers and groups:

    +
    Group image alignment

    Group image alignment

    +

    The alignment of images is similar to that of text. Every image has its frame, which can be possibly larger than the image itself. In such case, the image needs to be further aligned within the frame. This has been done automatically by centering the image within frame, but now you have full control over the alignment.

    +]]>
    + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/feed/ + 0 +
    + + Vertical Alignment and Text Wrapping in Better ListView + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/ + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/#comments + Wed, 16 Nov 2011 23:57:39 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=437 + + .NET ListView supports horizontal alignment of text in columns, items, sub-items and groups. Since Better ListView adds many new features, like multi-line items and images of arbitrary size, vertical alignment comes in handy.

    +

    By default, each view has its defaults, but you can customize text alignment on every column, item, sub-item and group individually:

    +
    +
    Vertical alignments of text

    Vertical alignments of text

    +
    +
    +
    +
    +

    The vertical alignment feature is a new property of each element type. For example, .NET ListView item has a property called Align which refers to horizontal alignment. Better ListView extends this to two independent properties called AlignHorizontal and AlignVertical. The naming scheme is same for columns, items, sub-items and groups.

    +

    Better ListView also supports splitting text in column headers and items (sub-items) into multiple lines.

    +

    We extended this functionality by adding a BetterListViewItem.TextWrapping and BetterListViewSubItem.TextWrapping properties. With these, you can control how the text in sub-items will be wrapped. There are three possible values:

    +
      +
    • Layout – the text will be wrapped to multiple lines, up to value specified by MaximumTextLines property of the corresponding view (layout)
    • +
    • None – the text will not be wrapped at all
    • +
    • Space – the text will be wrapped, but only to available space (item will never get higher due to wrapping text in sub-item with this setting)
    • +
    +
    The following screenshot shows these three wrapping modes in action:
    +
    +
    Various text wrapping modes

    Various text wrapping modes

    +
    +

    The sub-item in the first column has TextWrapping set to Layout and the layout has MaximumTextLines set to 4. The sub-item text thus can be split to up to four lines. It is actually split just to three because the column is wide enough.

    +

    The sub-item in the second column has TextWrapping set to None, which means the text in this sub-item is kept on single line.

    +

    The sub-item in the third column has TextWrapping set to Space. As you can see, even if the MaximumTextLines is set to 4, the sub-item text is limited to three lines, preventing item to grow larger.

    +]]>
    + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/sub-item/index.html b/public/blog/tag/sub-item/index.html new file mode 100644 index 0000000..4a03995 --- /dev/null +++ b/public/blog/tag/sub-item/index.html @@ -0,0 +1,218 @@ + + + + + + + +sub-item « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/sub-items/feed/index.html b/public/blog/tag/sub-items/feed/index.html new file mode 100644 index 0000000..aecd964 --- /dev/null +++ b/public/blog/tag/sub-items/feed/index.html @@ -0,0 +1,101 @@ + + + + sub-items – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Hiding Column Headers in Better ListView + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/#respond + Mon, 27 Aug 2012 23:11:27 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=803 + + Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    +]]>
    + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/sub-items/index.html b/public/blog/tag/sub-items/index.html new file mode 100644 index 0000000..2365447 --- /dev/null +++ b/public/blog/tag/sub-items/index.html @@ -0,0 +1,214 @@ + + + + + + + +sub-items « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/sub/feed/index.html b/public/blog/tag/sub/feed/index.html new file mode 100644 index 0000000..bfe3239 --- /dev/null +++ b/public/blog/tag/sub/feed/index.html @@ -0,0 +1,69 @@ + + + + sub – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hiding Column Headers in Better ListView + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/#respond + Mon, 27 Aug 2012 23:11:27 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=803 + + Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    +]]>
    + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/sub/index.html b/public/blog/tag/sub/index.html new file mode 100644 index 0000000..d7f2062 --- /dev/null +++ b/public/blog/tag/sub/index.html @@ -0,0 +1,212 @@ + + + + + + + +sub « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/subitem/feed/index.html b/public/blog/tag/subitem/feed/index.html new file mode 100644 index 0000000..4838ec1 --- /dev/null +++ b/public/blog/tag/subitem/feed/index.html @@ -0,0 +1,130 @@ + + + + subitem – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    + + Right-aligned Images in Better ListView + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/ + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/#respond + Thu, 19 Apr 2012 19:15:13 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=780 + + Better ListView 2.9.0 now supports more customizable image alignment. For example, images can be aligned on the right part of item:

    +
    Right-aligned Images

    Right-aligned Images

    +

    The alignment can be set separately on every sub-item (using AlignImageHorizontal and AlignImageVertical properties).

    +

    Moreover, the right-aligned images can be used in column headers and groups:

    +
    Group image alignment

    Group image alignment

    +

    The alignment of images is similar to that of text. Every image has its frame, which can be possibly larger than the image itself. In such case, the image needs to be further aligned within the frame. This has been done automatically by centering the image within frame, but now you have full control over the alignment.

    +]]>
    + http://www.componentowl.com/blog/right-aligned-images-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/subitem/index.html b/public/blog/tag/subitem/index.html new file mode 100644 index 0000000..e261807 --- /dev/null +++ b/public/blog/tag/subitem/index.html @@ -0,0 +1,216 @@ + + + + + + + +subitem « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/subitems/feed/index.html b/public/blog/tag/subitems/feed/index.html new file mode 100644 index 0000000..9e49295 --- /dev/null +++ b/public/blog/tag/subitems/feed/index.html @@ -0,0 +1,138 @@ + + + + subitems – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Centering Images in Better ListView Sub-items + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond + Wed, 06 Aug 2014 21:14:10 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=906 + + Centered images in Better ListView

    Centered images in Better ListView

    +

    Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.

    +

    The image will be centered inside available space regardless of text.

    +

    This is useful for sub-items and column headers consisting of image only.

    +]]>
    + http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ + 0 +
    + + Sub-item Check Boxes in Better ListView + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond + Sun, 06 Jul 2014 21:48:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=901 + + Better ListView Sub-item Check Boxes

    Better ListView Sub-item Check Boxes

    +

    Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.

    +

    This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.

    +

    Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).

    +

    Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.

    +

    Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.

    +]]>
    + http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ + 0 +
    + + Hiding Column Headers in Better ListView + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/#respond + Mon, 27 Aug 2012 23:11:27 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=803 + + Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    +]]>
    + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/subitems/index.html b/public/blog/tag/subitems/index.html new file mode 100644 index 0000000..6152e94 --- /dev/null +++ b/public/blog/tag/subitems/index.html @@ -0,0 +1,216 @@ + + + + + + + +subitems « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/support/feed/index.html b/public/blog/tag/support/feed/index.html new file mode 100644 index 0000000..3bbd1e7 --- /dev/null +++ b/public/blog/tag/support/feed/index.html @@ -0,0 +1,64 @@ + + + + support – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Windows Theme Support in Better ListView + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/#respond + Fri, 01 Jul 2011 22:46:55 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=287 + + Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    +]]>
    + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/support/index.html b/public/blog/tag/support/index.html new file mode 100644 index 0000000..c9304a3 --- /dev/null +++ b/public/blog/tag/support/index.html @@ -0,0 +1,212 @@ + + + + + + + +support « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/text/feed/index.html b/public/blog/tag/text/feed/index.html new file mode 100644 index 0000000..a863d2a --- /dev/null +++ b/public/blog/tag/text/feed/index.html @@ -0,0 +1,110 @@ + + + + text – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Multi-Line Text In ListView + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/ + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/#respond + Thu, 24 Nov 2011 16:42:44 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=450 + + Multi-Line text has been supported since Better ListView 2.0 (as automatic text-wrapping with configurable number of Maximum Text Lines), but we enhanced this feature inversion 2.3.2 by adding support for “hardcoded” newline characters (LF) in item text:

    +
    Items with multi-line text

    Items with multi-line text

    +

    Column headers and even groups can contain multi-line text:

    +
    Multi-line text in groups

    Multi-line text in groups

    +

    So the text can be split on multiple lines not only by wrapping the text, but also by user defined newline characters.

    +

    This feature comes out of the box.

    +

    The only setting associated with multi-line items is the MaximumTextLines property of the corresponding layout (e.g. BetterListView.LayoutItemsLargeIcon). This property specifies how many lines the text can have and this applies to both wrapped text and text with newline characters. So if you expect you text to have 5 to 20 lines, set the MaximumTextLines property to 20 and you know the items will not get too high while still displaying all the lines.

    +

    Multi-line text is supported on column headers, items, sub-items and groups.

    +

    Download the latest Better ListView

    +]]>
    + http://www.componentowl.com/blog/displayingmultiline-items-in-listview/feed/ + 0 +
    + + Vertical Alignment and Text Wrapping in Better ListView + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/ + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/#comments + Wed, 16 Nov 2011 23:57:39 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=437 + + .NET ListView supports horizontal alignment of text in columns, items, sub-items and groups. Since Better ListView adds many new features, like multi-line items and images of arbitrary size, vertical alignment comes in handy.

    +

    By default, each view has its defaults, but you can customize text alignment on every column, item, sub-item and group individually:

    +
    +
    Vertical alignments of text

    Vertical alignments of text

    +
    +
    +
    +
    +

    The vertical alignment feature is a new property of each element type. For example, .NET ListView item has a property called Align which refers to horizontal alignment. Better ListView extends this to two independent properties called AlignHorizontal and AlignVertical. The naming scheme is same for columns, items, sub-items and groups.

    +

    Better ListView also supports splitting text in column headers and items (sub-items) into multiple lines.

    +

    We extended this functionality by adding a BetterListViewItem.TextWrapping and BetterListViewSubItem.TextWrapping properties. With these, you can control how the text in sub-items will be wrapped. There are three possible values:

    +
      +
    • Layout – the text will be wrapped to multiple lines, up to value specified by MaximumTextLines property of the corresponding view (layout)
    • +
    • None – the text will not be wrapped at all
    • +
    • Space – the text will be wrapped, but only to available space (item will never get higher due to wrapping text in sub-item with this setting)
    • +
    +
    The following screenshot shows these three wrapping modes in action:
    +
    +
    Various text wrapping modes

    Various text wrapping modes

    +
    +

    The sub-item in the first column has TextWrapping set to Layout and the layout has MaximumTextLines set to 4. The sub-item text thus can be split to up to four lines. It is actually split just to three because the column is wide enough.

    +

    The sub-item in the second column has TextWrapping set to None, which means the text in this sub-item is kept on single line.

    +

    The sub-item in the third column has TextWrapping set to Space. As you can see, even if the MaximumTextLines is set to 4, the sub-item text is limited to three lines, preventing item to grow larger.

    +]]>
    + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/text/index.html b/public/blog/tag/text/index.html new file mode 100644 index 0000000..51fa01a --- /dev/null +++ b/public/blog/tag/text/index.html @@ -0,0 +1,214 @@ + + + + + + + +text « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/theme/feed/index.html b/public/blog/tag/theme/feed/index.html new file mode 100644 index 0000000..91bfd72 --- /dev/null +++ b/public/blog/tag/theme/feed/index.html @@ -0,0 +1,64 @@ + + + + theme – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Windows Theme Support in Better ListView + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/#respond + Fri, 01 Jul 2011 22:46:55 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=287 + + Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    +]]>
    + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/theme/index.html b/public/blog/tag/theme/index.html new file mode 100644 index 0000000..f23e1a8 --- /dev/null +++ b/public/blog/tag/theme/index.html @@ -0,0 +1,212 @@ + + + + + + + +theme « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/themes/feed/index.html b/public/blog/tag/themes/feed/index.html new file mode 100644 index 0000000..a273fd0 --- /dev/null +++ b/public/blog/tag/themes/feed/index.html @@ -0,0 +1,71 @@ + + + + themes – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Work in Progress: “Groups” / “Item Hierarchy” Features + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond + Fri, 25 Mar 2011 23:11:00 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=204 + + We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    +]]>
    + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/themes/index.html b/public/blog/tag/themes/index.html new file mode 100644 index 0000000..ee3572d --- /dev/null +++ b/public/blog/tag/themes/index.html @@ -0,0 +1,212 @@ + + + + + + + +themes « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/thumbnail-view/feed/index.html b/public/blog/tag/thumbnail-view/feed/index.html new file mode 100644 index 0000000..8d9737d --- /dev/null +++ b/public/blog/tag/thumbnail-view/feed/index.html @@ -0,0 +1,75 @@ + + + + thumbnail view – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Thumbnails with Borders and Shadows + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/ + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/#respond + Mon, 14 Feb 2011 19:17:14 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=103 + + We’ve just released Better ListView version 1.50 with some new features – thumbnails view, image borders support (inc. shadows), and more.

    +

    Our great inspiration for designing Better ListView is nothing less than the mighty Windows Explorer. This file manager uses obviously much more powerful control that the regular .NET list-view alone is.

    +

    It supports some extra views, line Contents and Extra Large Icons. It is also possible to adjust image size by rolling a mouse wheel while holding Control key.

    +

    Better ListView has the capability of displaying item icons with arbitrary sizes, but we also extended it with one extra view: Thumbnails:

    +
    Thumbnails Sample

    Thumbnails Sample

    +

    This view aligns items in the center while keeping constant spacing between items. Thumbnails also keep just single line of text for compactness. On the other hand, LargeIcon view varies horizontal space between items to fill client area evenly and breaks long text into several lines.

    +

    The constant spacing is inspired by various photo managers, where image thumbnails are better viewed side-by-side (and the view looks also more organized).

    +

    Image thumbnails also look better with some kind border or frame. We added this new feature in Better ListView 1.5 and it works in all views. There are several pre-defined types of borders, but user can draw his own:

    +
      +
    • None – simply no border at all
    • +
    • Single – single line border
    • +
    • SingleOffset – single line with a spacing between image and the border
    • +
    • SymmetricShadow – smooth shadow around image
    • +
    • DropShadow – smooth shadow on the right bottom part of the image
    • +
    +

    Thumbnails use DropShadow by default, but it can be adjusted for every view separately. One can also adjust thickness of the border/shadow and define custom spacing around image.

    +

    Take a look at one possible setting:

    +
    Image Borders

    Image Borders

    +

    This is SingleOffset border of width 3 pixels. Notice that also column header images can have its borders (these are SymmetricShadow).

    +

    When the border is defined and image size should be kept the same, some spacing have to be added around image. You can adjust this spacing to draw you own borders or any additional graphics (such as overlay icons). Here is an example –

    +
    Thumbnail with Extra Icons

    Thumbnail with Extra Icons

    +

    Download Better ListView

    +

    You can download Better ListView and play with it yourself.

    +]]>
    + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/thumbnail-view/index.html b/public/blog/tag/thumbnail-view/index.html new file mode 100644 index 0000000..798f170 --- /dev/null +++ b/public/blog/tag/thumbnail-view/index.html @@ -0,0 +1,212 @@ + + + + + + + +thumbnail view « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/thumbnail/feed/index.html b/public/blog/tag/thumbnail/feed/index.html new file mode 100644 index 0000000..43aa3b5 --- /dev/null +++ b/public/blog/tag/thumbnail/feed/index.html @@ -0,0 +1,84 @@ + + + + thumbnail – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/thumbnail/index.html b/public/blog/tag/thumbnail/index.html new file mode 100644 index 0000000..4c008d5 --- /dev/null +++ b/public/blog/tag/thumbnail/index.html @@ -0,0 +1,212 @@ + + + + + + + +thumbnail « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/thumbnailbrowser/feed/index.html b/public/blog/tag/thumbnailbrowser/feed/index.html new file mode 100644 index 0000000..51c6f4f --- /dev/null +++ b/public/blog/tag/thumbnailbrowser/feed/index.html @@ -0,0 +1,84 @@ + + + + thumbnailbrowser – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/thumbnailbrowser/index.html b/public/blog/tag/thumbnailbrowser/index.html new file mode 100644 index 0000000..34a47dd --- /dev/null +++ b/public/blog/tag/thumbnailbrowser/index.html @@ -0,0 +1,212 @@ + + + + + + + +thumbnailbrowser « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/thumbnails-view/feed/index.html b/public/blog/tag/thumbnails-view/feed/index.html new file mode 100644 index 0000000..f6e5ad7 --- /dev/null +++ b/public/blog/tag/thumbnails-view/feed/index.html @@ -0,0 +1,75 @@ + + + + thumbnails view – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Displaying Thumbnails with Borders and Shadows + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/ + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/#respond + Mon, 14 Feb 2011 19:17:14 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=103 + + We’ve just released Better ListView version 1.50 with some new features – thumbnails view, image borders support (inc. shadows), and more.

    +

    Our great inspiration for designing Better ListView is nothing less than the mighty Windows Explorer. This file manager uses obviously much more powerful control that the regular .NET list-view alone is.

    +

    It supports some extra views, line Contents and Extra Large Icons. It is also possible to adjust image size by rolling a mouse wheel while holding Control key.

    +

    Better ListView has the capability of displaying item icons with arbitrary sizes, but we also extended it with one extra view: Thumbnails:

    +
    Thumbnails Sample

    Thumbnails Sample

    +

    This view aligns items in the center while keeping constant spacing between items. Thumbnails also keep just single line of text for compactness. On the other hand, LargeIcon view varies horizontal space between items to fill client area evenly and breaks long text into several lines.

    +

    The constant spacing is inspired by various photo managers, where image thumbnails are better viewed side-by-side (and the view looks also more organized).

    +

    Image thumbnails also look better with some kind border or frame. We added this new feature in Better ListView 1.5 and it works in all views. There are several pre-defined types of borders, but user can draw his own:

    +
      +
    • None – simply no border at all
    • +
    • Single – single line border
    • +
    • SingleOffset – single line with a spacing between image and the border
    • +
    • SymmetricShadow – smooth shadow around image
    • +
    • DropShadow – smooth shadow on the right bottom part of the image
    • +
    +

    Thumbnails use DropShadow by default, but it can be adjusted for every view separately. One can also adjust thickness of the border/shadow and define custom spacing around image.

    +

    Take a look at one possible setting:

    +
    Image Borders

    Image Borders

    +

    This is SingleOffset border of width 3 pixels. Notice that also column header images can have its borders (these are SymmetricShadow).

    +

    When the border is defined and image size should be kept the same, some spacing have to be added around image. You can adjust this spacing to draw you own borders or any additional graphics (such as overlay icons). Here is an example –

    +
    Thumbnail with Extra Icons

    Thumbnail with Extra Icons

    +

    Download Better ListView

    +

    You can download Better ListView and play with it yourself.

    +]]>
    + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/thumbnails-view/index.html b/public/blog/tag/thumbnails-view/index.html new file mode 100644 index 0000000..f31538f --- /dev/null +++ b/public/blog/tag/thumbnails-view/index.html @@ -0,0 +1,212 @@ + + + + + + + +thumbnails view « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/thumbnails/feed/index.html b/public/blog/tag/thumbnails/feed/index.html new file mode 100644 index 0000000..199fa3b --- /dev/null +++ b/public/blog/tag/thumbnails/feed/index.html @@ -0,0 +1,130 @@ + + + + thumbnails – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    + + Displaying Thumbnails with Borders and Shadows + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/ + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/#respond + Mon, 14 Feb 2011 19:17:14 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=103 + + We’ve just released Better ListView version 1.50 with some new features – thumbnails view, image borders support (inc. shadows), and more.

    +

    Our great inspiration for designing Better ListView is nothing less than the mighty Windows Explorer. This file manager uses obviously much more powerful control that the regular .NET list-view alone is.

    +

    It supports some extra views, line Contents and Extra Large Icons. It is also possible to adjust image size by rolling a mouse wheel while holding Control key.

    +

    Better ListView has the capability of displaying item icons with arbitrary sizes, but we also extended it with one extra view: Thumbnails:

    +
    Thumbnails Sample

    Thumbnails Sample

    +

    This view aligns items in the center while keeping constant spacing between items. Thumbnails also keep just single line of text for compactness. On the other hand, LargeIcon view varies horizontal space between items to fill client area evenly and breaks long text into several lines.

    +

    The constant spacing is inspired by various photo managers, where image thumbnails are better viewed side-by-side (and the view looks also more organized).

    +

    Image thumbnails also look better with some kind border or frame. We added this new feature in Better ListView 1.5 and it works in all views. There are several pre-defined types of borders, but user can draw his own:

    +
      +
    • None – simply no border at all
    • +
    • Single – single line border
    • +
    • SingleOffset – single line with a spacing between image and the border
    • +
    • SymmetricShadow – smooth shadow around image
    • +
    • DropShadow – smooth shadow on the right bottom part of the image
    • +
    +

    Thumbnails use DropShadow by default, but it can be adjusted for every view separately. One can also adjust thickness of the border/shadow and define custom spacing around image.

    +

    Take a look at one possible setting:

    +
    Image Borders

    Image Borders

    +

    This is SingleOffset border of width 3 pixels. Notice that also column header images can have its borders (these are SymmetricShadow).

    +

    When the border is defined and image size should be kept the same, some spacing have to be added around image. You can adjust this spacing to draw you own borders or any additional graphics (such as overlay icons). Here is an example –

    +
    Thumbnail with Extra Icons

    Thumbnail with Extra Icons

    +

    Download Better ListView

    +

    You can download Better ListView and play with it yourself.

    +]]>
    + http://www.componentowl.com/blog/displaying-thumbnails-withs-borders-and-shadows/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/thumbnails/index.html b/public/blog/tag/thumbnails/index.html new file mode 100644 index 0000000..5ebd033 --- /dev/null +++ b/public/blog/tag/thumbnails/index.html @@ -0,0 +1,214 @@ + + + + + + + +thumbnails « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/tips-and-tricks/feed/index.html b/public/blog/tag/tips-and-tricks/feed/index.html new file mode 100644 index 0000000..5e1c981 --- /dev/null +++ b/public/blog/tag/tips-and-tricks/feed/index.html @@ -0,0 +1,55 @@ + + + + tips and tricks – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + How to Change List View Mouse Wheel Scroll Speed + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/ + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/#respond + Fri, 18 Mar 2011 18:22:44 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=189 + + Did you know that you can change the mouse wheel scroll speed of Better ListView?

    +

    Better ListView has property MouseWheelScrollExtent which is defined as “relative number of items to scroll for a single mouse wheel detent“.

    +

    What does it mean? Well, it basically defines by how many items will the list view scroll when you move the mouse wheel up or down. The default value of this property in version 1.51 is 2, so whenever you scroll up or down with your mouse wheel, the list view will move two items up or down.

    +

    You can set the MouseWheelScrollExtent to a larger value for faster scrolling, just like this:

    +

    BetterListView.MouseWheelScrollExtent := 3;

    +

    Now, every time you scroll, the list view will move by 3 items (which is similar to Windows Explorer, which usually moves by 3 items in the Details view).

    +]]>
    + http://www.componentowl.com/blog/how-to-change-list-view-mouse-wheel-scroll-speed/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/tips-and-tricks/index.html b/public/blog/tag/tips-and-tricks/index.html new file mode 100644 index 0000000..136aa44 --- /dev/null +++ b/public/blog/tag/tips-and-tricks/index.html @@ -0,0 +1,212 @@ + + + + + + + +tips and tricks « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/tracking/feed/index.html b/public/blog/tag/tracking/feed/index.html new file mode 100644 index 0000000..7b65e0e --- /dev/null +++ b/public/blog/tag/tracking/feed/index.html @@ -0,0 +1,154 @@ + + + + tracking – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/tracking/index.html b/public/blog/tag/tracking/index.html new file mode 100644 index 0000000..2e4a199 --- /dev/null +++ b/public/blog/tag/tracking/index.html @@ -0,0 +1,212 @@ + + + + + + + +tracking « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/tree-structure-in-listview/feed/index.html b/public/blog/tag/tree-structure-in-listview/feed/index.html new file mode 100644 index 0000000..e0a630a --- /dev/null +++ b/public/blog/tag/tree-structure-in-listview/feed/index.html @@ -0,0 +1,85 @@ + + + + tree structure in listview – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.0 Sneak Peek (Item hierarchy, groups, more) + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/ + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/#respond + Tue, 03 May 2011 09:28:55 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=232 + groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.]]> + Hierarchical items in two groups

    Hierarchical items in two groups

    +

    We are currently working hard on finishing Better ListView version 2.0 which will add new features: Support for groups, tree-like item structure (tree nodes are collapsible, as expected), and multi-line items.

    +

    We expect to release this upgrade in about a month. It will be a free upgrade for current and new users.

    +

    Groups

    +

    Groups in Better ListView have comparable capabilities as other Better ListView elements (column headers, items, sub-items). For example, you can adjust the foreground/background colors, font, image – and owner drawing is possible as well.

    +

    You can even include images into group headers (as you can see in the preview above), which is not possible in .NET ListView.

    +

    Groups are collapsible by default and the expand button can be switched off on each group individually.

    +

    Here are groups combined with Tile view (the second group is collapsed):

    +
    Groups with Tile view

    Groups with Tile view

    +

    The previous figure displays vertically oriented groups, but Better ListView also support horizontally oriented groups in the List mode:

    +
    Groups with List view

    Groups with List view

    +

    We put special effort to mimic the group display and behavior of Windows Explorer. The group headers can display all of the 15 group header states available in Windows visual style and their display is governed by the same logic as in the ListView counterpart.

    +

    The group headers always look perfect and native, right out of the box. You don’t need to tweak anything.

    +

    Item Hierarchy

    +
    +
    +

    +
    Items with hierarchy

    Items with hierarchy

    +

    +
    +
    +
    +

    This works in the similar way as in the standard TreeView control. Each item (or node) has property called ChildItems which can be filled with new BetterListViewItem instances. SubItems collection can still be used in either items and child-items (child items are treated in the very same way as their parents).

    +

    Item hierarchy can be combined with Groups feature as seen in the first preview.

    +

    Multi-Line Items

    +
    Multi-line items

    Multi-line items

    +

    A simple setting of item layout (MaximumTextLines property) allows breaking item text into several lines (up to the specified value). When the text is longer than MaximumTextLines, then the default trimming method is used (one from the TextTrimming enumeration: None, TrimCharacter, TrimWord, EllipsisCharacter, EllipsisWord, EllipsisPath).

    +

    Multi-line text can be used in every view and also in column headers.

    +

    Another New Features

    +

    There are also bunch of new minor features including:

    +

    Adjustable paddings – Every element part (e.g. item check box, group image…) contains customizable spaces at each side, so the user can easily create space where he needs and customize items/column headers/group headers to the finest detail.

    +

    Focusing sub-items – Items, group headers and even sub-items can be keyfocused. User can now invoke label editing or scroll to any “cell” in the Details-with-columns view solely with keyboard.

    +

    IEnumerable implementations –  BetterListView, BetterListViewGroup and BetterListViewItem implements IEnumerable interface for iterating through the whole item hierarchy, so using recursion to traverse child items is not necessary.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-0-sneak-peek-item-hierarchy-groups-more/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/tree-structure-in-listview/index.html b/public/blog/tag/tree-structure-in-listview/index.html new file mode 100644 index 0000000..7619f4f --- /dev/null +++ b/public/blog/tag/tree-structure-in-listview/index.html @@ -0,0 +1,212 @@ + + + + + + + +tree structure in listview « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/tree/feed/index.html b/public/blog/tag/tree/feed/index.html new file mode 100644 index 0000000..482be24 --- /dev/null +++ b/public/blog/tag/tree/feed/index.html @@ -0,0 +1,133 @@ + + + + tree – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + File Explorer with Better ListView + http://www.componentowl.com/blog/file-explorer-with-better-listview/ + http://www.componentowl.com/blog/file-explorer-with-better-listview/#respond + Tue, 09 Aug 2011 16:04:31 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=340 + + In release 2.0.2 we added a sample demonstrating how Better ListView can be used to construct folder tree and file browser to make a standalone file explorer:

    +

    File Explorer Sample

    +

    There are two controls derived from BetterListView. One for the navigation pane (folder tree on left side) and one for the file view (on the right side).

    +

    The FolderListView control allows browsing through virtual folders as well as folders on removable drives. We needed this control in our products because .NET does not provide any similar managed control (there is only FolderBrowserDialog, but we actually need a control).

    +

    You can use it for your purposes as well, it is available in Better ListView Samples source code.

    +

    Many features of Better ListView can be used to enhance file browsing, for example:

    +
      +
    • Drag and Drop – moving or copying files
    • +
    • Label Edit – renaming files
    • +
    • Thumbnails – display thumbnails of image files
    • +
    • Custom Tooltips – display extra information on each file item
    • +
    • Groups – organize files into groups (e.g. by size)
    • +
    • Check Boxes – select folders and sub-folders properly with three-state check boxes
    • +
    • Images – every file type could display different image (extracted icon)
    • +
    • Context Menus – do extra operations with files, like displaying file properties
    • +
    • Searching – doing keyboard search is very easy to search for some file
    • +
    • Sorting – sort files according to multiple properties (this is demonstrated in the sample)
    • +
    • Background Image – show that the user is located in special folder by ambient image on the background
    • +
    +]]>
    + http://www.componentowl.com/blog/file-explorer-with-better-listview/feed/ + 0 +
    + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/tree/index.html b/public/blog/tag/tree/index.html new file mode 100644 index 0000000..c5fe1dc --- /dev/null +++ b/public/blog/tag/tree/index.html @@ -0,0 +1,214 @@ + + + + + + + +tree « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/treeview/feed/index.html b/public/blog/tag/treeview/feed/index.html new file mode 100644 index 0000000..377bfbc --- /dev/null +++ b/public/blog/tag/treeview/feed/index.html @@ -0,0 +1,94 @@ + + + + treeview – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.00 released + http://www.componentowl.com/blog/better-listview-2-00-released/ + http://www.componentowl.com/blog/better-listview-2-00-released/#respond + Sun, 31 Jul 2011 15:25:39 +0000 + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=304 + + A new major version of Better ListView has been released! Download the new version.

    +
    Item hierarchy with multi-line items in groups

    Item hierarchy with multi-line items in groups

    +

    Summary of what’s new:

    +

    We have added four new major features:

    +
      +
    • Groups – items can be organized in collapsible groups
    • +
    • Item Hierarchy – items can be organized in a tree structure, can be also collapsed just like the nodes in a TreeView
    • +
    • Multi-Line Items – item texts can break in several lines and each item can have different size
    • +
    • Data Binding – complex data binding is fully supported, any List, DataTable, DataView, array or any other IList-type object can be bound to Better ListView as a data source
    • +
    +

    Many existing features of Better ListView has been enhanced in favor of these. For example:

    +
      +
    • Item reordering can be done with hierarchical items as well; user can even create child items
    • +
    • It is possible to move items between different groups
    • +
    +

    Some of the minor features added are:

    +
      +
    • Layouts can be adjustable – item sizes and spacings, even internal spacings
    • +
    • Added new label editing controls (calendar and drop down box)
    • +
    • Better ListView content (columns, items and groups) can be saved to file (XML or binary)
    • +
    • Multi-line items support added
    • +
    • See full changelog for details
    • +
    +

    We have also fixed many issues and improved performance of Thumbnails view and operations with collections.

    +

    About then new version

    +

    The new version 2.00 brings new major features, the most important one being item hierarchy support. This allows you to create tree-list structures in the list view, without having to sacrifice any of the list view functionality (columns, sorting, grouping, Drag and Drop reordering, etc).

    +

    Highly customizable item grouping capabilities were added. Individual group headers can have customized look and behavior. The group headers can be collapsible, support images, custom context menus, are focusable, and more.

    +

    Version 2.0 also improves the thumbnail view. The control handles larger images smoothly, even while resizing.

    +

    List items, group headers and column header can newly have custom padding specified for all of their elements, which makes it easy to do owner drawing of custom elements, such as overlay icons in the thumbnail view. Every part of the control can be newly replaced by custom drawing, not just overdrawn.

    +

    Version 2.0 newly allows you to save/load the list view contents with 1 just line of code, either in XML or binary format, to either file or string. Data-binding with custom column-mapping is supported as well.

    +

    Multi-line listview items are also newly supported. List items with very long text can take place of two (r more) regular items, so the text whole text is readable.

    +
    Better ListView 2

    Thumbnails in groups

    +
    DataTable bound to Better ListView

    DataTable bound to Better ListView

    +

    Other news – new comics for developers!

    +

    We’ve also started publishing new webcomics for developers on our website, drawn by the Better ListView lead developer, Libor Tinka.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-00-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/treeview/index.html b/public/blog/tag/treeview/index.html new file mode 100644 index 0000000..130db3a --- /dev/null +++ b/public/blog/tag/treeview/index.html @@ -0,0 +1,212 @@ + + + + + + + +treeview « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/underline/feed/index.html b/public/blog/tag/underline/feed/index.html new file mode 100644 index 0000000..d0c327c --- /dev/null +++ b/public/blog/tag/underline/feed/index.html @@ -0,0 +1,154 @@ + + + + underline – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hot Tracking Items in Better ListView + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/ + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/#respond + Fri, 15 Feb 2013 22:52:12 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=861 + + Hot Tracking

    Hot Tracking

    +

    This post will show you how easy it is to make item hot tracking in Better ListView.

    +

    First, create a global variable in your Form or Control-derived class to hold a Font instance we will use for hot tracked items:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private Font fontHot = new Font(“Segoe UI”, 12.0f, FontStyle.Bold);
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private fontHot As New Font(“Segoe UI”, 12F, FontStyle.Bold)
    +[/vb]

    +

    This is not necessary, but we will re-use the font and will not need to create and dispose Font instances during hot tracking.

    +

    Second, initialize a BetterListView instance:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +var listView = new CustomListView();

    +

    // add some items in the list
    +listView.Items.AddRange(new string[] { “The Hobbit”, “The People’s Crisis”, “The Net” });

    +

    // set default font for the items
    +listView.FontItems = new Font(“Segoe UI”, 12.0f, FontStyle.Regular);

    +

    // add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged;
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Dim listView = New CustomListView()

    +

    ‘ add some items in the list
    +listView.Items.AddRange(New String() {“The Hobbit”, “The People’s Crisis”, “The Net”})

    +

    ‘ set default font for the items
    +listView.FontItems = New Font(“Segoe UI”, 12F, FontStyle.Regular)

    +

    ‘ add HitTestChanged event handler
    +listView.HitTestChanged += ListViewHitTestChanged
    +[/vb]

    +

    Finally, implement the HitTestChanged event handler:

    +

    C#

    +

    [csharp gutter=”false” toolbar=”false”]
    +private void ListViewHitTestChanged(object sender, BetterListViewHitTestChangedEventArgs eventArgs)
    +{
    + BetterListView listView = (sender as BetterListView);
    + BetterListViewItem itemCurrent = eventArgs.HitTestInfoCurrent.ItemDisplay;
    + BetterListViewItem itemNew = eventArgs.HitTestInfoNew.ItemDisplay;

    +

    if (!ReferenceEquals(itemCurrent, itemNew))
    + {
    + listView.BeginUpdate();

    +

    if (itemCurrent != null)
    + {
    + // reset colors and font to default
    + itemCurrent.BackColor = Color.Empty;
    + itemCurrent.ForeColor = Color.Empty;
    + itemCurrent.Font = null;
    + }

    +

    if (itemNew != null)
    + {
    + // set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow;
    + itemNew.ForeColor = Color.DarkRed;
    + itemNew.Font = this.fontHot;
    + }

    +

    listView.EndUpdate();
    + }
    +}
    +[/csharp]

    +

    Visual Basic

    +

    [vb gutter=”false” toolbar=”false”]
    +Private Sub ListViewHitTestChanged(sender As Object, eventArgs As BetterListViewHitTestChangedEventArgs)
    + Dim listView As BetterListView = TryCast(sender, BetterListView)
    + Dim itemCurrent As BetterListViewItem = eventArgs.HitTestInfoCurrent.ItemDisplay
    + Dim itemNew As BetterListViewItem = eventArgs.HitTestInfoNew.ItemDisplay

    +

    If Not ReferenceEquals(itemCurrent, itemNew) Then
    + listView.BeginUpdate()

    +

    If itemCurrent IsNot Nothing Then
    + ‘ reset colors and font to default
    + itemCurrent.BackColor = Color.Empty
    + itemCurrent.ForeColor = Color.Empty
    + itemCurrent.Font = Nothing
    + End If

    +

    If itemNew IsNot Nothing Then
    + ‘ set hot background color of an item newly hovered
    + itemNew.BackColor = Color.GreenYellow
    + itemNew.ForeColor = Color.DarkRed
    + itemNew.Font = Me.fontHot
    + End If

    +

    listView.EndUpdate()
    + End If
    +End Sub
    +[/vb]

    +

    This method is called whenever an element over which mouse cursors hovers changes. For example, when one moves the mouse cursor between two item’s expand button element and text element or between two items. We detect just the latter case and set item properties accordingly.

    +

    Thats’ it!

    +

    Of course, you can change any of the properties during hot tracking or make use of rich Owner Drawing capabilities.

    +]]>
    + http://www.componentowl.com/blog/hot-tracking-items-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/underline/index.html b/public/blog/tag/underline/index.html new file mode 100644 index 0000000..7b2e7f1 --- /dev/null +++ b/public/blog/tag/underline/index.html @@ -0,0 +1,212 @@ + + + + + + + +underline « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/update/feed/index.html b/public/blog/tag/update/feed/index.html new file mode 100644 index 0000000..54700b2 --- /dev/null +++ b/public/blog/tag/update/feed/index.html @@ -0,0 +1,115 @@ + + + + update – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.10 released + http://www.componentowl.com/blog/better-listview-2-10-released/ + http://www.componentowl.com/blog/better-listview-2-10-released/#respond + Fri, 14 Oct 2011 16:57:54 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=373 + + A new version with major improvements, optimizations and fixes has been released! It addresses many suggestions provided by you, our valued customers.

    +

    Improved Performance

    +

    We put a considerable effort into optimizing Better ListView 2 to provide advanced features (e.g. hierarchical and multi-line items, collapsible groups) while still being swift and responsive.

    +

    The overall performance has greatly improved. Better ListView 2.1 can easily handle 10.000 items while still being very fast. The parts where improvements are best seen are:

    +
    +
      +
    • Adding many items to the list
    • +
    • Expanding/collapsing of hierarchical items
    • +
    • Resizing a column
    • +
    +
    We also added new options in the Performance property group, so you can easily switch between fast and powerful options.
    +
    +

    Samples in both C# and Visual Basic

    +

    We added easy to understand samples for both C# and Visual Basic.

    +

    You can simply follow a link from start menu to open the Visual Studio project for your favourite language, and play with all the features of Better ListView.

    +
    C# and VB Samples projects in Solution Explorer

    C# and VB Samples projects in Solution Explorer

    +

     

    +

    Extended Documentation

    +

    We added a Quick Start Tutorial to help you with setup, activation and integration of Better ListView in your projects, as well as many entirely new chapters in the documentation.

    +

    All code samples are from now on provided in both C# and Visual Basic to be easy to understand to both C# and VB.net developers.

    +

    Smoother migration from .NET ListView to Better ListView

    +

    Better ListView now contains all the constructor/method overloads and properties of the regular .NET ListView, so that for each member of .NET ListView there is an easily discoverable equivalent in Better ListView.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-10-released/feed/ + 0 +
    + + Work in Progress: “Groups” / “Item Hierarchy” Features + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond + Fri, 25 Mar 2011 23:11:00 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=204 + + We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    +]]>
    + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/update/index.html b/public/blog/tag/update/index.html new file mode 100644 index 0000000..9406618 --- /dev/null +++ b/public/blog/tag/update/index.html @@ -0,0 +1,214 @@ + + + + + + + +update « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/variable/feed/index.html b/public/blog/tag/variable/feed/index.html new file mode 100644 index 0000000..7e6e8a4 --- /dev/null +++ b/public/blog/tag/variable/feed/index.html @@ -0,0 +1,59 @@ + + + + variable – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Item Height in Details View of Better ListView + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/ + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/#respond + Wed, 21 Mar 2012 15:10:52 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=760 + + Better ListView 2.7.0.0 now supports items of arbitrary height in Details view:

    +
    Items with custom height

    Items with custom height

    +

    Items with variable heights were possible in recent versions of Better ListView as well, but this adjustment was limited to heights which are multiples of text line height.

    +

    We have introduced a BetterListViewItem.CustomHeight property, which is 0 by default.

    +

    Every item has some minimum size (defined by the font and image) but it can get arbitrarily larger. The following formula explains how item height is measured in Better ListView:

    +

    height = max(minimum height, image height, text height, custom height)

    +

    Setting minimum height for all items is possible through layout properties and the latter is defined by the item itself.

    +]]>
    + http://www.componentowl.com/blog/custom-item-height-in-details-view-of-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/variable/index.html b/public/blog/tag/variable/index.html new file mode 100644 index 0000000..c891699 --- /dev/null +++ b/public/blog/tag/variable/index.html @@ -0,0 +1,212 @@ + + + + + + + +variable « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/vertical/feed/index.html b/public/blog/tag/vertical/feed/index.html new file mode 100644 index 0000000..188c6b3 --- /dev/null +++ b/public/blog/tag/vertical/feed/index.html @@ -0,0 +1,72 @@ + + + + vertical – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Vertical Alignment and Text Wrapping in Better ListView + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/ + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/#comments + Wed, 16 Nov 2011 23:57:39 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=437 + + .NET ListView supports horizontal alignment of text in columns, items, sub-items and groups. Since Better ListView adds many new features, like multi-line items and images of arbitrary size, vertical alignment comes in handy.

    +

    By default, each view has its defaults, but you can customize text alignment on every column, item, sub-item and group individually:

    +
    +
    Vertical alignments of text

    Vertical alignments of text

    +
    +
    +
    +
    +

    The vertical alignment feature is a new property of each element type. For example, .NET ListView item has a property called Align which refers to horizontal alignment. Better ListView extends this to two independent properties called AlignHorizontal and AlignVertical. The naming scheme is same for columns, items, sub-items and groups.

    +

    Better ListView also supports splitting text in column headers and items (sub-items) into multiple lines.

    +

    We extended this functionality by adding a BetterListViewItem.TextWrapping and BetterListViewSubItem.TextWrapping properties. With these, you can control how the text in sub-items will be wrapped. There are three possible values:

    +
      +
    • Layout – the text will be wrapped to multiple lines, up to value specified by MaximumTextLines property of the corresponding view (layout)
    • +
    • None – the text will not be wrapped at all
    • +
    • Space – the text will be wrapped, but only to available space (item will never get higher due to wrapping text in sub-item with this setting)
    • +
    +
    The following screenshot shows these three wrapping modes in action:
    +
    +
    Various text wrapping modes

    Various text wrapping modes

    +
    +

    The sub-item in the first column has TextWrapping set to Layout and the layout has MaximumTextLines set to 4. The sub-item text thus can be split to up to four lines. It is actually split just to three because the column is wide enough.

    +

    The sub-item in the second column has TextWrapping set to None, which means the text in this sub-item is kept on single line.

    +

    The sub-item in the third column has TextWrapping set to Space. As you can see, even if the MaximumTextLines is set to 4, the sub-item text is limited to three lines, preventing item to grow larger.

    +]]>
    + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/vertical/index.html b/public/blog/tag/vertical/index.html new file mode 100644 index 0000000..324b325 --- /dev/null +++ b/public/blog/tag/vertical/index.html @@ -0,0 +1,212 @@ + + + + + + + +vertical « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/view/feed/index.html b/public/blog/tag/view/feed/index.html new file mode 100644 index 0000000..f736760 --- /dev/null +++ b/public/blog/tag/view/feed/index.html @@ -0,0 +1,59 @@ + + + + view – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Spacing between Items in Details View + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/ + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/#respond + Tue, 13 Mar 2012 22:53:09 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=753 + + Better ListView 2.6 newly supports custom spacing between items in Details view:

    +
    Custom Spacing between Items

    Custom Spacing between Items

    +

    This property has been recently available in other views, but Details view was exception since its selections needed to be treated in different way: They overlap by 1 pixel so that the double border is avoided in neighboring selections:

    +
    1 px overlap of items

    1 px overlap of items

    +

    We have resolved this to get proper behavior with custom spacings and now the spacing can be set the same way as in any other view:

    +

    Simply set LayoutItemsCurrent.ElementOuterPadding to have custom horizontal and vertical padding between items.

    +

    You can set this specifically for Details view by refering to property LayoutItemsDetails or LayoutItemsDetailsColumns (Details view with columns).

    +]]>
    + http://www.componentowl.com/blog/custom-spacing-between-items-in-details-view/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/view/index.html b/public/blog/tag/view/index.html new file mode 100644 index 0000000..a3bc334 --- /dev/null +++ b/public/blog/tag/view/index.html @@ -0,0 +1,212 @@ + + + + + + + +view « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/visibility/feed/index.html b/public/blog/tag/visibility/feed/index.html new file mode 100644 index 0000000..9ab29bd --- /dev/null +++ b/public/blog/tag/visibility/feed/index.html @@ -0,0 +1,69 @@ + + + + visibility – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hiding Column Headers in Better ListView + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/ + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/#respond + Mon, 27 Aug 2012 23:11:27 +0000 + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=803 + + Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

    +
    Hiding Column Headers

    Hiding Column Headers

    +

    To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

    +
      +
    • None – column headers are hidden, but corresponding sub-items are still visible
    • +
    • Nonclickable – column headers are visible, but not interactive
    • +
    • Clickable – column headers interact with mouse (have hot and pressed state)
    • +
    • Sortable – column headers are clickable and sort the corresponding column when clicked
    • +
    • Unsortable – same as Sortable, but the column headers have unsorted state as well
    • +
    • Hidden – column headers are hidden with corresponding sub-items
    • +
    +

    These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

    +

    When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

    +

    When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

    +]]>
    + http://www.componentowl.com/blog/hiding-column-headers-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/visibility/index.html b/public/blog/tag/visibility/index.html new file mode 100644 index 0000000..09370d4 --- /dev/null +++ b/public/blog/tag/visibility/index.html @@ -0,0 +1,212 @@ + + + + + + + +visibility « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/visible/feed/index.html b/public/blog/tag/visible/feed/index.html new file mode 100644 index 0000000..4b340b8 --- /dev/null +++ b/public/blog/tag/visible/feed/index.html @@ -0,0 +1,91 @@ + + + + visible – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Hiding Items in Better ListView + http://www.componentowl.com/blog/hiding-items-in-better-listview/ + http://www.componentowl.com/blog/hiding-items-in-better-listview/#respond + Mon, 06 Feb 2012 16:23:15 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=546 + + We currently introduced a BetterListViewItem.Visible property to allow hiding items visually, but keeping then in the Items collection:

    +
    Making items invisible

    Making items invisible

    +

    The above image shows two groups of items. The first groups uses hiding of items with the Visible property, while the second group simply turns off drawing of ceratin items.

    +

    The first approach is useful when you need to hide item as if it is removed, but keep it actually within Items collection.

    +

    The second approach need to create new control inheriting from BetterListView, overrride the OnDrawItem method and set properties like BetterListViewDrawItemEventArgs.DrawImage to false or simply not call the base implementation of OnDrawItem.

    +

    The second (owner drawing) approach is useful when you need just to switch off display of item without changing the item layout.

    +]]>
    + http://www.componentowl.com/blog/hiding-items-in-better-listview/feed/ + 0 +
    + + How to Hide a Column in Better ListView + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/ + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/#respond + Fri, 05 Aug 2011 11:56:31 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=330 + + The most popular view in ListView-like controls seems to be the “Details” view with columns, items and sub-items.

    +

    When someone wants to remove a column, he usually thinks of simply removing the column header from the Columns collection. Unfortunately, it’s not that simple. The sub-items get shifted and he needs to remove sub-items corresponding to the removed column for all items as well.

    +

    This is because ListView is not a control for displaying grids (a matrix of cells), but really the lists – sequences of objects, and the sub-items are not cells either, they are something like an extension of each item to support additional information about the item.

    +

    So how we neatly hide a column?

    +

    We introduced Column Hiding feature in the version 2.0.1. You can simply call Hide() on your column header instance and you’re done! There is also corresponding Show() method provided. Or you can set boolean Visible property. Now the column and all subsequent sub-items are hidden from view (although they are still present in data, of course):

    +

     

    +
    Hiding column via context menu

    Hiding column via context menu...

    +

     

    +
    The sixth column is hidden...

    ...and the sixth column gets hidden.

    +

     

    +

    Download Better ListView

    +]]>
    + http://www.componentowl.com/blog/how-to-hide-a-column-in-better-listview/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/visible/index.html b/public/blog/tag/visible/index.html new file mode 100644 index 0000000..7f44dea --- /dev/null +++ b/public/blog/tag/visible/index.html @@ -0,0 +1,214 @@ + + + + + + + +visible « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/visual/feed/index.html b/public/blog/tag/visual/feed/index.html new file mode 100644 index 0000000..304ee54 --- /dev/null +++ b/public/blog/tag/visual/feed/index.html @@ -0,0 +1,71 @@ + + + + visual – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Work in Progress: “Groups” / “Item Hierarchy” Features + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond + Fri, 25 Mar 2011 23:11:00 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=204 + + We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    +]]>
    + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/visual/index.html b/public/blog/tag/visual/index.html new file mode 100644 index 0000000..fb15018 --- /dev/null +++ b/public/blog/tag/visual/index.html @@ -0,0 +1,212 @@ + + + + + + + +visual « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/whats-new/feed/index.html b/public/blog/tag/whats-new/feed/index.html new file mode 100644 index 0000000..add13ac --- /dev/null +++ b/public/blog/tag/whats-new/feed/index.html @@ -0,0 +1,97 @@ + + + + what’s new – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better ListView 2.10 released + http://www.componentowl.com/blog/better-listview-2-10-released/ + http://www.componentowl.com/blog/better-listview-2-10-released/#respond + Fri, 14 Oct 2011 16:57:54 +0000 + + + + + + + + + + + + http://www.componentowl.com/blog/?p=373 + + A new version with major improvements, optimizations and fixes has been released! It addresses many suggestions provided by you, our valued customers.

    +

    Improved Performance

    +

    We put a considerable effort into optimizing Better ListView 2 to provide advanced features (e.g. hierarchical and multi-line items, collapsible groups) while still being swift and responsive.

    +

    The overall performance has greatly improved. Better ListView 2.1 can easily handle 10.000 items while still being very fast. The parts where improvements are best seen are:

    +
    +
      +
    • Adding many items to the list
    • +
    • Expanding/collapsing of hierarchical items
    • +
    • Resizing a column
    • +
    +
    We also added new options in the Performance property group, so you can easily switch between fast and powerful options.
    +
    +

    Samples in both C# and Visual Basic

    +

    We added easy to understand samples for both C# and Visual Basic.

    +

    You can simply follow a link from start menu to open the Visual Studio project for your favourite language, and play with all the features of Better ListView.

    +
    C# and VB Samples projects in Solution Explorer

    C# and VB Samples projects in Solution Explorer

    +

     

    +

    Extended Documentation

    +

    We added a Quick Start Tutorial to help you with setup, activation and integration of Better ListView in your projects, as well as many entirely new chapters in the documentation.

    +

    All code samples are from now on provided in both C# and Visual Basic to be easy to understand to both C# and VB.net developers.

    +

    Smoother migration from .NET ListView to Better ListView

    +

    Better ListView now contains all the constructor/method overloads and properties of the regular .NET ListView, so that for each member of .NET ListView there is an easily discoverable equivalent in Better ListView.

    +]]>
    + http://www.componentowl.com/blog/better-listview-2-10-released/feed/ + 0 +
    + + Better ListView 1.52 released + http://www.componentowl.com/blog/better-listview-1-52-released/ + http://www.componentowl.com/blog/better-listview-1-52-released/#respond + Tue, 29 Mar 2011 16:21:14 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=213 + + Another minor release with many fixes and some new features.

    +

    See what’s new in Better ListView 1.52.

    +

    Download the new version.

    +

    We are still working on the new major features (Item hierarchy, groups) as described here. These new features are near completion.

    +]]>
    + http://www.componentowl.com/blog/better-listview-1-52-released/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/whats-new/index.html b/public/blog/tag/whats-new/index.html new file mode 100644 index 0000000..eebdef5 --- /dev/null +++ b/public/blog/tag/whats-new/index.html @@ -0,0 +1,214 @@ + + + + + + + +what’s new « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/width/feed/index.html b/public/blog/tag/width/feed/index.html new file mode 100644 index 0000000..f3894ed --- /dev/null +++ b/public/blog/tag/width/feed/index.html @@ -0,0 +1,70 @@ + + + + width – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Custom Scroll Bar Size in Better ListView + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments + Tue, 19 Mar 2013 15:56:22 +0000 + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=878 + + Better ListView custom scroll bar size

    Better ListView custom scroll bar size

    +

    Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:

    +
      +
    • HScrollBarWidth
    • +
    • VScrollBarHeight
    • +
    +

    Of course, you can set these custom sizes in design-time as well as in run-time.

    +

    Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.

    +

    This features works in both Better ListView and Better ListView Express.

    +

     

    +

     

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ + 4 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/width/index.html b/public/blog/tag/width/index.html new file mode 100644 index 0000000..e883aa0 --- /dev/null +++ b/public/blog/tag/width/index.html @@ -0,0 +1,212 @@ + + + + + + + +width « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/winforms/feed/index.html b/public/blog/tag/winforms/feed/index.html new file mode 100644 index 0000000..147d3b5 --- /dev/null +++ b/public/blog/tag/winforms/feed/index.html @@ -0,0 +1,84 @@ + + + + winforms – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Better Thumbnail Browser Component Released + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/ + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/#comments + Sat, 01 Dec 2012 18:26:16 +0000 + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=823 + +  

    +

    We have released a whole new WinForms component called Better Thumbnail Browser. This control is useful for anyone developing photo management software or any kind of image database:

    +
    Better Thumbnail Browser Overview

    Better Thumbnail Browser Overview

    +

    The control is capable of loading image thumbnails on background and does all the dirty job of threading and synchronization for you.

    +

    My motivation to make such component as lead developer at ComponentOwl.com was to have something that can smoothly integrate in my photo management software.

    +

    Since we already have Better ListView component, which is quite mature (three major releases over two years of development), I decided to build upon it and finally make control for image thumbnails that is both extensible and powerful and have native look and feel.

    +

    Better Thumbnail Browser inherits most of its functionality from Better ListView (multi column sorting, custom paddings and spacings, multi-line text and groups to name a few). It adds image loading logic on top of it, which can handle various scenarios:

    +
      +
    • Load images from a folder, database or custom source automatically
    • +
    • Load thumbnails with arbitrary sizes on background while progressively displaying them
    • +
    • Handle zooming thumbnails on the fly
    • +
    • Loading thumbnail items in multiple passes (e.g. load meta-data, then low quality image, then high quality image)
    • +
    • Loading thumbnails in custom order
    • +
    • Loading visible thumbnails first, then all other (and do this even though the user is scrolling the view)
    • +
    • Manage updating individual thumbnails or their count on the fly
    • +
    • Support showing loading progress
    • +
    +

    The component is fully customizable and by default inherits native Windows theme. We tested it on Windows 8 with success:

    +
    Better Thumbnail Browser with Windows 8 Theme

    Better Thumbnail Browser with Windows 8 Theme

    +

     

    +

    Better Thumbnail Browser contains default implementation for loading thumbnail images from disk. If you want to gather all images from a given folder (say “c:\images”), display them in Better Thumbnail Browser and load them on background, the code is particularly simple:

    +
    thumbnailBrowser.Path = "c:\\images";
    +

    And that’s it!

    +

    Better Thumbnail Browser will be our third component which is used in end-user consumer-level software package. This ensures future development, improvements and support.

    +

     

    +

     

    +]]>
    + http://www.componentowl.com/blog/better-thumbnail-browser-component-released/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/winforms/index.html b/public/blog/tag/winforms/index.html new file mode 100644 index 0000000..96af9ec --- /dev/null +++ b/public/blog/tag/winforms/index.html @@ -0,0 +1,212 @@ + + + + + + + +winforms « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/work-focus/feed/index.html b/public/blog/tag/work-focus/feed/index.html new file mode 100644 index 0000000..fe72d04 --- /dev/null +++ b/public/blog/tag/work-focus/feed/index.html @@ -0,0 +1,151 @@ + + + + work focus – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/work-focus/index.html b/public/blog/tag/work-focus/index.html new file mode 100644 index 0000000..68ecb5b --- /dev/null +++ b/public/blog/tag/work-focus/index.html @@ -0,0 +1,212 @@ + + + + + + + +work focus « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/working-on/feed/index.html b/public/blog/tag/working-on/feed/index.html new file mode 100644 index 0000000..e6ea553 --- /dev/null +++ b/public/blog/tag/working-on/feed/index.html @@ -0,0 +1,104 @@ + + + + working on – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Coming soon: Better ListView 2.1 Optimized for Performance + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/ + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/#respond + Mon, 05 Sep 2011 16:33:45 +0000 + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=348 + + Better ListView 2 comes with many hot features, like groups and item hierarchy. Great features, unfortunately, often come at the price of decreased performance. However, we want to have Better ListView both feature-rich and fast.

    +

    Some users noticed a performance drop when working with large number of items (say 10 000+). Our top priority for version 2.1 is the overall optimization of Better ListView. Several optimizations have already been made in the recent updates (column resizing and thumbnail images), but we have to go further. You can expect Better ListView to be much snappier in the upcoming 2.1 update. The optimizations will cover these areas:

    +
      +
    • Faster collection operations (adding, removing, sorting) of large number of items
    • +
    • Faster expand/collapse of groups and items
    • +
    • Faster column resizing with multi-line items
    • +
    +

    We will also take a look on smoother Visual Studio integration, so you can see Better ListView ready in toolbox just after installation (we have to deal with Visual Studio Packages, which is quite an esoteric topic). If Better ListView doesn’t currently appear in your Visual Studio toolbox automatically, you can just right-click the toolbox window, and use “Choose Items” to add the DLL file yourself.

    +

    Some background info for the more curious of you: Version 1.5 of Better ListView was very fast. It was so fast because every item in the list had precisely the same size. Some operations, like hit testing, was done in constant time and no extra measurement of individual items was necessary. The new major 2.0 version of Better ListView supports items with variable sizes, and irregular layout consisting of grouped items. However, we observed that even in complex settings, there are just few “types” of items – for example, there are only three possible item sizes when using multi-line items with up to three lines of text. Our optimizations will thus be focused on taking advantage of this to reduce most expensive operations back to constant time complexity.

    +
    photo by Michael Roper

    photo by Michael Roper

    +]]>
    + http://www.componentowl.com/blog/coming-soon-better-listview-2-1-optimized-for-performance/feed/ + 0 +
    + + Work in Progress: “Groups” / “Item Hierarchy” Features + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond + Fri, 25 Mar 2011 23:11:00 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=204 + + We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    +]]>
    + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/working-on/index.html b/public/blog/tag/working-on/index.html new file mode 100644 index 0000000..223c32e --- /dev/null +++ b/public/blog/tag/working-on/index.html @@ -0,0 +1,214 @@ + + + + + + + +working on « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/wrapping/feed/index.html b/public/blog/tag/wrapping/feed/index.html new file mode 100644 index 0000000..24faacb --- /dev/null +++ b/public/blog/tag/wrapping/feed/index.html @@ -0,0 +1,72 @@ + + + + wrapping – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Vertical Alignment and Text Wrapping in Better ListView + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/ + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/#comments + Wed, 16 Nov 2011 23:57:39 +0000 + + + + + + + + + + http://www.componentowl.com/blog/?p=437 + + .NET ListView supports horizontal alignment of text in columns, items, sub-items and groups. Since Better ListView adds many new features, like multi-line items and images of arbitrary size, vertical alignment comes in handy.

    +

    By default, each view has its defaults, but you can customize text alignment on every column, item, sub-item and group individually:

    +
    +
    Vertical alignments of text

    Vertical alignments of text

    +
    +
    +
    +
    +

    The vertical alignment feature is a new property of each element type. For example, .NET ListView item has a property called Align which refers to horizontal alignment. Better ListView extends this to two independent properties called AlignHorizontal and AlignVertical. The naming scheme is same for columns, items, sub-items and groups.

    +

    Better ListView also supports splitting text in column headers and items (sub-items) into multiple lines.

    +

    We extended this functionality by adding a BetterListViewItem.TextWrapping and BetterListViewSubItem.TextWrapping properties. With these, you can control how the text in sub-items will be wrapped. There are three possible values:

    +
      +
    • Layout – the text will be wrapped to multiple lines, up to value specified by MaximumTextLines property of the corresponding view (layout)
    • +
    • None – the text will not be wrapped at all
    • +
    • Space – the text will be wrapped, but only to available space (item will never get higher due to wrapping text in sub-item with this setting)
    • +
    +
    The following screenshot shows these three wrapping modes in action:
    +
    +
    Various text wrapping modes

    Various text wrapping modes

    +
    +

    The sub-item in the first column has TextWrapping set to Layout and the layout has MaximumTextLines set to 4. The sub-item text thus can be split to up to four lines. It is actually split just to three because the column is wide enough.

    +

    The sub-item in the second column has TextWrapping set to None, which means the text in this sub-item is kept on single line.

    +

    The sub-item in the third column has TextWrapping set to Space. As you can see, even if the MaximumTextLines is set to 4, the sub-item text is limited to three lines, preventing item to grow larger.

    +]]>
    + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/feed/ + 1 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/wrapping/index.html b/public/blog/tag/wrapping/index.html new file mode 100644 index 0000000..a8cc8e3 --- /dev/null +++ b/public/blog/tag/wrapping/index.html @@ -0,0 +1,212 @@ + + + + + + + +wrapping « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/xp/feed/index.html b/public/blog/tag/xp/feed/index.html new file mode 100644 index 0000000..806d36a --- /dev/null +++ b/public/blog/tag/xp/feed/index.html @@ -0,0 +1,106 @@ + + + + xp – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Windows Theme Support in Better ListView + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/#respond + Fri, 01 Jul 2011 22:46:55 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=287 + + Both current Better ListView 1.5 and the upcoming Better ListView 2.0 put emphasis on native theme support.

    +

    Contrary to many custom controls, Better ListView adjusts itself to current theme even if the theme is changed in run-time. For example, when user of your application switches theme from Classic to Aero, or to some other custom theme with elements of different sizes, Better ListView re-measures itself for the new theme smoothly. Reloading the component or re-starting the application is not necessary.

    +

    One of the sweet bonuses of using Better ListView 2.0 instead of regular .NET ListView is the full Groups functionality in all themes and all versions of the operating system. For example, groups are not collapsible in standard ListView on Windows XP and even does not support images. In Better ListView, however, you are able to unleash full potential of groups everywhere.

    +

    The following images show Better ListView in different Windows themes: Classic, XP Luna and Aero:

    +
    Better ListView in Classic theme

    Better ListView in Classic theme

    +
    Better ListView in XP Luna Theme

    Better ListView in XP Luna Theme

    +
    Better ListView in Aero Theme

    Better ListView in Aero Theme

    +

     

    +]]>
    + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/feed/ + 0 +
    + + Work in Progress: “Groups” / “Item Hierarchy” Features + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/#respond + Fri, 25 Mar 2011 23:11:00 +0000 + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=204 + + We’re currently developing complex, but very useful features for the new major version of Better ListView:

    +
      +
    • Groups – to enable grouping items into collapsible areas with “group headers”
    • +
    • Item Hierarchy – to allow for visually organizing items like in the tree
    • +
    +

    We are facing some non-trivial obstacles on the journey You might be interested in:

    +

    Tree Structure vs List Structure

    +

    In all tree/list hybrid controls we saw there is an underlying tree structure made of nodes (like in the TreeView control). These hybrid controls are basically a tree with ability to be displayed as list.

    +

    In Better ListView, however, the primary data structure is a list, which is flat. Item hierarchy is still possible and really simple to use, just by enabling the user to set level of any item. If the item has higher level than some item above it, Better ListView will display this as a “child” item, allowing user to even collapse parent item without affecting the data structure. Sorting is also possible through “range sort”, e.g. sort only selected items or items in a certain level of hierarchy.

    +

    Compared to tree-like structure, user can still bind an IList to Better ListView or serialize/traverse through the whole item “hierarchy” with a simple foreach block.

    +

    Keeping Native Look

    +

    .NET 2.0 supports visual styles through its VisualStyleElement and VisualStyleRenderer classes, but this support is limited to basic elements. When it comes to shiny new elements that can be seen in Windows Explorer (e.g. triangular expando buttons or styles group headers), one have to hack into Windows theme to obtain correct constants. We did this nasty work to bring user visual style that matches exactly what he sees in native controls:

    +
    Visual Style Elements for Groups

    Visual Style Elements for Groups

    +

    The picture shows all the elements used in “Groups” and “Item Hierarchy” features. As You can see, it is a LOT. Only group header alone has 15 (!) states that should be drawn each in its specific situation. And Better ListView will handle all of them automatically for you.

    +

    We’ve taken customized themes into consideration, as well as older themes like “Vista Basic” or “XP Luna” or “Classic”. In all cases, we test control display thoroughly to obtain consistent results (a solid reference for us is a good old Windows Explorer as it shows most up-to-date wonders of native ListView control in each version of Windows at one place).

    +]]>
    + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/ + 0 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/xp/index.html b/public/blog/tag/xp/index.html new file mode 100644 index 0000000..e243213 --- /dev/null +++ b/public/blog/tag/xp/index.html @@ -0,0 +1,214 @@ + + + + + + + +xp « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/zen-coder/feed/index.html b/public/blog/tag/zen-coder/feed/index.html new file mode 100644 index 0000000..9929dcf --- /dev/null +++ b/public/blog/tag/zen-coder/feed/index.html @@ -0,0 +1,151 @@ + + + + zen coder – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/zen-coder/index.html b/public/blog/tag/zen-coder/index.html new file mode 100644 index 0000000..1b912a5 --- /dev/null +++ b/public/blog/tag/zen-coder/index.html @@ -0,0 +1,212 @@ + + + + + + + +zen coder « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/zen-habits/feed/index.html b/public/blog/tag/zen-habits/feed/index.html new file mode 100644 index 0000000..51dee82 --- /dev/null +++ b/public/blog/tag/zen-habits/feed/index.html @@ -0,0 +1,151 @@ + + + + zen habits – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/zen-habits/index.html b/public/blog/tag/zen-habits/index.html new file mode 100644 index 0000000..8621b10 --- /dev/null +++ b/public/blog/tag/zen-habits/index.html @@ -0,0 +1,212 @@ + + + + + + + +zen habits « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tag/zen/feed/index.html b/public/blog/tag/zen/feed/index.html new file mode 100644 index 0000000..fc43bcb --- /dev/null +++ b/public/blog/tag/zen/feed/index.html @@ -0,0 +1,151 @@ + + + + zen – Owl's Blog on .NET development + + http://www.componentowl.com/blog + Component Owl codes Better ListView control all night so you don't have to. + Tue, 04 Sep 2018 13:10:05 +0000 + en-US + hourly + 1 + https://wordpress.org/?v=4.9.8 + + Are You a Zen Coder or Distraction-Junkie? + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comments + Sun, 12 Feb 2012 07:04:41 +0000 + + + + + + + + + + + + + + + + + + + + + http://www.componentowl.com/blog/?p=664 + + What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    +]]>
    + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/feed/ + 55 +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/tag/zen/index.html b/public/blog/tag/zen/index.html new file mode 100644 index 0000000..79f6136 --- /dev/null +++ b/public/blog/tag/zen/index.html @@ -0,0 +1,212 @@ + + + + + + + +zen « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/index.html b/public/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/index.html new file mode 100644 index 0000000..a080ef7 --- /dev/null +++ b/public/blog/tedious-work-with-groups-and-item-hierarchy-features/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Work in Progress: “Groups” / “Item Hierarchy” Features + + http://www.componentowl.com/blog/tedious-work-with-groups-and-item-hierarchy-features/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/feed/index.html b/public/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/feed/index.html new file mode 100644 index 0000000..e7f557c --- /dev/null +++ b/public/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: The Three Main Advantages Better ListView has Over the Classic .NET Framework + + http://www.componentowl.com/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/vertical-alignment-and-text-wrapping-in-better-listview/feed/index.html b/public/blog/vertical-alignment-and-text-wrapping-in-better-listview/feed/index.html new file mode 100644 index 0000000..4c406f1 --- /dev/null +++ b/public/blog/vertical-alignment-and-text-wrapping-in-better-listview/feed/index.html @@ -0,0 +1,39 @@ + + + Comments on: Vertical Alignment and Text Wrapping in Better ListView + + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + By: Daniel N + http://www.componentowl.com/blog/vertical-alignment-and-text-wrapping-in-better-listview/#comment-1092 + + Thu, 17 Nov 2011 03:44:57 +0000 + http://www.componentowl.com/blog/?p=437#comment-1092 + + Very nice guys… With each new version, Better ListView is doing exactly that: just getting better and better!

    +

    I am particularly keen to try putting in my own linebreaks into items in the details view.

    +]]>
    +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/vertical-alignment-and-text-wrapping-in-better-listview/index.html?replytocom=1092.html b/public/blog/vertical-alignment-and-text-wrapping-in-better-listview/index.html?replytocom=1092.html new file mode 100644 index 0000000..444dbc2 --- /dev/null +++ b/public/blog/vertical-alignment-and-text-wrapping-in-better-listview/index.html?replytocom=1092.html @@ -0,0 +1,313 @@ + + + + + + + +Vertical Alignment and Text Wrapping in Better ListView « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Vertical Alignment and Text Wrapping in Better ListView

    + + + +
    +

    .NET ListView supports horizontal alignment of text in columns, items, sub-items and groups. Since Better ListView adds many new features, like multi-line items and images of arbitrary size, vertical alignment comes in handy.

    +

    By default, each view has its defaults, but you can customize text alignment on every column, item, sub-item and group individually:

    +
    +
    Vertical alignments of text

    Vertical alignments of text

    +
    +
    +
    +
    +

    The vertical alignment feature is a new property of each element type. For example, .NET ListView item has a property called Align which refers to horizontal alignment. Better ListView extends this to two independent properties called AlignHorizontal and AlignVertical. The naming scheme is same for columns, items, sub-items and groups.

    +

    Better ListView also supports splitting text in column headers and items (sub-items) into multiple lines.

    +

    We extended this functionality by adding a BetterListViewItem.TextWrapping and BetterListViewSubItem.TextWrapping properties. With these, you can control how the text in sub-items will be wrapped. There are three possible values:

    +
      +
    • Layout – the text will be wrapped to multiple lines, up to value specified by MaximumTextLines property of the corresponding view (layout)
    • +
    • None – the text will not be wrapped at all
    • +
    • Space – the text will be wrapped, but only to available space (item will never get higher due to wrapping text in sub-item with this setting)
    • +
    +
    The following screenshot shows these three wrapping modes in action:
    +
    +
    Various text wrapping modes

    Various text wrapping modes

    +
    +

    The sub-item in the first column has TextWrapping set to Layout and the layout has MaximumTextLines set to 4. The sub-item text thus can be split to up to four lines. It is actually split just to three because the column is wide enough.

    +

    The sub-item in the second column has TextWrapping set to None, which means the text in this sub-item is kept on single line.

    +

    The sub-item in the third column has TextWrapping set to Space. As you can see, even if the MaximumTextLines is set to 4, the sub-item text is limited to three lines, preventing item to grow larger.

    + +
    + + + + +
    + + + + + +

    One Response to “Vertical Alignment and Text Wrapping in Better ListView”

    + +
      +
    1. +
      +
      + Daniel N says:
      + + + +

      Very nice guys… With each new version, Better ListView is doing exactly that: just getting better and better!

      +

      I am particularly keen to try putting in my own linebreaks into items in the details view.

      + + +
      +
    2. +
    + + + + + +
    + +

    Leave a Reply to Daniel N

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    +
    + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/what-we-are-working-on-groups-item-hierarchy-support/feed/index.html b/public/blog/what-we-are-working-on-groups-item-hierarchy-support/feed/index.html new file mode 100644 index 0000000..dd1500d --- /dev/null +++ b/public/blog/what-we-are-working-on-groups-item-hierarchy-support/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: What we are working on: Groups, Item hierarchy support + + http://www.componentowl.com/blog/what-we-are-working-on-groups-item-hierarchy-support/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/windows-theme-support-in-better-listview/feed/index.html b/public/blog/windows-theme-support-in-better-listview/feed/index.html new file mode 100644 index 0000000..75938ea --- /dev/null +++ b/public/blog/windows-theme-support-in-better-listview/feed/index.html @@ -0,0 +1,26 @@ + + + Comments on: Windows Theme Support in Better ListView + + http://www.componentowl.com/blog/windows-theme-support-in-better-listview/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + + + \ No newline at end of file diff --git a/public/blog/wp-content/plugins/akismet/_inc/form.js?ver=4.0.8 b/public/blog/wp-content/plugins/akismet/_inc/form.js?ver=4.0.8 new file mode 100644 index 0000000..3a5be8a --- /dev/null +++ b/public/blog/wp-content/plugins/akismet/_inc/form.js?ver=4.0.8 @@ -0,0 +1,30 @@ +var ak_js = document.getElementById( "ak_js" ); + +if ( ! ak_js ) { + ak_js = document.createElement( 'input' ); + ak_js.setAttribute( 'id', 'ak_js' ); + ak_js.setAttribute( 'name', 'ak_js' ); + ak_js.setAttribute( 'type', 'hidden' ); +} +else { + ak_js.parentNode.removeChild( ak_js ); +} + +ak_js.setAttribute( 'value', ( new Date() ).getTime() ); + +var commentForm = document.getElementById( 'commentform' ); + +if ( commentForm ) { + commentForm.appendChild( ak_js ); +} +else { + var replyRowContainer = document.getElementById( 'replyrow' ); + + if ( replyRowContainer ) { + var children = replyRowContainer.getElementsByTagName( 'td' ); + + if ( children.length > 0 ) { + children[0].appendChild( ak_js ); + } + } +} \ No newline at end of file diff --git a/public/blog/wp-content/themes/componentowl/images/arrow-bullet.gif b/public/blog/wp-content/themes/componentowl/images/arrow-bullet.gif new file mode 100644 index 0000000..930e055 Binary files /dev/null and b/public/blog/wp-content/themes/componentowl/images/arrow-bullet.gif differ diff --git a/public/blog/wp-content/themes/componentowl/images/bg.png b/public/blog/wp-content/themes/componentowl/images/bg.png new file mode 100644 index 0000000..b725c3b Binary files /dev/null and b/public/blog/wp-content/themes/componentowl/images/bg.png differ diff --git a/public/blog/wp-content/themes/componentowl/images/footer-bg.png b/public/blog/wp-content/themes/componentowl/images/footer-bg.png new file mode 100644 index 0000000..10bed95 Binary files /dev/null and b/public/blog/wp-content/themes/componentowl/images/footer-bg.png differ diff --git a/public/blog/wp-content/themes/componentowl/images/icons/lightbulb.gif b/public/blog/wp-content/themes/componentowl/images/icons/lightbulb.gif new file mode 100644 index 0000000..cde578f Binary files /dev/null and b/public/blog/wp-content/themes/componentowl/images/icons/lightbulb.gif differ diff --git a/public/blog/wp-content/themes/componentowl/images/rss.png b/public/blog/wp-content/themes/componentowl/images/rss.png new file mode 100644 index 0000000..fbde3c7 Binary files /dev/null and b/public/blog/wp-content/themes/componentowl/images/rss.png differ diff --git a/public/blog/wp-content/themes/componentowl/images/search.gif b/public/blog/wp-content/themes/componentowl/images/search.gif new file mode 100644 index 0000000..d15c85a Binary files /dev/null and b/public/blog/wp-content/themes/componentowl/images/search.gif differ diff --git a/public/blog/wp-content/themes/componentowl/images/ss-bg.gif.html b/public/blog/wp-content/themes/componentowl/images/ss-bg.gif.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/themes/componentowl/images/ss-bg.gif.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/themes/componentowl/images/twitter.png b/public/blog/wp-content/themes/componentowl/images/twitter.png new file mode 100644 index 0000000..ae29a5d Binary files /dev/null and b/public/blog/wp-content/themes/componentowl/images/twitter.png differ diff --git a/public/blog/wp-content/themes/componentowl/javascripts/theme.js b/public/blog/wp-content/themes/componentowl/javascripts/theme.js new file mode 100644 index 0000000..01e00bf --- /dev/null +++ b/public/blog/wp-content/themes/componentowl/javascripts/theme.js @@ -0,0 +1,32 @@ +(function($) { + + $(document).ready(function() { + + $(".d-menu li").each(function() { + var $this = $(this); + var dropdown = $this.find(".dropdown"); + if (dropdown.size() == 1) { + $this.hover(function() { + $this.addClass("with-dropdown-hover"); + dropdown.show(); + }, function() { + $this.removeClass("with-dropdown-hover"); + dropdown.hide(); + }); + } + }); + + $("input.inline-label").each(function() { + $(this).data("initial_value", $(this).val()); + }); + $("input.inline-label").focus(function() { + var el = $(this); + el.addClass("inline-label-focus"); + if (el.val() == el.data("initial_value")) { + el.val(""); + } + }); + + }); + +})(jQuery); \ No newline at end of file diff --git a/public/blog/wp-content/themes/componentowl/style.css b/public/blog/wp-content/themes/componentowl/style.css new file mode 100644 index 0000000..e6c4e69 --- /dev/null +++ b/public/blog/wp-content/themes/componentowl/style.css @@ -0,0 +1,797 @@ +/* +Theme Name: ComponentOwl +Theme URI: http://www.componentowl.com/ +Description: ComponentOwl WordPress Theme. +Version: 1.0 +Author: Ondrej Zabojnik +Author URI: http://www.dextronet.com/ +Tags: blue, custom header, fixed width, two columns, widgets + +*/ + + + +/* COWL THEME */ + +html { height: 100%; } +body { height: 100%; font-size: 14px; font-family: arial, sans-serif; + background: #fefefe url(images/bg.png) top repeat-x; color: #000; text-align: center; } + +a { color: #825900; outline: none; } +a:hover { color: #000; } +a:active { color: #ab7500; } + +input[type=text], input[type=password], textarea, select { padding: 2px; border: 1px solid; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; + background-color: #fff; border-color: #abadb3 #dbdfe6 #e3e9ef #e2e3ea;} +input[type=text]:focus, input[type=password]:hover, input[type=password]:focus, input[type=text]:hover, textarea:focus, textarea:hover, select:focus, select:hover { + border-color: #d6a140 #efd9b2 #f3e3c6 #f2e1c1; +} +input { font-size: 13px; } +input.required, textarea.required { border-color: #dea110 #f1c354 #f2d58f #f2d58f !important; background-color: #fff8e9; } + +.inline-label-focus { color: #000 !important; } +.inline-label { color: #85878d; } + +.plain-border { border: 1px solid #4c4c4c; } +.centered { display: block; margin-left: auto; margin-right: auto; } + +h1 { margin: 0; padding: 0; } + +.blog-name { color: #000; font-size: 36px; margin: 15px 0 0; } +.blog-name a { color: inherit; text-decoration: none; } +.blog-description { font-size: 14px; font-weight: bold; font-family: arial, sans-serif; margin: 0 0 35px; } + +.image-link { display: block; text-indent: -9999em; } + +ul.common li { padding: 2px 0 3px 23px; background: url(images/arrow-bullet.gif) 4px 5px no-repeat; } + +.postmetadata { font-size: 12px; color: #9e9e9e; margin: 3px 0 0; } +.postmetadata a { color: #9e9e9e; } +.postmetadata a:hover { color: #000; } + +.postinfobar { padding: 3px; font-size: 12px; border-top: 1px dotted #a8906b; overflow: hidden; width: 100%; } +.postinfobar .comments { float: right; font-weight: bold; } +.altbar { margin-top: 8px; } + +.entry p { margin-top: 4px; line-height: 1.5em; color: #222222; font-family: sans-serif; } + +#sidebar { padding: 6px 0 8px; } + +#searchform-sidebar .search { border-color: #daba82; border-width: 2px; } +#searchform-sidebar .search:focus, #searchform-sidebar .search:hover { border-color: #d6a140; } + +#searchform-sidebar { margin: 12px 0 0; padding: 0 0 12px; position: relative; border-bottom: 1px dotted #a8906b; } +#s-sidebar { width: 191px; vertical-align: middle; margin: 0; } +#searchsubmit-sidebar { position: absolute; right: 3px; top: 2px; } + +.dextronet-sidebar-ad-box p { margin: 0 !important; } +.dextronet-sidebar-ad-box img { margin-top: 5px; } +.dextronet-sidebar-ad-box .download { display: block; margin-top: 8px; padding: 5px 0; color: #fff; font-weight: bold; text-align: center; background: #5caf1f; + text-decoration: none; -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; +} +.dextronet-sidebar-ad-box .download:hover { background: #825900; } + +#facebook_like iframe { height: 35px !important; } + +.tip { margin: 10px 0; border: 1px solid #d2d24b; padding: 3px 5px 3px 26px; + background: #ffffbb url(images/icons/lightbulb.gif) 5px 50% no-repeat; } + +.dextronet-newsletter-box { margin-top: 10px; background: #e1effc url(images/ss-bg.gif.html) 0 0 no-repeat; } +.dextronet-newsletter-box img { margin: 5px; } +.dextronet-newsletter-box form { padding: 5px; font-size: 12px; text-align: center; background: url(images/ss-bg.gif.html) 100% 100% no-repeat; } +.dextronet-newsletter-box div { padding: 3px 0; } +.dextronet-newsletter-box .email { width: 135px; } +.dextronet-newsletter-box input { margin-bottom: 3px; } + +.dextronet-feeds { margin: 15px 0 0; padding-bottom: 12px; border-bottom: 1px dotted #a8906b; } +.dextronet-feeds .links { margin: 0 !important; list-style: none; padding: 0 !important; } +.dextronet-feeds .links li { margin: 0 !important; } +.dextronet-feeds .links a { padding: 7px 0 10px 37px; display: block; } +.dextronet-feeds .links .rss { background: url(images/rss.png) 0 50% no-repeat; } +.dextronet-feeds .links .twitter { background: url(images/twitter.png) 0 50% no-repeat; } + +.product-ad { overflow: hidden; width: 100%; margin: 25px 0; border: 1px solid #86bcea; border-left: none; border-right: none; padding: 8px 0; } +.product-ad .screenshot { float: left; margin: 0 15px 0 0; } +.product-ad h3 { font-size: 26px; margin: 0; } +.product-ad p { font-size: 16px; margin: 0; font-weight: bold; } +.product-ad .buttons { padding-top: 14px; } + +.entry { padding-top: 10px; } +.entry h1, .entry h2 { color: #000; padding: 0; margin: 0; } +.entry h1 { font-size: 1.2em; margin: 20px 0 10px; } +.entry h2 { font-size: 1em; margin: 20px 0 8px; } + +.dbtn-c { + border-bottom: 1px solid #ecdfb9; + border-right: 1px solid #ecdfb9; + display: inline-block; +} +.dbtn-w { + background: #efe5c6; + border-color: #ac995e #9f8d55 #9f8d55 #ac995e; + border-style: solid; + border-width: 1px; + display: block; + height: 30px; +} +.dbtn { + background: url(../../../../images/dbtn.png) repeat-x; + border: none; + color: #000000; + cursor: pointer; + font: 15px arial, sans-serif; + height: 30px; + margin: 0; + outline: none; + vertical-align: top; + padding-left: 15px; + padding-right: 15px; +} +a.dbtn { display: block; height: 30px; line-height: 30px; text-decoration: none; } +.dbtn:active { background: #decd9b; } +.dbtn-hilight { border-color: #cfe3a6; } +.dbtn-hilight .dbtn-w { + background: #e8f2d3; + border-color: #9bc842 #84b12a #84b12a #9bc842; +} +.dbtn-hilight .dbtn { background-image: url(../../../../images/dbtn-hilight.png); font-weight: bold; } +.dbtn-hilight .dbtn:active { background: #bad782; } + + +/* MAIN STRUCTURE */ + +.d-main { float: left; width: 650px; } +.d-sidebar { float: right; width: 200px; } + +.d-placing { margin: auto; text-align: left; width: 900px; } +.d-page { position: relative; min-height: 100%; } + +.d-header { height: 47px; } +.d-logo { float: right; margin-top: 15px; } +.d-menu { float: left; margin: 0; padding: 0; } +.d-menu li { float: left; position: relative; padding-right: 35px !important; list-style: none; } +.d-menu .menu-item { display: block; position: relative; z-index: 99; padding: 12px 0 1px; color: #fff; text-decoration: none; } +.d-menu .active .menu-item { border-bottom: 1px solid #bb983b; padding-bottom: 2px; } +.d-menu .menu-item:hover { border-bottom: 2px solid #bb983b; padding-bottom: 1px; color: #fff; } +.d-menu .featured { color: #fecb33 !important; } + +.d-menu .dropdown { position: absolute; top: 30px; left: -20px; width: 250px; } +.d-menu .dropdown .outer { position: relative; z-index: 97; padding-left: 6px; background: url(../../../../images/dropdown-o.png) 0 100% no-repeat; } +.d-menu .dropdown .shadowbox { position: relative; z-index: 98; padding: 0 8px 8px 0; background: url(../../../../images/dropdown-s.png) 100% 100% no-repeat; } +.d-menu .dropdown .inner { position: relative; overflow: auto; height: 100%; z-index: 99; padding: 12px 14px; background: #362919; border: 1px solid #1c1410; border-top: none; } +.d-menu .dropdown a, .d-menu .dropdown a:hover { color: #fff; } + +.dropdown-submenu .inner { padding: 10px 0 0 !important; } +.dropdown-submenu a { padding: 10px 14px; display: block; text-decoration: none; } +.dropdown-submenu a:hover { background-color: #bb983b; } +.dropdown-submenu li { padding: 0; margin: 0; } +.dropdown-submenu img { display: block; float: left; margin: 4px 10px 0 0; } + +.dropdown .featured-item { font-size: 16px; font-weight: bold; } +.dropdown .subline { display: block; font-size: 12px; color: #fff; padding-top: 3px; } +.dropdown .dropdown-category { background-color: #876234; color: #fff; font-weight: bold; padding: 5px 8px; } + +.d-content-wrap { padding-bottom: 80px; overflow: hidden; height: 100%; padding-top: 40px } +.d-footer { position: absolute; bottom: 0; right: 0; width: 100%; padding: 13px 0 17px; color: #fff; font-size: 11px; + background: #3a2c18 url(images/footer-bg.png) repeat-x; } +.d-footer a { color: #fff; } +.d-footer a:hover { color: #f4c179; } +.d-footer .copy { font-size: 11px; padding-left: 140px; background: url(../../../../images/dextronet.gif) 0 12px no-repeat; } +.d-footer .social { padding: 10px 0 4px; } +.d-footer .social span { padding: 0 3px; } + +/* /MAIN STRUCTURE */ +/* /COWL THEME */ + + +#page { + background-color: white; + border: 1px solid #959596; + text-align: left; + } + +.widecolumn .entry p { + font-size: 1.05em; + } + +.narrowcolumn .entry, .widecolumn .entry { + line-height: 1.4em; + } + +.widecolumn { + line-height: 1.6em; + } + +.narrowcolumn .postmetadata { + text-align: center; + } + +.thread-alt { + background-color: #f8f8f8; +} +.thread-even { + background-color: white; +} +.depth-1 { +border: 1px solid #ddd; +} + +small { + font-family: arial, Sans-Serif; + font-size: 0.9em; + line-height: 1.5em; + } + +h2, h3 { + font-family: arial, helvetica, Sans-Serif; + font-weight: bold; + } + +#headerimg .description { + font-size: 1.2em; + text-align: center; + } + +h2 { + font-size: 1.70em; + } + +h2.pagetitle { + font-size: 1.55em; + } + +#sidebar h2 { + font-family: arial, Helvetica, Sans-Serif; + font-size: 1.1em; + } + +h3 { + font-size: 1.25em; + } + +#headerimg .description { + text-decoration: none; + color: white; + } + +h2, h2 a, h2 a:visited, h3, h3 a, h3 a:visited { + color: #000; + } + +h2, h2 a, h2 a:hover, h2 a:visited, h3, h3 a, h3 a:hover, h3 a:visited, #sidebar h2, #wp-calendar caption, cite { + text-decoration: none; + } +h2 a:hover { color: #000; } + +.entry p a:visited { + color: #585348; + } + +.sticky { + background: #f7f7f7; + padding: 0 10px 10px; + } +.sticky h2 { + padding-top: 10px; + } + +.commentlist li, #commentform input, #commentform textarea { + font: 0.9em arial, helvetica, Sans-Serif; + } +.commentlist li ul li { + font-size: 1em; +} + +.commentlist li { + font-weight: bold; +} + +.commentlist li .avatar { + float: right; + border: 1px solid #eee; + padding: 2px; + background: #fff; + } + +.commentlist cite, .commentlist cite a { + font-weight: bold; + font-style: normal; + text-decoration: none; + font-size: 1.1em; + } + +.commentlist p { + font-weight: normal; + line-height: 1.5em; + text-transform: none; + } + +#commentform p { + font-family: arial, Sans-Serif; + } + +.commentmetadata { + font-weight: normal; + } + +#sidebar { + font: 1em arial, Sans-Serif; + } + +small, #sidebar ul ul li, #sidebar ul ol li, .nocomments, blockquote, strike { + color: #777; + } + +code { + font: 1.1em 'Courier New', Courier, Fixed; + } + +acronym, abbr, span.caps +{ + font-size: 0.9em; + letter-spacing: .07em; + } + +#wp-calendar #prev a, #wp-calendar #next a { + font-size: 9pt; + } + +#wp-calendar a { + text-decoration: none; + } + +#wp-calendar caption { + font: bold 1.3em arial, Sans-Serif; + text-align: center; + } + +#wp-calendar th { + font-style: normal; + text-transform: capitalize; + } +/* End Typography & Colors */ + + + +/* Begin Structure */ +body { + margin: 0; + padding: 0; + } + +#page { + background-color: white; + margin: 20px auto; + padding: 0; + width: 760px; + border: 1px solid #959596; + } + +.narrowcolumn { + float: left; + padding: 0 0 20px 45px; + margin: 0px 0 0; + width: 450px; + } + +.widecolumn { + padding: 10px 0 20px 0; + margin: 5px 0 0 150px; + width: 450px; + } + +.post { + margin: 0 0 40px; + } + +.post hr { + display: block; + } + +.widecolumn .post { + margin: 0; + } + +.narrowcolumn .postmetadata { + padding-top: 5px; + } + +.widecolumn .postmetadata { + margin: 30px 0; + } + +.widecolumn .smallattachment { + text-align: center; + float: left; + width: 128px; + margin: 5px 5px 5px 0px; +} + +.widecolumn .attachment { + text-align: center; + margin: 5px 0px; +} + +.postmetadata { + clear: both; +} + +.clear { + clear: both; +} + +#footer { + padding: 0; + margin: 0 auto; + width: 760px; + clear: both; + } + +#footer p { + margin: 0; + padding: 20px 0; + text-align: center; + } +/* End Structure */ + + + +/* Begin Headers */ + +h2 { + margin: 25px 0 0; + } + +h2.pagetitle { + margin-top: 30px; + text-align: center; +} + +#sidebar h2 { + margin: 5px 0 0; + padding: 0; + } + +h3 { + padding: 0; + margin: 30px 0 0; + } + +h3.comments { + padding: 0; + margin: 40px auto 20px ; + } +/* End Headers */ + + + +/* Begin Images */ +p img { + padding: 0; + max-width: 100%; + } + +/* Using 'class="alignright"' on an image will (who would've + thought?!) align the image to the right. And using 'class="centered', + will of course center the image. This is much better than using + align="center", being much more futureproof (and valid) */ + +img.centered { + display: block; + margin-left: auto; + margin-right: auto; + } + +img.alignright { + padding: 4px; + margin: 0 0 2px 7px; + display: inline; + } + +img.alignleft { + padding: 4px; + margin: 0 7px 2px 0; + display: inline; + } + +.alignright { + float: right; + } + +.alignleft { + float: left; + } +/* End Images */ + + + +/* Begin Lists + + Special stylized non-IE bullets + Do not work in Internet Explorer, which merely default to normal bullets. */ + +html>body .entry ul { + margin-left: 0px; + padding: 0 0 0 30px; + list-style: none; + padding-left: 10px; + text-indent: -10px; + } + +html>body .entry li { + margin: 7px 0 8px 10px; + } + +.entry ul li:before { + content: "\00BB \0020"; + } + +.entry ol { + padding: 0 0 0 35px; + margin: 0; + } + +.entry ol li { + margin: 0; + padding: 0; + } + +.postmetadata ul, .postmetadata li { + display: inline; + list-style-type: none; + list-style-image: none; + } + +#sidebar ul, #sidebar ul ol { + margin: 0; + padding: 0; + } + +#sidebar ul li { + list-style-type: none; + list-style-image: none; + margin-bottom: 15px; + } + +#sidebar ul p, #sidebar ul select { + margin: 5px 0 8px; + } + +#sidebar ul ul, #sidebar ul ol { + margin: 0; + } + +#sidebar ul ul ul, #sidebar ul ol { + margin: 0 0 0 10px; + } + +ol li, #sidebar ul ol li { + list-style: decimal outside; + } + +#sidebar ul ul li, #sidebar ul ol li { + margin: 3px 0 0; + padding: 0; + } +/* End Entry Lists */ + + + +/* Begin Form Elements */ + +.entry form { /* This is mainly for password protected posts, makes them look better. */ + text-align:center; + } + +select { + width: 130px; + } + +#commentform input { + width: 170px; + padding: 2px; + margin: 5px 5px 1px 0; + } + +#commentform { + margin: 5px 10px 0 0; + } +#commentform textarea { + width: 100%; + padding: 2px; + } +#respond:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } +#commentform #submit { + margin: 0 0 5px auto; + float: right; + } +/* End Form Elements */ + + + +/* Begin Comments*/ +.alt { + margin: 0; + padding: 10px; + } + +.commentlist { + padding: 0; + text-align: justify; + } + +.commentlist li { + margin: 15px 0 10px; + padding: 5px 5px 10px 10px; + list-style: none; + + } +.commentlist li ul li { + margin-right: -5px; + margin-left: 10px; +} + +.commentlist p { + margin: 10px 5px 10px 0; +} +.children { padding: 0; } + +#commentform p { + margin: 5px 0; + } + +.nocomments { + text-align: center; + margin: 0; + padding: 0; + } + +.commentmetadata { + margin: 0; + display: block; + } +/* End Comments */ + + + +/* Begin Sidebar */ + +#sidebar form { + margin: 0; + } +/* End Sidebar */ + + + +/* Begin Calendar */ +#wp-calendar { + empty-cells: show; + margin: 10px auto 0; + width: 155px; + } + +#wp-calendar #next a { + padding-right: 10px; + text-align: right; + } + +#wp-calendar #prev a { + padding-left: 10px; + text-align: left; + } + +#wp-calendar a { + display: block; + } + +#wp-calendar caption { + text-align: center; + width: 100%; + } + +#wp-calendar td { + padding: 3px 0; + text-align: center; + } + +#wp-calendar td.pad:hover { /* Doesn't work in IE */ + background-color: #fff; } +/* End Calendar */ + + + +/* Begin Various Tags & Classes */ +acronym, abbr, span.caps { + cursor: help; + } + +acronym, abbr { + border-bottom: 1px dashed #999; + } + +blockquote { + margin: 15px 30px 0 10px; + padding-left: 20px; + border-left: 5px solid #ddd; + } + +blockquote cite { + margin: 5px 0 0; + display: block; + } + +.center { + text-align: center; + } + +.hidden { + display: none; + } + +.screen-reader-text { + position: absolute; + left: -1000em; +} + +hr { + display: none; + } + +a img { + border: none; + } + +.navigation { + display: block; + text-align: center; + margin-top: 10px; + margin-bottom: 60px; + } +/* End Various Tags & Classes*/ + + + +/* Captions */ +.aligncenter, +div.aligncenter { + display: block; + margin-left: auto; + margin-right: auto; +} + +.wp-caption { + border: 1px solid #ddd; + text-align: center; + background-color: #f3f3f3; + padding-top: 4px; + margin: 10px; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.wp-caption img { + margin: 0; + padding: 0; + border: 0 none; +} + +.wp-caption p.wp-caption-text { + font-size: 11px; + line-height: 17px; + padding: 0 4px 5px; + margin: 0; +} +/* End captions */ + + +/* "Daisy, Daisy, give me your answer do. I'm half crazy all for the love of you. + It won't be a stylish marriage, I can't afford a carriage. + But you'll look sweet upon the seat of a bicycle built for two." */ diff --git a/public/blog/wp-content/uploads/2011/01/is-full-300x229.jpg b/public/blog/wp-content/uploads/2011/01/is-full-300x229.jpg new file mode 100644 index 0000000..51c3c48 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/01/is-full-300x229.jpg differ diff --git a/public/blog/wp-content/uploads/2011/01/is-full.jpg b/public/blog/wp-content/uploads/2011/01/is-full.jpg new file mode 100644 index 0000000..6406813 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/01/is-full.jpg differ diff --git a/public/blog/wp-content/uploads/2011/01/is-highlight-300x229.jpg b/public/blog/wp-content/uploads/2011/01/is-highlight-300x229.jpg new file mode 100644 index 0000000..5dd7507 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/01/is-highlight-300x229.jpg differ diff --git a/public/blog/wp-content/uploads/2011/01/is-highlight.jpg b/public/blog/wp-content/uploads/2011/01/is-highlight.jpg new file mode 100644 index 0000000..19497e8 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/01/is-highlight.jpg differ diff --git a/public/blog/wp-content/uploads/2011/01/stdl-full-300x206.jpg b/public/blog/wp-content/uploads/2011/01/stdl-full-300x206.jpg new file mode 100644 index 0000000..0fe13ce Binary files /dev/null and b/public/blog/wp-content/uploads/2011/01/stdl-full-300x206.jpg differ diff --git a/public/blog/wp-content/uploads/2011/01/stdl-full.jpg b/public/blog/wp-content/uploads/2011/01/stdl-full.jpg new file mode 100644 index 0000000..4c64c36 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/01/stdl-full.jpg differ diff --git a/public/blog/wp-content/uploads/2011/01/stdl-highlight-300x206.jpg b/public/blog/wp-content/uploads/2011/01/stdl-highlight-300x206.jpg new file mode 100644 index 0000000..e907c81 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/01/stdl-highlight-300x206.jpg differ diff --git a/public/blog/wp-content/uploads/2011/01/stdl-highlight.jpg b/public/blog/wp-content/uploads/2011/01/stdl-highlight.jpg new file mode 100644 index 0000000..b900449 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/01/stdl-highlight.jpg differ diff --git a/public/blog/wp-content/uploads/2011/02/borders-150x150.jpg b/public/blog/wp-content/uploads/2011/02/borders-150x150.jpg new file mode 100644 index 0000000..4affc6b Binary files /dev/null and b/public/blog/wp-content/uploads/2011/02/borders-150x150.jpg differ diff --git a/public/blog/wp-content/uploads/2011/02/borders-300x300.jpg b/public/blog/wp-content/uploads/2011/02/borders-300x300.jpg new file mode 100644 index 0000000..970fbff Binary files /dev/null and b/public/blog/wp-content/uploads/2011/02/borders-300x300.jpg differ diff --git a/public/blog/wp-content/uploads/2011/02/borders.jpg b/public/blog/wp-content/uploads/2011/02/borders.jpg new file mode 100644 index 0000000..0ad6204 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/02/borders.jpg differ diff --git a/public/blog/wp-content/uploads/2011/02/extra-graphics-150x150.png b/public/blog/wp-content/uploads/2011/02/extra-graphics-150x150.png new file mode 100644 index 0000000..adb551f Binary files /dev/null and b/public/blog/wp-content/uploads/2011/02/extra-graphics-150x150.png differ diff --git a/public/blog/wp-content/uploads/2011/02/extra-graphics-300x300.png b/public/blog/wp-content/uploads/2011/02/extra-graphics-300x300.png new file mode 100644 index 0000000..94988ae Binary files /dev/null and b/public/blog/wp-content/uploads/2011/02/extra-graphics-300x300.png differ diff --git a/public/blog/wp-content/uploads/2011/02/extra-graphics.png b/public/blog/wp-content/uploads/2011/02/extra-graphics.png new file mode 100644 index 0000000..28586c0 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/02/extra-graphics.png differ diff --git a/public/blog/wp-content/uploads/2011/02/screenshot-300x196.jpg b/public/blog/wp-content/uploads/2011/02/screenshot-300x196.jpg new file mode 100644 index 0000000..ac8be6d Binary files /dev/null and b/public/blog/wp-content/uploads/2011/02/screenshot-300x196.jpg differ diff --git a/public/blog/wp-content/uploads/2011/02/screenshot.jpg b/public/blog/wp-content/uploads/2011/02/screenshot.jpg new file mode 100644 index 0000000..49965f3 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/02/screenshot.jpg differ diff --git a/public/blog/wp-content/uploads/2011/03/screen-styles-238x300.png b/public/blog/wp-content/uploads/2011/03/screen-styles-238x300.png new file mode 100644 index 0000000..de6529f Binary files /dev/null and b/public/blog/wp-content/uploads/2011/03/screen-styles-238x300.png differ diff --git a/public/blog/wp-content/uploads/2011/03/screen-styles.png b/public/blog/wp-content/uploads/2011/03/screen-styles.png new file mode 100644 index 0000000..4b9121c Binary files /dev/null and b/public/blog/wp-content/uploads/2011/03/screen-styles.png differ diff --git a/public/blog/wp-content/uploads/2011/05/cowl-blog-1-300x176.png b/public/blog/wp-content/uploads/2011/05/cowl-blog-1-300x176.png new file mode 100644 index 0000000..1856f7b Binary files /dev/null and b/public/blog/wp-content/uploads/2011/05/cowl-blog-1-300x176.png differ diff --git a/public/blog/wp-content/uploads/2011/05/cowl-blog-1.png b/public/blog/wp-content/uploads/2011/05/cowl-blog-1.png new file mode 100644 index 0000000..66ee4e2 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/05/cowl-blog-1.png differ diff --git a/public/blog/wp-content/uploads/2011/05/cowl-blog-2-300x134.png b/public/blog/wp-content/uploads/2011/05/cowl-blog-2-300x134.png new file mode 100644 index 0000000..ed3b5db Binary files /dev/null and b/public/blog/wp-content/uploads/2011/05/cowl-blog-2-300x134.png differ diff --git a/public/blog/wp-content/uploads/2011/05/cowl-blog-2.png b/public/blog/wp-content/uploads/2011/05/cowl-blog-2.png new file mode 100644 index 0000000..4299360 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/05/cowl-blog-2.png differ diff --git a/public/blog/wp-content/uploads/2011/05/cowl-blog-3-300x103.png b/public/blog/wp-content/uploads/2011/05/cowl-blog-3-300x103.png new file mode 100644 index 0000000..415022a Binary files /dev/null and b/public/blog/wp-content/uploads/2011/05/cowl-blog-3-300x103.png differ diff --git a/public/blog/wp-content/uploads/2011/05/cowl-blog-3.png b/public/blog/wp-content/uploads/2011/05/cowl-blog-3.png new file mode 100644 index 0000000..4464ec3 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/05/cowl-blog-3.png differ diff --git a/public/blog/wp-content/uploads/2011/05/cowl-blog-4-300x61.png b/public/blog/wp-content/uploads/2011/05/cowl-blog-4-300x61.png new file mode 100644 index 0000000..664752d Binary files /dev/null and b/public/blog/wp-content/uploads/2011/05/cowl-blog-4-300x61.png differ diff --git a/public/blog/wp-content/uploads/2011/05/cowl-blog-4.png b/public/blog/wp-content/uploads/2011/05/cowl-blog-4.png new file mode 100644 index 0000000..5e9c1dd Binary files /dev/null and b/public/blog/wp-content/uploads/2011/05/cowl-blog-4.png differ diff --git a/public/blog/wp-content/uploads/2011/05/cowl-blog-5.png b/public/blog/wp-content/uploads/2011/05/cowl-blog-5.png new file mode 100644 index 0000000..283fe5b Binary files /dev/null and b/public/blog/wp-content/uploads/2011/05/cowl-blog-5.png differ diff --git a/public/blog/wp-content/uploads/2011/06/blv-thumbnails-2-300x242.jpg b/public/blog/wp-content/uploads/2011/06/blv-thumbnails-2-300x242.jpg new file mode 100644 index 0000000..c5e9830 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/06/blv-thumbnails-2-300x242.jpg differ diff --git a/public/blog/wp-content/uploads/2011/06/blv-thumbnails-2.jpg b/public/blog/wp-content/uploads/2011/06/blv-thumbnails-2.jpg new file mode 100644 index 0000000..01d28ce Binary files /dev/null and b/public/blog/wp-content/uploads/2011/06/blv-thumbnails-2.jpg differ diff --git a/public/blog/wp-content/uploads/2011/06/blv-thumbnails-300x242.jpg b/public/blog/wp-content/uploads/2011/06/blv-thumbnails-300x242.jpg new file mode 100644 index 0000000..9735858 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/06/blv-thumbnails-300x242.jpg differ diff --git a/public/blog/wp-content/uploads/2011/06/blv-thumbnails.jpg b/public/blog/wp-content/uploads/2011/06/blv-thumbnails.jpg new file mode 100644 index 0000000..5a50dc7 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/06/blv-thumbnails.jpg differ diff --git a/public/blog/wp-content/uploads/2011/06/list-view-drag-drop-reordering-1.png b/public/blog/wp-content/uploads/2011/06/list-view-drag-drop-reordering-1.png new file mode 100644 index 0000000..82da67f Binary files /dev/null and b/public/blog/wp-content/uploads/2011/06/list-view-drag-drop-reordering-1.png differ diff --git a/public/blog/wp-content/uploads/2011/06/list-view-drag-drop-reordering-2.png b/public/blog/wp-content/uploads/2011/06/list-view-drag-drop-reordering-2.png new file mode 100644 index 0000000..358874b Binary files /dev/null and b/public/blog/wp-content/uploads/2011/06/list-view-drag-drop-reordering-2.png differ diff --git a/public/blog/wp-content/uploads/2011/07/betterlistview2-overview1-300x279.png b/public/blog/wp-content/uploads/2011/07/betterlistview2-overview1-300x279.png new file mode 100644 index 0000000..2644ff4 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/07/betterlistview2-overview1-300x279.png differ diff --git a/public/blog/wp-content/uploads/2011/07/betterlistview2-overview1.png b/public/blog/wp-content/uploads/2011/07/betterlistview2-overview1.png new file mode 100644 index 0000000..b6445c5 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/07/betterlistview2-overview1.png differ diff --git a/public/blog/wp-content/uploads/2011/07/betterlistview2-overview2-300x262.png b/public/blog/wp-content/uploads/2011/07/betterlistview2-overview2-300x262.png new file mode 100644 index 0000000..9a00341 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/07/betterlistview2-overview2-300x262.png differ diff --git a/public/blog/wp-content/uploads/2011/07/betterlistview2-overview2.png b/public/blog/wp-content/uploads/2011/07/betterlistview2-overview2.png new file mode 100644 index 0000000..73f2398 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/07/betterlistview2-overview2.png differ diff --git a/public/blog/wp-content/uploads/2011/07/betterlistview2-overview3-300x280.png b/public/blog/wp-content/uploads/2011/07/betterlistview2-overview3-300x280.png new file mode 100644 index 0000000..ea7b6c0 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/07/betterlistview2-overview3-300x280.png differ diff --git a/public/blog/wp-content/uploads/2011/07/betterlistview2-overview3.png b/public/blog/wp-content/uploads/2011/07/betterlistview2-overview3.png new file mode 100644 index 0000000..5917c6b Binary files /dev/null and b/public/blog/wp-content/uploads/2011/07/betterlistview2-overview3.png differ diff --git a/public/blog/wp-content/uploads/2011/07/blv-aero-300x213.png b/public/blog/wp-content/uploads/2011/07/blv-aero-300x213.png new file mode 100644 index 0000000..45b4c56 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/07/blv-aero-300x213.png differ diff --git a/public/blog/wp-content/uploads/2011/07/blv-aero.png b/public/blog/wp-content/uploads/2011/07/blv-aero.png new file mode 100644 index 0000000..b97f0d4 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/07/blv-aero.png differ diff --git a/public/blog/wp-content/uploads/2011/07/blv-classic-300x213.png b/public/blog/wp-content/uploads/2011/07/blv-classic-300x213.png new file mode 100644 index 0000000..7b61652 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/07/blv-classic-300x213.png differ diff --git a/public/blog/wp-content/uploads/2011/07/blv-classic.png b/public/blog/wp-content/uploads/2011/07/blv-classic.png new file mode 100644 index 0000000..bd3958f Binary files /dev/null and b/public/blog/wp-content/uploads/2011/07/blv-classic.png differ diff --git a/public/blog/wp-content/uploads/2011/07/blv-luna-300x213.png b/public/blog/wp-content/uploads/2011/07/blv-luna-300x213.png new file mode 100644 index 0000000..e3821e0 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/07/blv-luna-300x213.png differ diff --git a/public/blog/wp-content/uploads/2011/07/blv-luna.png b/public/blog/wp-content/uploads/2011/07/blv-luna.png new file mode 100644 index 0000000..386914c Binary files /dev/null and b/public/blog/wp-content/uploads/2011/07/blv-luna.png differ diff --git a/public/blog/wp-content/uploads/2011/08/blv-fileexplorersample.png b/public/blog/wp-content/uploads/2011/08/blv-fileexplorersample.png new file mode 100644 index 0000000..9c4fe6e Binary files /dev/null and b/public/blog/wp-content/uploads/2011/08/blv-fileexplorersample.png differ diff --git a/public/blog/wp-content/uploads/2011/08/column-hide-after.png b/public/blog/wp-content/uploads/2011/08/column-hide-after.png new file mode 100644 index 0000000..ef0ac87 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/08/column-hide-after.png differ diff --git a/public/blog/wp-content/uploads/2011/08/column-hide-before-300x82.png b/public/blog/wp-content/uploads/2011/08/column-hide-before-300x82.png new file mode 100644 index 0000000..8f7a9bf Binary files /dev/null and b/public/blog/wp-content/uploads/2011/08/column-hide-before-300x82.png differ diff --git a/public/blog/wp-content/uploads/2011/08/column-hide-before.png b/public/blog/wp-content/uploads/2011/08/column-hide-before.png new file mode 100644 index 0000000..29fbcbf Binary files /dev/null and b/public/blog/wp-content/uploads/2011/08/column-hide-before.png differ diff --git a/public/blog/wp-content/uploads/2011/09/2611677_345f676344.jpg b/public/blog/wp-content/uploads/2011/09/2611677_345f676344.jpg new file mode 100644 index 0000000..bce207d Binary files /dev/null and b/public/blog/wp-content/uploads/2011/09/2611677_345f676344.jpg differ diff --git a/public/blog/wp-content/uploads/2011/09/vs-error-list-300x111.png b/public/blog/wp-content/uploads/2011/09/vs-error-list-300x111.png new file mode 100644 index 0000000..ed9a92e Binary files /dev/null and b/public/blog/wp-content/uploads/2011/09/vs-error-list-300x111.png differ diff --git a/public/blog/wp-content/uploads/2011/09/vs-error-list.png b/public/blog/wp-content/uploads/2011/09/vs-error-list.png new file mode 100644 index 0000000..57cdba3 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/09/vs-error-list.png differ diff --git a/public/blog/wp-content/uploads/2011/10/samples-cs-vb-300x80.png b/public/blog/wp-content/uploads/2011/10/samples-cs-vb-300x80.png new file mode 100644 index 0000000..b294e93 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/10/samples-cs-vb-300x80.png differ diff --git a/public/blog/wp-content/uploads/2011/10/samples-cs-vb.png b/public/blog/wp-content/uploads/2011/10/samples-cs-vb.png new file mode 100644 index 0000000..539354f Binary files /dev/null and b/public/blog/wp-content/uploads/2011/10/samples-cs-vb.png differ diff --git a/public/blog/wp-content/uploads/2011/11/screen-keep-selection-highlight-300x178.png b/public/blog/wp-content/uploads/2011/11/screen-keep-selection-highlight-300x178.png new file mode 100644 index 0000000..86fcd80 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/11/screen-keep-selection-highlight-300x178.png differ diff --git a/public/blog/wp-content/uploads/2011/11/screen-keep-selection-highlight.png b/public/blog/wp-content/uploads/2011/11/screen-keep-selection-highlight.png new file mode 100644 index 0000000..16fd6f6 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/11/screen-keep-selection-highlight.png differ diff --git a/public/blog/wp-content/uploads/2011/11/screen-multi-line-2.png b/public/blog/wp-content/uploads/2011/11/screen-multi-line-2.png new file mode 100644 index 0000000..6295b03 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/11/screen-multi-line-2.png differ diff --git a/public/blog/wp-content/uploads/2011/11/screen-multiple-hot-items-300x176.png b/public/blog/wp-content/uploads/2011/11/screen-multiple-hot-items-300x176.png new file mode 100644 index 0000000..986ba70 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/11/screen-multiple-hot-items-300x176.png differ diff --git a/public/blog/wp-content/uploads/2011/11/screen-multiple-hot-items.png b/public/blog/wp-content/uploads/2011/11/screen-multiple-hot-items.png new file mode 100644 index 0000000..cded606 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/11/screen-multiple-hot-items.png differ diff --git a/public/blog/wp-content/uploads/2011/11/screen-wrapping-300x70.png b/public/blog/wp-content/uploads/2011/11/screen-wrapping-300x70.png new file mode 100644 index 0000000..1ed6c9f Binary files /dev/null and b/public/blog/wp-content/uploads/2011/11/screen-wrapping-300x70.png differ diff --git a/public/blog/wp-content/uploads/2011/11/screen-wrapping.png b/public/blog/wp-content/uploads/2011/11/screen-wrapping.png new file mode 100644 index 0000000..3da6f7e Binary files /dev/null and b/public/blog/wp-content/uploads/2011/11/screen-wrapping.png differ diff --git a/public/blog/wp-content/uploads/2011/11/screenshot-newlines-295x300.png b/public/blog/wp-content/uploads/2011/11/screenshot-newlines-295x300.png new file mode 100644 index 0000000..86359a2 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/11/screenshot-newlines-295x300.png differ diff --git a/public/blog/wp-content/uploads/2011/11/screenshot-newlines.png b/public/blog/wp-content/uploads/2011/11/screenshot-newlines.png new file mode 100644 index 0000000..0b77d00 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/11/screenshot-newlines.png differ diff --git a/public/blog/wp-content/uploads/2011/11/text-formatting-vertical-align-300x264.png b/public/blog/wp-content/uploads/2011/11/text-formatting-vertical-align-300x264.png new file mode 100644 index 0000000..770f152 Binary files /dev/null and b/public/blog/wp-content/uploads/2011/11/text-formatting-vertical-align-300x264.png differ diff --git a/public/blog/wp-content/uploads/2011/11/text-formatting-vertical-align.png b/public/blog/wp-content/uploads/2011/11/text-formatting-vertical-align.png new file mode 100644 index 0000000..98f4a5c Binary files /dev/null and b/public/blog/wp-content/uploads/2011/11/text-formatting-vertical-align.png differ diff --git a/public/blog/wp-content/uploads/2011/12/screen-dynamic-300x157.gif b/public/blog/wp-content/uploads/2011/12/screen-dynamic-300x157.gif new file mode 100644 index 0000000..3a0935c Binary files /dev/null and b/public/blog/wp-content/uploads/2011/12/screen-dynamic-300x157.gif differ diff --git a/public/blog/wp-content/uploads/2011/12/screen-dynamic.gif b/public/blog/wp-content/uploads/2011/12/screen-dynamic.gif new file mode 100644 index 0000000..678f5eb Binary files /dev/null and b/public/blog/wp-content/uploads/2011/12/screen-dynamic.gif differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-combineditems1.png b/public/blog/wp-content/uploads/2012/01/blv-combineditems1.png new file mode 100644 index 0000000..7b1cbb0 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-combineditems1.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-combineditems2.png b/public/blog/wp-content/uploads/2012/01/blv-combineditems2.png new file mode 100644 index 0000000..de68905 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-combineditems2.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-nonselectable-1-150x150.png b/public/blog/wp-content/uploads/2012/01/blv-nonselectable-1-150x150.png new file mode 100644 index 0000000..06b9cc9 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-nonselectable-1-150x150.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-nonselectable-1-300x300.png b/public/blog/wp-content/uploads/2012/01/blv-nonselectable-1-300x300.png new file mode 100644 index 0000000..08e0607 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-nonselectable-1-300x300.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-nonselectable-1.png b/public/blog/wp-content/uploads/2012/01/blv-nonselectable-1.png new file mode 100644 index 0000000..5d41a5f Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-nonselectable-1.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-nonselectable-2-150x150.png b/public/blog/wp-content/uploads/2012/01/blv-nonselectable-2-150x150.png new file mode 100644 index 0000000..472a9eb Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-nonselectable-2-150x150.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-nonselectable-2-300x300.png b/public/blog/wp-content/uploads/2012/01/blv-nonselectable-2-300x300.png new file mode 100644 index 0000000..452a2e1 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-nonselectable-2-300x300.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-nonselectable-2.png b/public/blog/wp-content/uploads/2012/01/blv-nonselectable-2.png new file mode 100644 index 0000000..60773c0 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-nonselectable-2.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-readonly-1-300x229.png b/public/blog/wp-content/uploads/2012/01/blv-readonly-1-300x229.png new file mode 100644 index 0000000..586f33a Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-readonly-1-300x229.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-readonly-1.png b/public/blog/wp-content/uploads/2012/01/blv-readonly-1.png new file mode 100644 index 0000000..657f119 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-readonly-1.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-readonly-2-300x229.png b/public/blog/wp-content/uploads/2012/01/blv-readonly-2-300x229.png new file mode 100644 index 0000000..242e35b Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-readonly-2-300x229.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-readonly-2.png b/public/blog/wp-content/uploads/2012/01/blv-readonly-2.png new file mode 100644 index 0000000..f98b9f1 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-readonly-2.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-readonly-3-300x229.png b/public/blog/wp-content/uploads/2012/01/blv-readonly-3-300x229.png new file mode 100644 index 0000000..7c80e13 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-readonly-3-300x229.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-readonly-3.png b/public/blog/wp-content/uploads/2012/01/blv-readonly-3.png new file mode 100644 index 0000000..756d3e5 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-readonly-3.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-showdefaultgroup1-300x202.png b/public/blog/wp-content/uploads/2012/01/blv-showdefaultgroup1-300x202.png new file mode 100644 index 0000000..b524a66 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-showdefaultgroup1-300x202.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-showdefaultgroup1.png b/public/blog/wp-content/uploads/2012/01/blv-showdefaultgroup1.png new file mode 100644 index 0000000..8f448ad Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-showdefaultgroup1.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-showdefaultgroup2-300x202.png b/public/blog/wp-content/uploads/2012/01/blv-showdefaultgroup2-300x202.png new file mode 100644 index 0000000..5032977 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-showdefaultgroup2-300x202.png differ diff --git a/public/blog/wp-content/uploads/2012/01/blv-showdefaultgroup2.png b/public/blog/wp-content/uploads/2012/01/blv-showdefaultgroup2.png new file mode 100644 index 0000000..76a5671 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/blv-showdefaultgroup2.png differ diff --git a/public/blog/wp-content/uploads/2012/01/metadata-view-194x300.png b/public/blog/wp-content/uploads/2012/01/metadata-view-194x300.png new file mode 100644 index 0000000..5f9efe9 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/metadata-view-194x300.png differ diff --git a/public/blog/wp-content/uploads/2012/01/metadata-view.png b/public/blog/wp-content/uploads/2012/01/metadata-view.png new file mode 100644 index 0000000..00209a2 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/01/metadata-view.png differ diff --git a/public/blog/wp-content/uploads/2012/02/blv-invisibleitems-257x300.gif b/public/blog/wp-content/uploads/2012/02/blv-invisibleitems-257x300.gif new file mode 100644 index 0000000..ac91471 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/02/blv-invisibleitems-257x300.gif differ diff --git a/public/blog/wp-content/uploads/2012/02/blv-invisibleitems.gif b/public/blog/wp-content/uploads/2012/02/blv-invisibleitems.gif new file mode 100644 index 0000000..dc0a2e6 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/02/blv-invisibleitems.gif differ diff --git a/public/blog/wp-content/uploads/2012/02/distraction-junkie-coder.png.png b/public/blog/wp-content/uploads/2012/02/distraction-junkie-coder.png.png new file mode 100644 index 0000000..fbf5498 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/02/distraction-junkie-coder.png.png differ diff --git a/public/blog/wp-content/uploads/2012/02/zen-coder.png b/public/blog/wp-content/uploads/2012/02/zen-coder.png new file mode 100644 index 0000000..f45699c Binary files /dev/null and b/public/blog/wp-content/uploads/2012/02/zen-coder.png differ diff --git a/public/blog/wp-content/uploads/2012/03/blv-customheight.png b/public/blog/wp-content/uploads/2012/03/blv-customheight.png new file mode 100644 index 0000000..587488b Binary files /dev/null and b/public/blog/wp-content/uploads/2012/03/blv-customheight.png differ diff --git a/public/blog/wp-content/uploads/2012/03/screen-custom-spacing-150x150.png b/public/blog/wp-content/uploads/2012/03/screen-custom-spacing-150x150.png new file mode 100644 index 0000000..4fd29f5 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/03/screen-custom-spacing-150x150.png differ diff --git a/public/blog/wp-content/uploads/2012/03/screen-custom-spacing.png b/public/blog/wp-content/uploads/2012/03/screen-custom-spacing.png new file mode 100644 index 0000000..f33deed Binary files /dev/null and b/public/blog/wp-content/uploads/2012/03/screen-custom-spacing.png differ diff --git a/public/blog/wp-content/uploads/2012/03/screen-pixel-share-300x158.png b/public/blog/wp-content/uploads/2012/03/screen-pixel-share-300x158.png new file mode 100644 index 0000000..cd3b0ee Binary files /dev/null and b/public/blog/wp-content/uploads/2012/03/screen-pixel-share-300x158.png differ diff --git a/public/blog/wp-content/uploads/2012/03/screen-pixel-share.png b/public/blog/wp-content/uploads/2012/03/screen-pixel-share.png new file mode 100644 index 0000000..92c070b Binary files /dev/null and b/public/blog/wp-content/uploads/2012/03/screen-pixel-share.png differ diff --git a/public/blog/wp-content/uploads/2012/04/blv-embedded-1-300x136.png b/public/blog/wp-content/uploads/2012/04/blv-embedded-1-300x136.png new file mode 100644 index 0000000..c3e198a Binary files /dev/null and b/public/blog/wp-content/uploads/2012/04/blv-embedded-1-300x136.png differ diff --git a/public/blog/wp-content/uploads/2012/04/blv-embedded-1.png b/public/blog/wp-content/uploads/2012/04/blv-embedded-1.png new file mode 100644 index 0000000..fd219b5 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/04/blv-embedded-1.png differ diff --git a/public/blog/wp-content/uploads/2012/04/blv-embedded-2.png b/public/blog/wp-content/uploads/2012/04/blv-embedded-2.png new file mode 100644 index 0000000..026b6fa Binary files /dev/null and b/public/blog/wp-content/uploads/2012/04/blv-embedded-2.png differ diff --git a/public/blog/wp-content/uploads/2012/04/rightalign-group2-300x261.png b/public/blog/wp-content/uploads/2012/04/rightalign-group2-300x261.png new file mode 100644 index 0000000..011148b Binary files /dev/null and b/public/blog/wp-content/uploads/2012/04/rightalign-group2-300x261.png differ diff --git a/public/blog/wp-content/uploads/2012/04/rightalign-group2.png b/public/blog/wp-content/uploads/2012/04/rightalign-group2.png new file mode 100644 index 0000000..fd9d10a Binary files /dev/null and b/public/blog/wp-content/uploads/2012/04/rightalign-group2.png differ diff --git a/public/blog/wp-content/uploads/2012/04/rightalign.png b/public/blog/wp-content/uploads/2012/04/rightalign.png new file mode 100644 index 0000000..c3ac98a Binary files /dev/null and b/public/blog/wp-content/uploads/2012/04/rightalign.png differ diff --git a/public/blog/wp-content/uploads/2012/08/anigif.gif b/public/blog/wp-content/uploads/2012/08/anigif.gif new file mode 100644 index 0000000..ffad706 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/08/anigif.gif differ diff --git a/public/blog/wp-content/uploads/2012/09/custom-selection.png b/public/blog/wp-content/uploads/2012/09/custom-selection.png new file mode 100644 index 0000000..0bedee2 Binary files /dev/null and b/public/blog/wp-content/uploads/2012/09/custom-selection.png differ diff --git a/public/blog/wp-content/uploads/2012/12/chapter-drag-drop.html b/public/blog/wp-content/uploads/2012/12/chapter-drag-drop.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2012/12/chapter-drag-drop.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2012/12/chapter-embedded-controls.html b/public/blog/wp-content/uploads/2012/12/chapter-embedded-controls.html new file mode 100644 index 0000000..c6640e1 --- /dev/null +++ b/public/blog/wp-content/uploads/2012/12/chapter-embedded-controls.html @@ -0,0 +1,719 @@ + + + + +Embedded Controls + + + + +
    +
    + + + + +

    Embedded Controls

    + + + + + +

    Embedded editing controls can be thought of as an extension to label + edit functionality (see Label + Editing for more information).

    + +

    Every item and sub-item has a cell area on which + an editing control can be placed. In the simplest case + (LabelEdit set to true), the editing control is + basically a System.Windows.Forms.TextBox control. It is + actually an instance of BetterListViewTextBoxEmbeddedControl, + which is a TextBox wrapper implementing + IBetterListViewEmbeddedControl interface. Any control can be + used as embedded control in Bettter ListView if implements one of these + interfaces:

    + +
      +
    • +

      IBetterListViewEmbeddedControl

      +
    • +
    • +

      IBetterListViewEmbeddedControlExtended

      +
    • +
    +

    The custom embedded control is shown on the image below. When user + clicks on sub-item text (an abbreviation of tea grading), an editing control + appears on the top-left corner of the cell area. The control contains + buttons for accepting and cancelling changes:

    + +

    + +

    Implementing IBetterListViewEmbeddedControl

    + + +

    This interface contains prescription for minimum amount of + functionality required by an embedded control:

    + +
      +
    • +

      Get label text for currently edited data.

      +
    • +
    • +

      Data accepting and cancelling events (e.g. if the control has an + OK button).

      +
    • +
    • +

      Set control size given the cell area and positioning + data.

      +
    • +
    • +

      Move data from sub-item to the control.

      +
    • +
    • +

      Move data from the control to the sub-item.

      +
    • +
    +

    Let's make a sample control. We will make a + TextBox-based embedded control for editing words in + lower-case. First, we inherit TextBox and implement + IBetterListViewEmbeddedControl interface:

    + +

    C#

    +
    /// <summary>
    +///   Represents a custom control embeddable in Better ListView.
    +/// </summary>
    +public class TextBoxEmbeddedControl : TextBox, IBetterListViewEmbeddedControl
    + +

    Visual Basic

    +
    ''' <summary>
    +'''   Represents a custom control embeddable in Better ListView.
    +''' </summary>
    +Public Class TextBoxEmbeddedControl
    +    Inherits TextBox
    +    Implements IBetterListViewEmbeddedControl
    + +

    Then we implement the LabelText property:

    + +

    C#

    +
    /// <summary>
    +///   current (edited) label text
    +/// </summary>
    +public string LabelText
    +{
    +    get
    +    {
    +        return Text.ToLower();
    +    }
    +}
    + +

    Visual Basic

    +
    ''' <summary>
    +'''   current (edited) label text
    +''' </summary>
    +Public ReadOnly Property LabelText() As String
    +    Get
    +        Return Text.ToLower()
    +    End Get
    +End Property
    + +

    As you can see, the text of the TextBox is converted to + lower case since we want item/sub-item labels to be only in lower + case.

    + +

    Next, we implement RequestAccept and + RequestCancel events:

    + +

    C#

    +
    /// <summary>
    +///   request accepting updated data in BetterListView
    +/// </summary>
    +public event EventHandler RequestAccept;
    +
    +/// <summary>
    +///   request cancelling editing
    +/// </summary>
    +public event EventHandler RequestCancel;
    + +

    Visual Basic

    +
    ''' <summary>
    +'''   request accepting updated data in BetterListView
    +''' </summary>
    +Public Event RequestAccept As EventHandler Implements IBetterListViewEmbeddedControl.RequestAccept
    +
    +''' <summary>
    +'''   request cancelling editing
    +''' </summary>
    +Public Event RequestCancel As EventHandler Implements IBetterListViewEmbeddedControl.RequestCancel
    + +

    Next, we implement GetData and SetData + methods:

    + +

    C#

    +
    /// <summary>
    +///   get data from the specified sub-item in control
    +/// </summary>
    +/// <param name = "subItem">sub-item whose data are being edited</param>
    +public void GetData(BetterListViewSubItem subItem)
    +{
    +	Text = subItem.Text;
    +}
    +
    +/// <summary>
    +///   set data from control to the specified sub-item
    +/// </summary>
    +/// <param name = "subItem">sub-item whose data are being edited</param>
    +public void SetData(BetterListViewSubItem subItem)
    +{
    +    subItem.Text = LabelText;
    +}
    + +

    Visual Basic

    +
    ''' <summary>
    +'''   get data from the specified sub-item in control
    +''' </summary>
    +''' <param name = "subItem">sub-item whose data are being edited</param>
    +Public Sub GetData(ByVal subItem As BetterListViewSubItem) Implements IBetterListViewEmbeddedControl.GetData
    +
    +    Text = subItem.Text
    +
    +End Sub
    +
    +''' <summary>
    +'''   set data from control to the specified sub-item
    +''' </summary>
    +''' <param name = "subItem">sub-item whose data are being edited</param>
    +Public Sub SetData(ByVal subItem As BetterListViewSubItem) Implements IBetterListViewEmbeddedControl.SetData
    +
    +    subItem.Text = LabelText
    +
    +End Sub
    + +

    These method are trivial since we need not to do any data + conversions (the only conversion here is lowering the case of edited text + in the LabelText getter).

    + +

    The last method contained in the interface is SetSize + method, which needs not to be implemented (the body can be kept empty). + You implement this method only if you need to adjust control's size when + label edit starts.

    + +

    The constructor should be implemented like this:

    + +

    C#

    +
    /// <summary>
    +///   Initializes a new instance of the <see cref = "TextBoxEmbeddedControl" /> class.
    +/// </summary>
    +public TextBoxEmbeddedControl()
    +{
    +    AcceptsReturn = true;
    +    CausesValidation = false;
    +}
    + +

    Visual Basic

    +
    ''' <summary>
    +'''   Initializes a new instance of the <see cref = "TextBoxEmbeddedControl" /> class.
    +''' </summary>
    +Public Sub New()
    +
    +    AcceptsReturn = True
    +    CausesValidation = False
    +
    +End Sub
    + +

    The AcceptsReturn property is set to true + because we will handle the ENTER key (and raise + RequestAccept event appropriately).

    + +

    The CausesValidation property is set to + false because it is a good practice in this situation.

    + +

    Both input and output data are validated in the + IBetterListViewEmbeddedControl implementation and validation + of some third-party controls can prevent whole form with the control from + closing.

    + +

    The last thing we implement is handling of the + ENTER key for accepting the data and the + ESCAPE key for cancelling:

    + +

    C#

    +
    protected override void OnKeyDown(KeyEventArgs e)
    +{
    +    if (e.KeyCode == Keys.Enter &&
    +        RequestAccept != null)
    +    {
    +        RequestAccept(this, EventArgs.Empty);
    +
    +        e.Handled = true;
    +
    +        return;
    +    }
    +
    +    if (e.KeyCode == Keys.Escape &&
    +        RequestCancel != null)
    +    {
    +        RequestCancel(this, EventArgs.Empty);
    +
    +        e.Handled = true;
    +
    +        return;
    +    }
    +
    +    base.OnKeyDown(e);
    +}
    + +

    Visual Basic

    +
    Protected Overrides Sub OnKeyDown(e As KeyEventArgs)
    +
    +    If e.KeyCode = Keys.Enter AndAlso RequestAccept IsNot Nothing Then
    +
    +        RequestAccept(Me, EventArgs.Empty)
    +
    +        e.Handled = True
    +
    +        Return
    +
    +    End If
    +
    +    If e.KeyCode = Keys.Escape AndAlso RequestCancel IsNot Nothing Then
    +
    +    RequestCancel(Me, EventArgs.Empty)
    +
    +    e.Handled = True
    +
    +    Return
    +
    +    End If
    +
    +    MyBase.OnKeyDown(e)
    +
    +End Sub
    + +

    +

    It is a common good practice to implement interfaces explicitly. + The sample implementation is implicit for the sake of better + readability. Embedded controls implemented in BetterListView.dll are + implemented implicitly (and marked virtual) to allow for being inherited + (e.g. MyCustomControl : BetterListViewEmbeddedControl) and + you may possibly want to override any part of the interface + implementation.

    +
    +

    Implementing IBetterListViewEmbeddedControlExtended

    + + +

    The extended interface has currently only one method called + RequestEndEdit. This method can be called by the Better + ListView, when it asks the control whether it is ready to end editing. The + control can return a boolean value (true - continue + EndEdit, false - refuse to end editing). There + are many situations when the label editing is terminated (e.g. scrolling + the control, selecting items...) and terminating the label edit is not + always wanted (this is a case of + System.Windows.Forms.DateTimePicker control, which sometimes + behaves as being transparent for mouse clicks and thus being closed + because of click-through on the Better ListView client area - the + RequestEndEdit method fixes such possible behavior of third + party controls).

    + + +

    Sample Source Code

    + + +

    Form with Better ListView containing some columns and items:

    + +

    C#

    +
    /// <summary>
    +///   Shows embedding of custom controls into Better ListView.
    +/// </summary>
    +internal sealed partial class EmbeddedControlSampleForm : Form
    +{
    +    /// <summary>
    +    ///   Initializes a new instance of the <see cref = "EmbeddedControlSampleForm" /> class.
    +    /// </summary>
    +    public EmbeddedControlSampleForm()
    +    {
    +        InitializeComponent();
    +
    +        this.listView.BeginUpdate();
    +
    +        this.listView.Columns.AddRange(new[]
    +                                       {
    +                                           new BetterListViewColumnHeader("Document name", 160),
    +                                           new BetterListViewColumnHeader("Access", 128)
    +                                       });
    +
    +        this.listView.Items.AddRange(
    +            new[]
    +            {
    +                new BetterListViewItem(new[] { "hydro-report.pdf", "read" }),
    +                new BetterListViewItem(new[] { "magnetic_resonance.docx", "read write" }),
    +                new BetterListViewItem(new[] { "billing forms (2011).zip", "read" })
    +            });
    +
    +        this.listView.LabelEditActivation = (BetterListViewLabelEditActivation.Keyboard | BetterListViewLabelEditActivation.SingleClick);
    +        this.listView.LabelEditModeSubItems = BetterListViewLabelEditMode.CustomControl;
    +
    +        this.listView.EndUpdate();
    +
    +        this.listView.RequestEmbeddedControl += ListViewRequestEmbeddedControl;
    +    }
    +
    +    private IBetterListViewEmbeddedControl ListViewRequestEmbeddedControl(object sender, BetterListViewRequestEmbeddedControlEventArgs eventArgs)
    +    {
    +        if (eventArgs.SubItem.Index == 1)
    +        {
    +            return (new DocumentAccessConrol());
    +        }
    +
    +        return null;
    +    }
    +}
    + +

    Visual Basic

    +
    ''' <summary>
    +'''   Shows embedding of custom controls into Better ListView.
    +''' </summary>
    +Partial Friend NotInheritable Class EmbeddedControlSampleForm
    +
    +    ''' <summary>
    +    '''   Initializes a new instance of the <see cref = "EmbeddedControlSampleForm" /> class.
    +    ''' </summary>
    +    Public Sub New()
    +
    +        InitializeComponent()
    +
    +        ListView.BeginUpdate()
    +
    +        ListView.Columns.AddRange(
    +            New BetterListViewColumnHeader() { _
    +                                                 New BetterListViewColumnHeader("Document name", 160),
    +                                                 New BetterListViewColumnHeader("Access", 128)
    +                                             })
    +
    +        ListView.Items.AddRange(
    +            New BetterListViewItem() { _
    +                                         New BetterListViewItem(New String() {"hydro-report.pdf", "read"}),
    +                                         New BetterListViewItem(New String() {"magnetic_resonance.docx", "read write"}),
    +                                         New BetterListViewItem(New String() {"billing forms (2011).zip", "read"})
    +                                     })
    +
    +        ListView.LabelEditActivation =
    +            (BetterListViewLabelEditActivation.Keyboard Or BetterListViewLabelEditActivation.SingleClick)
    +        ListView.LabelEditModeSubItems = BetterListViewLabelEditMode.CustomControl
    +
    +        ListView.EndUpdate()
    +
    +        AddHandler ListView.RequestEmbeddedControl, AddressOf ListViewRequestEmbeddedControl
    +
    +    End Sub
    +
    +    Private Function ListViewRequestEmbeddedControl(ByVal sender As Object,
    +                                                     ByVal eventArgs As BetterListViewRequestEmbeddedControlEventArgs) _
    +        As IBetterListViewEmbeddedControl
    +
    +        If eventArgs.SubItem.Index = 1 Then
    +            Return (New DocumentAccessConrol())
    +        End If
    +
    +        Return Nothing
    +
    +    End Function
    +
    +End Class
    + +

    DocumentAccessControl class used as complex embedded + control (see EmbeddedControlSampleForm sample in the provided + C# and Visual Basic samples for full source code):

    + +

    C#

    +
    /// <summary>
    +///   Represents a custom control embeddable in Better ListView.
    +/// </summary>
    +[ToolboxItem(false)]
    +internal sealed partial class DocumentAccessConrol : UserControl, IBetterListViewEmbeddedControl
    +{
    +    private const string StringRead = "read";
    +    private const string StringWrite = "write";
    +
    +    /// <summary>
    +    ///   current (edited) label text
    +    /// </summary>
    +    public string LabelText
    +    {
    +        get
    +        {
    +            // convert control's state to label
    +            if (this.checkBoxRead.Checked &&
    +                this.checkBoxWrite.Checked)
    +            {
    +                return String.Format("{0} {1}", StringRead, StringWrite);
    +            }
    +
    +            if (this.checkBoxRead.Checked)
    +            {
    +                return StringRead;
    +            }
    +
    +            if (this.checkBoxWrite.Checked)
    +            {
    +                return StringWrite;
    +            }
    +
    +            return String.Empty;
    +        }
    +    }
    +
    +    /// <summary>
    +    ///   request accepting updated data in BetterListView
    +    /// </summary>
    +    public event EventHandler RequestAccept;
    +
    +    /// <summary>
    +    ///   request cancelling editing
    +    /// </summary>
    +    public event EventHandler RequestCancel;
    +
    +    /// <summary>
    +    ///   Initializes a new instance of the <see cref = "DocumentAccessConrol" /> class.
    +    /// </summary>
    +    public DocumentAccessConrol()
    +    {
    +        InitializeComponent();
    +
    +        //NOTE: disabling validation prevents form close cancellation
    +        CausesValidation = false;
    +
    +        foreach (Control control in Controls)
    +        {
    +            control.LostFocus += ControlOnLostFocus;
    +        }
    +    }
    +
    +    /// <summary>
    +    ///   get data from the specified sub-item in control
    +    /// </summary>
    +    /// <param name = "subItem">sub-item whose data are being edited</param>
    +    public void GetData(BetterListViewSubItem subItem)
    +    {
    +        // convert label to control's state
    +        this.checkBoxRead.Checked = subItem.Text.Contains(StringRead);
    +        this.checkBoxWrite.Checked = subItem.Text.Contains(StringWrite);
    +    }
    +
    +    /// <summary>
    +    ///   set data from control to the specified sub-item
    +    /// </summary>
    +    /// <param name = "subItem">sub-item whose data are being edited</param>
    +    public void SetData(BetterListViewSubItem subItem)
    +    {
    +        subItem.Text = LabelText;
    +    }
    +
    +    /// <summary>
    +    ///   set control size
    +    /// </summary>
    +    /// <param name = "subItem">sub-item whose data are being edited</param>
    +    /// <param name = "placement">placement of the embedded control within sub-item</param>
    +    public void SetSize(BetterListViewSubItem subItem, BetterListViewEmbeddedControlPlacement placement)
    +    {
    +        // keep size of the control unchanged
    +    }
    +
    +    private void ControlOnLostFocus(object sender, EventArgs eventArgs)
    +    {
    +        //
    +        // NOTE: this code is needed just for hiding embedded control with sub-controls when user changes active form while label editing
    +        //
    +        bool anyFocused = Focused;
    +
    +        if (anyFocused == false)
    +        {
    +            foreach (Control control in Controls)
    +            {
    +                if (control.Focused)
    +                {
    +                    anyFocused = true;
    +
    +                    break;
    +                }
    +            }
    +        }
    +
    +        if (anyFocused == false)
    +        {
    +            RequestAccept(this, eventArgs);
    +        }
    +    }
    +
    +    private void ButtonOKClick(object sender, EventArgs e)
    +    {
    +        RequestAccept(this, e);
    +    }
    +
    +    private void ButtonCancelClick(object sender, EventArgs e)
    +    {
    +        RequestCancel(this, e);
    +    }
    +}
    + +

    Visual Basic

    +
    ''' <summary>
    +'''   Represents a custom control embeddable in Better ListView.
    +''' </summary>
    +<ToolboxItem(False)>
    +Partial Friend NotInheritable Class DocumentAccessConrol
    +    Inherits UserControl
    +    Implements IBetterListViewEmbeddedControl
    +
    +    Private Const StringRead As String = "read"
    +    Private Const StringWrite As String = "write"
    +
    +    ''' <summary>
    +    '''   current (edited) label text
    +    ''' </summary>
    +    Public ReadOnly Property LabelText() As String Implements IBetterListViewEmbeddedControl.LabelText
    +        Get
    +            ' convert control's state to label
    +            If CheckBoxRead.Checked AndAlso CheckBoxWrite.Checked Then
    +                Return [String].Format("{0} {1}", StringRead, StringWrite)
    +            End If
    +
    +            If CheckBoxRead.Checked Then
    +                Return StringRead
    +            End If
    +
    +            If CheckBoxWrite.Checked Then
    +                Return StringWrite
    +            End If
    +
    +            Return [String].Empty
    +        End Get
    +    End Property
    +
    +    ''' <summary>
    +    '''   request accepting updated data in BetterListView
    +    ''' </summary>
    +    Public Event RequestAccept As EventHandler Implements IBetterListViewEmbeddedControl.RequestAccept
    +
    +    ''' <summary>
    +    '''   request cancelling editing
    +    ''' </summary>
    +    Public Event RequestCancel As EventHandler Implements IBetterListViewEmbeddedControl.RequestCancel
    +
    +    ''' <summary>
    +    '''   Initializes a new instance of the <see cref = "DocumentAccessConrol" /> class.
    +    ''' </summary>
    +    Public Sub New()
    +
    +        InitializeComponent()
    +
    +        'NOTE: disabling validation prevents form close cancellation
    +        CausesValidation = False
    +
    +        For Each control As Control In Controls
    +            AddHandler control.LostFocus, AddressOf ControlOnLostFocus
    +        Next
    +
    +    End Sub
    +
    +    ''' <summary>
    +    '''   get data from the specified sub-item in control
    +    ''' </summary>
    +    ''' <param name = "subItem">sub-item whose data are being edited</param>
    +    Public Sub GetData(ByVal subItem As BetterListViewSubItem) Implements IBetterListViewEmbeddedControl.GetData
    +
    +        ' convert label to control's state
    +        CheckBoxRead.Checked = subItem.Text.Contains(StringRead)
    +        CheckBoxWrite.Checked = subItem.Text.Contains(StringWrite)
    +
    +    End Sub
    +
    +    ''' <summary>
    +    '''   set data from control to the specified sub-item
    +    ''' </summary>
    +    ''' <param name = "subItem">sub-item whose data are being edited</param>
    +    Public Sub SetData(ByVal subItem As BetterListViewSubItem) Implements IBetterListViewEmbeddedControl.SetData
    +
    +        subItem.Text = LabelText
    +
    +    End Sub
    +
    +    ''' <summary>
    +    '''   set control size
    +    ''' </summary>
    +    ''' <param name = "subItem">sub-item whose data are being edited</param>
    +    ''' <param name = "placement">placement of the embedded control within sub-item</param>
    +    Public Sub SetSize(ByVal subItem As BetterListViewSubItem,
    +                        ByVal placement As BetterListViewEmbeddedControlPlacement) _
    +        Implements IBetterListViewEmbeddedControl.SetSize
    +
    +        ' keep size of the control unchanged
    +
    +    End Sub
    +
    +    Private Sub ControlOnLostFocus(ByVal sender As Object, ByVal eventArgs As EventArgs)
    +
    +        '
    +        ' NOTE: this code is needed just for hiding embedded control with sub-controls when user changes active form while label editing
    +        '
    +        Dim anyFocused As Boolean = Focused
    +
    +        If anyFocused = False Then
    +            For Each control As Control In Controls
    +                If control.Focused Then
    +                    anyFocused = True
    +
    +                    Exit For
    +                End If
    +            Next
    +        End If
    +
    +        If anyFocused = False Then
    +            RaiseEvent RequestAccept(Me, eventArgs)
    +        End If
    +
    +    End Sub
    +
    +    Private Sub ButtonOKClick(ByVal sender As Object, ByVal e As EventArgs) Handles ButtonOK.Click
    +        RaiseEvent RequestAccept(Me, e)
    +    End Sub
    +
    +    Private Sub ButtonCancelClick(ByVal sender As Object, ByVal e As EventArgs) Handles ButtonCancel.Click
    +        RaiseEvent RequestCancel(Me, e)
    +    End Sub
    +
    +End Class
    + +
    + + + + + +
    + + + +
    + diff --git a/public/blog/wp-content/uploads/2012/12/chapter-empty-text.html b/public/blog/wp-content/uploads/2012/12/chapter-empty-text.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2012/12/chapter-empty-text.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2012/12/chapter-label-edit.html b/public/blog/wp-content/uploads/2012/12/chapter-label-edit.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2012/12/chapter-label-edit.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2012/12/embedded-control.png.html b/public/blog/wp-content/uploads/2012/12/embedded-control.png.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2012/12/embedded-control.png.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2012/12/label-edit.gif b/public/blog/wp-content/uploads/2012/12/label-edit.gif new file mode 100644 index 0000000..626305c Binary files /dev/null and b/public/blog/wp-content/uploads/2012/12/label-edit.gif differ diff --git a/public/blog/wp-content/uploads/2012/12/lang-vb.js.html b/public/blog/wp-content/uploads/2012/12/lang-vb.js.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2012/12/lang-vb.js.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2012/12/prettify.css.html b/public/blog/wp-content/uploads/2012/12/prettify.css.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2012/12/prettify.css.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2012/12/prettify.js.html b/public/blog/wp-content/uploads/2012/12/prettify.js.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2012/12/prettify.js.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2012/12/style.css.html b/public/blog/wp-content/uploads/2012/12/style.css.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2012/12/style.css.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2012/12/w8-theme.jpg b/public/blog/wp-content/uploads/2012/12/w8-theme.jpg new file mode 100644 index 0000000..2fbed5b Binary files /dev/null and b/public/blog/wp-content/uploads/2012/12/w8-theme.jpg differ diff --git a/public/blog/wp-content/uploads/2012/index.html b/public/blog/wp-content/uploads/2012/index.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-content/uploads/2012/index.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2012/resources/main.css.html b/public/blog/wp-content/uploads/2012/resources/main.css.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2012/resources/main.css.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2012/resources/overview.gif.html b/public/blog/wp-content/uploads/2012/resources/overview.gif.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2012/resources/overview.gif.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/01/chapter-save-load.html b/public/blog/wp-content/uploads/2013/01/chapter-save-load.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/01/chapter-save-load.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/01/chapter-search.html b/public/blog/wp-content/uploads/2013/01/chapter-search.html new file mode 100644 index 0000000..4f0055e --- /dev/null +++ b/public/blog/wp-content/uploads/2013/01/chapter-search.html @@ -0,0 +1,238 @@ + + + + +Searching Items + + + + +
    +
    + + + + +

    Searching Items

    + + + + + +

    Better ListView offers many options for searching items by typing on + keyboard and programmaticaly (FindItemWithText, + FindItemsWithText methods). Search can be extended to sub-items + and event multiple items can be contained in a search result.

    + +

    Search can be customized with SearchSettings property. + This structure contains three other properties:

    + +
      +
    • +Mode
      • +

        Specifies how the searching is done on each item/sub-item + string.

        + +
          +
        • +Disabled
          • +

            Searching is disabled.

            +
          +
        • +
        • +Prefix
          • +

            Search is restricted to text prefix.

            +
          +
        • +
        • +PrefixOrSubstring
          • +

            Search query can match any substring, if nothing found by + prefix.

            +
          +
        • +
        • +Substring
          • +

            Search query can match any substring.

            +
          +
        • +
        +
      +
    • +
    • +Options
      • +

        Additional options for searching.

        + +
          +
        • +CaseSensitive
          • +

            The search is case-sensitive.

            +
          +
        • +
        • +FirstWordOnly
          • +

            Search is restricted to the first word of searched + text.

            +
          +
        • +
        • +None
          • +

            No options active.

            +
          +
        • +
        • +PlaySound
          • +

            Sound is played, when nothing is found.

            +
          +
        • +
        • +PrefixPreference
          • +

            Results matched by prefix are prefered among other (e.g. + when searching for pla, then the text + player is prefered among the word + applause).

            +
          +
        • +
        • +SelectableItemsOnly
          • +

            Restrict the search to selectable items only.

            +
          +
        • +
        • +WordSearch
          • +

            Searched text si first split into words and searching is + done on each word separately.

            +
          +
        • +
        +
      +
    • +
    • +SubItemIndices
      • +

        Specifies sub-items on which the search is done; if the + collection is empty, than all sub-items are searched.

        +
      +
    • +
    +

    There is a default one-second delay to register when user stopped + typing and the search is discarded. A new search is initiated when user + starts typing after this interval has passed. This interval can be set via + SearchTimeoutDelay property.

    + +

    The delay is not relevant when user types the same letter several + times and there are other items beginning with that letter. If there are + items named ab, ac, + ad, then the selection cycles through these items as + long as the user keeps pressing A key. This works + essentialy the same way as in the Windows Explorer.

    + +

    +

    The keyboard search works, of course, only when the control has + focus. You can ensure this (e.g. when showing the form) by calling + Focus method on Better ListView.

    +
    +

    Sample Source Code

    + + +

    C#

    +
    this.listView.BeginUpdate();
    +
    +// fill the ListView with items in two columns
    +this.listView.Columns.AddRange(
    +    new[]
    +    {
    +        new BetterListViewColumnHeader("Word", 128),
    +        new BetterListViewColumnHeader("Synonym List", 160)
    +    });
    +
    +this.listView.Items.AddRange(
    +    new[]
    +    {
    +        new BetterListViewItem(new[] { "apparently", "evidently, presumably, seemingly" }),
    +        new BetterListViewItem(new[] { "blunt", "brusque, curt, snippy" }),
    +        new BetterListViewItem(new[] { "class", "caste, estate, folk" }),
    +        new BetterListViewItem(new[] { "detailed", "elaborate, full, thorough" }),
    +    });
    +
    +// search in substrings
    +BetterListViewSearchMode searchMode = BetterListViewSearchMode.Substring;
    +
    +// use case-sensitive searching and play sounds
    +BetterListViewSearchOptions searchOptions = (BetterListViewSearchOptions.CaseSensitive | BetterListViewSearchOptions.PlaySound);
    +
    +// search in the first and second column
    +//NOTE: empty array also means searching in all columns
    +int[] subItemIndices = new[] { 0, 1 };
    +
    +// set-up the search
    +this.listView.SearchSettings = new BetterListViewSearchSettings(searchMode, searchOptions, subItemIndices);
    +
    +this.listView.EndUpdate();
    + +

    Visual Basic

    +
    ListView.BeginUpdate()
    +
    +' fill the ListView with items in two columns
    +ListView.Columns.AddRange(
    +    New BetterListViewColumnHeader() { _
    +                                         New BetterListViewColumnHeader("Word", 128),
    +                                         New BetterListViewColumnHeader("Synonym List", 160)
    +                                     })
    +
    +ListView.Items.AddRange(
    +    New BetterListViewItem() { _
    +                                 New BetterListViewItem(New String() _
    +                                                            {"apparently", "evidently, presumably, seemingly"}),
    +                                 New BetterListViewItem(New String() {"blunt", "brusque, curt, snippy"}),
    +                                 New BetterListViewItem(New String() {"class", "caste, estate, folk"}),
    +                                 New BetterListViewItem(New String() {"detailed", "elaborate, full, thorough"})
    +                            })
    +
    +' search in substrings
    +Dim searchMode As BetterListViewSearchMode = BetterListViewSearchMode.Substring
    +
    +' use case-sensitive searching and play sounds
    +Dim searchOptions As BetterListViewSearchOptions =
    +        (BetterListViewSearchOptions.CaseSensitive Or BetterListViewSearchOptions.PlaySound)
    +
    +' search in the first and second column
    +'NOTE: empty array also means searching in all columns
    +Dim subItemIndices As Integer() = New Integer() {0, 1}
    +
    +' set-up the search
    +ListView.SearchSettings = New BetterListViewSearchSettings (searchMode, searchOptions, subItemIndices)
    +
    +ListView.EndUpdate()
    + +
    + + + + + +
    + + + +
    + diff --git a/public/blog/wp-content/uploads/2013/01/chapter-serialization.html b/public/blog/wp-content/uploads/2013/01/chapter-serialization.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/01/chapter-serialization.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/01/lang-vb.js.html b/public/blog/wp-content/uploads/2013/01/lang-vb.js.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/01/lang-vb.js.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/01/prettify.css.html b/public/blog/wp-content/uploads/2013/01/prettify.css.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/01/prettify.css.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/01/prettify.js.html b/public/blog/wp-content/uploads/2013/01/prettify.js.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/01/prettify.js.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/01/properties.png b/public/blog/wp-content/uploads/2013/01/properties.png new file mode 100644 index 0000000..9113cd0 Binary files /dev/null and b/public/blog/wp-content/uploads/2013/01/properties.png differ diff --git a/public/blog/wp-content/uploads/2013/01/screen-blv-binding1.png b/public/blog/wp-content/uploads/2013/01/screen-blv-binding1.png new file mode 100644 index 0000000..bafa4de Binary files /dev/null and b/public/blog/wp-content/uploads/2013/01/screen-blv-binding1.png differ diff --git a/public/blog/wp-content/uploads/2013/01/screen-blv-binding2.png b/public/blog/wp-content/uploads/2013/01/screen-blv-binding2.png new file mode 100644 index 0000000..8fff006 Binary files /dev/null and b/public/blog/wp-content/uploads/2013/01/screen-blv-binding2.png differ diff --git a/public/blog/wp-content/uploads/2013/01/screen-blv-binding3.png b/public/blog/wp-content/uploads/2013/01/screen-blv-binding3.png new file mode 100644 index 0000000..9087b20 Binary files /dev/null and b/public/blog/wp-content/uploads/2013/01/screen-blv-binding3.png differ diff --git a/public/blog/wp-content/uploads/2013/01/search-highlight-1.gif b/public/blog/wp-content/uploads/2013/01/search-highlight-1.gif new file mode 100644 index 0000000..69a6cd6 Binary files /dev/null and b/public/blog/wp-content/uploads/2013/01/search-highlight-1.gif differ diff --git a/public/blog/wp-content/uploads/2013/01/search-highlight-2.gif b/public/blog/wp-content/uploads/2013/01/search-highlight-2.gif new file mode 100644 index 0000000..3f3dc1d Binary files /dev/null and b/public/blog/wp-content/uploads/2013/01/search-highlight-2.gif differ diff --git a/public/blog/wp-content/uploads/2013/01/style.css.html b/public/blog/wp-content/uploads/2013/01/style.css.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/01/style.css.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/02/chapter-multi-line.html b/public/blog/wp-content/uploads/2013/02/chapter-multi-line.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/02/chapter-multi-line.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/02/chapter-owner-draw.html b/public/blog/wp-content/uploads/2013/02/chapter-owner-draw.html new file mode 100644 index 0000000..f90869f --- /dev/null +++ b/public/blog/wp-content/uploads/2013/02/chapter-owner-draw.html @@ -0,0 +1,334 @@ + + + + +Owner Drawing + + + + +
    +
    + + + + +

    Owner Drawing

    + + + + + +

    Owner drawing allow to customize appearance of any element, element + part and the control itself:

    + +

    + +

    Drawing Over Control Parts

    + + +

    The simple way to draw over control parts is by using drawing + events:

    + +
      +
    • +

      DrawBackground

      +
    • +
    • +

      DrawColumnHeader

      +
    • +
    • +

      DrawColumnHeaderBackground

      +
    • +
    • +

      DrawGroup

      +
    • +
    • +

      DrawGroupBackground

      +
    • +
    • +

      DrawItem

      +
    • +
    • +

      DrawItemBackground

      +
    • +
    • +

      DrawInsertionMark

      +
    • +
    +

    Each of these events contains System.Drawing.Graphics + object in event data with which custom drawing is possible. Areas of + drawing are also provided. For example, to draw inside item inner area, + there is a + BetterListViewDrawItemEventArgs.ItemBounds.BoundsInner + property containing the rectangle.

    + +

    +

    If you want to paint outside element areas, set + OptimizedInvalidation property to false. This + will ensure your custom drawing code will be called in every redraw + cycle.

    +
    +

    Replacing Default Drawing by Custom Drawing

    + + +

    Owner drawing events are always called after the default drawing, so + it is possible only to draw over exisiting drawing. When you need turn off + some painting and do your own drawing instead of the default one (e.g. + draw rotated text instead the straight one), you have to create your + custom control inheriting from BetterListView:

    + +

    C#

    +
    class OwnerDrawBetterListView : BetterListView
    +{
    +    // ...
    +}
    + +

    Visual Basic

    +
    Class OwnerDrawBetterListView Inherits BetterListView
    +    ' ...
    +End Class
    + +

    Then you can override one of the drawing methods:

    + +
      +
    • +

      OnDrawBackground

      +
    • +
    • +

      OnDrawColumnHeader

      +
    • +
    • +

      OnDrawGroup

      +
    • +
    • +

      OnDrawGroupBackground

      +
    • +
    • +

      OnDrawItem

      +
    • +
    • +

      OnDrawItemBackground

      +
    • +
    • +

      OnDrawInsertionMark

      +
    • +
    +

    This gives you more control over the painting, because your drawing + code can be called before or + after the default drawing, depending on where and if + you call base implementation.

    + +

    Every part of the default drawing has a switch so you can turn the + default drawing off. For example, if you want not to draw default text on + some item, set BetterListViewDrawItemEventArgs.DrawText + property to false.

    + +

    It is also possible to do custom drawing as the very last drawing of + the whole control. To do this, override DrawingRedrawCore + method and do your drawing after calling the base implementation:

    + +

    C#

    +
    protected override void DrawingRedrawCore(Graphics grfx)
    +{
    +    base.DrawingRedrawCore(grfx);
    +
    +    // do your custom drawing
    +}
    + +

    Visual Basic

    +
    Protected Overrides Sub DrawingRedrawCore(grfx As Graphics)
    +
    +    MyBase.DrawingRedrawCore(grfx)
    +
    +    ' do your custom drawing
    +    
    +End Sub
    + + +

    Overriding Item and Control States

    + + +

    The appearance of element depends not only on its state, but also on + the control state.

    + +

    If you override one of the drawing methods (e.g. + OnDrawItem), you can modify event data before calling base + class implementation (e.g. base.OnDrawItem).

    + +

    For example, BetterListViewDrawItemEventArgs contains + ItemStateInfo property. By modifying this property, you can + force drawing item in any state you wish.

    + +

    BetterListViewDrawItemEventArgs also contains two + properties regarding control state:

    + +
      +
    • +DrawEnabled
      • +

        Draw item as if the control is in enabled state + (BetterListView.Enabled is true).

        +
      +
    • +
    • +DrawFocused
      • +

        Draw item as if the control in in focused state + (BetterListView.Focused is true).

        +
      +
    • +
    +

    By default, these properties correspond to actual control's state, + but they can be modified. For example, one may want to set + DrawFocused to true on every item that is selected, so the + item will be highlighted even if the control loses focus.

    + +

    The control state properties are available only in the + BetterListViewItemEventArgs, but element states can be + modified in all painting event handlers (also column headers and + groups).

    + + +

    Sample Source Code

    + + +

    The following sample shows owner drawing of item background:

    + +

    C#

    +
    this.listView.BeginUpdate();
    +
    +this.listView.Items.Add("Item with owner-drawn image and background.");
    +
    +this.listView.View = BetterListViewView.Tile;
    +// turn off automatic image sizing to make space for image even when items do not have any images set
    +this.listView.LayoutOptions = (BetterListViewLayoutOptions.Auto & ~BetterListViewLayoutOptions.AutoSizeItemImage);
    +// set 4-pixel boundary around image
    +this.listView.LayoutItemsCurrent.ImagePadding = new Padding(4);
    +// set image size to be 50 by 50 pixels (it is possible to set image sizes for sub-items as well by adding more Size instances in the collection)
    +this.listView.LayoutItemsCurrent.ImageSizes = new ReadOnlyCollection<Size>(new[] { new Size(50, 50) });
    +
    +this.listView.EndUpdate();
    +
    +// we would like to draw over item's foreground (custom image)
    +this.listView.DrawItem += ListViewDrawItem;
    +// we would like to draw over item's background
    +this.listView.DrawItemBackground += ListViewDrawItemBackground;
    + +

    Visual Basic

    +
    ListView.BeginUpdate()
    +
    +ListView.Items.Add("Item with owner-drawn image and background.")
    +
    +ListView.View = BetterListViewView.Tile
    +' turn off automatic image sizing to make space for image even when items do not have any images set
    +ListView.LayoutOptions = (BetterListViewLayoutOptions.Auto And Not BetterListViewLayoutOptions.AutoSizeItemImage)
    +' set 4-pixel boundary around image
    +ListView.LayoutItemsCurrent.ImagePadding = New Padding(4)
    +' set image size to be 50 by 50 pixels (it is possible to set image sizes for sub-items as well by adding more Size instances in the collection)
    +ListView.LayoutItemsCurrent.ImageSizes = New ReadOnlyCollection(Of Size)(New Size() {New Size(50, 50)})
    +
    +ListView.EndUpdate()
    +
    +' we would like to draw over item's foreground (custom image)
    +AddHandler ListView.DrawItem, AddressOf ListViewDrawItem
    +' we would like to draw over item's background
    +AddHandler ListView.DrawItemBackground, AddressOf ListViewDrawItemBackground
    + +

    DrawItem event handler draws on the item image + area:

    + +

    C#

    +
    void ListViewDrawItem(object sender, BetterListViewDrawItemEventArgs eventArgs)
    +{
    +    eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality;
    +
    +    Pen pen = new Pen(Color.BlueViolet, 2.5f);
    +
    +    // draw ellipse in the image area
    +    eventArgs.Graphics.DrawEllipse(
    +        pen,
    +        eventArgs.ItemBounds.SubItemBounds[0].BoundsImage);
    +
    +    pen.Dispose();
    +}
    + +

    Visual Basic

    +
    Sub ListViewDrawItem(ByVal sender As Object, ByVal eventArgs As BetterListViewDrawItemEventArgs)
    +
    +    eventArgs.Graphics.SmoothingMode = SmoothingMode.HighQuality
    +
    +    Dim pen As New Pen(Color.BlueViolet, 2.5F)
    +
    +    ' draw ellipse in the image area
    +    eventArgs.Graphics.DrawEllipse(pen, eventArgs.ItemBounds.SubItemBounds(0).BoundsImage)
    +
    +    pen.Dispose()
    +
    +End Sub
    + +

    DrawItemBackground event handler draws on the item + background area:

    + +

    C#

    +
    void ListViewDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
    +{
    +    Brush brush = new LinearGradientBrush(
    +        eventArgs.ItemBounds.BoundsInner,
    +        Color.FromArgb(64, Color.DarkSeaGreen),
    +        Color.Transparent,
    +        LinearGradientMode.ForwardDiagonal);
    +
    +    // draw over the item's background in the inner area
    +    eventArgs.Graphics.FillRectangle(brush, eventArgs.ItemBounds.BoundsInner);
    +
    +    brush.Dispose();
    +}
    + +

    Visual Basic

    +
    Sub ListViewDrawItemBackground(ByVal sender As Object, ByVal eventArgs As BetterListViewDrawItemBackgroundEventArgs)
    +
    +    Dim brush As Brush = New LinearGradientBrush(
    +        eventArgs.ItemBounds.BoundsInner,
    +        Color.FromArgb(64, Color.DarkSeaGreen),
    +        Color.Transparent,
    +        LinearGradientMode.ForwardDiagonal)
    +
    +    ' draw over the item's background in the inner area
    +    eventArgs.Graphics.FillRectangle(brush, eventArgs.ItemBounds.BoundsInner)
    +
    +    brush.Dispose()
    +
    +End Sub
    + +
    + + + + + +
    + + + +
    + diff --git a/public/blog/wp-content/uploads/2013/02/chapter-performance.html b/public/blog/wp-content/uploads/2013/02/chapter-performance.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/02/chapter-performance.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/02/hot-item-backcolor.gif b/public/blog/wp-content/uploads/2013/02/hot-item-backcolor.gif new file mode 100644 index 0000000..11ff695 Binary files /dev/null and b/public/blog/wp-content/uploads/2013/02/hot-item-backcolor.gif differ diff --git a/public/blog/wp-content/uploads/2013/02/lang-vb.js.html b/public/blog/wp-content/uploads/2013/02/lang-vb.js.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/02/lang-vb.js.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/02/owner-draw.png.html b/public/blog/wp-content/uploads/2013/02/owner-draw.png.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/02/owner-draw.png.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/02/prettify.css.html b/public/blog/wp-content/uploads/2013/02/prettify.css.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/02/prettify.css.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/02/prettify.js.html b/public/blog/wp-content/uploads/2013/02/prettify.js.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/02/prettify.js.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/02/style.css.html b/public/blog/wp-content/uploads/2013/02/style.css.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/02/style.css.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/03/blv-fading.png b/public/blog/wp-content/uploads/2013/03/blv-fading.png new file mode 100644 index 0000000..fdbc81b Binary files /dev/null and b/public/blog/wp-content/uploads/2013/03/blv-fading.png differ diff --git a/public/blog/wp-content/uploads/2013/03/blv-scroll-size.png b/public/blog/wp-content/uploads/2013/03/blv-scroll-size.png new file mode 100644 index 0000000..65876c8 Binary files /dev/null and b/public/blog/wp-content/uploads/2013/03/blv-scroll-size.png differ diff --git a/public/blog/wp-content/uploads/2013/index.html b/public/blog/wp-content/uploads/2013/index.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/index.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/resources/main.css.html b/public/blog/wp-content/uploads/2013/resources/main.css.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/resources/main.css.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2013/resources/overview.gif.html b/public/blog/wp-content/uploads/2013/resources/overview.gif.html new file mode 100644 index 0000000..a77b0e3 --- /dev/null +++ b/public/blog/wp-content/uploads/2013/resources/overview.gif.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-content/uploads/2014/02/image.gif b/public/blog/wp-content/uploads/2014/02/image.gif new file mode 100644 index 0000000..1a93b9a Binary files /dev/null and b/public/blog/wp-content/uploads/2014/02/image.gif differ diff --git a/public/blog/wp-content/uploads/2014/04/blv-alternating-rows.png b/public/blog/wp-content/uploads/2014/04/blv-alternating-rows.png new file mode 100644 index 0000000..6de3f56 Binary files /dev/null and b/public/blog/wp-content/uploads/2014/04/blv-alternating-rows.png differ diff --git a/public/blog/wp-content/uploads/2014/04/blv-gridlines-1.png b/public/blog/wp-content/uploads/2014/04/blv-gridlines-1.png new file mode 100644 index 0000000..c657b05 Binary files /dev/null and b/public/blog/wp-content/uploads/2014/04/blv-gridlines-1.png differ diff --git a/public/blog/wp-content/uploads/2014/04/blv-gridlines-2.png b/public/blog/wp-content/uploads/2014/04/blv-gridlines-2.png new file mode 100644 index 0000000..0efdbc8 Binary files /dev/null and b/public/blog/wp-content/uploads/2014/04/blv-gridlines-2.png differ diff --git a/public/blog/wp-content/uploads/2014/07/blv-sub-item-checkboxes.png b/public/blog/wp-content/uploads/2014/07/blv-sub-item-checkboxes.png new file mode 100644 index 0000000..a69737c Binary files /dev/null and b/public/blog/wp-content/uploads/2014/07/blv-sub-item-checkboxes.png differ diff --git a/public/blog/wp-content/uploads/2014/08/blv-overlay.png b/public/blog/wp-content/uploads/2014/08/blv-overlay.png new file mode 100644 index 0000000..02d3033 Binary files /dev/null and b/public/blog/wp-content/uploads/2014/08/blv-overlay.png differ diff --git a/public/blog/wp-includes/js/comment-reply.min.js?ver=4.9.8 b/public/blog/wp-includes/js/comment-reply.min.js?ver=4.9.8 new file mode 100644 index 0000000..4042143 --- /dev/null +++ b/public/blog/wp-includes/js/comment-reply.min.js?ver=4.9.8 @@ -0,0 +1 @@ +var addComment={moveForm:function(a,b,c,d){var e,f,g,h,i=this,j=i.I(a),k=i.I(c),l=i.I("cancel-comment-reply-link"),m=i.I("comment_parent"),n=i.I("comment_post_ID"),o=k.getElementsByTagName("form")[0];if(j&&k&&l&&m&&o){i.respondId=c,d=d||!1,i.I("wp-temp-form-div")||(e=document.createElement("div"),e.id="wp-temp-form-div",e.style.display="none",k.parentNode.insertBefore(e,k)),j.parentNode.insertBefore(k,j.nextSibling),n&&d&&(n.value=d),m.value=b,l.style.display="",l.onclick=function(){var a=addComment,b=a.I("wp-temp-form-div"),c=a.I(a.respondId);if(b&&c)return a.I("comment_parent").value="0",b.parentNode.insertBefore(c,b),b.parentNode.removeChild(b),this.style.display="none",this.onclick=null,!1};try{for(var p=0;p",{size:1}).attr("size")&&a.attrFn,h=a.attr,i=a.attrHooks.value&&a.attrHooks.value.get||function(){return null},j=a.attrHooks.value&&a.attrHooks.value.set||function(){return c},k=/^(?:input|button)$/i,l=/^[238]$/,m=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,n=/^(?:checked|selected)$/i;e(a,"attrFn",g||{},"jQuery.attrFn is deprecated"),a.attr=function(b,e,f,i){var j=e.toLowerCase(),o=b&&b.nodeType;return i&&(h.length<4&&d("jQuery.fn.attr( props, pass ) is deprecated"),b&&!l.test(o)&&(g?e in g:a.isFunction(a.fn[e])))?a(b)[e](f):("type"===e&&f!==c&&k.test(b.nodeName)&&b.parentNode&&d("Can't change the 'type' of an input or button in IE 6/7/8"),!a.attrHooks[j]&&m.test(j)&&(a.attrHooks[j]={get:function(b,d){var e,f=a.prop(b,d);return f===!0||"boolean"!=typeof f&&(e=b.getAttributeNode(d))&&e.nodeValue!==!1?d.toLowerCase():c},set:function(b,c,d){var e;return c===!1?a.removeAttr(b,d):(e=a.propFix[d]||d,e in b&&(b[e]=!0),b.setAttribute(d,d.toLowerCase())),d}},n.test(j)&&d("jQuery.fn.attr('"+j+"') might use property instead of attribute")),h.call(a,b,e,f))},a.attrHooks.value={get:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?i.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value') no longer gets properties"),b in a?a.value:null)},set:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?j.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value', val) no longer sets properties"),void(a.value=b))}};var o,p,q=a.fn.init,r=a.find,s=a.parseJSON,t=/^\s*)([^>]*)$/;a.fn.init=function(b,e,f){var g,h;return b&&"string"==typeof b&&!a.isPlainObject(e)&&(g=w.exec(a.trim(b)))&&g[0]&&(t.test(b)||d("$(html) HTML strings must start with '<' character"),g[3]&&d("$(html) HTML text after last tag is ignored"),"#"===g[0].charAt(0)&&(d("HTML string cannot start with a '#' character"),a.error("JQMIGRATE: Invalid selector string (XSS)")),e&&e.context&&e.context.nodeType&&(e=e.context),a.parseHTML)?q.call(this,a.parseHTML(g[2],e&&e.ownerDocument||e||document,!0),e,f):(h=q.apply(this,arguments),b&&b.selector!==c?(h.selector=b.selector,h.context=b.context):(h.selector="string"==typeof b?b:"",b&&(h.context=b.nodeType?b:e||document)),h)},a.fn.init.prototype=a.fn,a.find=function(a){var b=Array.prototype.slice.call(arguments);if("string"==typeof a&&u.test(a))try{document.querySelector(a)}catch(c){a=a.replace(v,function(a,b,c,d){return"["+b+c+'"'+d+'"]'});try{document.querySelector(a),d("Attribute selector with '#' must be quoted: "+b[0]),b[0]=a}catch(e){d("Attribute selector with '#' was not fixed: "+b[0])}}return r.apply(this,b)};var x;for(x in r)Object.prototype.hasOwnProperty.call(r,x)&&(a.find[x]=r[x]);a.parseJSON=function(a){return a?s.apply(this,arguments):(d("jQuery.parseJSON requires a valid JSON string"),null)},a.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a.browser||(o=a.uaMatch(navigator.userAgent),p={},o.browser&&(p[o.browser]=!0,p.version=o.version),p.chrome?p.webkit=!0:p.webkit&&(p.safari=!0),a.browser=p),e(a,"browser",a.browser,"jQuery.browser is deprecated"),a.boxModel=a.support.boxModel="CSS1Compat"===document.compatMode,e(a,"boxModel",a.boxModel,"jQuery.boxModel is deprecated"),e(a.support,"boxModel",a.support.boxModel,"jQuery.support.boxModel is deprecated"),a.sub=function(){function b(a,c){return new b.fn.init(a,c)}a.extend(!0,b,this),b.superclass=this,b.fn=b.prototype=this(),b.fn.constructor=b,b.sub=this.sub,b.fn.init=function(d,e){var f=a.fn.init.call(this,d,e,c);return f instanceof b?f:b(f)},b.fn.init.prototype=b.fn;var c=b(document);return d("jQuery.sub() is deprecated"),b},a.fn.size=function(){return d("jQuery.fn.size() is deprecated; use the .length property"),this.length};var y=!1;a.swap&&a.each(["height","width","reliableMarginRight"],function(b,c){var d=a.cssHooks[c]&&a.cssHooks[c].get;d&&(a.cssHooks[c].get=function(){var a;return y=!0,a=d.apply(this,arguments),y=!1,a})}),a.swap=function(a,b,c,e){var f,g,h={};y||d("jQuery.swap() is undocumented and deprecated");for(g in b)h[g]=a.style[g],a.style[g]=b[g];f=c.apply(a,e||[]);for(g in b)a.style[g]=h[g];return f},a.ajaxSetup({converters:{"text json":a.parseJSON}});var z=a.fn.data;a.fn.data=function(b){var e,f,g=this[0];return!g||"events"!==b||1!==arguments.length||(e=a.data(g,b),f=a._data(g,b),e!==c&&e!==f||f===c)?z.apply(this,arguments):(d("Use of jQuery.fn.data('events') is deprecated"),f)};var A=/\/(java|ecma)script/i;a.clean||(a.clean=function(b,c,e,f){c=c||document,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,d("jQuery.clean() is deprecated");var g,h,i,j,k=[];if(a.merge(k,a.buildFragment(b,c).childNodes),e)for(i=function(a){return!a.type||A.test(a.type)?f?f.push(a.parentNode?a.parentNode.removeChild(a):a):e.appendChild(a):void 0},g=0;null!=(h=k[g]);g++)a.nodeName(h,"script")&&i(h)||(e.appendChild(h),"undefined"!=typeof h.getElementsByTagName&&(j=a.grep(a.merge([],h.getElementsByTagName("script")),i),k.splice.apply(k,[g+1,0].concat(j)),g+=j.length));return k});var B=a.event.add,C=a.event.remove,D=a.event.trigger,E=a.fn.toggle,F=a.fn.live,G=a.fn.die,H=a.fn.load,I="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",J=new RegExp("\\b(?:"+I+")\\b"),K=/(?:^|\s)hover(\.\S+|)\b/,L=function(b){return"string"!=typeof b||a.event.special.hover?b:(K.test(b)&&d("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),b&&b.replace(K,"mouseenter$1 mouseleave$1"))};a.event.props&&"attrChange"!==a.event.props[0]&&a.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),a.event.dispatch&&e(a.event,"handle",a.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),a.event.add=function(a,b,c,e,f){a!==document&&J.test(b)&&d("AJAX events should be attached to document: "+b),B.call(this,a,L(b||""),c,e,f)},a.event.remove=function(a,b,c,d,e){C.call(this,a,L(b)||"",c,d,e)},a.each(["load","unload","error"],function(b,c){a.fn[c]=function(){var a=Array.prototype.slice.call(arguments,0);return"load"===c&&"string"==typeof a[0]?H.apply(this,a):(d("jQuery.fn."+c+"() is deprecated"),a.splice(0,0,c),arguments.length?this.bind.apply(this,a):(this.triggerHandler.apply(this,a),this))}}),a.fn.toggle=function(b,c){if(!a.isFunction(b)||!a.isFunction(c))return E.apply(this,arguments);d("jQuery.fn.toggle(handler, handler...) is deprecated");var e=arguments,f=b.guid||a.guid++,g=0,h=function(c){var d=(a._data(this,"lastToggle"+b.guid)||0)%g;return a._data(this,"lastToggle"+b.guid,d+1),c.preventDefault(),e[d].apply(this,arguments)||!1};for(h.guid=f;ga?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0; +}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML="
    a",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:l.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?""!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n(" + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Factivation-issues-and-how-to-solve-them%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Factivation-issues-and-how-to-solve-them%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Factivation-issues-and-how-to-solve-them%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Falternating-rows-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Falternating-rows-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Falternating-rows-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Falternating-rows-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Falternating-rows-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Falternating-rows-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-1-50-released%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-1-50-released%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-1-50-released%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-1-50-released%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-1-50-released%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-1-50-released%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-1-52-released%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-1-52-released%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-1-52-released%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-1-52-released%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-1-52-released%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-1-52-released%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-0-samples-preview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-0-samples-preview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-0-samples-preview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-0-samples-preview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-0-samples-preview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-0-samples-preview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-0-sneak-peek-item-hierarchy-groups-more%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-0-sneak-peek-item-hierarchy-groups-more%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-0-sneak-peek-item-hierarchy-groups-more%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-0-sneak-peek-item-hierarchy-groups-more%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-0-sneak-peek-item-hierarchy-groups-more%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-0-sneak-peek-item-hierarchy-groups-more%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-00-released%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-00-released%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-00-released%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-00-released%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-00-released%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-00-released%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-1-optimizations-done-minor-features-and-testing%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-1-optimizations-done-minor-features-and-testing%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-1-optimizations-done-minor-features-and-testing%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-1-optimizations-done-minor-features-and-testing%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-1-optimizations-done-minor-features-and-testing%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-1-optimizations-done-minor-features-and-testing%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-10-released%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-10-released%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-10-released%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-10-released%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-10-released%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-2-10-released%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-released%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-released%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-released%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-released%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-released%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-released%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-reviewed-at-devproconnections-com%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-reviewed-at-devproconnections-com%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-reviewed-at-devproconnections-com%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-reviewed-at-devproconnections-com%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-reviewed-at-devproconnections-com%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-reviewed-at-devproconnections-com%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-tip-how-to-draw-custom-selection%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-tip-how-to-draw-custom-selection%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-tip-how-to-draw-custom-selection%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-tip-how-to-draw-custom-selection%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-tip-how-to-draw-custom-selection%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-listview-tip-how-to-draw-custom-selection%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-thumbnail-browser-component-released%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-thumbnail-browser-component-released%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-thumbnail-browser-component-released%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-thumbnail-browser-component-released%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-thumbnail-browser-component-released%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbetter-thumbnail-browser-component-released%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbinding-images-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbinding-images-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbinding-images-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbinding-images-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbinding-images-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fbinding-images-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fblv-and-internet-explorer%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fblv-and-internet-explorer%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fblv-and-internet-explorer%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fblv-and-internet-explorer%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fblv-and-internet-explorer%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fblv-and-internet-explorer%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcentering-images-in-better-listview-sub-items%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcentering-images-in-better-listview-sub-items%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcentering-images-in-better-listview-sub-items%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcentering-images-in-better-listview-sub-items%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcentering-images-in-better-listview-sub-items%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcentering-images-in-better-listview-sub-items%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcombined-items-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcombined-items-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcombined-items-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcombined-items-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcombined-items-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcombined-items-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcoming-soon-better-listview-2-1-optimized-for-performance%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcoming-soon-better-listview-2-1-optimized-for-performance%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcoming-soon-better-listview-2-1-optimized-for-performance%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcoming-soon-better-listview-2-1-optimized-for-performance%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcoming-soon-better-listview-2-1-optimized-for-performance%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcoming-soon-better-listview-2-1-optimized-for-performance%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-behavior-of-group-headers-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-behavior-of-group-headers-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-behavior-of-group-headers-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-behavior-of-group-headers-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-behavior-of-group-headers-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-behavior-of-group-headers-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-item-height-in-details-view-of-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-item-height-in-details-view-of-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-item-height-in-details-view-of-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-item-height-in-details-view-of-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-item-height-in-details-view-of-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-item-height-in-details-view-of-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-label-edit-how-to-rename-file-names-without-extension-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-label-edit-how-to-rename-file-names-without-extension-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-label-edit-how-to-rename-file-names-without-extension-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-label-edit-how-to-rename-file-names-without-extension-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-label-edit-how-to-rename-file-names-without-extension-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-label-edit-how-to-rename-file-names-without-extension-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-scroll-bar-size-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-scroll-bar-size-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-scroll-bar-size-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-scroll-bar-size-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-scroll-bar-size-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-scroll-bar-size-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-spacing-between-items-in-details-view%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-spacing-between-items-in-details-view%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-spacing-between-items-in-details-view%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-spacing-between-items-in-details-view%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-spacing-between-items-in-details-view%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustom-spacing-between-items-in-details-view%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustomize-label-editing-embedded-control-for-each-line-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustomize-label-editing-embedded-control-for-each-line-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustomize-label-editing-embedded-control-for-each-line-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustomize-label-editing-embedded-control-for-each-line-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustomize-label-editing-embedded-control-for-each-line-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fcustomize-label-editing-embedded-control-for-each-line-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fdisplaying-thumbnails-withs-borders-and-shadows%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fdisplaying-thumbnails-withs-borders-and-shadows%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fdisplaying-thumbnails-withs-borders-and-shadows%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fdisplaying-thumbnails-withs-borders-and-shadows%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fdisplaying-thumbnails-withs-borders-and-shadows%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fdisplaying-thumbnails-withs-borders-and-shadows%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fdisplayingmultiline-items-in-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fdisplayingmultiline-items-in-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fdisplayingmultiline-items-in-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fdisplayingmultiline-items-in-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fdisplayingmultiline-items-in-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fdisplayingmultiline-items-in-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fenabling-search-highlight-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fenabling-search-highlight-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fenabling-search-highlight-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fenabling-search-highlight-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fenabling-search-highlight-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fenabling-search-highlight-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Ffile-explorer-with-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Ffile-explorer-with-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Ffile-explorer-with-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Ffile-explorer-with-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Ffile-explorer-with-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Ffile-explorer-with-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhiding-column-headers-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhiding-column-headers-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhiding-column-headers-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhiding-column-headers-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhiding-column-headers-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhiding-column-headers-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhiding-items-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhiding-items-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhiding-items-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhiding-items-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhiding-items-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhiding-items-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhot-tracking-items-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhot-tracking-items-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhot-tracking-items-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhot-tracking-items-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhot-tracking-items-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhot-tracking-items-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-add-grid-lines-in-empty-space-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-add-grid-lines-in-empty-space-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-add-grid-lines-in-empty-space-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-add-grid-lines-in-empty-space-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-add-grid-lines-in-empty-space-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-add-grid-lines-in-empty-space-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-change-list-view-mouse-wheel-scroll-speed%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-change-list-view-mouse-wheel-scroll-speed%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-change-list-view-mouse-wheel-scroll-speed%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-change-list-view-mouse-wheel-scroll-speed%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-change-list-view-mouse-wheel-scroll-speed%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-change-list-view-mouse-wheel-scroll-speed%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-display-items-in-custom-states%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-display-items-in-custom-states%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-display-items-in-custom-states%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-display-items-in-custom-states%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-display-items-in-custom-states%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-display-items-in-custom-states%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-dynamically-resize-focused-item%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-dynamically-resize-focused-item%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-dynamically-resize-focused-item%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-dynamically-resize-focused-item%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-dynamically-resize-focused-item%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-dynamically-resize-focused-item%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-hide-a-column-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-hide-a-column-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-hide-a-column-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-hide-a-column-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-hide-a-column-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-hide-a-column-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-make-items-fading-on-edges-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-make-items-fading-on-edges-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-make-items-fading-on-edges-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-make-items-fading-on-edges-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-make-items-fading-on-edges-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-make-items-fading-on-edges-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-store-better-listview-content-in-a-string-user-request%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-store-better-listview-content-in-a-string-user-request%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-store-better-listview-content-in-a-string-user-request%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-store-better-listview-content-in-a-string-user-request%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-store-better-listview-content-in-a-string-user-request%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fhow-to-store-better-listview-content-in-a-string-user-request%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Flist-view-drag-and-drop-item-reorder-sort%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Flist-view-drag-and-drop-item-reorder-sort%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Flist-view-drag-and-drop-item-reorder-sort%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Flist-view-drag-and-drop-item-reorder-sort%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Flist-view-drag-and-drop-item-reorder-sort%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Flist-view-drag-and-drop-item-reorder-sort%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fnon-selectable-items-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fnon-selectable-items-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fnon-selectable-items-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fnon-selectable-items-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fnon-selectable-items-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fnon-selectable-items-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fread-only-mode-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fread-only-mode-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fread-only-mode-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fread-only-mode-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fread-only-mode-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fread-only-mode-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fright-aligned-images-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fright-aligned-images-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fright-aligned-images-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fright-aligned-images-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fright-aligned-images-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fright-aligned-images-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsearch-filtering-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsearch-filtering-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsearch-filtering-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsearch-filtering-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsearch-filtering-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsearch-filtering-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsub-item-check-boxes-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsub-item-check-boxes-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsub-item-check-boxes-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsub-item-check-boxes-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsub-item-check-boxes-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsub-item-check-boxes-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsynergy-of-better-listview-and-our-applications%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsynergy-of-better-listview-and-our-applications%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsynergy-of-better-listview-and-our-applications%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsynergy-of-better-listview-and-our-applications%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsynergy-of-better-listview-and-our-applications%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fsynergy-of-better-listview-and-our-applications%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Ftedious-work-with-groups-and-item-hierarchy-features%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Ftedious-work-with-groups-and-item-hierarchy-features%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Ftedious-work-with-groups-and-item-hierarchy-features%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Ftedious-work-with-groups-and-item-hierarchy-features%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Ftedious-work-with-groups-and-item-hierarchy-features%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Ftedious-work-with-groups-and-item-hierarchy-features%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fthe-three-main-advantages-componentowl-has-over-the-classic-net-framework%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fthe-three-main-advantages-componentowl-has-over-the-classic-net-framework%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fthe-three-main-advantages-componentowl-has-over-the-classic-net-framework%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fthe-three-main-advantages-componentowl-has-over-the-classic-net-framework%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fthe-three-main-advantages-componentowl-has-over-the-classic-net-framework%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fthe-three-main-advantages-componentowl-has-over-the-classic-net-framework%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fvertical-alignment-and-text-wrapping-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fvertical-alignment-and-text-wrapping-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fvertical-alignment-and-text-wrapping-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fvertical-alignment-and-text-wrapping-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fvertical-alignment-and-text-wrapping-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fvertical-alignment-and-text-wrapping-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fwhat-we-are-working-on-groups-item-hierarchy-support%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fwhat-we-are-working-on-groups-item-hierarchy-support%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fwhat-we-are-working-on-groups-item-hierarchy-support%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fwhat-we-are-working-on-groups-item-hierarchy-support%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fwhat-we-are-working-on-groups-item-hierarchy-support%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fwhat-we-are-working-on-groups-item-hierarchy-support%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fwindows-theme-support-in-better-listview%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fwindows-theme-support-in-better-listview%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fwindows-theme-support-in-better-listview%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fwindows-theme-support-in-better-listview%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fwindows-theme-support-in-better-listview%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fwindows-theme-support-in-better-listview%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fzen-coder-vs-distraction-junkie%2F&format=xml.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fzen-coder-vs-distraction-junkie%2F&format=xml.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fzen-coder-vs-distraction-junkie%2F&format=xml.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fzen-coder-vs-distraction-junkie%2F.html b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fzen-coder-vs-distraction-junkie%2F.html new file mode 100644 index 0000000..be71cc0 --- /dev/null +++ b/public/blog/wp-json/oembed/1.0/embed?url=http:%2F%2Fwww.componentowl.com%2Fblog%2Fzen-coder-vs-distraction-junkie%2F.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/xmlrpc.php.html b/public/blog/xmlrpc.php.html new file mode 100644 index 0000000..1e42e3e --- /dev/null +++ b/public/blog/xmlrpc.php.html @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/blog/xmlrpc.php?rsd b/public/blog/xmlrpc.php?rsd new file mode 100644 index 0000000..2ac2d3a --- /dev/null +++ b/public/blog/xmlrpc.php?rsd @@ -0,0 +1,14 @@ + + + WordPress + https://wordpress.org/ + http://www.componentowl.com/blog + + + + + + + + + diff --git a/public/blog/zen-coder-vs-distraction-junkie/feed/index.html b/public/blog/zen-coder-vs-distraction-junkie/feed/index.html new file mode 100644 index 0000000..eb6def1 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/feed/index.html @@ -0,0 +1,161 @@ + + + Comments on: Are You a Zen Coder or Distraction-Junkie? + + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/ + Component Owl codes Better ListView control all night so you don't have to. + Thu, 02 Apr 2015 07:58:08 +0000 + hourly + 1 + https://wordpress.org/?v=4.9.8 + + By: Coding Dojo Day 1 | Invoke Interests + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comment-1397 + + Thu, 02 Apr 2015 07:58:08 +0000 + http://www.componentowl.com/blog/?p=664#comment-1397 + + […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

    +]]>
    +
    + + By: Foobar + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comment-1365 + + Fri, 06 Jun 2014 09:30:12 +0000 + http://www.componentowl.com/blog/?p=664#comment-1365 + + and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

    +]]>
    +
    + + By: Himanshu Mishra + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comment-1288 + + Tue, 15 Jan 2013 15:31:16 +0000 + http://www.componentowl.com/blog/?p=664#comment-1288 + + Great article ! …. thanks :)

    +]]>
    +
    + + By: Amir + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comment-1283 + + Wed, 16 May 2012 10:59:19 +0000 + http://www.componentowl.com/blog/?p=664#comment-1283 + + “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
    +This is how I got to your article!!! Some nice things grow from bad habits

    +]]>
    +
    + + By: bluszcz + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comment-1282 + + Tue, 08 May 2012 14:50:29 +0000 + http://www.componentowl.com/blog/?p=664#comment-1282 + + “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

    +

    I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

    +

    ;)

    +]]>
    +
    + + By: Sunday Selection 2012-03-11 « The ByteBaker + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comment-1275 + + Sun, 11 Mar 2012 17:52:05 +0000 + http://www.componentowl.com/blog/?p=664#comment-1275 + + […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

    +]]>
    +
    + + By: Umair Jabbar + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comment-1274 + + Mon, 27 Feb 2012 10:19:35 +0000 + http://www.componentowl.com/blog/?p=664#comment-1274 + + Very nicely written.

    +

    I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

    +]]>
    +
    + + By: Jiri Novotny + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comment-1273 + + Sun, 26 Feb 2012 08:25:57 +0000 + http://www.componentowl.com/blog/?p=664#comment-1273 + + My latest post about Hidden Procrastination:

    +

    http://www.dextronet.com/blog/2012/02/hidden-procrastination/

    +]]>
    +
    + + By: sigs + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comment-1272 + + Fri, 24 Feb 2012 04:25:43 +0000 + http://www.componentowl.com/blog/?p=664#comment-1272 + + It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

    +

    alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

    +

    On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

    +

    Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

    +

    My two cents.

    +]]>
    +
    + + By: Ivan + http://www.componentowl.com/blog/zen-coder-vs-distraction-junkie/#comment-1270 + + Fri, 17 Feb 2012 18:27:35 +0000 + http://www.componentowl.com/blog/?p=664#comment-1270 + + For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

    +

    It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

    +

    Tabs BE-GONE!

    +

    Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

    +]]>
    +
    +
    +
    + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1217.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1217.html new file mode 100644 index 0000000..fc35697 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1217.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Wolfram Arnold

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1218.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1218.html new file mode 100644 index 0000000..9c4a4e0 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1218.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Kyle Ellingworth

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1219.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1219.html new file mode 100644 index 0000000..9a2dcb0 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1219.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Jiri Novotny

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1220.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1220.html new file mode 100644 index 0000000..c5eff65 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1220.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to G

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1221.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1221.html new file mode 100644 index 0000000..1eadf28 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1221.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Jiri Novotny

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1222.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1222.html new file mode 100644 index 0000000..3846355 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1222.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Orgil

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1224.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1224.html new file mode 100644 index 0000000..ac2140e --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1224.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Jiri Novotny

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1225.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1225.html new file mode 100644 index 0000000..b95d9a3 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1225.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Jad Jabbour

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1226.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1226.html new file mode 100644 index 0000000..10aa7c5 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1226.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Jiri Novotny

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1227.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1227.html new file mode 100644 index 0000000..21d3227 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1227.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Jad Jabbour

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1228.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1228.html new file mode 100644 index 0000000..cefd924 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1228.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Cristobal

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1229.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1229.html new file mode 100644 index 0000000..c163c25 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1229.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to sissi

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1232.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1232.html new file mode 100644 index 0000000..c61eebe --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1232.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Bipin

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1233.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1233.html new file mode 100644 index 0000000..7e12ef3 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1233.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Timon Vonk

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1234.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1234.html new file mode 100644 index 0000000..77a378f --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1234.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Murat Özgür Kaymakcı

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1235.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1235.html new file mode 100644 index 0000000..7173d0f --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1235.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Daniele

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1236.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1236.html new file mode 100644 index 0000000..655cdb3 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1236.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Jeff

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1237.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1237.html new file mode 100644 index 0000000..220a4b9 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1237.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Raphael

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1238.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1238.html new file mode 100644 index 0000000..dac2db2 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1238.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Nish

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1239.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1239.html new file mode 100644 index 0000000..dda118b --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1239.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Dave East

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1241.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1241.html new file mode 100644 index 0000000..3fcb16d --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1241.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to alex

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1242.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1242.html new file mode 100644 index 0000000..dde51a4 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1242.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Karthik Murugan

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1243.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1243.html new file mode 100644 index 0000000..deb4bde --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1243.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Jiri Novotny

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1244.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1244.html new file mode 100644 index 0000000..8c3da52 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1244.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Mr.excepter

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1245.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1245.html new file mode 100644 index 0000000..a635617 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1245.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Luigi

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1246.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1246.html new file mode 100644 index 0000000..463a3da --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1246.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to anon

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1247.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1247.html new file mode 100644 index 0000000..636b872 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1247.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Juanjo

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1248.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1248.html new file mode 100644 index 0000000..7cdd605 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1248.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to pw

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1249.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1249.html new file mode 100644 index 0000000..6cb17f1 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1249.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to CharlieBear

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1250.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1250.html new file mode 100644 index 0000000..9af99d3 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1250.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Ryan

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1251.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1251.html new file mode 100644 index 0000000..7e3ed75 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1251.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Douglas

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1252.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1252.html new file mode 100644 index 0000000..8326dcc --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1252.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Dan Sutton

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1253.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1253.html new file mode 100644 index 0000000..86566b6 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1253.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to alex

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1254.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1254.html new file mode 100644 index 0000000..399b992 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1254.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Carlos López

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1255.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1255.html new file mode 100644 index 0000000..285ff7c --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1255.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Jiri Novotny

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1256.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1256.html new file mode 100644 index 0000000..bc78622 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1256.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to pat

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1257.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1257.html new file mode 100644 index 0000000..22b05ec --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1257.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Christian

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1258.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1258.html new file mode 100644 index 0000000..b5f21fd --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1258.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to dario-g

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1259.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1259.html new file mode 100644 index 0000000..29b91b7 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1259.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Bob

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1262.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1262.html new file mode 100644 index 0000000..ea31053 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1262.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Emanuel Landeholm

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1263.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1263.html new file mode 100644 index 0000000..9814d2f --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1263.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Jiri Novotny

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1264.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1264.html new file mode 100644 index 0000000..9a29751 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1264.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Brett L. Schuchert

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1265.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1265.html new file mode 100644 index 0000000..2da8cf8 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1265.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Carl

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1266.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1266.html new file mode 100644 index 0000000..343003b --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1266.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Kemal Delalić

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1269.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1269.html new file mode 100644 index 0000000..b4441ff --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1269.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to minime

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1270.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1270.html new file mode 100644 index 0000000..ff8a583 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1270.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Ivan

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1272.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1272.html new file mode 100644 index 0000000..6b2df30 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1272.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to sigs

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1273.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1273.html new file mode 100644 index 0000000..b156fd8 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1273.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Jiri Novotny

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1274.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1274.html new file mode 100644 index 0000000..636d94a --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1274.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Umair Jabbar

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1275.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1275.html new file mode 100644 index 0000000..a9b6327 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1275.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Sunday Selection 2012-03-11 « The ByteBaker

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1282.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1282.html new file mode 100644 index 0000000..bb88040 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1282.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to bluszcz

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1283.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1283.html new file mode 100644 index 0000000..e9acf7f --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1283.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Amir

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1288.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1288.html new file mode 100644 index 0000000..3508829 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1288.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Himanshu Mishra

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1365.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1365.html new file mode 100644 index 0000000..06af2a2 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1365.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Foobar

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1397.html b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1397.html new file mode 100644 index 0000000..0b590a3 --- /dev/null +++ b/public/blog/zen-coder-vs-distraction-junkie/index.html?replytocom=1397.html @@ -0,0 +1,1188 @@ + + + + + + + +Are You a Zen Coder or Distraction-Junkie? « Owl's Blog on .NET development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +

    Owl's Blog on .NET development

    + +
    Component Owl codes Better ListView control all night so you don't have to.
    + + + + +
    +

    Are You a Zen Coder or Distraction-Junkie?

    + + + +
    +

    What you do when compiling can ruin your life. And not just when compiling, but when waiting for any short computer operation to finish.

    +

    That time is ridiculously tiny compared to the rest of your workday, yet it can have a huge impact on your productivity and well-being overall. Yes, that’s a big fat claim.

    +

    And by the way, this article is not just about coders or programmers. It’s about any smart people working with computers. And there will be pictures! Let’s rock and roll –

    +

    Why am I writing this

    +

    I recently started implementing certain time management techniques into my work style to boost my productivity, reduce stress, and help my body and brain rest. I basically wanted to work in uninterruptable 100% focused 60-120 minutes blocks of time, followed by a 20-30 minute breaks.

    +

    However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.

    +

    So I decided to do some research. There was a discussion on “What to do while compiling?” on StackExchange. The most up-voted answers were of the “reduce the compilation time” kind. However, these answers don’t solve the more general problem: There will always be waiting times while working on the computer.

    +

    Other than that, the people in the discussion were mostly suggesting what they usually do (such as checking email or news) – which is a horrible idea. One good advice was that “Multi-tasking is bad”. I agree with that. But overall? Not. Good. Enough. The answers were disappointing. So, in this article, I am going to explore this issue deeply and present you with the optimal approach.

    +

    Two kinds of coders

    +

    There are two extreme archetypes of coders – The “zen coder”, and the “distraction junkie coder”. Both are extreme, so both should be rare on the bell curve of distribution, right?

    +

    Wrong. Although the “Distraction junkie coder” is, in fact, extreme, he is unbelievably prevalent.

    +

    A picture is worth 1000 words, so I am going to show you, with pictures, what is happening on the mental desktops of both of these kinds of coders.

    +

    The zen coder

    +

    What does zen coder do?

    +

    He codes. That’s the only thing he does, and that tells it all. Perhaps the more important question is what he does not do: He does not succumb to distractions. Clean focus. Clean cuts. Clean coding. 60-120 minutes of pure coding, then a 20-30 minute break, which is usually off the computer. Then he codes again. (The minutes are just an example. He can use a different pattern – but he is always balanced and betting on the long-term productivity.)

    +

    His mind is like calm fluid water with a steady flow. It is not like frozen water shattered to 1000 constantly shaking pieces.

    +

    This is how the mental desktop of zen coder looks like:

    +

    Zen coder's mental desktop

    +

    The distraction junkie coder

    +

    Even if your mental desktop looks like the one of a zen coder, just a few minutes after you open Facebook and check your email – e.g. when compiling, it will look like this:

    +

    Distraction junkie coder mental desktop

    +

    And that is, ladies and gentlemen, after just merely checking your email and opening Facebook! If you also have a bunch of real-time notifications, IMs, and check your RSS and twitter, the above will look like a scheme of a meditating monk’s brain compared to the havoc you will break.

    +

    You will probably never fully recover from that. Not on that particular day, anyway. Even if you minimize all this crap on your mental desktop to your mental taskbar, it will remain there, tempt you forever, and eat up your mental resources. And boy, the time will fly by, and you will wonder where it went.

    +

    Oh, and by the way, if you are distraction junkie, then you must check out our web comics for developers! Don’t even return to finish reading this article. And don’t forget to subscribe to the comics RSS! And read all the strips! Then send it to your buddy, and start chatting! The distraction-rabbit holes are not that deep, really!

    +

    The difference between zen coder and distraction junkie coder

    +

    Zen coder prefers long-term happiness and productivity. He is capable of focusing deeply. He trains focus.

    +

    Distraction junkie coder prefers instant gratification for the price of not reaching his full potential and hurting himself both physically and mentally in the long run. He is too lazy to focus.

    +

    To fully grasp this, we first need to understand how our brains work.

    +

    How our brains work

    +

    The truth is that we don’t really know, yet. But, based on our current understanding, there are some useful analogies that psychologists have been putting to a good use for some time, and that can help us grasp some of the complexities.

    +

    The computer analogy

    +

    Your brain is a computer. Sure, it is infinitely more complex than a PC, but the computer metaphor allows us to describe many processes that are going on in the brain. There is something like HDD, there is something like RAM, CPU, there are processes and threads, and it takes certain amount of time to access information and to calculate things.

    +

    It is obvious that our brain has only a certain capacity to focus at any particular moment. You can focus on 1 thing well, or on 3 things badly, but you can’t do both. Even switching from one task to another carries a cognitive cost, especially if the tasks are in different contexts.

    +

    Once you bring something to your awareness, it takes time to fully dispose of it and its associated resources and to purge it from your mental RAM and background processes. It can even take hours or days. Things recently brought to your awareness constantly re-appear at random moments. Even if you do not notice them floating in your mind, they are there – and they take up resources, and reduce your ability to focus.

    +

    The chest of drawers analogy

    +

    Another useful metaphor is a chest of drawers. Your brain stores stuff in drawers. Each drawer is a cloud of data associated and linked together based on certain contexts and concepts. At any particular time, some of the drawers are open, and some closed. The open drawers represent your current mental landscape, the stuff that is easily accessible.

    +

    The big problem is that it takes time to close mental drawers, but opening them is instant.

    +

    So, when you are working, and then switch to some news site, it can instantly open a bunch of drawers. When you return to work, these drawers will remain open. The only benefit is it can help you with creativity and brainstorming – but unnecessarily opened drawers come at a cost. They reduce your left-brain raw mental power and ability to focus.

    +

    What to do while compiling?

    +

    What you do when waiting for some computer operation to execute can determine if you are a zen coder, or distraction junkie coder.

    +

    The main idea here is to:

    +
      +
    1. Not lose focus, and
    2. +
    3. Take a micro break.
    4. +
    +

    Not losing focus is not that hard – all you have to do is to switch your brain off, or keep thinking about your code. However, switching off is better. It’s a micro-meditation, and it also serves our goal of taking a micro-break.

    +

    Why meditation? Well, your brain is crunching code all day, so why not give it a rest? Plus it’s scientifically proven that meditation leads to permanent increase in levels happiness. Just imagine the long term benefits of this seemingly trivial habit of meditating for 30-60 seconds couple of times per day.

    +

    Now, what to do on your micro-break? Do any of the following, combine as you wish. You can also do them all, in this order, depending (or not) on how long is the operation taking.

    +
      +
    1. Get up
    2. +
    3. Look into distance
    4. +
    5. Put your hands behind your head and lean back on your chair
    6. +
    7. Stretch your legs, then raise your hands as high as possible
    8. +
    9. Close your eyes
    10. +
    11. Gently massage your eyes
    12. +
    13. Slowly turn your head to the right, left, up and down as far as possible
    14. +
    15. Close your eyes and breathe
    16. +
    17. Go get a glass of water (Be careful not to get distracted by your co-workers on your way.)
    18. +
    +

    You can do also anything else that engages primarily your body and not mind – isometrics exercise, juggling, sword-fighting ;-).

    +

    And by the way – if your boss gives you hard time about any of this, then refer him to this article. It is far better for you to quickly rejuvenate yourself and maintain focus than to appear working and get distracted, lose focus and become tired sooner.

    +

    Stretching can be very beneficial. My physiotherapist discovered a lot of tension in my shoulders on my last visit. She told me that it’s there probably because I have my hands bent all the time when siting at the computer, so the muscles shorten and work uneconomically. The best thing I can do? Lift and move my hands, try to reach as high as possible. That’s now one of the things I do when compiling or waiting for a computer operation to execute.

    +

    You’ve probably heard that it is a good idea to stretch and take a short break regularly when working on the computer. The problem is the implementation – even if you set a timer, what if you are in a middle of a difficult problem when it goes off? It’s just seems impossible to implement. However, if you take the micro-break while compiling, it works great and you can even make a habit out of it, so it gets “automated”! The compilation now becomes your reminder to stretch. Incredibly powerful stuff.

    +

    The things you shouldn’t do when compiling

    +

    I really want to hammer my point home, so just to make things absolutely clear, here is a list of what you should NOT do when compiling. Think of it this way: These things will not just ruin your focus, but you will deprive your mind and body of the micro-break.

    +
      +
    1. Check your RSS
    2. +
    3. Check news (any news)
    4. +
    5. Check email
    6. +
    7. Check social media (Facebook, twitter, G+, LinkedIn, reddit – you name it)
    8. +
    9. Watch videos
    10. +
    +

    Doing the following 2 things is better than all of the above, but it is still not optimal:

    +
      +
    1. Chat with a co-worker
    2. +
    3. Read a physical book
    4. +
    +

    Clean Focus and Clean Cuts

    +

    I will close this article with what I think is the ideal approach to daily work-flow – the zen coder way.

    +

    The key to true productivity and efficiency is to focus 100% on the one thing you are doing at the moment, and then to completely switch and do something else. There shouldn’t be any blurry transitions from one thing to the next.

    +

    Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely. You can check your email and social media during the break, sure, but a brisk walk or a short nap and healthy snack will do you more good. After the break is over, check what’s next in your task management software (e.g. I use my own Swift To-Do List), and do another block of focused work. It is somewhat similar to Pomodoro technique, only on a larger scale.

    +

    The breaks are not optional. Don’t even think about skipping them. Your body needs them. Take the breaks even if you do what you love – in such a case, you will be motivated to accomplish more in the next time block.

    +

    Your work-flow should look something like this:

    +

    (Task 1 – Task 2) – Break – (Task 2 – Task 3 – Task 4) – Break – (Another 60-120 minute block of tasks) – Break…

    +

    And not something completely chaotic, random and sad, like this:

    +

    Task 1 – Email – Task 1 – Facebook – Task 1 – Task 2 – Minibreak – Facebook – Task 2 – Email – reddit – Task 3 – Email – Break – Task 2 – Email – Task 3 – twitter – Hacker News – twitter – Task 1 – Task 3 – Break – Task 4

    +

    If your workflow is sub-optimal like that, you will neither fully relax nor accomplish what you could. This is inferior on every level. It is not just a waste of your potential and time, but often also completely unnecessary wreckage of your body in the long run.

    +

    I won’t lie to you. Focusing is really hard. It’s hard, because when you are not doing it, you are basically training the opposite. Habits and ingrained routines are inherently hard to change.

    +

    The good news is you can train. You can learn to focus. It’s a learnable skill for everyone, and incredibly well worth the effort.

    +

    – By , the obsessed author of task management software for Windows. He is posting this guest article here on ComponentOwl.com, because his Swift To-Do List uses .NET Better ListView from Component Owl as its core component.

    +

    PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.

    + +
    + + + + +
    + + + + + +

    55 Responses to “Are You a Zen Coder or Distraction-Junkie?”

    + +
      +
    1. +
      +
      + Wolfram Arnold says:
      + + + +

      Great article. I agree with the premise. On the solution side, I find pair programming the single most effective technique to avoid distraction junkie behavior. After all who wants to be seen browse the news or update Facebook by their colleague? And during small waits, just talk with your pair as to what to do next, how to refactor the code, get up and stretch, get a cup of tea, etc.

      + + +
      +
        +
      • +
        + + + + +

        Agreed. I just joined a team after years of training/coaching. Working in pairs make focus so much easier. Also, one computer and two people make it harder to do the social media thing. Recently, my pair partner and I (the partner changes) frequently look at side stuff around our project during a build (with unit tests and functional tests running). This kind of focus is fun for me. It does make it easy for me to not even want to use a computer when I get home in the evening… at least some days.

        + + +
        +
      • +
      +
    2. +
    3. +
      +
      + Kyle Ellingworth says:
      + + + +

      Jiri. I first off want to say that I believe what you’ve written to be correct, or at least careful in tentatively stating things you haven’t confirmed as fact. I also believe it to be immensely useful to people chronically suck in their own self-harming cycles, be it distraction or demotivation or anxieties.

      +

      I want to criticize you in how you go about meeting your goals. I should let you know that I’m operating on a few assumptions. The first is that a normal rational human being is skeptical to new information they find. The second is that normal rational human beings reject things which they cannot confirm to a critical threshold. The third is that, when it comes to their own minds, the skepticism is increased at least ten-fold.

      +

      Your presentation meets exactly that failure. You present your methodologies in a clear, accessible way, to people who have no reason to trust you. The information is narrow in scope, and largely consists of abstractions of an inner cognitive model you have, and how new techniques relate to your model. As this is all new information to your reader, the amount of points a reader can identify with are limited. The number of reassuring moments of agreement, where you say something the reader already knew themselves, is limited. Thus, the user faces sustained unverified facts, and their skepticism gets more and more impatient. I’d reckon most readers wouldn’t even make it through the article without dismissing you as yet another useless writer who thinks they’ve figured out the world.

      +

      “all you have to do is to switch your brain off” is extremely vague and meaningless language, despite knowing all of the things I know now, I have yet to achieve such a thing. In fact, the entire meditation connection was weak, because you claim benefits, but never tie it into the original point. “He is too lazy to focus.” is not only a potential insight to your self-confident reader, but also a reassurance that people are who we are, and cannot change. People aren’t lazy, they just sometimes get stuck in loops which diverge them from reaching their goals, or their goals are misaligned with their objects, or a number of other temporary transient reasons.

      +

      Sorry, I’ve written a lot and I don’t feel like continuing. If you’ve read through this post completely dismissive of my points, then at least take the time to analyze which thoughts lead to your dismissals, and where those thoughts came from and shall lead…

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Kyle,

        +

        Thanks for your comments.

        +

        What I’ve written works for me. It has taken me many years of trial-and-error to discover this approach. I also know it works for others – but that’s just anecdotal evidence, and every human being is a bit different.

        +

        The best way to verify if something works for me is to simply try it, and I think that’s valid approach for most. If what I wrote makes sense to someone, he can just try it.

        +

        But you are, of course, right – I could’ve been much more convincing. I will definitely work on that, as I always want to hone my skills as a writer.

        +

        Have a wonderful day, Kyle, and once again, thanks for writing.

        + + +
        +
          +
        • +
          +
          + Nish says:
          + + + +

          Well said, to both of you. Finally, evidence that mature, stimulating, respectful & thought provoking debate can occur in web comments!

          + + +
          +
        • +
        • +
          +
          + Ivan says:
          + + + +

          For what is work Jiri, I don’t know anything about you at all. But I do have a brain and can reason things, so I don’t need to trust you to be able to learn from what you wrote :)

          +

          It really drove a point home, and I thank you for the lots of productivity I’m about to start gaining.

          +

          Tabs BE-GONE!

          +

          Also, I’ve wanted to gain some fitness for a long time now, so I’m gonna start doing some push-ups during my micro-breaks, and perhaps do a run during a larger break, so my body thanks you too :)

          + + +
          +
        • +
        +
      • +
      +
    4. +
    5. +
      +
      + G says:
      + + + +

      The distraction junkie thinks outside the box and may well come up with better solutions.

      +

      The “zoned-out” coder, is boxed in.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is no question that outside inputs can be beneficial for creativity. The problem lies in when these outside inputs are consumed.

        + + +
        +
          +
        • +
          +
          + sigs says:
          + + + +

          It’s a balancing act. Also, multitasking is a very personal thing. I might be your distraction junkie coder; and sometimes I really wish I could pull myself together more forcefully and just Get Shit Done 100% of some time interval…

          +

          alas, that’s not how it goes. If I want, I can focus, but the result isn’t much better. I might get trapped in a loop of not finding the (later) obvious solution and just walk in circles. That’s no fun either.

          +

          On the other hand, I often notice that after a break – be it walking a round or opening facebook, reading the updates and then closing it – my brain has done the work for me. I think of it as distancing and returning. Work on it and push it as far as it goes; when it gets stuck, take some distance, return and see if it looks different now.

          +

          Obviously if it’s badly stuck (for, say, days) I get frustrated and blame it on distractions and my inability to focus. But at the same time, I know I’m not just turning a crank. I mean, 95% of the time I am, obviously, but the remaining 5% is the art and the craft, the part that justifies them having me doing it and not the 18-year-old fresh off high school.

          +

          My two cents.

          + + +
          +
        • +
        +
      • +
      +
    6. +
    7. +
      +
      + Orgil says:
      + + + +

      Why did you spend so much time to write this article if you are zen coder?
      +i agree with you if you are zen blogger writing about the coding :)

      +

      btw, i like your pictures how you depict mental metaphor

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        There is nothing wrong doing 2 or more different things. I’m not trying to imply that at all.

        +

        Wrong is if you try to do them all at once.

        +

        (And by the way, this post is my weekend and after-work project.)

        + + +
        +
      • +
      +
    8. +
    9. +
      +
      + Jad Jabbour says:
      + + + +

      Hey, nice article, interesting theory but i beg to differ and i will do so by giving 2 examples.

      +

      my theory: It differs from one person to the other, and multi-tasking can be a good thing.

      +

      1- Albert Einstein came up with his best theories while he was working at the post office a rote, boring monotonous job ( like checking your feeds, which has become natural to us ).

      +

      2- I do have , as a coder, time management problems but the problem is not that, i work best when i am multitasking and i solve problems faster than when i am fully focused ( i;ve experimented ) but i have found that the main reason i have time management problems is because we developers lose interest when we are in code-monkey mode, there are no solutions to think of, we already solved it, we have our flow charts and UMLs and are simply coding away, it’s boring REALLY REALLY BORING and uninteresting. As soon as i face a bug/error my brain kicks into overdrive. also the closer i am to the deadline the more my brain is in overdrive.

      +

      there might be some truth to what you wrote but i do believe it differs from one person to the other.
      +anyone else feels this way ?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Hi Jad,

        +

        1) I also get my absolutely best ideas when in the shower, or on my way to work, or when cooking. But that is not in conflict with what I wrote at all.

        +

        Imagine Albert Einstein writing some theory on a blackboard, and constantly checking his twitter and email. That’s the problem. Not doing something else and letting your subconscious mind work.

        +

        2) In this case, Pomodoro and other anti-procrastination techniques help. In my case, I just launch some upbeat music and code away. It is actually a quite joyful experience.

        + + +
        + +
      • +
      +
    10. +
    11. +
      +
      + Cristobal says:
      + + + +

      Nice article!. I’m definitly a Distraction-Junkie one. I’m taking your article like a “from Distraction-Junkie to Zen-Coder” guide ;).
      +Thanks.

      + + +
      +
    12. +
    13. +
      +
      + sissi says:
      + + + +

      it is hard to get into that “flow” of coding anyways in many workplaces. quite often there are like five managers for two coders and you constantly have someone approaching your desk or waffling nearby. on the other hand when it’s too quiet it is kind of awkward too so I prefer very much to code locked away on my own.

      +

      the only problem is that when coding alone i feel constantly hungry and eat all the time :-D

      +

      it also helps to physically power yourself out before you code as otherwise your body gets in the way and you want to move and do physical stuff rather than sit and focus. some physically demanding yoga practise like ashtanga or vinyassa is good as it gives your body the workout he needs and prepares/focuses your mind.

      +

      being focused needs to be practised every day all the time. so reading an article or book without the mind wandering off or listening to another person talking without thinking of your to-do-list needs to be practised constantly otherwise your attention span will get shorter and shorter.

      +

      i read a quote of some zen master once that goes something like this and sums the issue up nicely. the master was talking to a student who was complaining about that meditation is boring (i think): “you lie but you’re sitting already. you sit but you’re standing already. you stand but you’re walking already. when I lie I am lying. when I sit I am sitting. when I stand I am standing and when I walk I am walking.”

      + + +
      +
    14. +
    15. +
      +
      + Bipin says:
      + + + +

      Nice article.Ran into this while i was programming :D

      + + +
      +
    16. +
    17. +
      +
      + Timon Vonk says:
      + + + +

      Great article! I would even go so far as stating that the main thing differentiating great and average programmers is just this; getting the flow right to supercharge productivity.

      +

      As a CTO, I code only part time, and sometimes not at all. However, that does imply that the time I do spend coding, has to be as effective as possible. I recently started experimenting with morning workouts — quick and timed — giving me huge amounts of energy for the rest of the day. Also, adrenaline helps you focus. Secondly, for timeslots I prefer the pomodoro technique. Macs have some great tools for this. The thirty minute slots with a timer force you to concentrate. Stating what you are going to do for the next slot commits your mind and _really_ helps you to maintain focus. Combined with planning your day every morning and saying to yourself: “This is what I’m going to finish”, is has awesome effects.

      +

      Finally, no notifications. Not for mail, skype, twitter, adium or IRC. If its important, people should call, else they’d have to wait a while. Not even highlighted icons.

      + + +
      +
    18. +
    19. +
      + + + + +

      very good point for productivity and time management. You should write more about this topic, maybe a being zen coder guide :) thank you.

      + + +
      +
    20. +
    21. +
      +
      + Daniele says:
      + + + +

      i just read this while a clean and build, no joking….

      + + +
      +
    22. +
    23. +
      +
      + Jeff says:
      + + + +

      I find that depression begets distraction-junkie behavior, which begets further depression.

      +

      To sit at a computer all day and be happy requires that one regularly reach ‘the zone’. In order to reach this state, one must have significant mastery of his or her domain. Constantly having to decipher terrible documentation and work in a hideous or convoluted codebase inhibits this. After enough resultant distress and little sense of mastery, a person loses interest and begins to search for the brief doses of accomplishment and satisfaction from other sources.

      +

      The next time you stall out on a difficult or irritating problem, do you Alt-Tab to [favorite social bookmarking site]? If so, you’re substituting momentary distraction and discovery for real accomplishment, to the detriment of both.

      +

      If you find yourself unable to break this cycle, consider whether you may have fallen into depression.

      + + +
      +
    24. +
    25. +
      +
      + Raphael says:
      + + + +

      I feel your pain. I could never go back to the old ways of developing in java or .net when programming finally reached a point where the developer productivity and conformt is more important that over engineered, over complicated, over bloated architectures.

      +

      Simplicity is a great asset towards reaching zero turn-around.

      + + +
      +
    26. +
    27. +
      +
      + Dave East says:
      + + + +

      You just listed ALL of those things I do on a microbreak! (the good ones, not the bad ones :P)

      + + +
      +
    28. +
    29. +
      +
      + alex says:
      + + + +

      I would say chatting with a coworker is even worse than a computer-related distraction. If you’re checking your RSS and see that the compiler is done, you can close it and run the program. If you’re chatting with a person and the compilation finishes, there’s typically a social taboo against just turning your back on them.

      + + +
      +
    30. +
    31. +
      +
      + Karthik Murugan says:
      + + + +

      Just wondering, if listening to music while coding causes any distraction?

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        The research mentioned in “Peopleware” book suggests that listening to music counter-intuitively reduces your creative abilities. The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks. On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.

        +

        My rule of thumb would be to listen to music only when doing routine stuff/work where you don’t need to think much, and use silence or white-noise when working on creative or difficult tasks. If your environment is noisy, you can also consider noise-cancelling headphones – the added benefit is that people will be less likely to disturb you.

        + + +
        +
          +
        • +
          +
          + alex says:
          + + + +

          “The music engages (and “occupies”) the right-part of your brain, which is used for creative tasks.”

          +

          Right.

          +

          “On the other hand, music helps you to stay in the flow, and can help with the left-brain tasks.”

          +

          Wait, this is the opposite of what you just said. I don’t remember this part in Peopleware.

          + + +
          +
            +
          • +
            +
            + Jiri Novotny says:
            + + + +

            Peopleware (Second edition) talks about music & productivity in the chapter Bring Back the Door, page 78.

            +

            But you are right, that part with staying in the flow was not in Peopleware. That’s just my observation.

            +

            Peopleware is highly critical of listening to music while working.

            +

            It also says: “As any kid who does his arithmetic homework with the music on knows, the part of the brain required for arithmetic and related logic is unbothered by music – there’s another brain center that listens to music.”

            +

            It all depends on the situation. For example, factory workers have better productivity when music is playing. That’s why I was saying it’s good for staying in the flow – however, that was a very unfortunate expression. What I really meant is that it’s good for routine stuff, including administrative tasks and mindless implementation where thinking is not needed. For me, music can produce euphoria while doing these otherwise mindless tasks. I can then turn it off and proceed with the regular tasks where creativity is certainly a huge benefit.

            +

            This is a good resource if you want to discover more about the relationship and productivity:

            +

            http://www.workplacedoctors.com/wpdocs/qdetail.asp?id=1297

            +

            The results of studies done to this day are mixed. IIRC, I’ve seen one study that claimed students taking a math test performed better when listening to classical music during the test. But, there are also several other studies that show different results.

            + + +
            +
          • +
          +
        • +
        +
      • +
      +
    32. +
    33. +
      +
      + Mr.excepter says:
      + + + +

      wow,zen coder,awesome!!!
      +I used be a Distraction-Junkie coder,and I have found the same way to make my work more Efficiently.
      +but I want to konw that if there are some exceptions in other business need Distraction-Junkie,maybe we can
      +settle this Contradiction.

      + + +
      +
    34. +
    35. +
      +
      + Luigi says:
      + + + +

      Very intresting… But if I was not a distractionjunkie developer, I never found this article. :)

      + + +
      + +
    36. +
    37. +
      +
      + anon says:
      + + + +

      reached this article during one such regular distraction for HN. so not entirely wasted. but i haven’t started working on my million dollar idea, so sadly very true. bookmarking it! and blocking hn, reddit… in hosts file.

      + + +
      +
    38. +
    39. +
      +
      + Juanjo says:
      + + + +

      It’s absolutely true, but done that I can’t always be a zen coder I try to have distractions after the code compiles so that I am bored of distractions while it compiles and still can have errors. I admit neither it works too well …
      +I think the solution could be to write news insulting us for being lazy, and so we would get motivation to continue working.

      + + +
      +
    40. +
    41. +
      +
      + CharlieBear says:
      + + + +

      Bulls-eye! Some really good tweeking ideas for design and coding issues have come with eyes closed while waiting on a compile or upload. I not a Zen developer yet but will work on your idea and see if I can get to the next level with less STRESS! You are 100% correct about the downside of being a distraction junkie. Thanks for a great article!

      + + +
      +
    42. +
    43. +
      +
      + Ryan says:
      + + + +

      Very interesting article, and I mostly agree with all of it. Multitasking can be dangerous and distracting, however, where I work, my communication with different departments is critical, so I can’t go not-checking-my-email for three hours. I definitely do things like check my email, maybe chat, during build time. These things are so quick I can stop immediately and go back to working. I do however avoid things like facebook/reddit/slashdot, because those are less likely the engagements I can quickly drop as soon as my build is done. Just my two cents, some people might have more self control over others when it comes to getting back to work.
      +Also, I find I’m most productive when I have a more-than-full pipeline (i.e, many more tasks to work on with little time to do them all)

      + + +
      +
    44. +
    45. +
      +
      + Douglas says:
      + + + +

      I actually really enjoyed this article and will be sharing with a lot of people. I must say that I struggle with this exact problem of checking dev blogs and social feeds of developers while waiting for cpu operations. The developer subject almost allows me to rationalize the time I’m wasting because its code related and I learn from it, but I should be doing this during long breaks or before/after work because it can take me a long time to get back to focus. Thanks for sharing this information and I look forward to attempting to implement this right away.

      + + +
      +
    46. +
    47. +
      +
      + Dan Sutton says:
      + + + +

      I think I’m both types: it depends on how hard a problem I’m trying to solve. If I’m writing a compiler, as I was last week, then there’s virtually no distraction at all; if it’s website stuff, then Facebook sees quite a bit of me. There’s a boredom quotient here, too… the harder stuff is more interesting and thus I’m going to be less apt to be sucked into doing something else on days when I really have to think. As you can probably tell, today is not one of those days…

      + + +
      +
    48. +
    49. +
      +
      + Carlos López says:
      + + + +

      How bad it is that i read this whole article on one of my compiling breaks??

      +

      Jajajaja, i’m not a Zen coders, i do in fact, do some relaxations, chat a little with co-workers, check internet stuff.

      +

      Most of the time, i’m breaking bugs of stuff i coded. Depends on what i’m doing its how i work. If its something urgent or something pretty interesting, times goes flying, if its some addition of thing already working or breaking bugs, then break present a lot!

      + + +
      +
    50. +
    51. +
      +
      + pat says:
      + + + +

      I think you’re underestimating the importance of compilation time, or how broad the spectrum of compilation times can be. Sure, there will always be cases where you need to wait on your computer, but for a programmer, if you can eliminate the compilation penalty, you can eliminate 99% of the opportunities for self-distraction.

      +

      For one project I’m working on, “A”, it takes 2 minutes to do a build, even when nothing has changed. Another project I’m working on, “B”, uses a compiler that only needs to compile the one function that changed (in memory, i.e., it doesn’t even need to load a whole text file from disk), and never takes even as much as 0.1 sec.

      +

      For project “A”, if I adopted this “zen” approach, I would spend the vast majority of my day simply staring out the window. So I have to try to multitask, on other aspects of the project, admittedly poorly. For project “B”, I simply can’t get distracted long enough to go to some social media site, even if I wanted to. I only know the compiler took a whole 0.04s because it told me.

      +

      There is a social problem here, yes, but it’s caused by a technical one. Have you ever used a service that took 2 minutes to log in? (I have! If you were on the internet back before modems even had a “K” in their speed, you probably have, too.) There’s a huge usability difference between a slow service, and something like Facebook which is essentially instant-on. One truth of technology is that a big enough quantitative difference leads to a qualitative difference.

      +

      Why is it even possible for some compilers to be so slow still? They’re not doing *that* much work. My version control software (hg inotify) knows instantly whether any files have changed, and doesn’t need to walk a bunch of folders to check timestamps to find that out. Why isn’t my compiler that smart? I’ve got gobs of extra memory and CPU to spare. It shouldn’t sit around doing nothing at all, and then spring into action when I run the “build” command and start up a bunch of new processes, and load a bunch of files, and feed them through the lexer and parser and so on. It could have been doing the first 98% of this while I was typing, and it was sitting idle.

      +

      There’s nothing special about compilation, except that we do it a lot. If your text editor if it took 2 minutes to save a file, would you say “There will always be waiting times while working on the computer” and analyze the effects of visiting Facebook, or would you find a way to switch editors? On project “B”, I can’t remember the last time I had to wait on my computer for anything.

      + + +
      +
    52. +
    53. +
      +
      + Christian says:
      + + + +

      Hi,

      +

      nice post. I wrote a similar before over a week. I called it:
      +“The 10 Rules of a Zen programmer”
      +http://www.grobmeier.de/the-10-rules-of-a-zen-programmer-03022012.html

      +

      Basically you are going into detail with my first rule of Zen Programming: focus. What I like is the idea of micro breaks. The images are great.

      +

      Anyway, I think “focus” only does not make you a Zen programmer alone. The article does not show about your relation to Zen, so I think you used this term to emphasize the “reduced” distraction noise around you.

      +

      However, a good article.

      +

      Cheers

      + + +
      +
    54. +
    55. +
      +
      + dario-g says:
      + + + +

      Great article but fast CPU, plenty of RAM and SSD will help you ;) Like helped me :)

      + + +
      +
    56. +
    57. +
      +
      + Bob says:
      + + + +

      Lucky for the author I’m a distraction junkie or I would have never read this article.

      + + +
      +
    58. +
    59. +
      +
      + Emanuel Landeholm says:
      + + + +

      +1

      +

      Back in my C programming days of computing youth I used to do a lot of juggling. Looking back, I now realize that I was really on to something back then. But in a completely oblivious way! I should probably pick up a new set of juggling balls… Then again, perhaps not. I don’t want to distract my co-workers unnecessarily.

      + + +
      +
        +
      • +
        +
        + Jiri Novotny says:
        + + + +

        Juggling is awesome! One of my friends in the office juggles too. It’s not annoying me at all.

        +

        Or, you can juggle in a different room. If you get a desk close to the door, you can leave/enter the room unnoticed.

        + + +
        +
      • +
      +
    60. +
    61. +
      +
      + Carl says:
      + + + +

      Interesting article. Since starting regular (1-2 hours daily) meditation a couple of years ago my working day has naturally, without any effort on my part, started to follow roughly the pattern suggested in this article. I’ve also stopped looking for distractions during compilations (again, it’s just happened almost on its own).

      +

      I can also confirm that the benefits to my productivity have been significant.

      +

      Cheers,
      +Carl

      + + +
      +
    62. +
    63. +
      +
      + Kemal Delalić says:
      + + + +

      Awesome post, I can’t stress enough how important it is not to lose focus

      + + +
      +
    64. +
    65. +
      +
      + minime says:
      + + + +

      What you forgot is all the external distractions, like phone calls, coworkers coming in, or system surveillance alarms…

      + + +
      +
    66. +
    67. +
      +
      + Jiri Novotny says:
      + + + +

      My latest post about Hidden Procrastination:

      +

      http://www.dextronet.com/blog/2012/02/hidden-procrastination/

      + + +
      +
    68. +
    69. +
      +
      + Umair Jabbar says:
      + + + +

      Very nicely written.

      +

      I am glad that my natural habit of stretching more than once on a day at work is not something that I should try and suppress :)

      + + +
      +
    70. +
    71. +
      + + + + +

      […] Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks. […]

      + + +
      +
    72. +
    73. +
      +
      + bluszcz says:
      + + + +

      “””PS: Know anyone who is checking email 50 times a day, and has 12 different notifications jumping in his face all the time? Send him this article. He will thank you later.”””

      +

      I knew. And I sent it to this person. It was my boss. He said thank you and fired me.

      +

      ;)

      + + +
      +
    74. +
    75. +
      +
      + Amir says:
      + + + +

      “However, I almost immediately run into a big problem: When I was compiling or deploying something, I automatically opened one or more of the following: Email client, Facebook, news reader, news sites. That’s a bad habit. It’s hard to break. It ruins my goal of clean focus.”
      +This is how I got to your article!!! Some nice things grow from bad habits

      + + +
      +
    76. +
    77. +
      +
      + Himanshu Mishra says:
      + + + +

      Great article ! …. thanks :)

      + + +
      +
    78. +
    79. +
      +
      + Foobar says:
      + + + +

      and average managers always value distraction junkie coder higher than zen coder, because first one multitasks and is more social [and is always first to blame others]

      + + +
      +
    80. +
    81. +
      + + + + +

      […] of a syllabus and the curriculum. I started working on them after the lecture. I had fun coding in zen mode for some time, going through the course material on my own pace and doing the quizzes and […]

      + + +
      +
    82. +
    + + + + + +
    + +

    Leave a Reply to Coding Dojo Day 1 | Invoke Interests

    + + + + +
    + + +

    +

    + +

    +

    + +

    +

    + + + + +

    + +

    + + +

    +

    + + +
    + + + +
    + + + +
    +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git "a/public/download/\\\".html" "b/public/download/\\\".html" new file mode 100644 index 0000000..d659db7 --- /dev/null +++ "b/public/download/\\\".html" @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + +Better ListView for .NET (C#, VB) - Alternative list view component + + + + + + + + + +
    + + + + + +
    +
    +
    +

    Better ListView: Alternative list view control for .NET

    + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + +
    +

    Seamless integration with .NET 2.0 and higher

    + +
    + + + + +
    +

    Better ListView

    +
    + + +
    +

    Thumbnails

    +
    + + +
    +

    Multi-line Items

    +
    + + +
    +

    Item Hierarchy

    +
    + + + + + + + + + + + +
    + +
    + + + +
    + + +
    +
    + + + + + +
    + + + + + diff --git a/public/download/better-listview.html b/public/download/better-listview.html new file mode 100644 index 0000000..33ca3db --- /dev/null +++ b/public/download/better-listview.html @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + +Download Better ListView 3.15 + + + + + + + +
    + + + + + + + +
    +
    +
    + +

    Thank you for downloading Better ListView 3.15!

    + + + + + +

    If the download doesn't start automatically in a few seconds, please use this button:

    +
    + +
    + + + +
    +
    +
    + + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/public/javascripts/app_packaged.js?1455269826 b/public/javascripts/app_packaged.js?1455269826 new file mode 100644 index 0000000..4166e1c --- /dev/null +++ b/public/javascripts/app_packaged.js?1455269826 @@ -0,0 +1,16 @@ +/* + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function(aQ,S){function a2(){if(!aj.isReady){try{U.documentElement.doScroll("left")}catch(c){setTimeout(a2,1);return}aj.ready()}}function I(s,c){c.src?aj.ajax({url:c.src,async:false,dataType:"script"}):aj.globalEval(c.text||c.textContent||c.innerHTML||"");c.parentNode&&c.parentNode.removeChild(c)}function ar(s,c,K,F,G,w){var A=s.length;if(typeof c==="object"){for(var J in c){ar(s,J,c[J],F,G,K)}return s}if(K!==S){F=!w&&F&&aj.isFunction(K);for(J=0;J)[^>]*$|^#([\w-]+)$/,aV=/^.[^:#\[\.,]*$/,ap=/\S/,M=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,r=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,az=navigator.userAgent,b=false,ax=[],aD,a3=Object.prototype.toString,aX=Object.prototype.hasOwnProperty,aA=Array.prototype.push,aw=Array.prototype.slice,a8=Array.prototype.indexOf;aj.fn=aj.prototype={init:function(s,c){var A,w;if(!s){return this}if(s.nodeType){this.context=this[0]=s;this.length=1;return this}if(s==="body"&&!c){this.context=U;this[0]=U.body;this.selector="body";this.length=1;return this}if(typeof s==="string"){if((A=a9.exec(s))&&(A[1]||!c)){if(A[1]){w=c?c.ownerDocument||c:U;if(s=r.exec(s)){if(aj.isPlainObject(c)){s=[U.createElement(s[1])];aj.fn.attr.call(s,c,true)}else{s=[w.createElement(s[1])]}}else{s=a5([A[1]],[w]);s=(s.cacheable?s.fragment.cloneNode(true):s.fragment).childNodes}return aj.merge(this,s)}else{if(c=U.getElementById(A[2])){if(c.id!==A[2]){return av.find(s)}this.length=1;this[0]=c}this.context=U;this.selector=s;return this}}else{if(!c&&/^\w+$/.test(s)){this.selector=s;this.context=U;s=U.getElementsByTagName(s);return aj.merge(this,s)}else{return !c||c.jquery?(c||av).find(s):aj(c).find(s)}}}else{if(aj.isFunction(s)){return av.ready(s)}}if(s.selector!==S){this.selector=s.selector;this.context=s.context}return aj.makeArray(s,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return aw.call(this,0)},get:function(c){return c==null?this.toArray():c<0?this.slice(c)[0]:this[c]},pushStack:function(s,c,A){var w=aj();aj.isArray(s)?aA.apply(w,s):aj.merge(w,s);w.prevObject=this;w.context=this.context;if(c==="find"){w.selector=this.selector+(this.selector?" ":"")+A}else{if(c){w.selector=this.selector+"."+c+"("+A+")"}}return w},each:function(s,c){return aj.each(this,s,c)},ready:function(c){aj.bindReady();if(aj.isReady){c.call(U,aj)}else{ax&&ax.push(c)}return this},eq:function(c){return c===-1?this.slice(c):this.slice(c,+c+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(aw.apply(this,arguments),"slice",aw.call(arguments).join(","))},map:function(c){return this.pushStack(aj.map(this,function(s,w){return c.call(s,w,s)}))},end:function(){return this.prevObject||aj(null)},push:aA,sort:[].sort,splice:[].splice};aj.fn.init.prototype=aj.fn;aj.extend=aj.fn.extend=function(){var s=arguments[0]||{},c=1,K=arguments.length,F=false,G,w,A,J;if(typeof s==="boolean"){F=s;s=arguments[1]||{};c=2}if(typeof s!=="object"&&!aj.isFunction(s)){s={}}if(K===c){s=this;--c}for(;c
    a";var G=J.getElementsByTagName("*"),w=J.getElementsByTagName("a")[0];if(!(!G||!G.length||!w)){aj.support={leadingWhitespace:J.firstChild.nodeType===3,tbody:!J.getElementsByTagName("tbody").length,htmlSerialize:!!J.getElementsByTagName("link").length,style:/red/.test(w.getAttribute("style")),hrefNormalized:w.getAttribute("href")==="/a",opacity:/^0.55$/.test(w.style.opacity),cssFloat:!!w.style.cssFloat,checkOn:J.getElementsByTagName("input")[0].value==="on",optSelected:U.createElement("select").appendChild(U.createElement("option")).selected,parentNode:J.removeChild(J.appendChild(U.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};K.type="text/javascript";try{K.appendChild(U.createTextNode("window."+F+"=1;"))}catch(A){}L.insertBefore(K,L.firstChild);if(aQ[F]){aj.support.scriptEval=true;delete aQ[F]}try{delete K.test}catch(c){aj.support.deleteExpando=false}L.removeChild(K);if(J.attachEvent&&J.fireEvent){J.attachEvent("onclick",function s(){aj.support.noCloneEvent=false;J.detachEvent("onclick",s)});J.cloneNode(true).fireEvent("onclick")}J=U.createElement("div");J.innerHTML="";L=U.createDocumentFragment();L.appendChild(J.firstChild);aj.support.checkClone=L.cloneNode(true).cloneNode(true).lastChild.checked;aj(function(){var N=U.createElement("div");N.style.width=N.style.paddingLeft="1px";U.body.appendChild(N);aj.boxModel=aj.support.boxModel=N.offsetWidth===2;U.body.removeChild(N).style.display="none"});L=function(N){var P=U.createElement("div");N="on"+N;var O=N in P;if(!O){P.setAttribute(N,"return;");O=typeof P[N]==="function"}return O};aj.support.submitBubbles=L("submit");aj.support.changeBubbles=L("change");L=K=J=G=w=null}})();aj.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var aJ="jQuery"+aH(),f=0,aU={};aj.extend({cache:{},expando:aJ,noData:{embed:true,object:true,applet:true},data:function(s,c,F){if(!(s.nodeName&&aj.noData[s.nodeName.toLowerCase()])){s=s==aQ?aU:s;var w=s[aJ],A=aj.cache;if(!w&&typeof c==="string"&&F===S){return null}w||(w=++f);if(typeof c==="object"){s[aJ]=w;A[w]=aj.extend(true,{},c)}else{if(!A[w]){s[aJ]=w;A[w]={}}}s=A[w];if(F!==S){s[c]=F}return typeof c==="string"?s[c]:s}},removeData:function(s,c){if(!(s.nodeName&&aj.noData[s.nodeName.toLowerCase()])){s=s==aQ?aU:s;var F=s[aJ],w=aj.cache,A=w[F];if(c){if(A){delete A[c];aj.isEmptyObject(A)&&aj.removeData(s)}}else{if(aj.support.deleteExpando){delete s[aj.expando]}else{s.removeAttribute&&s.removeAttribute(aj.expando)}delete w[F]}}}});aj.fn.extend({data:function(s,c){if(typeof s==="undefined"&&this.length){return aj.data(this[0])}else{if(typeof s==="object"){return this.each(function(){aj.data(this,s)})}}var A=s.split(".");A[1]=A[1]?"."+A[1]:"";if(c===S){var w=this.triggerHandler("getData"+A[1]+"!",[A[0]]);if(w===S&&this.length){w=aj.data(this[0],s)}return w===S&&A[1]?this.data(A[0]):w}else{return this.trigger("setData"+A[1]+"!",[A[0],c]).each(function(){aj.data(this,s,c)})}},removeData:function(c){return this.each(function(){aj.removeData(this,c)})}});aj.extend({queue:function(s,c,A){if(s){c=(c||"fx")+"queue";var w=aj.data(s,c);if(!A){return w||[]}if(!w||aj.isArray(A)){w=aj.data(s,c,aj.makeArray(A))}else{w.push(A)}return w}},dequeue:function(s,c){c=c||"fx";var A=aj.queue(s,c),w=A.shift();if(w==="inprogress"){w=A.shift()}if(w){c==="fx"&&A.unshift("inprogress");w.call(s,function(){aj.dequeue(s,c)})}}});aj.fn.extend({queue:function(s,c){if(typeof s!=="string"){c=s;s="fx"}if(c===S){return aj.queue(this[0],s)}return this.each(function(){var w=aj.queue(this,s,c);s==="fx"&&w[0]!=="inprogress"&&aj.dequeue(this,s)})},dequeue:function(c){return this.each(function(){aj.dequeue(this,c)})},delay:function(s,c){s=aj.fx?aj.fx.speeds[s]||s:s;c=c||"fx";return this.queue(c,function(){var w=this;setTimeout(function(){aj.dequeue(w,c)},s)})},clearQueue:function(c){return this.queue(c||"fx",[])}});var bg=/[\n\t]/g,ad=/\s+/,bc=/\r/g,aO=/href|src|style/,aW=/(button|input)/i,ay=/(button|input|object|select|textarea)/i,ac=/^(a|area)$/i,a0=/radio|checkbox/;aj.fn.extend({attr:function(s,c){return ar(this,s,c,true,aj.attr)},removeAttr:function(c){return this.each(function(){aj.attr(this,c,"");this.nodeType===1&&this.removeAttribute(c)})},addClass:function(L){if(aj.isFunction(L)){return this.each(function(O){var N=aj(this);N.addClass(L.call(this,O,N.attr("class")))})}if(L&&typeof L==="string"){for(var K=(L||"").split(ad),J=0,F=this.length;J-1){return true}}return false},val:function(s){if(s===S){var c=this[0];if(c){if(aj.nodeName(c,"option")){return(c.attributes.value||{}).specified?c.value:c.text}if(aj.nodeName(c,"select")){var K=c.selectedIndex,F=[],G=c.options;c=c.type==="select-one";if(K<0){return null}var w=c?K:0;for(K=c?K+1:G.length;w=0}else{if(aj.nodeName(this,"select")){var N=aj.makeArray(O);aj("option",this).each(function(){this.selected=aj.inArray(aj(this).val(),N)>=0});if(!N.length){this.selectedIndex=-1}}else{this.value=O}}}})}});aj.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(s,c,G,A){if(!s||s.nodeType===3||s.nodeType===8){return S}if(A&&c in aj.attrFn){return aj(s)[c](G)}A=s.nodeType!==1||!aj.isXMLDoc(s);var F=G!==S;c=A&&aj.props[c]||c;if(s.nodeType===1){var w=aO.test(c);if(c in s&&A&&!w){if(F){c==="type"&&aW.test(s.nodeName)&&s.parentNode&&aj.error("type property can't be changed");s[c]=G}if(aj.nodeName(s,"form")&&s.getAttributeNode(c)){return s.getAttributeNode(c).nodeValue}if(c==="tabIndex"){return(c=s.getAttributeNode("tabIndex"))&&c.specified?c.value:ay.test(s.nodeName)||ac.test(s.nodeName)&&s.href?0:S}return s[c]}if(!aj.support.style&&A&&c==="style"){if(F){s.style.cssText=""+G}return s.style.cssText}F&&s.setAttribute(c,""+G);s=!aj.support.hrefNormalized&&A&&w?s.getAttribute(c,2):s.getAttribute(c);return s===null?S:s}return aj.style(s,c,G)}});var aB=/\.(.*)$/,u=function(c){return c.replace(/[^\w\s\.\|`]/g,function(s){return"\\"+s})};aj.event={add:function(P,O,L,J){if(!(P.nodeType===3||P.nodeType===8)){if(P.setInterval&&P!==aQ&&!P.frameElement){P=aQ}var K,F;if(L.handler){K=L;L=K.handler}if(!L.guid){L.guid=aj.guid++}if(F=aj.data(P)){var G=F.events=F.events||{},s=F.handle;if(!s){F.handle=s=function(){return typeof aj!=="undefined"&&!aj.event.triggered?aj.event.handle.apply(s.elem,arguments):S}}s.elem=P;O=O.split(" ");for(var A,w=0,c;A=O[w++];){F=K?aj.extend({},K):{handler:L,data:J};if(A.indexOf(".")>-1){c=A.split(".");A=c.shift();F.namespace=c.slice(0).sort().join(".")}else{c=[];F.namespace=""}F.type=A;F.guid=L.guid;var Q=G[A],N=aj.event.special[A]||{};if(!Q){Q=G[A]=[];if(!N.setup||N.setup.call(P,J,c,s)===false){if(P.addEventListener){P.addEventListener(A,s,false)}else{P.attachEvent&&P.attachEvent("on"+A,s)}}}if(N.add){N.add.call(P,F);if(!F.handler.guid){F.handler.guid=L.guid}}Q.push(F);aj.event.global[A]=true}P=null}}},global:{},remove:function(R,Q,O,L){if(!(R.nodeType===3||R.nodeType===8)){var N,J=0,K,A,G,F,c,T,P=aj.data(R),s=P&&P.events;if(P&&s){if(Q&&Q.type){O=Q.handler;Q=Q.type}if(!Q||typeof Q==="string"&&Q.charAt(0)==="."){Q=Q||"";for(N in s){aj.event.remove(R,N+Q)}}else{for(Q=Q.split(" ");N=Q[J++];){F=N;K=N.indexOf(".")<0;A=[];if(!K){A=N.split(".");N=A.shift();G=new RegExp("(^|\\.)"+aj.map(A.slice(0).sort(),u).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(c=s[N]){if(O){F=aj.event.special[N]||{};for(w=L||0;w=0){N.type=J=J.slice(0,-1);N.exclusive=true}if(!K){N.stopPropagation();aj.event.global[J]&&aj.each(aj.cache,function(){this.events&&this.events[J]&&aj.event.trigger(N,L,this.handle.elem)})}if(!K||K.nodeType===3||K.nodeType===8){return S}N.result=S;N.target=K;L=aj.makeArray(L);L.unshift(N)}N.currentTarget=K;(G=aj.data(K,"handle"))&&G.apply(K,L);G=K.parentNode||K.ownerDocument;try{if(!(K&&K.nodeName&&aj.noData[K.nodeName.toLowerCase()])){if(K["on"+J]&&K["on"+J].apply(K,L)===false){N.result=false}}}catch(A){}if(!N.isPropagationStopped()&&G){aj.event.trigger(N,L,G,true)}else{if(!N.isDefaultPrevented()){G=N.target;var F,c=aj.nodeName(G,"a")&&J==="click",w=aj.event.special[J]||{};if((!w._default||w._default.call(K,N)===false)&&!c&&!(G&&G.nodeName&&aj.noData[G.nodeName.toLowerCase()])){try{if(G[J]){if(F=G["on"+J]){G["on"+J]=null}aj.event.triggered=true;G[J]()}}catch(s){}if(F){G["on"+J]=F}aj.event.triggered=false}}}},handle:function(s){var c,J,F,G;s=arguments[0]=aj.event.fix(s||aQ.event);s.currentTarget=this;c=s.type.indexOf(".")<0&&!s.exclusive;if(!c){J=s.type.split(".");s.type=J.shift();F=new RegExp("(^|\\.)"+J.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}G=aj.data(this,"events");J=G[s.type];if(G&&J){J=J.slice(0);G=0;for(var w=J.length;G-1?aj.map(s.options,function(A){return A.selected}).join("-"):""}else{if(s.nodeName.toLowerCase()==="select"){w=s.selectedIndex}}}return w},bf=function(s,c){var F=s.target,w,A;if(!(!v.test(F.nodeName)||F.readOnly)){w=aj.data(F,"_change_data");A=k(F);if(s.type!=="focusout"||F.type!=="radio"){aj.data(F,"_change_data",A)}if(!(w===S||A===w)){if(w!=null||A){s.type="change";return aj.event.trigger(s,c,F)}}}};aj.event.special.change={filters:{focusout:bf,click:function(s){var c=s.target,w=c.type;if(w==="radio"||w==="checkbox"||c.nodeName.toLowerCase()==="select"){return bf.call(this,s)}},keydown:function(s){var c=s.target,w=c.type;if(s.keyCode===13&&c.nodeName.toLowerCase()!=="textarea"||s.keyCode===32&&(w==="checkbox"||w==="radio")||w==="select-multiple"){return bf.call(this,s)}},beforeactivate:function(c){c=c.target;aj.data(c,"_change_data",k(c))}},setup:function(){if(this.type==="file"){return false}for(var c in h){aj.event.add(this,c+".specialChange",h[c])}return v.test(this.nodeName)},teardown:function(){aj.event.remove(this,".specialChange");return v.test(this.nodeName)}};h=aj.event.special.change.filters}U.addEventListener&&aj.each({focus:"focusin",blur:"focusout"},function(s,c){function w(A){A=aj.event.fix(A);A.type=c;return aj.event.handle.call(this,A)}aj.event.special[c]={setup:function(){this.addEventListener(s,w,true)},teardown:function(){this.removeEventListener(s,w,true)}}});aj.each(["bind","one"],function(s,c){aj.fn[c]=function(K,F,G){if(typeof K==="object"){for(var w in K){this[c](w,F,K[w],G)}return this}if(aj.isFunction(F)){G=F;F=S}var A=c==="one"?aj.proxy(G,function(L){aj(this).unbind(L,A);return G.apply(this,arguments)}):G;if(K==="unload"&&c!=="one"){this.one(K,F,G)}else{w=0;for(var J=this.length;w0){bn=bp;break}}}bp=bp[bb]}aa[Y]=bn}}}var Q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,R=0,O=Object.prototype.toString,P=false,K=true;[0,0].sort(function(){K=false;return 0});var N=function(bo,bn,ba,ab){ba=ba||[];var Z=bn=bn||U;if(bn.nodeType!==1&&bn.nodeType!==9){return[]}if(!bo||typeof bo!=="string"){return ba}for(var aa=[],bt,bu,bq,bb,bs=true,bp=s(bn),br=bo;(Q.exec(""),bt=Q.exec(br))!==null;){br=bt[3];aa.push(bt[1]);if(bt[2]){bb=bt[3];break}}if(aa.length>1&&G.exec(bo)){if(aa.length===2&&L.relative[aa[0]]){bu=X(aa[0]+aa[1],bn)}else{for(bu=L.relative[aa[0]]?[bn]:N(aa.shift(),bn);aa.length;){bo=aa.shift();if(L.relative[bo]){bo+=aa.shift()}bu=X(bo,bu)}}}else{if(!ab&&aa.length>1&&bn.nodeType===9&&!bp&&L.match.ID.test(aa[0])&&!L.match.ID.test(aa[aa.length-1])){bt=N.find(aa.shift(),bn,bp);bn=bt.expr?N.filter(bt.expr,bt.set)[0]:bt.set[0]}if(bn){bt=ab?{expr:aa.pop(),set:c(ab)}:N.find(aa.pop(),aa.length===1&&(aa[0]==="~"||aa[0]==="+")&&bn.parentNode?bn.parentNode:bn,bp);bu=bt.expr?N.filter(bt.expr,bt.set):bt.set;if(aa.length>0){bq=c(bu)}else{bs=false}for(;aa.length;){var Y=aa.pop();bt=Y;if(L.relative[Y]){bt=aa.pop()}else{Y=""}if(bt==null){bt=bn}L.relative[Y](bq,bt,bp)}}else{bq=[]}}bq||(bq=bu);bq||N.error(Y||bo);if(O.call(bq)==="[object Array]"){if(bs){if(bn&&bn.nodeType===1){for(bo=0;bq[bo]!=null;bo++){if(bq[bo]&&(bq[bo]===true||bq[bo].nodeType===1&&A(bn,bq[bo]))){ba.push(bu[bo])}}}else{for(bo=0;bq[bo]!=null;bo++){bq[bo]&&bq[bo].nodeType===1&&ba.push(bu[bo])}}}else{ba.push.apply(ba,bq)}}else{c(bq,ba)}if(bb){N(bb,Z,ba,ab);N.uniqueSort(ba)}return ba};N.uniqueSort=function(Z){if(J){P=K;Z.sort(J);if(P){for(var Y=1;Y":function(ab,aa){var Z=typeof aa==="string";if(Z&&!/\W/.test(aa)){aa=aa.toLowerCase();for(var Y=0,ba=ab.length;Y=0)){Z||Y.push(aa)}else{if(Z){ab[bn]=false}}}}return false},ID:function(Y){return Y[1].replace(/\\/g,"")},TAG:function(Y){return Y[1].toLowerCase()},CHILD:function(Z){if(Z[1]==="nth"){var Y=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(Z[2]==="even"&&"2n"||Z[2]==="odd"&&"2n+1"||!/\D/.test(Z[2])&&"0n+"+Z[2]||Z[2]);Z[2]=Y[1]+(Y[2]||1)-0;Z[3]=Y[3]-0}Z[0]=R++;return Z},ATTR:function(ab,aa,Z,Y,ba,bb){aa=ab[1].replace(/\\/g,"");if(!bb&&L.attrMap[aa]){ab[1]=L.attrMap[aa]}if(ab[2]==="~="){ab[4]=" "+ab[4]+" "}return ab},PSEUDO:function(ab,aa,Z,Y,ba){if(ab[1]==="not"){if((Q.exec(ab[3])||"").length>1||/^\w/.test(ab[3])){ab[3]=N(ab[3],null,null,aa)}else{ab=N.filter(ab[3],aa,Z,true^ba);Z||Y.push.apply(Y,ab);return false}}else{if(L.match.POS.test(ab[0])||L.match.CHILD.test(ab[0])){return true}}return ab},POS:function(Y){Y.unshift(true);return Y}},filters:{enabled:function(Y){return Y.disabled===false&&Y.type!=="hidden"},disabled:function(Y){return Y.disabled===true},checked:function(Y){return Y.checked===true},selected:function(Y){return Y.selected===true},parent:function(Y){return !!Y.firstChild},empty:function(Y){return !Y.firstChild},has:function(aa,Z,Y){return !!N(Y[3],aa).length},header:function(Y){return/h\d/i.test(Y.nodeName)},text:function(Y){return"text"===Y.type},radio:function(Y){return"radio"===Y.type},checkbox:function(Y){return"checkbox"===Y.type},file:function(Y){return"file"===Y.type},password:function(Y){return"password"===Y.type},submit:function(Y){return"submit"===Y.type},image:function(Y){return"image"===Y.type},reset:function(Y){return"reset"===Y.type},button:function(Y){return"button"===Y.type||Y.nodeName.toLowerCase()==="button"},input:function(Y){return/input|select|textarea|button/i.test(Y.nodeName)}},setFilters:{first:function(Z,Y){return Y===0},last:function(ab,aa,Z,Y){return aa===Y.length-1},even:function(Z,Y){return Y%2===0},odd:function(Z,Y){return Y%2===1},lt:function(aa,Z,Y){return ZY[3]-0},nth:function(aa,Z,Y){return Y[3]-0===Z},eq:function(aa,Z,Y){return Y[3]-0===Z}},filter:{PSEUDO:function(ab,aa,Z,Y){var ba=aa[1],bb=L.filters[ba];if(bb){return bb(ab,Z,aa,Y)}else{if(ba==="contains"){return(ab.textContent||ab.innerText||W([ab])||"").indexOf(aa[3])>=0}else{if(ba==="not"){aa=aa[3];Z=0;for(Y=aa.length;Z=0}},ID:function(Z,Y){return Z.nodeType===1&&Z.getAttribute("id")===Y},TAG:function(Z,Y){return Y==="*"&&Z.nodeType===1||Z.nodeName.toLowerCase()===Y},CLASS:function(Z,Y){return(" "+(Z.className||Z.getAttribute("class"))+" ").indexOf(Y)>-1},ATTR:function(ab,aa){var Z=aa[1];ab=L.attrHandle[Z]?L.attrHandle[Z](ab):ab[Z]!=null?ab[Z]:ab.getAttribute(Z);Z=ab+"";var Y=aa[2];aa=aa[4];return ab==null?Y==="!=":Y==="="?Z===aa:Y==="*="?Z.indexOf(aa)>=0:Y==="~="?(" "+Z+" ").indexOf(aa)>=0:!aa?Z&&ab!==false:Y==="!="?Z!==aa:Y==="^="?Z.indexOf(aa)===0:Y==="$="?Z.substr(Z.length-aa.length)===aa:Y==="|="?Z===aa||Z.substr(0,aa.length+1)===aa+"-":false},POS:function(ab,aa,Z,Y){var ba=L.setFilters[aa[2]];if(ba){return ba(ab,Z,aa,Y)}}}},G=L.match.POS;for(var w in L.match){L.match[w]=new RegExp(L.match[w].source+/(?![^\[]*\])(?![^\(]*\))/.source);L.leftMatch[w]=new RegExp(/(^(?:.|\r|\n)*?)/.source+L.match[w].source.replace(/\\(\d+)/g,function(Z,Y){return"\\"+(Y-0+1)}))}var c=function(Z,Y){Z=Array.prototype.slice.call(Z,0);if(Y){Y.push.apply(Y,Z);return Y}return Z};try{Array.prototype.slice.call(U.documentElement.childNodes,0)}catch(F){c=function(ab,aa){aa=aa||[];if(O.call(ab)==="[object Array]"){Array.prototype.push.apply(aa,ab)}else{if(typeof ab.length==="number"){for(var Z=0,Y=ab.length;Z";var Y=U.documentElement;Y.insertBefore(aa,Y.firstChild);if(U.getElementById(Z)){L.find.ID=function(ab,ba,bb){if(typeof ba.getElementById!=="undefined"&&!bb){return(ba=ba.getElementById(ab[1]))?ba.id===ab[1]||typeof ba.getAttributeNode!=="undefined"&&ba.getAttributeNode("id").nodeValue===ab[1]?[ba]:S:[]}};L.filter.ID=function(ab,ba){var bb=typeof ab.getAttributeNode!=="undefined"&&ab.getAttributeNode("id");return ab.nodeType===1&&bb&&bb.nodeValue===ba}}Y.removeChild(aa);Y=aa=null})();(function(){var Y=U.createElement("div");Y.appendChild(U.createComment(""));if(Y.getElementsByTagName("*").length>0){L.find.TAG=function(ab,aa){aa=aa.getElementsByTagName(ab[1]);if(ab[1]==="*"){ab=[];for(var Z=0;aa[Z];Z++){aa[Z].nodeType===1&&ab.push(aa[Z])}aa=ab}return aa}}Y.innerHTML="";if(Y.firstChild&&typeof Y.firstChild.getAttribute!=="undefined"&&Y.firstChild.getAttribute("href")!=="#"){L.attrHandle.href=function(Z){return Z.getAttribute("href",2)}}Y=null})();U.querySelectorAll&&function(){var aa=N,Z=U.createElement("div");Z.innerHTML="

    ";if(!(Z.querySelectorAll&&Z.querySelectorAll(".TEST").length===0)){N=function(ab,bn,bo,ba){bn=bn||U;if(!ba&&bn.nodeType===9&&!s(bn)){try{return c(bn.querySelectorAll(ab),bo)}catch(bb){}}return aa(ab,bn,bo,ba)};for(var Y in aa){N[Y]=aa[Y]}Z=null}}();(function(){var Y=U.createElement("div");Y.innerHTML="
    ";if(!(!Y.getElementsByClassName||Y.getElementsByClassName("e").length===0)){Y.lastChild.className="e";if(Y.getElementsByClassName("e").length!==1){L.order.splice(1,0,"CLASS");L.find.CLASS=function(ab,aa,Z){if(typeof aa.getElementsByClassName!=="undefined"&&!Z){return aa.getElementsByClassName(ab[1])}};Y=null}}})();var A=U.compareDocumentPosition?function(Z,Y){return !!(Z.compareDocumentPosition(Y)&16)}:function(Z,Y){return Z!==Y&&(Z.contains?Z.contains(Y):true)},s=function(Y){return(Y=(Y?Y.ownerDocument||Y:0).documentElement)?Y.nodeName!=="HTML":false},X=function(ab,aa){var Z=[],Y="",ba;for(aa=aa.nodeType?[aa]:aa;ba=L.match.PSEUDO.exec(ab);){Y+=ba[0];ab=ab.replace(L.match.PSEUDO,"")}ab=L.relative[ab]?ab+"*":ab;ba=0;for(var bb=aa.length;ba=0===A})};aj.fn.extend({find:function(s){for(var c=this.pushStack("","find",s),J=0,F=0,G=this.length;F0){for(var w=J;w0},closest:function(L,K){if(aj.isArray(L)){var J=[],F=this[0],G,w={},A;if(F&&L.length){G=0;for(var c=L.length;G-1:aj(F).is(G)){J.push({selector:A,elem:F});delete w[A]}}F=F.parentNode}}return J}var s=aj.expr.match.POS.test(L)?aj(L,K||this.context):null;return this.map(function(O,N){for(;N&&N.ownerDocument&&N!==K;){if(s?s.index(N)>-1:aj(N).is(L)){return N}N=N.parentNode}return null})},index:function(c){if(!c||typeof c==="string"){return aj.inArray(this[0],c?aj(c):this.parent().children())}return aj.inArray(c.jquery?c[0]:c,this)},add:function(s,c){s=typeof s==="string"?aj(s,c||this.context):aj.makeArray(s);c=aj.merge(this.get(),s);return this.pushStack(m(s[0])||m(c[0])?c:aj.unique(c))},andSelf:function(){return this.add(this.prevObject)}});aj.each({parent:function(c){return(c=c.parentNode)&&c.nodeType!==11?c:null},parents:function(c){return aj.dir(c,"parentNode")},parentsUntil:function(s,c,w){return aj.dir(s,"parentNode",w)},next:function(c){return aj.nth(c,2,"nextSibling")},prev:function(c){return aj.nth(c,2,"previousSibling")},nextAll:function(c){return aj.dir(c,"nextSibling")},prevAll:function(c){return aj.dir(c,"previousSibling")},nextUntil:function(s,c,w){return aj.dir(s,"nextSibling",w)},prevUntil:function(s,c,w){return aj.dir(s,"previousSibling",w)},siblings:function(c){return aj.sibling(c.parentNode.firstChild,c)},children:function(c){return aj.sibling(c.firstChild)},contents:function(c){return aj.nodeName(c,"iframe")?c.contentDocument||c.contentWindow.document:aj.makeArray(c.childNodes)}},function(s,c){aj.fn[s]=function(F,w){var A=aj.map(this,c,F);g.test(s)||(w=F);if(w&&typeof w==="string"){A=aj.filter(w,A)}A=this.length>1?aj.unique(A):A;if((this.length>1||aY.test(w))&&bd.test(s)){A=A.reverse()}return this.pushStack(A,s,aw.call(arguments).join(","))}});aj.extend({filter:function(s,c,w){if(w){s=":not("+s+")"}return aj.find.matches(s,c)},dir:function(s,c,A){var w=[];for(s=s[c];s&&s.nodeType!==9&&(A===S||s.nodeType!==1||!aj(s).is(A));){s.nodeType===1&&w.push(s);s=s[c]}return w},nth:function(s,c,A){c=c||1;for(var w=0;s;s=s[A]){if(s.nodeType===1&&++w===c){break}}return s},sibling:function(s,c){for(var w=[];s;s=s.nextSibling){s.nodeType===1&&s!==c&&w.push(s)}return w}});var ak=/ jQuery\d+="(?:\d+|null)"/g,au=/^\s+/,D=/(<([\w:]+)[^>]*?)\/>/g,aF=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,n=/<([\w:]+)/,ae=/"},aL={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]};aL.optgroup=aL.option;aL.tbody=aL.tfoot=aL.colgroup=aL.caption=aL.thead;aL.th=aL.td;if(!aj.support.htmlSerialize){aL._default=[1,"div
    ","
    "]}aj.fn.extend({text:function(c){if(aj.isFunction(c)){return this.each(function(s){var w=aj(this);w.text(c.call(this,s,w.text()))})}if(typeof c!=="object"&&c!==S){return this.empty().append((this[0]&&this[0].ownerDocument||U).createTextNode(c))}return aj.text(this)},wrapAll:function(s){if(aj.isFunction(s)){return this.each(function(w){aj(this).wrapAll(s.call(this,w))})}if(this[0]){var c=aj(s,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&c.insertBefore(this[0]);c.map(function(){for(var w=this;w.firstChild&&w.firstChild.nodeType===1;){w=w.firstChild}return w}).append(this)}return this},wrapInner:function(c){if(aj.isFunction(c)){return this.each(function(s){aj(this).wrapInner(c.call(this,s))})}return this.each(function(){var s=aj(this),w=s.contents();w.length?w.wrapAll(c):s.append(c)})},wrap:function(c){return this.each(function(){aj(this).wrapAll(c)})},unwrap:function(){return this.parent().each(function(){aj.nodeName(this,"body")||aj(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(c){this.nodeType===1&&this.appendChild(c)})},prepend:function(){return this.domManip(arguments,true,function(c){this.nodeType===1&&this.insertBefore(c,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(s){this.parentNode.insertBefore(s,this)})}else{if(arguments.length){var c=aj(arguments[0]);c.push.apply(c,this.toArray());return this.pushStack(c,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(s){this.parentNode.insertBefore(s,this.nextSibling)})}else{if(arguments.length){var c=this.pushStack(this,"after",arguments);c.push.apply(c,aj(arguments[0]).toArray());return c}}},remove:function(s,c){for(var A=0,w;(w=this[A])!=null;A++){if(!s||aj.filter(s,[w]).length){if(!c&&w.nodeType===1){aj.cleanData(w.getElementsByTagName("*"));aj.cleanData([w])}w.parentNode&&w.parentNode.removeChild(w)}}return this},empty:function(){for(var s=0,c;(c=this[s])!=null;s++){for(c.nodeType===1&&aj.cleanData(c.getElementsByTagName("*"));c.firstChild;){c.removeChild(c.firstChild)}}return this},clone:function(s){var c=this.map(function(){if(!aj.support.noCloneEvent&&!aj.isXMLDoc(this)){var A=this.outerHTML,w=this.ownerDocument;if(!A){A=w.createElement("div");A.appendChild(this.cloneNode(true));A=A.innerHTML}return aj.clean([A.replace(ak,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(au,"")],w)[0]}else{return this.cloneNode(true)}});if(s===true){bl(this,c);bl(this.find("*"),c.find("*"))}return c},html:function(s){if(s===S){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ak,""):null}else{if(typeof s==="string"&&!aR.test(s)&&(aj.support.leadingWhitespace||!au.test(s))&&!aL[(n.exec(s)||["",""])[1].toLowerCase()]){s=s.replace(D,bm);try{for(var c=0,A=this.length;c0||K.cacheable||this.length>1?A.cloneNode(true):A)}}s.length&&aj.each(s,I)}return this}});aj.fragments={};aj.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(s,c){aj.fn[s]=function(J){var F=[];J=aj(J);var G=this.length===1&&this[0].parentNode;if(G&&G.nodeType===11&&G.childNodes.length===1&&J.length===1){J[c](this[0]);return this}else{G=0;for(var w=J.length;G0?this.clone(true):this).get();aj.fn[c].apply(aj(J[G]),A);F=F.concat(A)}return this.pushStack(F,s,J.selector)}}});aj.extend({clean:function(O,N,L,J){N=N||U;if(typeof N.createElement==="undefined"){N=N.ownerDocument||N[0]&&N[0].ownerDocument||U}for(var K=[],F=0,G;(G=O[F])!=null;F++){if(typeof G==="number"){G+=""}if(G){if(typeof G==="string"&&!x.test(G)){G=N.createTextNode(G)}else{if(typeof G==="string"){G=G.replace(D,bm);var s=(n.exec(G)||["",""])[1].toLowerCase(),A=aL[s]||aL._default,w=A[0],c=N.createElement("div");for(c.innerHTML=A[1]+G+A[2];w--;){c=c.lastChild}if(!aj.support.tbody){w=ae.test(G);s=s==="table"&&!w?c.firstChild&&c.firstChild.childNodes:A[1]===""&&!w?c.childNodes:[];for(A=s.length-1;A>=0;--A){aj.nodeName(s[A],"tbody")&&!s[A].childNodes.length&&s[A].parentNode.removeChild(s[A])}}!aj.support.leadingWhitespace&&au.test(G)&&c.insertBefore(N.createTextNode(au.exec(G)[0]),c.firstChild);G=c.childNodes}}if(G.nodeType){K.push(G)}else{K=aj.merge(K,G)}}}if(L){for(F=0;K[F];F++){if(J&&aj.nodeName(K[F],"script")&&(!K[F].type||K[F].type.toLowerCase()==="text/javascript")){J.push(K[F].parentNode?K[F].parentNode.removeChild(K[F]):K[F])}else{K[F].nodeType===1&&K.splice.apply(K,[F+1,0].concat(aj.makeArray(K[F].getElementsByTagName("script"))));L.appendChild(K[F])}}}return K},cleanData:function(L){for(var K,J,F=aj.cache,G=aj.event.special,w=aj.support.deleteExpando,A=0,c;(c=L[A])!=null;A++){if(J=c[aj.expando]){K=F[J];if(K.events){for(var s in K.events){G[s]?aj.event.remove(c,s):aI(c,s,K.handle)}}if(w){delete c[aj.expando]}else{c.removeAttribute&&c.removeAttribute(aj.expando)}delete F[J]}}}});var i=/z-?index|font-?weight|opacity|zoom|line-?height/i,a6=/alpha\([^)]*\)/,aS=/opacity=([^)]*)/,aG=/float/i,af=/-([a-z])/ig,bh=/([A-Z])/g,a1=/^-?\d+(?:px)?$/i,aK=/^-?\d/,ah={position:"absolute",visibility:"hidden",display:"block"},B=["Left","Right"],l=["Top","Bottom"],bk=U.defaultView&&U.defaultView.getComputedStyle,an=aj.support.cssFloat?"cssFloat":"styleFloat",y=function(s,c){return c.toUpperCase()};aj.fn.css=function(s,c){return ar(this,s,c,true,function(F,w,A){if(A===S){return aj.curCSS(F,w)}if(typeof A==="number"&&!i.test(w)){A+="px"}aj.style(F,w,A)})};aj.extend({style:function(s,c,F){if(!s||s.nodeType===3||s.nodeType===8){return S}if((c==="width"||c==="height")&&parseFloat(F)<0){F=S}var w=s.style||s,A=F!==S;if(!aj.support.opacity&&c==="opacity"){if(A){w.zoom=1;c=parseInt(F,10)+""==="NaN"?"":"alpha(opacity="+F*100+")";s=w.filter||aj.curCSS(s,"filter")||"";w.filter=a6.test(s)?s.replace(a6,c):c}return w.filter&&w.filter.indexOf("opacity=")>=0?parseFloat(aS.exec(w.filter)[1])/100+"":""}if(aG.test(c)){c=an}c=c.replace(af,y);if(A){w[c]=F}return w[c]},css:function(s,c,J,F){if(c==="width"||c==="height"){var G,w=c==="width"?B:l;function A(){G=c==="width"?s.offsetWidth:s.offsetHeight;F!=="border"&&aj.each(w,function(){F||(G-=parseFloat(aj.curCSS(s,"padding"+this,true))||0);if(F==="margin"){G+=parseFloat(aj.curCSS(s,"margin"+this,true))||0}else{G-=parseFloat(aj.curCSS(s,"border"+this+"Width",true))||0}})}s.offsetWidth!==0?A():aj.swap(s,ah,A);return Math.max(0,Math.round(G))}return aj.curCSS(s,c,J)},curCSS:function(s,c,G){var A,F=s.style;if(!aj.support.opacity&&c==="opacity"&&s.currentStyle){A=aS.test(s.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return A===""?"1":A}if(aG.test(c)){c=an}if(!G&&F&&F[c]){A=F[c]}else{if(bk){if(aG.test(c)){c="float"}c=c.replace(bh,"-$1").toLowerCase();F=s.ownerDocument.defaultView;if(!F){return null}if(s=F.getComputedStyle(s,null)){A=s.getPropertyValue(c)}if(c==="opacity"&&A===""){A="1"}}else{if(s.currentStyle){G=c.replace(af,y);A=s.currentStyle[c]||s.currentStyle[G];if(!a1.test(A)&&aK.test(A)){c=F.left;var w=s.runtimeStyle.left;s.runtimeStyle.left=s.currentStyle.left;F.left=G==="fontSize"?"1em":A||0;A=F.pixelLeft+"px";F.left=c;s.runtimeStyle.left=w}}}}return A},swap:function(s,c,F){var w={};for(var A in c){w[A]=s.style[A];s.style[A]=c[A]}F.call(s);for(A in c){s.style[A]=w[A]}}});if(aj.expr&&aj.expr.filters){aj.expr.filters.hidden=function(s){var c=s.offsetWidth,A=s.offsetHeight,w=s.nodeName.toLowerCase()==="tr";return c===0&&A===0&&!w?true:c>0&&A>0&&!w?false:aj.curCSS(s,"display")==="none"};aj.expr.filters.visible=function(c){return !aj.expr.filters.hidden(c)}}var a4=aH(),aP=//gi,al=/select|textarea/i,E=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,aC=/=\?(&|$)/,j=/\?/,o=/(\?|&)_=.*?(&|$)/,a=/^(\w+:)?\/\/([^\/?#]+)/,a7=/%20/g,aT=aj.fn.load;aj.fn.extend({load:function(s,c,G){if(typeof s!=="string"){return aT.call(this,s)}else{if(!this.length){return this}}var A=s.indexOf(" ");if(A>=0){var F=s.slice(A,s.length);s=s.slice(0,A)}A="GET";if(c){if(aj.isFunction(c)){G=c;c=null}else{if(typeof c==="object"){c=aj.param(c,aj.ajaxSettings.traditional);A="POST"}}}var w=this;aj.ajax({url:s,type:A,dataType:"html",data:c,complete:function(J,K){if(K==="success"||K==="notmodified"){w.html(F?aj("
    ").append(J.responseText.replace(aP,"")).find(F):J.responseText)}G&&w.each(G,[J.responseText,K,J])}});return this},serialize:function(){return aj.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?aj.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||al.test(this.nodeName)||E.test(this.type))}).map(function(s,c){s=aj(this).val();return s==null?null:aj.isArray(s)?aj.map(s,function(w){return{name:c.name,value:w}}):{name:c.name,value:s}}).get()}});aj.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(s,c){aj.fn[c]=function(w){return this.bind(c,w)}});aj.extend({get:function(s,c,A,w){if(aj.isFunction(c)){w=w||A;A=c;c=null}return aj.ajax({type:"GET",url:s,data:c,success:A,dataType:w})},getScript:function(s,c){return aj.get(s,null,c,"script")},getJSON:function(s,c,w){return aj.get(s,c,w,"json")},post:function(s,c,A,w){if(aj.isFunction(c)){w=w||A;A=c;c={}}return aj.ajax({type:"POST",url:s,data:c,success:A,dataType:w})},ajaxSetup:function(c){aj.extend(aj.ajaxSettings,c)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:aQ.XMLHttpRequest&&(aQ.location.protocol!=="file:"||!aQ.ActiveXObject)?function(){return new aQ.XMLHttpRequest}:function(){try{return new aQ.ActiveXObject("Microsoft.XMLHTTP")}catch(c){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(aa){function Z(){X.success&&X.success.call(P,K,R,s);X.global&&W("ajaxSuccess",[s,X])}function Y(){X.complete&&X.complete.call(P,s,R);X.global&&W("ajaxComplete",[s,X]);X.global&&!--aj.active&&aj.event.trigger("ajaxStop")}function W(ba,bb){(X.context?aj(X.context):aj.event).trigger(ba,bb)}var X=aj.extend(true,{},aj.ajaxSettings,aa),Q,R,K,P=aa&&aa.context||X,L=X.type.toUpperCase();if(X.data&&X.processData&&typeof X.data!=="string"){X.data=aj.param(X.data,X.traditional)}if(X.dataType==="jsonp"){if(L==="GET"){aC.test(X.url)||(X.url+=(j.test(X.url)?"&":"?")+(X.jsonp||"callback")+"=?")}else{if(!X.data||!aC.test(X.data)){X.data=(X.data?X.data+"&":"")+(X.jsonp||"callback")+"=?"}}X.dataType="json"}if(X.dataType==="json"&&(X.data&&aC.test(X.data)||aC.test(X.url))){Q=X.jsonpCallback||"jsonp"+a4++;if(X.data){X.data=(X.data+"").replace(aC,"="+Q+"$1")}X.url=X.url.replace(aC,"="+Q+"$1");X.dataType="script";aQ[Q]=aQ[Q]||function(ba){K=ba;Z();Y();aQ[Q]=S;try{delete aQ[Q]}catch(bb){}c&&c.removeChild(F)}}if(X.dataType==="script"&&X.cache===null){X.cache=false}if(X.cache===false&&L==="GET"){var G=aH(),w=X.url.replace(o,"$1_="+G+"$2");X.url=w+(w===X.url?(j.test(X.url)?"&":"?")+"_="+G:"")}if(X.data&&L==="GET"){X.url+=(j.test(X.url)?"&":"?")+X.data}X.global&&!aj.active++&&aj.event.trigger("ajaxStart");G=(G=a.exec(X.url))&&(G[1]&&G[1]!==location.protocol||G[2]!==location.host);if(X.dataType==="script"&&L==="GET"&&G){var c=U.getElementsByTagName("head")[0]||U.documentElement,F=U.createElement("script");F.src=X.url;if(X.scriptCharset){F.charset=X.scriptCharset}if(!Q){var J=false;F.onload=F.onreadystatechange=function(){if(!J&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){J=true;Z();Y();F.onload=F.onreadystatechange=null;c&&F.parentNode&&c.removeChild(F)}}}c.insertBefore(F,c.firstChild);return S}var A=false,s=X.xhr();if(s){X.username?s.open(L,X.url,X.async,X.username,X.password):s.open(L,X.url,X.async);try{if(X.data||aa&&aa.contentType){s.setRequestHeader("Content-Type",X.contentType)}if(X.ifModified){aj.lastModified[X.url]&&s.setRequestHeader("If-Modified-Since",aj.lastModified[X.url]);aj.etag[X.url]&&s.setRequestHeader("If-None-Match",aj.etag[X.url])}G||s.setRequestHeader("X-Requested-With","XMLHttpRequest");s.setRequestHeader("Accept",X.dataType&&X.accepts[X.dataType]?X.accepts[X.dataType]+", */*":X.accepts._default)}catch(ab){}if(X.beforeSend&&X.beforeSend.call(P,s,X)===false){X.global&&!--aj.active&&aj.event.trigger("ajaxStop");s.abort();return false}X.global&&W("ajaxSend",[s,X]);var V=s.onreadystatechange=function(bb){if(!s||s.readyState===0||bb==="abort"){A||Y();A=true;if(s){s.onreadystatechange=aj.noop}}else{if(!A&&s&&(s.readyState===4||bb==="timeout")){A=true;s.onreadystatechange=aj.noop;R=bb==="timeout"?"timeout":!aj.httpSuccess(s)?"error":X.ifModified&&aj.httpNotModified(s,X.url)?"notmodified":"success";var bn;if(R==="success"){try{K=aj.httpData(s,X.dataType,X)}catch(ba){R="parsererror";bn=ba}}if(R==="success"||R==="notmodified"){Q||Z()}else{aj.handleError(X,s,R,bn)}Y();bb==="timeout"&&s.abort();if(X.async){s=null}}}};try{var T=s.abort;s.abort=function(){s&&T.call(s);V("abort")}}catch(O){}X.async&&X.timeout>0&&setTimeout(function(){s&&!A&&V("timeout")},X.timeout);try{s.send(L==="POST"||L==="PUT"||L==="DELETE"?X.data:null)}catch(N){aj.handleError(X,s,null,N);Y()}X.async||V();return s}},handleError:function(s,c,A,w){if(s.error){s.error.call(s.context||s,c,A,w)}if(s.global){(s.context?aj(s.context):aj.event).trigger("ajaxError",[c,s,w])}},active:0,httpSuccess:function(s){try{return !s.status&&location.protocol==="file:"||s.status>=200&&s.status<300||s.status===304||s.status===1223||s.status===0}catch(c){}return false},httpNotModified:function(s,c){var A=s.getResponseHeader("Last-Modified"),w=s.getResponseHeader("Etag");if(A){aj.lastModified[c]=A}if(w){aj.etag[c]=w}return s.status===304||s.status===0},httpData:function(s,c,F){var w=s.getResponseHeader("content-type")||"",A=c==="xml"||!c&&w.indexOf("xml")>=0;s=A?s.responseXML:s.responseText;A&&s.documentElement.nodeName==="parsererror"&&aj.error("parsererror");if(F&&F.dataFilter){s=F.dataFilter(s,c)}if(typeof s==="string"){if(c==="json"||!c&&w.indexOf("json")>=0){s=aj.parseJSON(s)}else{if(c==="script"||!c&&w.indexOf("javascript")>=0){aj.globalEval(s)}}}return s},param:function(s,c){function G(J,K){if(aj.isArray(K)){aj.each(K,function(L,N){c||/\[\]$/.test(J)?A(J,N):G(J+"["+(typeof N==="object"||aj.isArray(N)?L:"")+"]",N)})}else{!c&&K!=null&&typeof K==="object"?aj.each(K,function(L,N){G(J+"["+L+"]",N)}):A(J,K)}}function A(J,K){K=aj.isFunction(K)?K():K;F[F.length]=encodeURIComponent(J)+"="+encodeURIComponent(K)}var F=[];if(c===S){c=aj.ajaxSettings.traditional}if(aj.isArray(s)||s.jquery){aj.each(s,function(){A(this.name,this.value)})}else{for(var w in s){G(w,s[w])}}return F.join("&").replace(a7,"+")}});var bi={},be=/toggle|show|hide/,aZ=/^([+-]=)?([\d+-.]+)(.*)$/,at,H=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];aj.fn.extend({show:function(s,c){if(s||s===0){return this.animate(aE("show",3),s,c)}else{s=0;for(c=this.length;s").appendTo("body");w=A.css("display");if(w==="none"){w="block"}A.remove();bi[F]=w}aj.data(this[s],"olddisplay",w)}}s=0;for(c=this.length;s=0;A--){if(w[A].elem===this){c&&w[A](true);w.splice(A,1)}}});c||this.dequeue();return this}});aj.each({slideDown:aE("show",1),slideUp:aE("hide",1),slideToggle:aE("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(s,c){aj.fn[s]=function(A,w){return this.animate(c,A,w)}});aj.extend({speed:function(s,c,A){var w=s&&typeof s==="object"?s:{complete:A||!A&&c||aj.isFunction(s)&&s,duration:s,easing:A&&c||c&&!aj.isFunction(c)&&c};w.duration=aj.fx.off?0:typeof w.duration==="number"?w.duration:aj.fx.speeds[w.duration]||aj.fx.speeds._default;w.old=w.complete;w.complete=function(){w.queue!==false&&aj(this).dequeue();aj.isFunction(w.old)&&w.old.call(this)};return w},easing:{linear:function(s,c,A,w){return A+w*s},swing:function(s,c,A,w){return(-Math.cos(s*Math.PI)/2+0.5)*w+A}},timers:[],fx:function(s,c,w){this.options=c;this.elem=s;this.prop=w;if(!c.orig){c.orig={}}}});aj.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(aj.fx.step[this.prop]||aj.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(c){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}return(c=parseFloat(aj.css(this.elem,this.prop,c)))&&c>-10000?c:parseFloat(aj.curCSS(this.elem,this.prop))||0},custom:function(s,c,F){function w(G){return A.step(G)}this.startTime=aH();this.start=s;this.end=c;this.unit=F||this.unit||"px";this.now=this.start;this.pos=this.state=0;var A=this;w.elem=this.elem;if(w()&&aj.timers.push(w)&&!at){at=setInterval(aj.fx.tick,13)}},show:function(){this.options.orig[this.prop]=aj.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());aj(this.elem).show()},hide:function(){this.options.orig[this.prop]=aj.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(s){var c=aH(),F=true;if(s||c>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var w in this.options.curAnim){if(this.options.curAnim[w]!==true){F=false}}if(F){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;s=aj.data(this.elem,"olddisplay");this.elem.style.display=s?s:this.options.display;if(aj.css(this.elem,"display")==="none"){this.elem.style.display="block"}}this.options.hide&&aj(this.elem).hide();if(this.options.hide||this.options.show){for(var A in this.options.curAnim){aj.style(this.elem,A,this.options.orig[A])}}this.options.complete.call(this.elem)}return false}else{A=c-this.startTime;this.state=A/this.options.duration;s=this.options.easing||(aj.easing.swing?"swing":"linear");this.pos=aj.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||s](this.state,A,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};aj.extend(aj.fx,{tick:function(){for(var s=aj.timers,c=0;c
    ";s.insertBefore(c,s.firstChild);G=c.firstChild;A=G.firstChild;F=G.nextSibling.firstChild.firstChild;this.doesNotAddBorder=A.offsetTop!==5;this.doesAddBorderForTableAndCells=F.offsetTop===5;A.style.position="fixed";A.style.top="20px";this.supportsFixedPosition=A.offsetTop===20||A.offsetTop===15;A.style.position=A.style.top="";G.style.overflow="hidden";G.style.position="relative";this.subtractsBorderForOverflowNotVisible=A.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=s.offsetTop!==w;s.removeChild(c);aj.offset.initialize=aj.noop},bodyOffset:function(s){var c=s.offsetTop,w=s.offsetLeft;aj.offset.initialize();if(aj.offset.doesNotIncludeMarginInBodyOffset){c+=parseFloat(aj.curCSS(s,"marginTop",true))||0;w+=parseFloat(aj.curCSS(s,"marginLeft",true))||0}return{top:c,left:w}},setOffset:function(s,c,J){if(/static/.test(aj.curCSS(s,"position"))){s.style.position="relative"}var F=aj(s),G=F.offset(),w=parseInt(aj.curCSS(s,"top",true),10)||0,A=parseInt(aj.curCSS(s,"left",true),10)||0;if(aj.isFunction(c)){c=c.call(s,J,G)}J={top:c.top-G.top+w,left:c.left-G.left+A};"using" in c?c.using.call(s,J):F.css(J)}};aj.fn.extend({position:function(){if(!this[0]){return null}var s=this[0],c=this.offsetParent(),A=this.offset(),w=/^body|html$/i.test(c[0].nodeName)?{top:0,left:0}:c.offset();A.top-=parseFloat(aj.curCSS(s,"marginTop",true))||0;A.left-=parseFloat(aj.curCSS(s,"marginLeft",true))||0;w.top+=parseFloat(aj.curCSS(c[0],"borderTopWidth",true))||0;w.left+=parseFloat(aj.curCSS(c[0],"borderLeftWidth",true))||0;return{top:A.top-w.top,left:A.left-w.left}},offsetParent:function(){return this.map(function(){for(var c=this.offsetParent||U.body;c&&!/^body|html$/i.test(c.nodeName)&&aj.css(c,"position")==="static";){c=c.offsetParent}return c})}});aj.each(["Left","Top"],function(s,c){var w="scroll"+c;aj.fn[w]=function(F){var G=this[0],A;if(!G){return null}if(F!==S){return this.each(function(){if(A=p(this)){A.scrollTo(!s?F:aj(A).scrollLeft(),s?F:aj(A).scrollTop())}else{this[w]=F}})}else{return(A=p(G))?"pageXOffset" in A?A[s?"pageYOffset":"pageXOffset"]:aj.support.boxModel&&A.document.documentElement[w]||A.document.body[w]:G[w]}}});aj.each(["Height","Width"],function(s,c){var w=c.toLowerCase();aj.fn["inner"+c]=function(){return this[0]?aj.css(this[0],w,false,"padding"):null};aj.fn["outer"+c]=function(A){return this[0]?aj.css(this[0],w,false,A?"margin":"border"):null};aj.fn[w]=function(A){var F=this[0];if(!F){return A==null?null:this}if(aj.isFunction(A)){return this.each(function(G){var J=aj(this);J[w](A.call(this,G,J[w]()))})}return"scrollTo" in F&&F.document?F.document.compatMode==="CSS1Compat"&&F.document.documentElement["client"+c]||F.document.body["client"+c]:F.nodeType===9?Math.max(F.documentElement["client"+c],F.body["scroll"+c],F.documentElement["scroll"+c],F.body["offset"+c],F.documentElement["offset"+c]):A===S?aj.css(F,w):this.css(w,typeof A==="string"?A:A+"px")}});aQ.jQuery=aQ.$=aj})(window);jQuery.ui||(function(c){var j=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(l,m,o){var n=c.ui[l].prototype;for(var k in o){n.plugins[k]=n.plugins[k]||[];n.plugins[k].push([m,o[k]])}},call:function(k,m,l){var o=k.plugins[m];if(!o||!k.element[0].parentNode){return}for(var n=0;n0){return true}n[k]=1;m=(n[k]>0);n[k]=0;return m},isOverAxis:function(l,k,m){return(l>k)&&(l<(k+m))},isOver:function(p,l,o,n,k,m){return c.ui.isOverAxis(p,o,k)&&c.ui.isOverAxis(l,n,m)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var g=c.attr,f=c.fn.removeAttr,i="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(l,k,m){var n=m!==undefined;return(k=="role"?(n?g.call(this,l,k,"wairole:"+m):(g.apply(this,arguments)||"").replace(b,"")):(a.test(k)?(n?l.setAttributeNS(i,k.replace(a,"aaa:"),m):g.call(this,l,k.replace(a,"aaa:"))):g.apply(this,arguments)))};c.fn.removeAttr=function(k){return(a.test(k)?this.each(function(){this.removeAttributeNS(i,k.replace(a,""))}):f.call(this,k))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return j.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var k;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){k=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{k=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!k.length?c(document):k}});c.extend(c.expr[":"],{data:function(m,l,k){return !!c.data(m,k[3])},focusable:function(l){var m=l.nodeName.toLowerCase(),k=c.attr(l,"tabindex");return(/input|select|textarea|button|object/.test(m)?!l.disabled:"a"==m||"area"==m?l.href||!isNaN(k):!isNaN(k))&&!c(l)["area"==m?"parents":"closest"](":hidden").length},tabbable:function(l){var k=c.attr(l,"tabindex");return(isNaN(k)||k>=0)&&c(l).is(":focusable")}});function h(n,o,p,m){function l(r){var q=c[n][o][r]||[];return(typeof q=="string"?q.split(/,?\s+/):q)}var k=l("getter");if(m.length==1&&typeof m[0]=="string"){k=k.concat(l("getterSetter"))}return(c.inArray(p,k)!=-1)}c.widget=function(l,k){var m=l.split(".")[0];l=l.split(".")[1];c.fn[l]=function(q){var o=(typeof q=="string"),p=Array.prototype.slice.call(arguments,1);if(o&&q.substring(0,1)=="_"){return this}if(o&&h(m,l,q,p)){var n=c.data(this[0],l);return(n?n[q].apply(n,p):undefined)}return this.each(function(){var r=c.data(this,l);(!r&&!o&&c.data(this,l,new c[m][l](this,q))._init());(r&&o&&c.isFunction(r[q])&&r[q].apply(r,p))})};c[m]=c[m]||{};c[m][l]=function(p,o){var n=this;this.namespace=m;this.widgetName=l;this.widgetEventPrefix=c[m][l].eventPrefix||l;this.widgetBaseClass=m+"-"+l;this.options=c.extend({},c.widget.defaults,c[m][l].defaults,c.metadata&&c.metadata.get(p)[l],o);this.element=c(p).bind("setData."+l,function(r,q,s){if(r.target==p){return n._setData(q,s)}}).bind("getData."+l,function(r,q){if(r.target==p){return n._getData(q)}}).bind("remove",function(){return n.destroy()})};c[m][l].prototype=c.extend({},c.widget.prototype,k);c[m][l].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(m,n){var l=m,k=this;if(typeof m=="string"){if(n===undefined){return this._getData(m)}l={};l[m]=n}c.each(l,function(o,p){k._setData(o,p)})},_getData:function(k){return this.options[k]},_setData:function(k,l){this.options[k]=l;if(k=="disabled"){this.element[l?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",l)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(m,n,o){var q=this.options[m],k=(m==this.widgetEventPrefix?m:this.widgetEventPrefix+m);n=c.Event(n);n.type=k;if(n.originalEvent){for(var l=c.event.props.length,p;l;){p=c.event.props[--l];n[p]=n.originalEvent[p]}}this.element.trigger(n,o);return !(c.isFunction(q)&&q.call(this.element[0],n,o)===false||n.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var k=this;this.element.bind("mousedown."+this.widgetName,function(l){return k._mouseDown(l)}).bind("click."+this.widgetName,function(l){if(k._preventClickEvent){k._preventClickEvent=false;l.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(m){m.originalEvent=m.originalEvent||{};if(m.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(m));this._mouseDownEvent=m;var l=this,n=(m.which==1),k=(typeof this.options.cancel=="string"?c(m.target).parents().add(m.target).filter(this.options.cancel).length:false);if(!n||k||!this._mouseCapture(m)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){l.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(m)&&this._mouseDelayMet(m)){this._mouseStarted=(this._mouseStart(m)!==false);if(!this._mouseStarted){m.preventDefault();return true}}this._mouseMoveDelegate=function(o){return l._mouseMove(o)};this._mouseUpDelegate=function(o){return l._mouseUp(o)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||m.preventDefault());m.originalEvent.mouseHandled=true;return true},_mouseMove:function(k){if(c.browser.msie&&!k.button){return this._mouseUp(k)}if(this._mouseStarted){this._mouseDrag(k);return k.preventDefault()}if(this._mouseDistanceMet(k)&&this._mouseDelayMet(k)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,k)!==false);(this._mouseStarted?this._mouseDrag(k):this._mouseUp(k))}return !this._mouseStarted},_mouseUp:function(k){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(k.target==this._mouseDownEvent.target);this._mouseStop(k)}return false},_mouseDistanceMet:function(k){return(Math.max(Math.abs(this._mouseDownEvent.pageX-k.pageX),Math.abs(this._mouseDownEvent.pageY-k.pageY))>=this.options.distance)},_mouseDelayMet:function(k){return this.mouseDelayMet},_mouseStart:function(k){},_mouseDrag:function(k){},_mouseStop:function(k){},_mouseCapture:function(k){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(a){a.ajaxSettings.accepts._default="text/javascript, text/html, application/xml, text/xml, */*"})(jQuery);(function(a){a.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};a.fn.enable=function(){return this.each(function(){this.disabled=false})};a.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function(a){a.extend({fieldEvent:function(b,f){var d=b[0]||b,c="change";if(d.type=="radio"||d.type=="checkbox"){c="click"}else{if(f&&(d.type=="text"||d.type=="textarea"||d.type=="password")){c="keyup"}}return c}});a.fn.extend({delayedObserver:function(b,f){var c=a(this);if(typeof window.delayedObserverStack=="undefined"){window.delayedObserverStack=[]}if(typeof window.delayedObserverCallback=="undefined"){window.delayedObserverCallback=function(h){var g=window.delayedObserverStack[h];if(g.timer){clearTimeout(g.timer)}g.timer=setTimeout(function(){g.timer=null;g.callback(g.obj,g.obj.formVal())},g.delay*1000);g.oldVal=g.obj.formVal()}}window.delayedObserverStack.push({obj:c,timer:null,delay:b,oldVal:c.formVal(),callback:f});var d=window.delayedObserverStack.length-1;if(c[0].tagName=="FORM"){a(":input",c).each(function(){var g=a(this);g.bind(a.fieldEvent(g,b),function(){var h=window.delayedObserverStack[d];if(h.obj.formVal()==h.oldVal){return}else{window.delayedObserverCallback(d)}})})}else{c.bind(a.fieldEvent(c,b),function(){var g=window.delayedObserverStack[d];if(g.obj.formVal()==g.oldVal){return}else{window.delayedObserverCallback(d)}})}},formVal:function(){var b=this[0];if(b.tagName=="FORM"){return this.serialize()}if(b.type=="checkbox"||b.type=="radio"){return this.filter("input:checked").val()||""}else{return this.val()}}})})(jQuery);(function($){$.fn.extend({visualEffect:function(o,options){if(options){speed=options.duration*1000}else{speed=null}e=o.replace(/\_(.)/g,function(m,l){return l.toUpperCase()});return eval("$(this)."+e+"("+speed+")")},appear:function(speed,callback){return this.fadeIn(speed,callback)},blindDown:function(speed,callback){return this.show("blind",{direction:"vertical"},speed,callback)},blindUp:function(speed,callback){return this.hide("blind",{direction:"vertical"},speed,callback)},blindRight:function(speed,callback){return this.show("blind",{direction:"horizontal"},speed,callback)},blindLeft:function(speed,callback){this.hide("blind",{direction:"horizontal"},speed,callback);return this},dropOut:function(speed,callback){return this.hide("drop",{direction:"down"},speed,callback)},dropIn:function(speed,callback){return this.show("drop",{direction:"up"},speed,callback)},fade:function(speed,callback){return this.fadeOut(speed,callback)},fadeToggle:function(speed,callback){return this.animate({opacity:"toggle"},speed,callback)},fold:function(speed,callback){return this.hide("fold",{},speed,callback)},foldOut:function(speed,callback){return this.show("fold",{},speed,callback)},grow:function(speed,callback){return this.show("scale",{},speed,callback)},highlight:function(speed,callback){return this.show("highlight",{},speed,callback)},puff:function(speed,callback){return this.hide("puff",{},speed,callback)},pulsate:function(speed,callback){return this.show("pulsate",{},speed,callback)},shake:function(speed,callback){return this.show("shake",{},speed,callback)},shrink:function(speed,callback){return this.hide("scale",{},speed,callback)},squish:function(speed,callback){return this.hide("scale",{origin:["top","left"]},speed,callback)},slideUp:function(speed,callback){return this.hide("slide",{direction:"up"},speed,callback)},slideDown:function(speed,callback){return this.show("slide",{direction:"up"},speed,callback)},switchOff:function(speed,callback){return this.hide("clip",{},speed,callback)},switchOn:function(speed,callback){return this.show("clip",{},speed,callback)}})})(jQuery);function bmtForm(b){var a=jQuery(b);jQuery(".product-id").val(a.attr("data-value"))}function fillDiscountCode(a){jQuery("#DISCOUNTCODE").val(a)}function fillBmtId(b,a){jQuery("#BMTID_"+a).val(b)}function download(a){setTimeout(function(){location.href=a},500);jQuery("#subscription_first_name").focus()}function subscribing(a){var c=jQuery(".subscribe",a);c.hide();var d=a.attr("data-progress")||"Subscribing...";var b=jQuery("
    ").addClass("subscribing").html(d);c.after(b)}function validate_newsletter_form(c){var a=jQuery(c);var d="Please fill in ";var b=jQuery.validation.getRule("email").check(jQuery(".email",a).val());if(b){a.find("input").removeClass(t.required);subscribing(a);return true}else{jQuery(".email",a).addClass(t.required).focus();d+=t.valid_email;alert(d);return false}}function validate_uninstall_from(c){var a=jQuery(c);var d="";var b=jQuery.validation.getRule("email").check(jQuery(".email",a).val());var f=jQuery("#support_request_message").val();if(!b&&!f){d="Please type in the main issue or your comments or valid email.";alert(d);return false}a.find("input[name=magicwand]").val(t.antispam);sending();return true}function sending(){var a=jQuery("#send");a.hide();var b=jQuery("
    ").attr("id","sending").addClass("sending").html("Sending message...");a.after(b)}function validate_contact_from(b){var c="Please fill in ";var a=jQuery.validation.getRule("email").check(jQuery("#support_request_email").val());var d=jQuery.validation.getRule("required").check(jQuery("#support_request_message").val());if(a&&d){jQuery(b).find("input, textarea").removeClass(t.required);jQuery(b).find("input[name=magicwand]").val(t.antispam);sending();return true}else{if(!a){c+=t.valid_email;jQuery("#support_request_email").addClass(t.required);jQuery("#support_request_email").focus()}if(!a&&!d){c+=" and "}if(!d){c+=t.message;jQuery("#support_request_message").addClass(t.required);if(a){jQuery("#support_request_message").focus()}}c+=".";alert(c);return false}}function feedback_sent(){jQuery("#sending").remove();jQuery("#support_request_name").val("");jQuery("#support_request_email").val("");jQuery("#support_request_message").val("");var a=jQuery("
    ").addClass("sent-notice").html(t.thanks_for_message);jQuery("#send").after(a)}function why_uninstall_sent(){jQuery("#sending").remove();var a=jQuery("
    ").addClass("sent-notice").html(t.thanks_for_why_uninstall);jQuery("#send").after(a)}function subscription_saved(c){var a=jQuery(c);var b=jQuery(".subscribing",a);b.addClass("subscribed").html(t.thank_you);jQuery(".email",a).val("").blur();jQuery(".name",a).val("");setTimeout(function(){b.fadeOut(150,function(){jQuery(".subscribe",a).fadeIn(150);b.remove()})},7000)}function download_subscription_saved(a){parent.jQuery("#fancybox-outer").removeClass("fancybox-highlight");parent.jQuery.fancybox(t.thanks_for_subscription)}function feedback_not_sent(a){jQuery("#sending").remove();jQuery("#send").show();alert(a)}function subscription_not_saved(a){jQuery(".subscribing").remove();jQuery(".subscribe").show();alert(a)}function order_feedback_sent(a){jQuery.fancybox(t.order_thanks_for_message)}function send_another(){jQuery(".sent-notice").remove();jQuery("#send").show();jQuery("#support_request_name").focus()}function order_send_another(){jQuery("#show-contact-form").click()}function close_fancybox(){jQuery.fancybox.close()}function rot13(a){return a.replace(/[a-zA-Z]/g,function(b){return String.fromCharCode((b<="Z"?90:122)>=(b=b.charCodeAt(0)+13)?b:b-26)})}function download_email(a){setTimeout(function(){jQuery.fancybox("",{href:"/subscriptions/from_download/"+a,type:"iframe",transitionIn:"elastic",centerOnScroll:true,width:600,height:215,onStart:function(){jQuery("#fancybox-outer").addClass("fancybox-highlight")},onClosed:function(){jQuery("#fancybox-outer").removeClass("fancybox-highlight")}})},10)}(function(b){var a=function(){var d={email:{check:function(g){if(g){var f=/^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4}$/;return c(g,f)}return false},msg:""},required:{check:function(f){if(f){return true}else{return false}},msg:""}};var c=function(g,f){return f.test(g)};return{addRule:function(f,g){d[f]=g},getRule:function(f){return d[f]}}};b.validation=new a()})(jQuery);(function(C){var M,V,T,N,d,y,l,L,Q,B;var F=0,J={},h=[],f=0,H={},A=[];var g=null,n=new Image,K=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,k=/[^\.]\.(swf)\s*$/i;var r,O=1;var a,c,R=false,E=20,v=C.extend(C("
    ")[0],{prop:0}),j=0,U=!C.support.opacity&&!window.XMLHttpRequest;C.fn.fixPNG=function(){return this.each(function(){var Y=C(this).css("backgroundImage");if(Y.match(/^url\(["']?(.*\.png)["']?\)$/i)){Y=RegExp.$1;C(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod="+(C(this).css("backgroundRepeat")=="no-repeat"?"crop":"scale")+", src='"+Y+"')"}).each(function(){var Z=C(this).css("position");if(Z!="absolute"&&Z!="relative"){C(this).css("position","relative")}}).css("zoom",1)}})};C.fn.fancybox=function(Y){C(this).data("fancybox",C.extend({},Y));C(this).unbind("click.fb").bind("click.fb",function(aa){aa.preventDefault();if(R){return}R=true;C(this).blur();h=[];F=0;var Z=C(this).attr("rel")||"";if(!Z||Z==""||Z==="nofollow"){h.push(this)}else{h=C("a[rel="+Z+"], area[rel="+Z+"]");F=h.index(this)}m();return false});return this};C.fancybox=function(ab,aa){if(R){return}R=true;h=[];F=0;if(C.isArray(ab)){for(var Z=0,Y=ab.length;Z-1&&A.length>Y){F=Y;m()}if(H.cyclic&&A.length>1&&Y<0){F=A.length-1;m()}if(H.cyclic&&A.length>1&&Y>=A.length){F=0;m()}return};C.fancybox.cancel=function(){if(R){return}R=true;C.event.trigger("fancybox-cancel");i();if(J&&C.isFunction(J.onCancel)){J.onCancel(h,F,J)}R=false};C.fancybox.close=function(){if(R||N.is(":hidden")){return}R=true;if(H&&C.isFunction(H.onCleanup)){if(H.onCleanup(A,f,H)===false){R=false;return}}i();C(L.add(Q).add(B)).hide();C("#fancybox-title").remove();N.add(y).add(T).unbind();C(window).unbind("resize.fb scroll.fb");C(document).unbind("keydown.fb");function Y(){T.fadeOut("fast");N.hide();C.event.trigger("fancybox-cleanup");y.empty();if(C.isFunction(H.onClosed)){H.onClosed(A,f,H)}A=J=[];f=F=0;H=J={};R=false}y.css("overflow","hidden");if(H.transitionOut=="elastic"){a=X();var Z=N.position();c={top:Z.top,left:Z.left,width:N.width(),height:N.height()};if(H.opacity){c.opacity=1}v.prop=1;C(v).animate({prop:0},{duration:H.speedOut,easing:H.easingOut,step:I,complete:Y})}else{N.fadeOut(H.transitionOut=="none"?0:H.speedOut,Y)}};C.fancybox.resize=function(){if(R||N.is(":hidden")){return}R=true;var Z=y.wrapInner("
    ").children();var Y=Z.height();N.css({height:Y+(H.padding*2)+j});y.css({height:Y});Z.replaceWith(Z.children());C.fancybox.center()};C.fancybox.center=function(){R=true;var Y=G();var Z=H.margin;var aa={};aa.top=Y[3]+((Y[1]-((N.height()-j)+(E*2)))*0.5);aa.left=Y[2]+((Y[0]-(N.width()+(E*2)))*0.5);aa.top=Math.max(Y[3]+Z,aa.top);aa.left=Math.max(Y[2]+Z,aa.left);N.css(aa);R=false};function i(){V.hide();n.onerror=n.onload=null;if(g){g.abort()}M.empty()}function q(){C.fancybox('

    The requested content cannot be loaded.
    Please try again later.

    ',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})}function m(){i();var ad=h[F];J=C.extend({},C.fn.fancybox.defaults,(typeof C(ad).data("fancybox")=="undefined"?J:C(ad).data("fancybox")));var aa,ab,af=ad.title||C(ad).title||J.title||"";if(ad.nodeName&&!J.orig){J.orig=C(ad).children("img:first").length?C(ad).children("img:first"):C(ad)}if(af==""&&J.orig){af=J.orig.attr("alt")}if(ad.nodeName&&(/^(?:javascript|#)/i).test(ad.href)){aa=J.href||null}else{aa=J.href||ad.href||null}if(J.type){ab=J.type;if(!aa){aa=J.content}}else{if(J.content){ab="html"}else{if(aa){if(aa.match(K)){ab="image"}else{if(aa.match(k)){ab="swf"}else{if(C(ad).hasClass("iframe")){ab="iframe"}else{if(aa.match(/#/)){ad=aa.substr(aa.indexOf("#"));ab=C(ad).length>0?"inline":"ajax"}else{ab="ajax"}}}}}else{ab="inline"}}}J.type=ab;J.href=aa;J.title=af;if(J.autoDimensions&&J.type!=="iframe"&&J.type!=="swf"){J.width="auto";J.height="auto"}if(J.modal){J.overlayShow=true;J.hideOnOverlayClick=false;J.hideOnContentClick=false;J.enableEscapeButton=false;J.showCloseButton=false}if(C.isFunction(J.onStart)){if(J.onStart(h,F,J)===false){R=false;return}}M.css("padding",(E+J.padding+J.margin));C(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){C(this).replaceWith(y.children())});switch(ab){case"html":M.html(J.content);u();break;case"inline":C('
    ').hide().insertBefore(C(ad)).bind("fancybox-cleanup",function(){C(this).replaceWith(y.children())}).bind("fancybox-cancel",function(){C(this).replaceWith(M.children())});C(ad).appendTo(M);u();break;case"image":R=false;C.fancybox.showActivity();n=new Image;n.onerror=function(){q()};n.onload=function(){n.onerror=null;n.onload=null;S()};n.src=aa;break;case"swf":var ae="";var Z="";ae+='';C.each(J.swf,function(ag,ah){ae+='';Z+=" "+ag+'="'+ah+'"'});ae+='";M.html(ae);u();break;case"ajax":var Y=aa.split("#",2);var ac=J.ajax.data||{};if(Y.length>1){aa=Y[0];typeof ac=="string"?ac+="&selector="+Y[1]:ac.selector=Y[1]}R=false;C.fancybox.showActivity();g=C.ajax(C.extend(J.ajax,{url:aa,data:ac,error:q,success:function(ah,ai,ag){if(g.status==200){M.html(ah);u()}}}));break;case"iframe":C('').appendTo(M);w();break}}function S(){R=true;J.width=n.width;J.height=n.height;C("").attr({id:"fancybox-img",src:n.src,alt:J.title}).appendTo(M);w()}function u(){M.width(J.width);M.height(J.height);if(J.width=="auto"){J.width=M.width()}if(J.height=="auto"){J.height=M.height()}w()}function w(){V.hide();if(N.is(":visible")&&C.isFunction(H.onCleanup)){if(H.onCleanup(A,f,H)===false){C.event.trigger("fancybox-cancel");R=false;return}}A=h;f=F;H=J;y.get(0).scrollTop=0;y.get(0).scrollLeft=0;if(H.overlayShow){if(U){C("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"})}T.css({"background-color":H.overlayColor,opacity:H.overlayOpacity}).unbind().show()}c=b();s();if(N.is(":visible")){C(L.add(Q).add(B)).hide();var Z=N.position();a={top:Z.top,left:Z.left,width:N.width(),height:N.height()};var Y=(a.width==c.width&&a.height==c.height);y.fadeOut(H.changeFade,function(){C.event.trigger("fancybox-change");y.css({top:H.padding,left:H.padding,width:Math.max(a.width-(H.padding*2),1),height:Math.max(a.height-(H.padding*2),1)}).empty().css("overflow","hidden");function aa(){y.html(M.contents()).fadeIn(H.changeFade,x)}v.prop=0;C(v).animate({prop:1},{duration:Y?0:H.changeSpeed,easing:H.easingChange,step:I,complete:aa})});return}N.css("opacity",1);if(H.transitionIn=="elastic"){a=X();y.css({top:H.padding,left:H.padding,width:Math.max(a.width-(H.padding*2),1),height:Math.max(a.height-(H.padding*2),1)}).html(M.contents());N.css(a).show();if(H.opacity){c.opacity=0}v.prop=0;C(v).animate({prop:1},{duration:H.speedIn,easing:H.easingIn,step:I,complete:x})}else{y.css({top:H.padding,left:H.padding,width:Math.max(c.width-(H.padding*2),1),height:Math.max(c.height-(H.padding*2)-j,1)}).html(M.contents());N.css(c).fadeIn(H.transitionIn=="none"?0:H.speedIn,x)}}function I(ac){var Z=Math.round(a.width+(c.width-a.width)*ac);var Y=Math.round(a.height+(c.height-a.height)*ac);var ab=Math.round(a.top+(c.top-a.top)*ac);var aa=Math.round(a.left+(c.left-a.left)*ac);N.css({width:Z+"px",height:Y+"px",top:ab+"px",left:aa+"px"});Z=Math.max(Z-H.padding*2,0);Y=Math.max(Y-(H.padding*2+(j*ac)),0);y.css({width:Z+"px",height:Y+"px"});if(typeof c.opacity!=="undefined"){N.css("opacity",(ac<0.5?0.5:ac))}}function x(){y.css("overflow",overflow=(H.scrolling=="auto"?(H.type=="image"||H.type=="iframe"||H.type=="swf"?"hidden":"auto"):(H.scrolling=="yes"?"auto":"visible")));if(!C.support.opacity){y.get(0).style.removeAttribute("filter");N.get(0).style.removeAttribute("filter")}C("#fancybox-title").show();if(H.hideOnContentClick){y.one("click",C.fancybox.close)}if(H.hideOnOverlayClick){T.one("click",C.fancybox.close)}if(H.showCloseButton){L.show()}p();C(window).bind("resize.fb",C.fancybox.center);H.centerOnScroll?C(window).bind("scroll.fb",C.fancybox.center):C(window).unbind("scroll.fb");if(C.isFunction(H.onComplete)){H.onComplete(A,f,H)}R=false;W()}function b(){var Y=G();var af={};var ad=H.margin;var Z=H.autoScale;var ae=(E+ad)*2;var ac=(E+ad)*2;var aa=(H.padding*2);if(H.width.toString().indexOf("%")>-1){af.width=((Y[0]*parseFloat(H.width))/100)-(E*2);Z=false}else{af.width=H.width+aa}if(H.height.toString().indexOf("%")>-1){af.height=((Y[1]*parseFloat(H.height))/100)-(E*2);Z=false}else{af.height=H.height+aa}if(Z&&(af.width>(Y[0]-ae)||af.height>(Y[1]-ac))){if(J.type=="image"||J.type=="swf"){ae+=aa;ac+=aa;var ab=Math.min(Math.min(Y[0]-ae,H.width)/H.width,Math.min(Y[1]-ac,H.height)/H.height);af.width=Math.round(ab*(af.width-aa))+aa;af.height=Math.round(ab*(af.height-aa))+aa}else{af.width=Math.min(af.width,(Y[0]-ae));af.height=Math.min(af.height,(Y[1]-ac))}}af.top=Y[3]+((Y[1]-(af.height+(E*2)))*0.5);af.left=Y[2]+((Y[0]-(af.width+(E*2)))*0.5);if(H.autoScale==false){af.top=Math.max(Y[3]+ad,af.top);af.left=Math.max(Y[2]+ad,af.left)}return af}function X(){var ab=J.orig?C(J.orig):false;var aa={};if(ab&&ab.length){var Z=z(ab);aa={width:(Z.width+(H.padding*2)),height:(Z.height+(H.padding*2)),top:(Z.top-H.padding-E),left:(Z.left-H.padding-E)}}else{var Y=G();aa={width:1,height:1,top:Y[3]+Y[1]*0.5,left:Y[2]+Y[0]*0.5}}return aa}function p(){C(document).unbind("keydown.fb").bind("keydown.fb",function(Y){if(Y.keyCode==27&&H.enableEscapeButton){Y.preventDefault();C.fancybox.close()}else{if(Y.keyCode==37){Y.preventDefault();C.fancybox.prev()}else{if(Y.keyCode==39){Y.preventDefault();C.fancybox.next()}}}});if(C.fn.mousewheel){N.unbind("mousewheel.fb");if(A.length>1){N.bind("mousewheel.fb",function(Y,Z){Y.preventDefault();if(R||Z==0){return}Z>0?C.fancybox.prev():C.fancybox.next()})}}if(!H.showNavArrows){return}if((H.cyclic&&A.length>1)||f!=0){Q.show()}if((H.cyclic&&A.length>1)||f!=(A.length-1)){B.show()}}function W(){if((A.length-1)>f){var Y=A[f+1].href;if(typeof Y!=="undefined"&&Y.match(K)){var Z=new Image();Z.src=Y}}if(f>0){var Y=A[f-1].href;if(typeof Y!=="undefined"&&Y.match(K)){var Z=new Image();Z.src=Y}}}function o(){if(!V.is(":visible")){clearInterval(r);return}C("div",V).css("top",(O*-40)+"px");O=(O+1)%12}function G(){return[C(window).width(),C(window).height(),C(document).scrollLeft(),C(document).scrollTop()]}function z(Y){var Z=Y.offset();Z.top+=parseFloat(Y.css("paddingTop"))||0;Z.left+=parseFloat(Y.css("paddingLeft"))||0;Z.top+=parseFloat(Y.css("border-top-width"))||0;Z.left+=parseFloat(Y.css("border-left-width"))||0;Z.width=Y.width();Z.height=Y.height();return Z}function s(){C("#fancybox-title").remove();j=0;if(H.titleShow==false){return}var aa=A[f];var ab=H.title;ab=C.isFunction(H.titleFormat)?H.titleFormat(ab,A,f,H):P(ab);if(!ab||ab==""){return}var Z=c.width-(H.padding*2);var Y="fancybox-title-"+H.titlePosition;C('
    ').css({width:Z,paddingLeft:H.padding,paddingRight:H.padding}).html(ab).appendTo("body");switch(H.titlePosition){case"inside":j=C("#fancybox-title").outerHeight(true)-H.padding;c.top-=Math.floor(j/2);c.height+=j;break;case"over":C("#fancybox-title").css("bottom",H.padding);break;default:C("#fancybox-title").css("bottom",C("#fancybox-title").outerHeight(true)*-1);break}C("#fancybox-title").appendTo(d).hide();if(U){C("#fancybox-title span").fixPNG()}}function P(Y){if(Y&&Y.length){switch(H.titlePosition){case"inside":return Y;break;case"over":return''+Y+"";break;default:return''+Y+'';break}}return false}function D(){if(C("#fancybox-wrap").length){return}C("body").append(M=C('
    '),V=C('
    '),T=C('
    '),N=C('
    '));d=C('
    ').append('
    ').appendTo(N);d.append(y=C('
    '),L=C('
    '),Q=C(''),B=C(''));L.click(C.fancybox.close);V.click(C.fancybox.cancel);Q.click(function(Y){Y.preventDefault();C.fancybox.prev()});B.click(function(Y){Y.preventDefault();C.fancybox.next()});if(!C.support.opacity){d.find(".fancy-bg").fixPNG()}if(U){C(L.add(".fancy-ico").add("div",V)).fixPNG();T.get(0).style.setExpression("height","document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");V.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");d.prepend('')}}C.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};C(document).ready(function(){D()})})(jQuery);(function(f){function b(p,c,k){var q=this,g=p.add(this),o=p.find(k.tabs),n=c.jquery?c:p.children(c),m;o.length||(o=p.children());n.length||(n=p.parent().find(c));n.length||(n=f(c));f.extend(this,{click:function(j,i){var h=o.eq(j);if(typeof j=="string"&&j.replace("#","")){h=o.filter("[href*="+j.replace("#","")+"]");j=Math.max(o.index(h),0)}if(k.rotate){var l=o.length-1;if(j<0){return q.click(l,i)}if(j>l){return q.click(0,i)}}if(!h.length){if(m>=0){return q}j=k.initialIndex;h=o.eq(j)}if(j===m){return q}i=i||f.Event();i.type="onBeforeClick";g.trigger(i,[j]);if(!i.isDefaultPrevented()){d[k.effect].call(q,j,function(){i.type="onClick";g.trigger(i,[j])});m=j;o.removeClass(k.current);h.addClass(k.current);return q}},getConf:function(){return k},getTabs:function(){return o},getPanes:function(){return n},getCurrentPane:function(){return n.eq(m)},getCurrentTab:function(){return o.eq(m)},getIndex:function(){return m},next:function(){return q.click(m+1)},prev:function(){return q.click(m-1)},destroy:function(){o.unbind(k.event).removeClass(k.current);n.find("a[href^=#]").unbind("click.T");return q}});f.each("onBeforeClick,onClick".split(","),function(i,h){f.isFunction(k[h])&&f(q).bind(h,k[h]);q[h]=function(j){f(q).bind(h,j);return q}});if(k.history&&f.fn.history){f.tools.history.init(o);k.event="history"}o.each(function(h){f(this).bind(k.event,function(i){q.click(h,i);return i.preventDefault()})});n.find("a[href^=#]").bind("click.T",function(h){q.click(f(this).attr("href"),h)});if(location.hash){q.click(location.hash)}else{if(k.initialIndex===0||k.initialIndex>0){q.click(k.initialIndex)}}}f.tools=f.tools||{version:"1.2.3"};f.tools.tabs={conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",rotate:false,history:false},addEffect:function(g,c){d[g]=c}};var d={"default":function(g,c){this.getPanes().hide().eq(g).show();c.call()},fade:function(i,c){var h=this.getConf(),j=h.fadeOutSpeed,g=this.getPanes();j?g.fadeOut(j):g.hide();g.eq(i).fadeIn(h.fadeInSpeed,c)},slide:function(g,c){this.getPanes().slideUp(200);this.getPanes().eq(g).slideDown(400,c)},ajax:function(g,c){this.getPanes().eq(0).load(this.getTabs().eq(g).attr("href"),c)}},a;f.tools.tabs.addEffect("horizontal",function(g,c){a||(a=this.getPanes().eq(0).width());this.getCurrentPane().animate({width:0},function(){f(this).hide()});this.getPanes().eq(g).animate({width:a},function(){f(this).show();c.call()})});f.fn.tabs=function(h,c){var g=this.data("tabs");if(g){g.destroy();this.removeData("tabs")}if(f.isFunction(c)){c={onBeforeClick:c}}c=f.extend({},f.tools.tabs.conf,c);this.each(function(){g=new b(f(this),h,c);f(this).data("tabs",g)});return c.api?g:this}})(jQuery);(function(c){function d(h,i){var g=c(i);return g.length<2?g:h.parent().find(i)}function b(w,x){var y=this,q=w.add(y),v=w.children(),u=0,n=x.vertical;a||(a=y);if(v.length>1){v=c(x.items,w)}c.extend(y,{getConf:function(){return x},getIndex:function(){return u},getSize:function(){return y.getItems().size()},getNaviButtons:function(){return j.add(i)},getRoot:function(){return w},getItemWrap:function(){return v},getItems:function(){return v.children(x.item).not("."+x.clonedClass)},move:function(f,g){return y.seekTo(u+f,g)},next:function(f){return y.move(1,f)},prev:function(f){return y.move(-1,f)},begin:function(f){return y.seekTo(0,f)},end:function(f){return y.seekTo(y.getSize()-1,f)},focus:function(){return a=y},addItem:function(f){f=c(f);if(x.circular){c(".cloned:last").before(f);c(".cloned:first").replaceWith(f.clone().addClass(x.clonedClass))}else{v.append(f)}q.trigger("onAddItem",[f]);return y},seekTo:function(f,m,k){if(x.circular&&f===0&&u==-1&&m!==0){return y}if(!x.circular&&f<0||f>y.getSize()||f<-1){return y}var g=f;if(f.jquery){f=y.getItems().index(f)}else{g=y.getItems().eq(f)}var l=c.Event("onBeforeSeek");if(!k){q.trigger(l,[f,m]);if(l.isDefaultPrevented()||!g.length){return y}}g=n?{top:-g.position().top}:{left:-g.position().left};u=f;a=y;if(m===undefined){m=x.speed}v.animate(g,m,x.easing,k||function(){q.trigger("onSeek",[f])});return y}});c.each(["onBeforeSeek","onSeek","onAddItem"],function(f,g){c.isFunction(x[g])&&c(y).bind(g,x[g]);y[g]=function(k){c(y).bind(g,k);return y}});if(x.circular){var h=y.getItems().slice(-1).clone().prependTo(v),z=y.getItems().eq(1).clone().appendTo(v);h.add(z).addClass(x.clonedClass);y.onBeforeSeek(function(f,k,g){if(!f.isDefaultPrevented()){if(k==-1){y.seekTo(h,g,function(){y.end(0)});return f.preventDefault()}else{k==y.getSize()&&y.seekTo(z,g,function(){y.begin(0)})}}});y.seekTo(0,0)}var j=d(w,x.prev).click(function(){y.prev()}),i=d(w,x.next).click(function(){y.next()});!x.circular&&y.getSize()>1&&y.onBeforeSeek(function(f,g){setTimeout(function(){if(!f.isDefaultPrevented()){j.toggleClass(x.disabledClass,g<=0);i.toggleClass(x.disabledClass,g>=y.getSize()-1)}},1)});x.mousewheel&&c.fn.mousewheel&&w.mousewheel(function(f,g){if(x.mousewheel){y.move(g<0?1:-1,x.wheelSpeed||50);return false}});x.keyboard&&c(document).bind("keydown.scrollable",function(f){if(!(!x.keyboard||f.altKey||f.ctrlKey||c(f.target).is(":input"))){if(!(x.keyboard!="static"&&a!=y)){var g=f.keyCode;if(n&&(g==38||g==40)){y.move(g==38?-1:1);return f.preventDefault()}if(!n&&(g==37||g==39)){y.move(g==37?-1:1);return f.preventDefault()}}}});c(y).trigger("onBeforeSeek",[x.initialIndex])}c.tools=c.tools||{version:"1.2.3"};c.tools.scrollable={conf:{activeClass:"active",circular:false,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:null,items:".items",keyboard:true,mousewheel:false,next:".next",prev:".prev",speed:400,vertical:false,wheelSpeed:0}};var a;c.fn.scrollable=function(g){var h=this.data("scrollable");if(h){return h}g=c.extend({},c.tools.scrollable.conf,g);this.each(function(){h=new b(c(this),g);c(this).data("scrollable",h)});return g.api?h:this}})(jQuery);$(document).ready(function(){if($("#download-page").size()){download($("#download_url").val())}$(".d-menu li").each(function(){var c=$(this);var d=c.find(".dropdown");if(d.size()==1){c.hover(function(){c.addClass("with-dropdown-hover");d.show()},function(){c.removeClass("with-dropdown-hover");d.hide()})}});var b=$("#buy-nav");if(b.size()>0){b.tabs("#buy-panels .panel")}$(".autosubmit").change(function(){$(this).closest("form").submit()});$("a.screenshot:not(.nozoom)").fancybox({titlePosition:"inside",transitionIn:"elastic",transitionOut:"elastic",hideOnContentClick:true,autoScale:false,titleFormat:function(d){var c=d;if($("#screenshot-buttons").size()>0){c='
    '+d+'
    '+$("#screenshot-buttons").html()+"
    "}return c}});$("span.emil").each(function(){var d=$(this);var f=d.text().replace(" (at) ","@").replace(" (dot) ",".");var c=$("").attr("href","mailto:"+f).text(f);d.after(c);d.remove()});$(".obfmail").each(function(){var c=$(this);c.attr("href","mailto:"+rot13(c.attr("rel")))});$("#show-contact-form").fancybox({onComplete:function(){$("#contact_name").focus()},onStart:function(){$("#contact_name").val("");$("#contact_email").val("");$("#contact_message").val("");$("#sending").remove();$("#send").show()}});$(".static-popup-link").fancybox({ajax:{type:"GET"},hideOnContentClick:true});$(".inline-popup-link").fancybox({hideOnContentClick:true});$(".popup-link").fancybox({ajax:{type:"GET"},hideOnContentClick:false});$("input.inline-label").each(function(){$(this).data("initial_value",$(this).val())});$("input.inline-label").focus(function(){var c=$(this);c.addClass("inline-label-focus");if(c.val()==c.data("initial_value")){c.val("")}});$(".history-back").click(function(c){c.preventDefault();history.go(-1)});$("form.prevent-return input").keypress(function(c){if(c.keyCode==13){c.preventDefault()}});$(".pr-content a.img").click(function(c){window.open(this.href);c.preventDefault()});var a=$("#cscontact-nav");if(a.size()>0){a.tabs("#cscontact .panel")}}); \ No newline at end of file diff --git a/public/javascripts/dextronet.js b/public/javascripts/dextronet.js new file mode 100644 index 0000000..7ab45c1 --- /dev/null +++ b/public/javascripts/dextronet.js @@ -0,0 +1,200 @@ +function bmtForm(el) { + var $el = jQuery(el); + jQuery(".product-id").val($el.attr("data-value")); +} + +function fillDiscountCode(code) { + jQuery("#DISCOUNTCODE").val(code); +} + +function fillBmtId(id, key) { + jQuery("#BMTID_"+key).val(id); +} + +function download(url) +{ + setTimeout(function() { location.href = url; }, 500); + jQuery("#subscription_first_name").focus(); +} + +function subscribing($form) { + var $this = jQuery(".subscribe", $form); + $this.hide(); + var text = $form.attr("data-progress") || "Subscribing..." + var subscribing = jQuery("
    ").addClass('subscribing').html(text); + $this.after(subscribing); +} + +function validate_newsletter_form(form) +{ + var $form = jQuery(form); + var info = "Please fill in "; + var email = jQuery.validation.getRule('email').check(jQuery('.email', $form).val()); + if (email) { + $form.find("input").removeClass(t.required); + subscribing($form); + return true; + } else { + jQuery('.email', $form).addClass(t.required).focus(); + info += t.valid_email; + //jQuery(".subscribing", $form).remove(); + //jQuery(".subscribe", $form).show(); + alert(info); + return false; + } +} + +function validate_uninstall_from(form) +{ + var $form = jQuery(form); + var info = ""; + var email = jQuery.validation.getRule('email').check(jQuery('.email', $form).val()); + var comments = jQuery('#support_request_message').val(); + if (!email && !comments) { + info = "Please type in the main issue or your comments or valid email."; + //jQuery("#sending").remove(); + //jQuery("#send").show(); + alert(info); + return false; + } + $form.find("input[name=magicwand]").val(t.antispam); + sending(); + return true; +} + +function sending() { + var $el = jQuery("#send"); + $el.hide(); + var sending = jQuery("
    ").attr("id", "sending").addClass("sending").html('Sending message...'); + $el.after(sending); +} + +function validate_contact_from(form) +{ + var info = "Please fill in "; + var email = jQuery.validation.getRule('email').check(jQuery('#support_request_email').val()); + var msg = jQuery.validation.getRule('required').check(jQuery('#support_request_message').val()); + + if (email && msg) { + jQuery(form).find("input, textarea").removeClass(t.required); + jQuery(form).find("input[name=magicwand]").val(t.antispam); + sending(); + return true; + } else { + if (!email) { + info += t.valid_email; + jQuery('#support_request_email').addClass(t.required); + jQuery('#support_request_email').focus(); + } + if (!email && !msg) { info += " and "; } + if (!msg) { + info += t.message; + jQuery('#support_request_message').addClass(t.required); + if (email) jQuery('#support_request_message').focus(); + } + info += "."; + //jQuery("#sending").remove(); + //jQuery("#send").show(); + alert(info); + return false; + } +}; + +function feedback_sent() +{ + jQuery("#sending").remove(); + jQuery("#support_request_name").val(""); + jQuery("#support_request_email").val(""); + jQuery("#support_request_message").val(""); + var bar = jQuery("
    ").addClass("sent-notice").html(t.thanks_for_message); + jQuery("#send").after(bar); +}; + +function why_uninstall_sent() +{ + jQuery("#sending").remove(); + var bar = jQuery("
    ").addClass("sent-notice").html(t.thanks_for_why_uninstall); + jQuery("#send").after(bar); +}; + +function subscription_saved(formId) +{ + var $form = jQuery(formId); + var subscribing = jQuery(".subscribing", $form); + subscribing.addClass("subscribed").html(t.thank_you); + jQuery(".email", $form).val("").blur(); + jQuery(".name", $form).val(""); + setTimeout(function() { + subscribing.fadeOut(150, function() { + jQuery(".subscribe", $form).fadeIn(150); + subscribing.remove(); + }); + }, 7000); +}; + +function download_subscription_saved(formId) +{ + parent.jQuery("#fancybox-outer").removeClass("fancybox-highlight"); + parent.jQuery.fancybox(t.thanks_for_subscription); +}; + +function feedback_not_sent(msg) +{ + jQuery("#sending").remove(); + jQuery("#send").show(); + alert(msg); +}; + +function subscription_not_saved(msg) +{ + jQuery(".subscribing").remove(); + jQuery(".subscribe").show(); + alert(msg); +}; + +function order_feedback_sent(notice) +{ + jQuery.fancybox(t.order_thanks_for_message); +}; + +function send_another() +{ + jQuery(".sent-notice").remove(); + jQuery("#send").show(); + jQuery("#support_request_name").focus(); +}; + +function order_send_another() +{ + jQuery("#show-contact-form").click(); +}; + +function close_fancybox() +{ + jQuery.fancybox.close(); +}; + +function rot13(str) { + return str.replace(/[a-zA-Z]/g, function(c){ + return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26); + }); +}; + +function download_email(product_code) { + setTimeout(function() { + jQuery.fancybox('', { + href: '/subscriptions/from_download/'+product_code, + type: 'iframe', + transitionIn: 'elastic', + centerOnScroll: true, + width: 600, + height: 215, + onStart: function() { + jQuery("#fancybox-outer").addClass("fancybox-highlight"); + }, + onClosed: function() { + jQuery("#fancybox-outer").removeClass("fancybox-highlight"); + } + }); + }, 10); +} \ No newline at end of file diff --git a/public/javascripts/plugins/jquery.validation.js b/public/javascripts/plugins/jquery.validation.js new file mode 100644 index 0000000..dfdc0c6 --- /dev/null +++ b/public/javascripts/plugins/jquery.validation.js @@ -0,0 +1,49 @@ +(function($) { + + var validation = function() { + + var rules = { // Private object + + email : { + check: function(value) { + + if(value) { + var pattern = /^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4}$/; + return testValue(value, pattern); + } + return false; + }, + msg : "" + }, + required : { + + check: function(value) { + + if(value) { + return true; + } + else { + return false; + } + }, + msg : "" + } + } + var testValue = function(value, pattern) { // Private Method + return pattern.test(value); + } + return { // Public methods + + addRule : function(name, rule) { + + rules[name] = rule; + }, + getRule : function(name) { + + return rules[name]; + } + } + } + //A new instance of our object in the jQuery namespace. + $.validation = new validation(); +})(jQuery); \ No newline at end of file diff --git a/public/sitemap.html b/public/sitemap.html new file mode 100644 index 0000000..bc31a05 --- /dev/null +++ b/public/sitemap.html @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + +Better ListView .NET control: Improved List View control for C# and VB.NET (Windows Forms) + + + + + + + +
    + + + + + + + +
    +
    +
    + +

    ComponentOwl.com Sitemap

    + +

    Component Owl - .NET controls for WinForms / 

    + + + + + + + +
    +
    +
    + + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/public/stylesheets/base_packaged.css?1455269822.css b/public/stylesheets/base_packaged.css?1455269822.css new file mode 100644 index 0000000..778ac82 --- /dev/null +++ b/public/stylesheets/base_packaged.css?1455269822.css @@ -0,0 +1 @@ +#fancybox-loading{position:fixed;top:50%;left:50%;height:40px;width:40px;margin-top:-20px;margin-left:-20px;cursor:pointer;overflow:hidden;background:transparent;z-index:1104;display:none;}* html #fancybox-loading{position:absolute;margin-top:0;}#fancybox-loading div{position:absolute;top:0;left:0;width:40px;height:480px;background:transparent url('../images/fancybox/fancy_loading.png') no-repeat;}#fancybox-overlay{position:fixed;top:0;left:0;bottom:0;right:0;background:#000;z-index:1100;display:none;}* html #fancybox-overlay{position:absolute;width:100%;}#fancybox-tmp{padding:0;margin:0;border:0;overflow:auto;display:none;}#fancybox-wrap{position:absolute;top:0;left:0;margin:0;padding:20px;z-index:1101;display:none;}#fancybox-outer{position:relative;width:100%;height:100%;background:#FFF;}#fancybox-inner{position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;outline:none;overflow:hidden;}#fancybox-hide-sel-frame{position:absolute;top:0;left:0;width:100%;height:100%;background:transparent;}#fancybox-close{position:absolute;top:-15px;right:-15px;width:32px;height:32px;background:url('../images/fancybox/fancy_close.png') top left no-repeat;cursor:pointer;z-index:1103;display:none;}#fancybox_error{color:#444;font:normal 12px/20px Arial;}#fancybox-content{height:auto;width:auto;padding:0;margin:0;}#fancybox-img{width:100%;height:100%;padding:0;margin:0;border:none;outline:none;line-height:0;vertical-align:top;-ms-interpolation-mode:bicubic;}#fancybox-frame{position:relative;width:100%;height:100%;border:none;display:block;}#fancybox-title{position:absolute;bottom:0;left:0;font-family:Arial;font-size:12px;z-index:1102;}.fancybox-title-inside{padding:10px 0;text-align:center;color:#333;}.fancybox-title-outside{padding-top:5px;color:#FFF;text-align:center;font-weight:bold;}.fancybox-title-over{color:#FFF;text-align:left;}#fancybox-title-over{padding:10px;background:url('../images/fancybox/fancy_title_over.png');display:block;}#fancybox-title-wrap{display:inline-block;}#fancybox-title-wrap span{height:32px;float:left;}#fancybox-title-left{padding-left:15px;background:transparent url('../images/fancybox/fancy_title_left.png') repeat-x;}#fancybox-title-main{font-weight:bold;line-height:29px;background:transparent url('../images/fancybox/fancy_title_main.png') repeat-x;color:#FFF;}#fancybox-title-right{padding-left:15px;background:transparent url('../images/fancybox/fancy_title_right.png') repeat-x;}#fancybox-left,#fancybox-right{position:absolute;bottom:0;height:100%;width:35%;cursor:pointer;outline:none;background-image:url('../images/fancybox/blank.gif');z-index:1102;display:none;}#fancybox-left{left:0;}#fancybox-right{right:0;}#fancybox-left-ico,#fancybox-right-ico{position:absolute;top:50%;left:-9999px;width:30px;height:30px;margin-top:-15px;cursor:pointer;z-index:1102;display:block;}#fancybox-left-ico{background:transparent url('../images/fancybox/fancy_nav_left.png') no-repeat;}#fancybox-right-ico{background:transparent url('../images/fancybox/fancy_nav_right.png') no-repeat;}#fancybox-left:hover,#fancybox-right:hover{visibility:visible;}#fancybox-left:hover span{left:20px;}#fancybox-right:hover span{left:auto;right:20px;}div.fancy-bg{position:absolute;padding:0;margin:0;border:0;z-index:1001;}div#fancy-bg-n{top:-20px;left:0;width:100%;height:20px;background:transparent url('../images/fancybox/fancy_shadow_n.png') repeat-x;}div#fancy-bg-ne{top:-20px;right:-20px;width:20px;height:20px;background:transparent url('../images/fancybox/fancy_shadow_ne.png') no-repeat;}div#fancy-bg-e{top:0;right:-20px;height:100%;width:20px;background:transparent url('../images/fancybox/fancy_shadow_e.png') repeat-y;}div#fancy-bg-se{bottom:-20px;right:-20px;width:20px;height:20px;background:transparent url('../images/fancybox/fancy_shadow_se.png') no-repeat;}div#fancy-bg-s{bottom:-20px;left:0;width:100%;height:20px;background:transparent url('../images/fancybox/fancy_shadow_s.png') repeat-x;}div#fancy-bg-sw{bottom:-20px;left:-20px;width:20px;height:20px;background:transparent url('../images/fancybox/fancy_shadow_sw.png') no-repeat;}div#fancy-bg-w{top:0;left:-20px;height:100%;width:20px;background:transparent url('../images/fancybox/fancy_shadow_w.png') repeat-y;}div#fancy-bg-nw{top:-20px;left:-20px;width:20px;height:20px;background:transparent url('../images/fancybox/fancy_shadow_nw.png') no-repeat;}*{margin:0;padding:0;}html{height:100%;}body{height:100%;font-size:14px;color:#000;text-align:center;}a img{border:none;}a{color:#825900;outline:none;}a:hover{color:#000;}a:active{color:#ab7500;}ul,li{list-style:none;}.left,.subleft{float:left;}.right,.subright{float:right;}.clear{clear:both;}.nowrap{white-space:nowrap;}.underline{text-decoration:underline;}input[type=text],input[type=password],textarea,select{padding:2px;border:1px solid;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;background-color:#fff;border-color:#abadb3 #dbdfe6 #e3e9ef #e2e3ea;}input[type=text]:focus{border-color:#d6a140 #efd9b2 #f3e3c6 #f2e1c1;}input[type=password]:hover{border-color:#d6a140 #efd9b2 #f3e3c6 #f2e1c1;}input[type=password]:focus{border-color:#d6a140 #efd9b2 #f3e3c6 #f2e1c1;}input[type=text]:hover{border-color:#d6a140 #efd9b2 #f3e3c6 #f2e1c1;}textarea:focus{border-color:#d6a140 #efd9b2 #f3e3c6 #f2e1c1;}textarea:hover{border-color:#d6a140 #efd9b2 #f3e3c6 #f2e1c1;}select:focus{border-color:#d6a140 #efd9b2 #f3e3c6 #f2e1c1;}select:hover{border-color:#d6a140 #efd9b2 #f3e3c6 #f2e1c1;}input{border-width:1px;}input{font-size:13px;}input.stressed{border-color:#e0ad50;}input.stressed:focus{border-color:#cd8d19;}input.stressed:hover{border-color:#cd8d19;}.latest_from_blog,.image-link{text-indent:-9999em;}.image-link{display:block;}.inline-label-focus{color:#000!important;}.inline-label{color:#85878d;}ul.common li{padding:2px 0 3px 23px;background:url(../images/arrow-bullet.gif) 4px 5px no-repeat;}ul.common ul li{background-image:url(../images/arrow2.gif);}.answer ul li{padding:2px 0 3px 23px;background:url(../images/arrow-bullet.gif) 4px 5px no-repeat;}.answer ul ul li{background-image:url(../images/arrow2.gif);}ul.checklist li{background:url(../images/icons/tick.gif) 0 0 no-repeat!important;padding:0 0 10px 23px;}ol.common{margin-left:22px;}ol.common li{list-style-type:decimal;padding-bottom:6px;}.testimonial{margin:20px 15px 0;padding:10px 0 0;background:url(../images/testimonial.gif) no-repeat;font-size:12px;}.testimonial blockquote{margin:0;padding:0 12px 2px;text-align:justify;font-style:italic;background:#f9f0da;}.testimonial em{display:block;padding:15px 20px 0 100px;font-size:.9em;color:#825900;font-weight:bold;font-style:normal;background:url(../images/testimonial.gif) 100% 0 no-repeat;}input.name,input.email{background-position:4px 50%;background-repeat:no-repeat;padding-left:24px;}input.name{width:150px;background-image:url(../images/icons/user.gif);}input.email{width:150px;background-image:url(../images/icons/mail.gif);}textarea.message{width:330px;height:72px;padding-left:24px;background-image:url(../images/icons/pencil.gif);background-position:4px 2px;background-repeat:no-repeat;}input.required,textarea.required{border-color:#dea110 #f1c354 #f2d58f #f2d58f!important;background-color:#fff8e9;}input{font-size:13px;}textarea{font-family:'trebuchet ms',sans-serif;font-size:12px;}.popup-link{padding-right:13px;background:url(../images/icons/arrow-popup.gif) 100% 50% no-repeat;}.sharethis a{color:#1c6e35;}.sharethis a:hover{color:#000;}hr{border:0;height:1px;color:#a8906b;background-color:#a8906b;}.contact-form{text-align:left;}.contact-form fieldset{padding:0;border-width:0;}.contact-form legend{padding:0 5px;text-align:center;}.contact-form label{display:block;}.contact-form input{margin-bottom:15px;}.contact-form textarea{margin-bottom:15px;}.contact-form select{width:172px;}.contact-form .ufd{margin-bottom:15px!important;}.contact-form .message{width:360px;height:140px;}.contact-form .submit{text-align:center;margin-top:5px;}.contact-form .sent-notice{padding:5px;background:#fdf8a3;font-weight:bold;font-size:12px;}.dbtn-c{border-bottom:1px solid #ecdfb9;border-right:1px solid #ecdfb9;display:inline-block;}.dbtn-w{background:#efe5c6;border-color:#ac995e #9f8d55 #9f8d55 #ac995e;border-style:solid;border-width:1px;display:block;height:30px;}.dbtn{background:url(../images/dbtn.png) repeat-x;border:none;color:#000;cursor:pointer;font:15px arial,sans-serif;height:30px;margin:0;outline:none;vertical-align:top;padding-left:5px;padding-right:5px;}.dbtn:active{background:#decd9b;}.dbtn-hilight{border-color:#cfe3a6;}.dbtn-hilight .dbtn-w{background:#e8f2d3;border-color:#9bc842 #84b12a #84b12a #9bc842;}.dbtn-hilight .dbtn{background-image:url(../images/dbtn-hilight.png);}.dbtn-hilight .dbtn:active{background:#bad782;}.dbtn-small .dbtn-w{height:23px;}.dbtn-small .dbtn{font-size:12px;height:23px;}a.dbtn{display:block;height:30px;line-height:30px;text-decoration:none;padding-left:15px;padding-right:15px;}.small-button{padding:4px 7px;background:#efe5c6;}body{font-family:'arial',sans-serif;background:#fefefe url(../images/bg.png) 0 0 repeat-x;}.standard-buy{float:left;width:193px;height:44px;margin-top:9px;background:url(../images/button-pricing.gif) no-repeat;}.standard-buy:hover{background-position:0 -44px;}.commercial-buy{float:left;width:214px;height:62px;background:url(../images/button-buy-commercial-license.gif) no-repeat;}.commercial-buy:hover{background-position:0 -62px;}.standard-more{float:left;width:195px;height:62px;margin-right:12px;background:url(../images/button-more.gif) no-repeat;}.standard-more:hover{background-position:0 -62px;}.standard-download{float:left;width:214px;height:62px;margin-right:12px;background:url(../images/button-download.gif) no-repeat;}.standard-download:hover{background-position:0 -62px;}.standard-free-download{float:left;width:214px;height:62px;margin-right:12px;background:url(../images/button-free-download.gif) no-repeat;}.standard-free-download:hover{background-position:0 -62px;}input.buy,input.renew{width:65px;height:31px;margin:5px 1px 5px 5px;border:0;background:url(../images/button-buy-small.gif) 0 0 no-repeat;}input.renew{margin-right:5px;background-image:url(../images/button-renew.gif);}.home-static h3{font-family:georgia,serif;margin:35px 0 15px;font-size:26px;font-weight:normal;}.home-static h3 strong{padding:0 5px 0 3px;font-weight:normal;background-image:url(../images/subhd-lb.gif),url(../images/subhd-rb.gif),url(../images/subhd-bg.gif);background-position:0 6px,100% 6px,0 6px;background-repeat:no-repeat,no-repeat,repeat-x;}.home-static p{margin:15px 0;}.home-static .sharethis{margin-top:40px;}.home-static .lists{overflow:hidden;width:100%;}.home-static .list-l{float:left;width:440px;}.home-static .list-r{float:right;width:450px;}.home-static .buttons-hp{margin-top:0!important;}.compatiblehd{font-size:20px!important;}.compatiblelists{overflow:hidden;width:100%;}.compatiblelist li{padding-bottom:8px;}.compatiblelist .logo{float:left;padding-right:15px;height:65px;}.compatiblelist .dotnet{padding-top:11px;}.compatiblelist .vs{padding-top:2px;}.tellinghd{font-style:italic;margin-top:0!important;}.tellingct{width:100%;overflow:hidden;}.tellingcnt{width:635px;float:left;}.tellingct .testimonial{float:right;width:240px;}.testimonial-wide{padding:8px 0 8px 15px;border:1px solid #a8906b;border-left:none;border-right:none;font-family:georgia,serif;font-size:16px;margin:30px 0 35px;background:#fffbf4;}.buttons-hp{overflow:hidden;width:100%;border:1px solid #b4e9fd;border-left:none;border-right:none;padding:12px;background:#f6fcff;position:relative;margin-top:15px;}.logos{margin-top:5px;}.logos img{margin-left:30px;vertical-align:middle;}.buttons-hp .logos{float:left;padding-left:5px;margin-top:14px;}.hp-wrap{width:100%;overflow:hidden;margin-top:15px;}.hp-wrap iframe{float:right;margin-right:25px;}.buttons-hp-vertical{float:left;text-align:center;width:250px;margin-left:25px;margin-top:20px;padding:15px;}.buttons-hp-vertical a{float:none;margin:0 auto 15px;}.buttons-hp-vertical .logos{float:none;padding:0;margin:0 auto;}.buttons-hp-vertical img{margin:0 10px;}.hpline{padding:0;border:none;height:1px;margin:35px 0 0;background-color:#b4e9fd;}.sshd{font-size:20px!important;padding-left:8px;margin:0;}.ending{margin-bottom:7px!important;}.darrows{position:relative;width:175px;height:54px;z-index:2;background:url(../images/arrows.png) no-repeat;margin:0 0 -7px 30px;}.homehd{font-family:georgia,serif;font-size:34px;text-align:center;font-weight:normal;margin:14px 0 10px;line-height:39px;}.homehd span{padding:0 29px 0 23px;background-image:url(../images/homehd-lb.gif),url(../images/homehd-rb.gif),url(../images/homehd-bg.gif);background-position:0 0,100% 0,0 0;background-repeat:no-repeat,no-repeat,repeat-x;}.homeph{text-align:center;font-size:16px;}.ss-overview{margin:0 0 10px;}.nav{height:30px;width:100%;border-bottom:1px solid #a8906b;margin-bottom:20px;}.nav a{color:#825900;text-decoration:none;padding:6px 20px 7px;}.nav a:hover{color:#000;}.nav a.current{color:#000;}.nav li{float:left;text-transform:uppercase;line-height:31px;font-size:12px;font-weight:bold;}.nav .current{border:1px solid #a8906b;border-bottom:none;background:#fbf1e0;}.product-content{overflow:hidden;height:100%;}.product-content h1{font-size:36px;font-weight:normal;letter-spacing:-1px;margin:15px 0 0;}.product-content h1 .subheading{font-size:28px;margin-bottom:7px;}.product-content .section-info{margin:0 0 30px;font-size:14px;}.product-content .sides{overflow:hidden;width:100%;margin-bottom:30px;}.product-content .right{width:686px;}.product-content .left{width:214px;font-size:12px;}.product-content .compatibility{margin-top:12px;padding-top:12px;border-top:1px dotted #a8906b;}.product-content .compatibility img{margin:5px;}.product-content .newsletter{margin-top:12px;padding-top:12px;border-top:1px dotted #a8906b;}.product-content .newsletter img{margin:5px;}.product-content .sharethis-ct{margin-top:12px;padding-top:12px;border-top:1px dotted #a8906b;}.product-content .sharethis-ct img{margin:5px;}.product-content div.screenshot{margin-top:12px;padding-top:12px;border-top:1px dotted #a8906b;}.product-content div.screenshot img{margin:5px;}.product-content .documentation p{font-weight:bold;padding-top:6px;}.product-content .screenshot{text-align:center;}.product-content .fb-like{position:relative;margin-top:10px;height:75px;overflow:hidden;background-color:#eceff6;border:1px solid #9da1c4;}.product-content .fb-like iframe{border:none!important;margin:-1px 0 0 -1px!important;}.product-content .newsletter form div{padding:3px 0;}.product-content .newsletter form .email{width:135px;margin:5px 0;}.product-content .sharethis{padding-top:5px;}.product-content .buttons-box{text-align:center;}.product-content .buttons-box .standard-download{margin-bottom:10px;}.product-content .buttons-box .standard-free-download{margin-bottom:10px;}.product-content .buttons-box .standard-buy{margin:0 0 10px 10px;display:inline;}.product-content .buttons-box .commercial-buy{margin:0 0 10px;}.product-content .small-button-ct{margin:15px;text-align:center;}.product-content .screenshots{overflow:hidden;padding-top:23px;width:100%;}.product-content .screenshots .odd{float:left;margin-left:23px;}.product-content .screenshots .even{float:right;margin-right:23px;}.product-content .screenshots strong{display:block;padding:5px 0 30px 5px;}.product-content .screenshots img{border:3px solid #efe5c6;border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px;}.product-content .screenshot-row{overflow:hidden;}.product-content .buttons-wrap{margin-top:40px;margin-bottom:0;}.product-detail .bigtext{font-size:16px;line-height:25px;margin-bottom:30px;}.product-detail h2{margin:20px 0 15px;font-size:22px;}.product-detail h2.first{margin-top:0;}.product-detail p{margin:15px 0;}.product-detail h3{margin:15px 0;}.product-detail .box{float:right;margin:5px 30px 20px 40px;}.product-detail .bigbig{font-size:16px;}.product-detail .hilight{background-color:#ff9;}.product-detail h3{font-size:15px;font-family:'arial',sans-serif;color:#000!important;}.product-detail .big{font-size:15px;font-family:'arial',sans-serif;color:#000!important;}.product-detail .tick{padding-left:40px;background:url(../images/tick.gif.html) 0 50% no-repeat;}.product-detail .buttons-wrap{text-align:center;}.product-detail .buttons{overflow:hidden;padding-top:5px;margin:auto;width:280px;}.product-detail .edition-buttons{overflow:hidden;padding-top:5px;margin:auto;width:280px;}.product-detail .edition-buttons{width:350px;}.product-detail .big-download{margin:0 auto 15px auto;}.product-detail .stdl7-download{margin:0 auto 15px auto;}.product-detail .long blockquote{font-size:12px;}.product-detail .comparison-pair{border-spacing:0;border:1px solid #000;border-collapse:collapse;}.product-detail .comparison-pair td{border:1px solid #000;padding:4px 6px;width:50%;}.product-detail .comparison-pair th{border:1px solid #000;padding:4px 6px;width:50%;}.product-detail .comparison-pair th{background:#332618;color:#fff;}.releases h3{margin-top:25px;}.releases hr{margin:15px 0;}.changes-since{font-style:italic;}.features-page h3{font-size:16px;color:#456b12!important;padding-top:10px;margin-top:35px;border-top:1px solid #d0efa6;}.features-page img{margin:12px auto 0;}.features-page .image{text-align:center;}.order-content h1{font-size:36px;font-weight:normal;letter-spacing:-1px;margin:15px 0 0;}.order-content .section-info{margin:0 0 30px;font-size:14px;}.order-content .licenses-info{width:100%;overflow:hidden;padding:20px 0 0;margin:25px 0;border-top:1px dotted #a8906b;}.order-content .licenses-info .block{float:left;width:290px;margin-right:30px;}.order-content .licenses-info .last{margin-right:0;}.order-content .licenses-info h3{margin-bottom:5px;font-size:14px;}.order-content .panel{background:#fff;border:2px solid #ecf7fe;}.order-content table{width:100%;border-spacing:0;border:1px solid #9bc8e8;border-collapse:collapse;margin:0;}.order-content table td{border:1px solid #9bc8e8;}.order-content table th{border:1px solid #9bc8e8;}.order-content table th{background:#ecf7fe;padding:4px 6px;}.order-content table td{padding:12px 8px;}.order-content table .price{width:80px;text-align:right;font-weight:bold;}.order-content table .addon{width:240px;}.order-content table .buy{width:70px;padding:0;}.order-content .componentsource .block{margin-top:5px;}.support-content{overflow:hidden;width:100%;}.support-content h1{margin:15px 0;font-size:36px;}.support-content .contact-form-ct{position:relative;width:452px;left:50%;margin-top:30px;margin-left:-230px;background:#fff;border:2px solid #ecdfb9;}.support-content .contact-form-wrap{padding:20px 30px;border:1px solid #ac995e;}.support-content p{margin:20px 0;}.support-content hr{margin:30px 0;}.support-content .note{font-size:12px;}.support-content .left{width:596px;}.support-content .right{width:274px;padding-top:10px;}.support-content .reference a{padding-left:30px;margin:0;padding:6px 0 6px 30px;background:0 50% no-repeat;}.support-content .guide a{padding-left:30px;margin:0;padding:6px 0 6px 30px;background:0 50% no-repeat;}.support-content .documentation a{padding-left:30px;margin:0;padding:6px 0 6px 30px;background:0 50% no-repeat;}.support-content .stackoverflow a{padding-left:30px;margin:0;padding:6px 0 6px 30px;background:0 50% no-repeat;}.support-content .reference a{background-image:url(../images/icons/book.gif);}.support-content .guide a{background-image:url(../images/icons/info.gif);}.support-content .documentation a{background-image:url(../images/icons/documentation.gif);}.support-content .stackoverflow a{background-image:url(../images/icons/stackoverflow.gif);}.uninstall-content .contact-form-ct{width:460px!important;}.uninstall-content .emailsafe{margin-top:12px;}.download-content{padding-bottom:60px;}.download-content h2{margin:15px 0;font-size:36px;font-weight:normal;}.download-content .section-info{font-size:16px;margin:30px 0;}.download-content p{margin:15px 0;}.download-content hr{margin:60px 0;}.download-content .newsletter-ct{background:#fff;border:2px solid #ecdfb9;}.download-content .newsletter{padding:15px 0 20px 35px;border:1px solid #ac995e;height:80px;overflow:hidden;}.download-content .newsletter h3{margin-bottom:15px;font-size:20px;}.download-content .newsletter .field{float:left;margin-right:30px;}.download-content .newsletter label{display:block;}.download-content .newsletter .email{font-size:13px;padding:4px 5px;}.download-content .newsletter .name{font-size:13px;padding:4px 5px;}.download-content .newsletter .email{padding-left:24px;width:166px;}.download-content .newsletter .name{background-image:none;width:186px;}.download-content .newsletter .subscribe{margin-top:10px;}.download-content .newsletter .subscribing{margin-top:10px;}.download-content .newsletter .subscribing{float:left;}.about-content h1{font-size:40px;font-weight:normal;letter-spacing:-1px;margin:15px 0 10px;}.about-content h2{font-size:34px;font-weight:normal;letter-spacing:-1px;margin:40px 0 15px;}.about-content h3{font-size:28px;font-weight:normal;letter-spacing:-1px;margin:60px 0 15px;}.about-content .team{margin-top:40px;}.about-content .customers{margin-top:40px;}.about-content .csauthor{margin-top:40px;}.about-content .placing{padding-left:58px;}.about-content .about-ct{background:url(../images/blv-users.gif) no-repeat 98% 50%;}.about-content .dextronet{background:url(../images/icons/dextronet-bird-gray.jpg) no-repeat 0 0;}.about-content .dextronet h2{padding-top:5px;}.about-content .cowl{background:url(../images/icons/component-owl-gray.jpg) no-repeat 0 0;}.about-content .cowl h2{padding-top:10px;margin-top:45px;}.about-content .quote{font-family:georgia,serif;font-size:21px;margin:22px 0 28px;}.about-content .quote b{font-weight:normal;font-size:120px;display:block;float:left;line-height:95px;color:#d3cccc;margin:0 7px 0 0;}.about-content p{margin:15px 0 15px 0;width:630px;text-align:justify;}.about-content .with-image{overflow:auto;}.about-content .with-image img{float:left;display:block;margin:0 10px 0 0;}.about-content .libor{overflow:hidden;}.about-content .cs{overflow:hidden;}.about-content .hq{overflow:hidden;}.about-content .libor img{float:left;margin:0 15px 5px 0;}.about-content .cs img{float:left;margin:0 15px 5px 0;}.about-content .hq img{float:left;margin:0 15px 5px 0;}.about-content .libor{margin:30px 0 30px 60px;width:500px;}.about-content .libor em{display:block;padding-top:14px;}.about-content .libor img{margin-right:10px;}.about-content .hq{margin:60px 0 0 -7px;padding:7px 0 7px 7px;width:410px;text-align:left;}.about-content .hq img{-moz-box-shadow:0 0 7px #aaa;-webkit-box-shadow:0 0 7px #aaa;box-shadow:0 0 7px #aaa;border:2px solid #fff;}.about-content .logo-inset{vertical-align:middle;margin:0 3px;margin-top:-3px;}.about-content .testimonial-wide-ct{width:630px;margin:50px 0;border:2px solid #ffeecf;border-left:none;border-right:none;}.about-content .testimonial-wide{margin:0;}.about-content .contact-info-ct{background:url(../images/europe.jpg) right 150px no-repeat;width:650px;padding-bottom:20px;}.about-content .contact{border-left:2px solid #a8906b;padding:5px 0 5px 10px;line-height:20px;background:#fff3de;}#cscontact-ct{width:630px;margin:30px 0 0;}#cscontact{border:1px solid #c1c1c1;background:#fafafa;padding:10px;font-size:12px;border-top:none;clear:both;}#cscontact table{width:100%;}#cscontact tr{vertical-align:top;}#cscontact .address{width:33%;}#cscontact .hours{width:33%;}#cscontact-nav{border-bottom:1px solid #c1c1c1;padding-bottom:30px;}#cscontact-nav li{display:inline;}#cscontact-nav a{float:left;padding:8px 10px 6px;text-transform:uppercase;text-decoration:none;font-weight:bold;font-size:12px;color:#545454;line-height:15px;}#cscontact-nav .current{border:1px solid #c1c1c1;border-bottom:1px solid #fafafa;background:#fafafa;color:#000;}.subscribe-content{padding:0 5px;overflow:hidden;}.subscribe-content p{font-size:13px;}.subscribe-content h2{margin-bottom:0!important;}.subscribe-content fieldset{padding:5px 10px 10px;margin-top:5px;}.subscribe-content legend{font-weight:bold;text-transform:uppercase;padding:0 5px;}.subscribe-content .newsletter-box{padding:10px 0 15px 15px;margin-top:10px;background:#fff;border:1px solid #e7c483;}.subscribe-content .newsletter-box .field{float:left;margin-right:20px;}.subscribe-content .newsletter-box label{display:block;}.subscribe-content .newsletter-box .email{font-size:13px;padding:4px 5px;}.subscribe-content .newsletter-box .name{font-size:13px;padding:4px 5px;}.subscribe-content .newsletter-box .email{padding-left:24px;width:136px;}.subscribe-content .newsletter-box .name{background-image:none;width:156px;}.subscribe-content .newsletter-box .subscribe{margin-top:10px;}.subscribe-content .newsletter-box .subscribing{float:left;margin-top:15px;}.subscribe-content .trouble{margin-top:10px;}.sitemap-content h1{margin:15px 0;}.sitemap-content h2{margin:25px 0 5px;}.sitemap-content .top{margin:0 0 30px 15px;}.sitemap-content ul ul{margin-top:3px;}.legal-content{font-size:14px;}.legal-content h1{margin:15px 0;}.legal-content h2{margin:15px 0 10px;}.legal-content p{padding:0 0 20px;}.legal-content ul.common{padding-bottom:20px;}.service-content h1{margin:15px 0;}.service-content h2{margin:15px 0 10px;}.service-content h3{margin:0 0 5px;}.service-content p{padding:0 0 20px;}.service-content table{border-spacing:0;border:none;margin-top:20px;}.service-content table th{text-align:left;}.service-content table th{padding:5px 50px 5px 0;border-bottom:1px solid #eadbc4;}.service-content table td{padding:5px 50px 5px 0;border-bottom:1px solid #eadbc4;}.service-content table .country{font-weight:bold;}.service-content table .flag{padding-right:5px;}.service-content .blocks{overflow:hidden;width:100%;margin:40px 0 0;}.service-content .block{width:250px;margin-right:40px;float:left;}.comics-wrap{text-align:center;}.comics{display:inline-block;position:relative;margin:0 auto;}.comicshd{text-indent:-9999em;background:url(../images/web-comics.gif) 50% 0 no-repeat;margin:28px 0 10px;height:27px;}.comics-bubble-ct{height:66px;background:url(../images/owl-small.gif) 0 0 no-repeat;padding:24px 0 0 52px;margin:10px 0 0 30px;}.comics-bubble{line-height:32px;height:32px;font-size:16px;padding-left:30px;background:url(../images/bubble-small.gif) 0 0 no-repeat;width:745px;white-space:nowrap;}.comics-bubble p{background:#e0f6ff url(../images/bubble-small.gif) 100% -32px no-repeat;padding-right:10px;}.comics-navigation{margin:0 auto;border:2px solid #1a1a1a;border-radius:14px;width:400px;overflow:hidden;padding:5px;margin-bottom:28px;}.comics-day{float:left;width:324px;text-align:center;font-size:20px;}.comics-np{padding-left:38px;}.comics-nn{padding-right:38px;}.comics-next,.comics-prev{display:block;width:38px;height:25px;text-indent:-9999em;}.comics-next{background:url(../images/comics-next.gif) 0 0 no-repeat;float:right;}.comics-prev{background:url(../images/comics-prev.gif) 0 0 no-repeat;float:left;}.comics-next:hover{background-position:0 -25px;}.comics-prev:hover{background-position:0 -25px;}.comics-social-ct{text-align:center;margin:28px 0;}.comics-social{border:2px solid #1a1a1a;border-radius:14px;padding:8px;overflow:hidden;display:inline-block;text-align:left;}.comics-rss{margin:28px 0;text-align:center;}.comics-rss a{padding:6px 0 10px 40px;background:url(../images/RSS_32.png) 0 50% no-repeat;font-weight:bold;}.comics-info{margin:28px auto 20px;width:700px;font-style:italic;font-size:16px;text-align:center;}.owl-flag{position:absolute;top:0;left:50%;margin-left:485px;_display:none;}.d-iframe{background:none;text-align:left;}.d-page{position:relative;min-height:100%;}.d-placing{margin:0 auto;text-align:left;width:930px;}.d-header{height:47px;}.d-logo{float:right;margin-top:10px;}.logoimg{margin-right:5px;display:inline-block;}.d-menu{float:left;}.d-menu li{float:left;position:relative;padding-right:35px;}.d-menu .menu-item{display:block;position:relative;z-index:99;padding:12px 0 1px;color:#fff;text-decoration:none;}.d-menu .active .menu-item{border-bottom:1px solid #bb983b;padding-bottom:2px;}.d-menu .menu-item:hover{border-bottom:2px solid #bb983b;padding-bottom:1px;color:#fff;}.d-menu .featured{color:#fecb33!important;}.d-menu .dropdown{position:absolute;top:30px;left:-20px;width:250px;}.d-menu .dropdown .outer{position:relative;z-index:97;padding-left:6px;background:url(../images/dropdown-o.png) 0 100% no-repeat;}.d-menu .dropdown .shadowbox{position:relative;z-index:98;padding:0 8px 8px 0;background:url(../images/dropdown-s.png) 100% 100% no-repeat;}.d-menu .dropdown .inner{position:relative;overflow:auto;height:100%;z-index:99;padding:12px 14px;background:#362919;border:1px solid #1c1410;border-top:none;}.d-menu .dropdown a{color:#fff;}.d-menu .dropdown a:hover{color:#fff;}.dropdown-submenu .inner{padding:10px 0 0!important;}.dropdown-submenu a{padding:10px 14px;display:block;text-decoration:none;}.dropdown-submenu a:hover{background-color:#bb983b;}.dropdown-submenu li{padding:0;margin:0;}.dropdown-submenu img{display:block;float:left;margin:4px 10px 0 0;}.dropdown .featured-item{font-size:16px;font-weight:bold;}.dropdown .subline{display:block;font-size:12px;color:#fff;padding-top:3px;}.dropdown .dropdown-category{background-color:#876234;color:#fff;font-weight:bold;padding:5px 8px;}.d-content-wrap{padding-bottom:400px;}.d-footer{position:absolute;bottom:0;right:0;width:100%;padding-top:25px;color:#fff;background:#3a2c18 url(../images/footer-bg.png) repeat-x;font-size:12px;}.d-footer a{color:#fff;}.d-footer a:hover{color:#f5b458;}.d-footer .d-placing{overflow:hidden;}.d-footer .left{width:540px;}.d-footer .right{width:325px;}.d-footer hr{background-color:#fff;margin-top:10px;}.d-footer .copy{font-size:11px;padding:0 0 13px 140px;background:url(../images/dextronet.gif) 0 12px no-repeat;}.d-footer .social{padding:10px 0 4px;}.d-footer .social span{padding:0 3px;}div.testimonial-intext{text-align:center;}div.testimonial-intext .testimonial-wrap{width:500px;margin:30px auto 0;padding-top:10px;background:url(../images/testimonial-intext.gif) 0 0 no-repeat;}div.testimonial-intext blockquote{width:475px;margin:0 auto;padding:0 10px 4px 15px;text-align:left;text-indent:-5px;font-size:13px;font-family:georgia,serif;background:#f7eee8;}div.testimonial-intext strong{width:150px;display:block;font-weight:normal;margin:0 auto;text-align:left;padding:20px 0 0 350px;color:#825900;font-size:11px;background:url(../images/testimonial-intext.gif) -500px 0 no-repeat;}div.testimonial-intext .featured blockquote{font-size:16px;}div.testimonial-intext .featured strong{font-size:12px;}div.testimonial-intext{margin:20px 0 0;}div.testimonial-intext .testimonial-wrap{margin-top:0;}div.testimonial-intext strong{margin-bottom:6px;}.latest-posts{height:255px;overflow:hidden;}.latest-posts .latest_from_blog a{display:block;width:279px;height:18px;background:url(../images/heading-latest_from_blog.gif) no-repeat;}.latest-posts h4{margin:13px 0 0;padding:0 0 3px;font-size:13px;color:#ffd191;}.latest-posts h4 a{color:#ffd191;}.latest-posts h4 a:hover{color:#fcead0;}.latest-posts .post-info{font-size:11px;color:#a38952;text-transform:uppercase;font-weight:bold;}.other-posts{text-align:right;}.other-posts a{color:#fcead0;}.other-posts a:hover{color:#f5b458;}.section-heading{margin:15px 0;font-size:36px;}.resources-content{padding-bottom:30px;}.resources-content h1{margin-top:30px;}.resources-content h2{margin:10px 0 0!important;font-weight:normal;}.resources-content h1{font-size:23px;}.resources-content h2{font-size:17px;}.resources-content .post-info{margin-bottom:0;color:#a38952;font-size:11px;}.resources-content .small-button-ct{overflow:hidden;width:100%;margin:13px 0 0;}.resources-content .small-button{display:block;float:left;}.resources-content .featured-articles h2{font-weight:bold;}.article-content{overflow:hidden;height:100%;padding-bottom:30px;}.article-content .left{width:650px;}.article-content .right{width:228px;margin-top:15px;}.article-content .title{margin-top:25px;font-size:23px;}.article-content .sidebar{padding:15px 0 0;background:url(../images/lower-side-bg.jpg.html) 0 0 no-repeat;}.article-content .sidebar h4{font-size:18px;color:#4783bf;margin:0 0 10px;}.article-content .sidebar .text{margin:10px 0;}.article-content .sidebar .text p{margin:0 0 8px;}.article-content .sidebar .text h1{margin:8px 0 3px;font-size:12px;font-family:'trebuchet ms',sans-serif;}.article-content .sidebar .text h2{margin:8px 0 3px;font-size:12px;font-family:'trebuchet ms',sans-serif;}.article-content .sidebar .text h3{margin:8px 0 3px;font-size:12px;font-family:'trebuchet ms',sans-serif;}.article-content .sidebar .text h4{margin:8px 0 3px;font-size:12px;font-family:'trebuchet ms',sans-serif;}.article-content .sidebar .buttonz{text-align:center;margin-top:10px;}.article-content .sidebar .buttonz a{margin:0 auto 10px;float:none;}.article-content .sidebar .download{text-align:center;font-size:14px;font-weight:bold;margin-top:10px;}.article-content .sidebar .download a{background:url(../images/icons/arrow-270-medium.gif.html) 0 2px no-repeat;padding-left:16px;}.article-content .content{margin-top:20px;font-size:14px;color:#222;}.article-content .content p{margin:0 0 20px;}.article-content .content h1{color:#000;font-family:'trebuchet ms',sans-serif;padding:0 0 5px;margin-top:30px;}.article-content .content h2{color:#000;font-family:'trebuchet ms',sans-serif;padding:0 0 5px;margin-top:30px;}.article-content .content h3{color:#000;font-family:'trebuchet ms',sans-serif;padding:0 0 5px;margin-top:30px;}.article-content .content h1{font-size:18px;}.article-content .content h2{font-size:16px;margin-top:20px;}.article-content .content h3{font-size:14px;margin-top:20px;}.dextronet-feeds{margin:15px 0 0;padding-bottom:12px;border-bottom:1px dotted #a8906b;}.dextronet-feeds .links{margin:0!important;list-style:none;padding:0!important;}.dextronet-feeds .links li{margin:0!important;}.dextronet-feeds .links a{padding:7px 0 10px 37px;display:block;}.dextronet-feeds .links .rss{background:url(../images/icons/rss-32.png) 0 50% no-repeat;}.dextronet-feeds .links .twitter{background:url(../images/icons/twitter-32.png) 0 50% no-repeat;}.dextronet-feeds .links .facebook{background:url(../images/icons/facebook-32.png) 0 50% no-repeat;}.news .links{width:100%;overflow:hidden;margin-bottom:10px;}.news .links li{float:left;margin-right:10px;}.news .links a{display:block;padding:6px 8px 6px 26px;text-decoration:none;background:#49371e 7px 50% no-repeat;}.news .links .rss{background-image:url(../images/rss.gif);}.news .links .twitter{background-image:url(../images/twitter.gif);}.news h4{color:#e4b16a;font-size:13px;}.news h4 a{color:#e4b16a;font-size:13px;}.news h4 a:hover{color:#fcead0;}.news .news-item{width:100%;overflow:hidden;margin-bottom:3px;padding-bottom:3px;border-bottom:1px dotted #644c2a;}.news .last-item{border-bottom:none;}.news .date{float:left;width:20px;text-align:right;padding:3px 6px;color:#a38952;}.news .date span{display:block;}.news .message{padding:3px 0;color:#fcead0;}.comics-blv-wrap{text-align:center;}.comics-blv{margin:60px auto 30px;padding:7px 0;border:1px solid #ecdfb9;border-left:none;border-right:none;width:100%;overflow:hidden;font-size:20px;background:#fffcf3;font-family:"trebuchet ms",arial,sans-serif;width:800px;text-align:left;}.comics-blv .ss{float:left;margin:0 8px 0 8px;border:none;}.comics-blv .inside{padding-top:8px;}.comics-blv .text{padding-bottom:8px;}.comparison{border-collapse:collapse;border-spacing:0;font-size:small;text-align:center;width:100%;margin-bottom:50px;}.comparison td{padding:4px 6px;border:1px solid #000;}.comparison th{padding:4px 6px;border:1px solid #000;}.comparison-blank{border-top:none!important;border-left:none!important;text-align:left;padding-left:0!important;}.comparison-blank h2{margin:0;padding:0;}.comparison-line-even{background-color:#f0f0f0;text-align:left;}.comparison-line-odd{text-align:left;}.comparison-yes{background-color:#cfc;color:#008000;text-align:center;}.comparison-no{background-color:#fcc;color:#800000;text-align:center;}.comparison-other{width:90px;background:#332618;color:#fff;}h1,h2,h3,.heading{font-family:'arial',sans-serif;font-weight:bold;}.section-info{font-weight:bold;font-family:'arial',sans-serif;}.sitemap-content h2{font-size:20px;}.pr-content h2{font-size:22px;}.static-content h2{font-size:23px;}.static-content h3{font-size:18px;}.subscribe-content h2{font-size:34px;} \ No newline at end of file