Friday, October 30, 2009

moving to wordpress

Moving to new location on wordpress
. They seems to provide much better functionality for editing and statistics

Sunday, October 4, 2009

convert jscript to html

Very simple yet good jscript to html code formatting tool

disable venkman output to console

Venkman produces a lot of output to console which makes it hard to see the output from your extensions. To disable output from venkman, you can update venkman_utils.js in venkman.jar by replacing dd function with an empty function dd = function (){};

debug output from firefox extension

Start firefox with -console flag

Call dumpln function from your code (copy of code from venkman)

var dumpln;

if (typeof document == "undefined") /* in xpcshell */
{
dumpln = print;
}
else
{
if (typeof dump == "function") {
dumpln = function (str) {dump (str + "\n");}
} else if (jsenv.HAS_RHINO) {
dumpln = function (str) {
var out = java.lang.System.out;
out.println(str); out.flush();
}
}
else {
dumpln = function () {} /* no suitable function */
}
}

Tuesday, September 8, 2009

Firefox vs Chrome #2

Made another attempt to use Chrome 2.x and 3.x. Layout issues seems to be fixed. However there are still problems like
- Navigation back from 404 does not always work (never hit such problems in FF)
- Adding RSS to google reader is not supported

Back to FF.

Thursday, August 13, 2009

Windows7. Disable hiding windows during Alt-Tab

Win7 alt-tab hides windows after few seconds timeout. To disable this behavior uncheck “Enable Aero Peek” in the performance dialog.

Saturday, May 2, 2009

FireFox vs Chrome

After trying Chrome for a week I got back to FireFox. Main problems with Chrome are
- Increased battery usage. Battery time decreases ~30% when Chrome is running. Does not happen for FF on the same sites
- Chrome renders some sites (like google reader) differently than IE / FF
- Address bar shows prompt for visited sites instead of typed sides like FF.
- In the default configuration does not allow to subscribe to RSS feeds. Shows XML dump in a window

Saturday, February 28, 2009

myDock 0.9.1051 is released

New version is available on alexezh.googlepages.com. Update includes minor fixes.

Sunday, February 22, 2009

Subsclass UserControl in SilverLight

By default Expression creates custom controls derived from UserControls

partial class MyControl : UserControl
{
}

In order to derive from a different class you will have to change code in several places

Define new base class with required virtual methods. Do not make class abstract

public class MyUserControl : UserControl
{
public virtual void Foo() {;}
}

Change MyControl to use MyUserControl

partial class MyControl : UserControl
{
public override void Foo() {;}
}

Change XAML for MyControl to use

<MyUserControl x:Class="MyControl">
</MyUserControl>

To make Blend happy, add following lines to AssemblyInfo.cs

// Make blend happy
using System.Windows.Markup;
[assembly: XmlnsDefinition("http://schemas.microsoft.com/client/2007", "YourNamespace")]

Sunday, February 15, 2009

Better version of VS windows hiding tool

Remembers which windows were shown the last time. Source is available at http://alexezh.googlepages.com/MyMacros.txt

Sunday, January 25, 2009

Optimize VS workspace by hiding tool windows

Simple macro toggles all tool windows

Dim showToolWindows As Integer

Public Sub MyToggleToolWindows()

If (showToolWindows = 1) Then

showToolWindows = 0

Else

showToolWindows = 1

End If

For Each window As Window In DTE.Windows

' Check that this is a tool window and not a document window.

If (window.Document Is Nothing) Then

' hide window.

Try

window.Visible = showToolWindows

Catch exception As Exception

End Try

End If

Next

End Sub

Sunday, January 11, 2009

SL unmanaged helpers on codeplex

I posted updated version of unmanaged helpers for accessing SL object model. With helpers you can write code in C++ which matches C# or jscript.

For example here is how to add an event handler to an object

vObj.addEventListener(L"MouseEnter",
CXcpDelegateT(CObject)::create(this, &CObject::OnMouseEnter));

Source code is available on http://www.codeplex.com/mydock

Back to basics

I spent last few month designing new UI for myDock. Test version of UI did not work very well, so I am returning back to original code.

On the good side, I mastered a process of hosting SL2.0 including managed code from unmanaged applications. See details on http://www.codeplex.com/mydock

1051 version will be available in few days

Tuesday, September 23, 2008

Saturday, September 20, 2008

Change MSI to run under custom actions under user account

MSI package generated by VS2008 will run custom actions under SYSTEM account. This "feature" was implemented to work around Vista's UAC.

There is no way to change this behavior from VS2008, but you can adjust MSI package using ORCA tool (available in SDK).

Start ORCA tool, open MSI package, navigate to custom actions. Select action which you would like to run under user account and subtract 0x800 from Type. In my case, value generated by VS2008 is 3090, new value should be 1042.

Save MSI back. Done

Saturday, September 13, 2008

Problem with 0.9.1031 and Silverlight1.0

0.9.1031 crashes when running with SL1.0. SL2.0 Beta2 works fine. If you run into this problem, you can either install SL1.0 or use MyDock0.9.1027

Tuesday, September 9, 2008

myDock 0.9.1031

New version of myDock is available on http://alexezh.googlepages.com

Monday, September 1, 2008

Sunday, August 31, 2008

pathgeometry vs mini language

http://www.farseergames.com/blog/post/Workaround-for-Accessing-PathGeometry-Data-in-Code.aspx

Sunday, August 24, 2008

using selectSingleNode for XAML

When using selectSingleNode to search XAML, it is required to set SelectionNamespace property with fake prefix. Here is an example

spDoc2->setProperty(CComBSTR(L"SelectionLanguage"), CComVariant(L"XPath"));
spDoc2->setProperty(CComBSTR(L"SelectionNamespaces"),
CComVariant("xmlns:d=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\""));

m_spDoc->selectSingleNode(CComBSTR(L"./d:Canvas"), &m_spRoot);