Reopen closed tabs on ExtJS TabPanel and autoDestroy

by 5. January 2010 00:58

Basically when you close a tab TabPanel completely destroys it by default (and you can’t reopen closed tab).

To override this behavior add autoDestroy: false to your TabPanel settings object.

But when you try to close a tab you will see  something like this:

autoDestroy_before

That is, tab header is disappeared but the body still visible.

The problem is that you should process remove operation by yourself. Especially if you still want to hide tab body after closing the tab. To do this add two event handlers:

listeners: { 
            remove: function(tp, c) { 
                c.hide(); 
            }, 
            add: function(tp, c) { 
                c.show(); 
            } 
        }

autoDestroy_after

Tags:

IT | Software

AG_E_UNKNOWN_ERROR (code 4004) while referencing custom control in Silverlight

by 28. December 2009 16:20

AG_E_UNKNOWN_ERROR

Check all namespace declarations in your Generic.xaml.  If you find something like this:

xmlns:local="clr-namespace:Your_namespace" you should add assembly reference as well:
xmlns:local="clr-namespace:Your_namespace;assembly=Your_assembly"

AG_E_PARSER_BAD_TYPE

Maybe you forgot add reference to assembly(and all its references) with custom control?

Error: Unhandled Error in Silverlight Application Code: 2103 Category: InitializeError Message: Invalid or malformed application: Check manifest

Right click on project, go to properties, and select the valid name under "Startup object"

Tags: ,

IT | Software

Thoughts on MongoDB indexes and auto increment

by 8. December 2009 18:57

If you come(as i do) from SQL world the first thing about indexes you may ask about is auto incremented indexes. Personally i used it as an unique id in relationships such as author->article. However in MongoDB we can use extremely useful built-in, auto generated, unique ids (such an id always appended to the document with key “_id”).

In SQL word id is usually an 4 byte integer, but in Mongo it’s 12 bytes long.

According to the documentation(http://www.mongodb.org/display/DOCS/Object+IDs) ObjectId generator uses increment.

Anyway, some very interesting links:

http://jira.mongodb.org/browse/SERVER-195

Very detailed discussion on relations for SQL guys

Note: in mongodb-csharp ObjectID type is called Oid.

UPDATE

Although ObjectIds are unique you can’t (at least not always) use it for (date) sorting. If you insert records from many machines (or processes) MongoDb doesn’t guarantee that they will constantly grow since internally it uses memcmp function to compare _ids

When the _ids compared memcmp firstly compares time when they created. Usually ObjectID generator have 1 second resolution. If time is the same then machine ids compared. In mongodb-csharp driver for example, machine id is the first 3 bytes of HostName md5 hash. As you can see the result of comparison even at this point is unpredictable.

Tags:

IT

How to install M-Audio delta drivers on Server 2008 R2

by 4. December 2009 17:49

When i tried to install latest Windows 7 drivers on my PC(currently running on MS Server 2008) I saw the following message “The operating system is not supported by …”. How to trick the installer? Well, solution comes from this post. Simply we need to open unpacked installer in Orca – a tool for MSI installers editing and delete some version checks.

Tags: ,

IT | Life

3 wtf Internet Explorer Javascript Errors

by 26. November 2009 23:43

 

  • Invalid property value. bodyStyle: 'background-color: <-space_here#dfe8f7;'. Without space it works perfectly. You can find bodyStyle setting in ExtJs control constructors.
  • Unkown runtime error Ext.DomHelper.overwrite("_id_here_", '       ');. You cannot set innerHTML of table in Explorer directly. Use deleteRow/appendRow methods.
  • Invalid source HTML for this operation (also known as Unknown runtime error) $('span').innerHTML += <div>...</div>''. You cannot insert a block element inside a non-block element

For me, these errors became a revelation =). Mainly because of the fantastically useful error messages.

Tags: , ,

IT | Software

Latex and Cyrrilic

by 17. November 2009 21:51

documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}

\title{Cartesian closed categories and the price of eggs}
\author{Jane Doe}
\date{September 1994}
\begin{document}
\maketitle
Привет Мир!
\end{document}

 

Also i have cm-super installed together with all other available in Ubuntu Cyrillic fonts.

And note utf-8 mule mode in Emacs.

And very nice pages about using Latex with Emacs(in russian) 

Tags: ,

IT | Software

How to make F# compilation command shorter

by 31. October 2009 12:52

Here the script:

===========================================

#!/bin/bash

NEWARGS=""

while [ $# -gt 0 ]
do
NEWARGS="$NEWARGS $1"
shift
done

mono /usr/bin/fsharp/bin/fsc.exe $NEWARGS

=============================================

Here we just assembly command line back to one string

 

it assumses that you have fsharp installed in /usr/bin/fsharp.

Create a file named fsc in /usr/bin (for example). Make in executable chmod +x /path_to_fsc. And now you can call just fsc <your_args> instead of mono fsc.exe <your_args> (i assume that you add /usr/bin/fsharp/bin to $PATH)

 

With help of this toy script i've compiled http://www.piotrzurek.net/2009/07/11/worlds-first-f-web-browser-runs-on-linux-using-gtk-and-webkit/. And the browser works great!.

Tags: , ,

IT | Software

Clear Design

by 5. June 2009 11:33

C#

public static void qwe(dynamic arg)
{
    Console.Write(arg.Last);
}

 

.NET Reflector

public static void qwe([Dynamic] object arg)
{
if (<qwe>o__SiteContainerd.<>p__Sitee == null)
    {
<qwe>o__SiteContainerd.<>p__Sitee = CallSite<Action<CallSite, Type, object>>.Create(new CSharpInvokeMemberBinder(CSharpCallFlags.None, "Write", typeof(Program), null, new CSharpArgumentInfo[] { new CSharpArgumentInfo(CSharpArgumentInfoFlags.IsStaticType | CSharpArgumentInfoFlags.UseCompileTimeType, null), new CSharpArgumentInfo(CSharpArgumentInfoFlags.None, null) }));
    }
if (<qwe>o__SiteContainerd.<>p__Sitef == null)
    {
<qwe>o__SiteContainerd.<>p__Sitef = CallSite<Func<CallSite, object, object>>.Create(new CSharpGetMemberBinder("Last", typeof(Program), new CSharpArgumentInfo[] { new CSharpArgumentInfo(CSharpArgumentInfoFlags.None, null) }));
    }
<qwe>o__SiteContainerd.<>p__Sitee.Target(<qwe>o__SiteContainerd.<>p__Sitee, typeof(Console), <qwe>o__SiteContainerd.<>p__Sitef.Target(<qwe>o__SiteContainerd.<>p__Sitef, arg));
}

Tags: ,

IT | Software

Bug in Visual Studio

by 30. May 2009 00:05

Capture

Capture1

Capture6

This dialogs were shown at #VS10 startup. Window background became totally black. :-\

Tags:

IT

A few links on MS SQL 2005 deadlocks

by 3. May 2009 00:16

Tags: ,

IT

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name: Ilya Khaprov (rus Илья Хапров)

Age: 23

Sex: Male

I'm a postgraduate (an "aspirant" in Russian terminology see Wikipedia for details) at Bryansk State Technical University.

I'm working with .Net since 2004. Also i like lisp.

My research interests lie in the area of Intelligence. In particular i am studing personal information filters, ontology learning, and some other stuff.

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in  anyway.

© Copyright 2009

Recent Visitors