Question Marks When Writting in Cyrillic Language

Posted on March 27th, 2008 in RU | No Comments »

Переименовать в базе данных collation с “latin1_swedish_ci” на “utf8_unicode_ci” не помогло, так что открутил назад.

А вот если закомментировать в файле wp-config.php две строчки, превратив

define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

в

// define('DB_CHARSET', 'utf8');
// define('DB_COLLATE', '');

то все работает нормально.

P.S. Как выяснилось, в процессе перестановки collate туда-сюда, в части старых постов почему-то заглючили отдельные символы (тире и кавычки, хотя и не везде). Пришлось подправить вручную.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Reddit
  • Scoopeo

The rule of thumb

Posted on January 3rd, 2008 in EN | 1 Comment »

If you may configure something using Spring — never ever try to configure the same thing with Hibernate.

Sorry, Gavin.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Reddit
  • Scoopeo

Is the modern software getting more and more humanlike?

Posted on December 20th, 2007 in EN | 2 Comments »

The colleague of mine just got this from his IntelliJ IDEA 7.0.2:

idea_cannot_message.gif

At least it apologizes…

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Reddit
  • Scoopeo

Good old IE bug?

Posted on November 12th, 2007 in EN | 4 Comments »

May someone explain me why the following HTML code is causing IE6 SP2 crash?

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<table>
    <tr>
        <td>
            <table style="table-layout:fixed">
                <col width="20"/>
            </table>
        </td>
    </tr>
</table>
</body>
</html>

Bonus: CodeColorizer

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Reddit
  • Scoopeo

Playing around with IntelliJ IDEA 7

Posted on October 30th, 2007 in EN | 1 Comment »

There is something charming in those small things IDE developers make for us.

idea7-lookup.png

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Reddit
  • Scoopeo

Mainsoft makes one more step forward to developing Grasshopper community

Posted on July 11th, 2007 in EN | 2 Comments »

This week Mainsoft introduced a new source of information for all Grasshopper users: «The Grasshoppers» blog.

Although currently there is only one person actually blogging there, this is a promising step forward to developing a rich community of both Grasshopper users and developers.

By the way, it worth to take a look at full Grasshopper bloggers list.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Reddit
  • Scoopeo

Mono and CafePress

Posted on June 26th, 2007 in EN | 5 Comments »

Since CafePress is still lacking any kind of Mono project stuff, I decided to make one of my own.

mono_cup.jpg

There is nothing better than starting you morning with a good cup of Mono…

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Reddit
  • Scoopeo

Source code inspection framework wanted

Posted on June 11th, 2007 in EN | No Comments »

Another example of problem similar to hashCode() mutability is an option for broken «consistent with equals» contract imposed by implementation of java.util.TreeSet while implementing java.util.Comparator.

Actually, both of these cases (as well as a numerous others) are just an evidence of much wider problem – the requirement to follow some kind of contract various infrastructure implementations rely on and lack of ability to validate/impose such a constraints using existing IDEs and tools. The basic of this is the fact no IDE vendor can track an implementations of an infrastructure libraries existing (the best support feasible to achieve is Microsoft-style solution: an inspection for .Net framework libraries embedded into Visual Studio) and thus creating inspections “by reaction” will always loose the battle.

The best way to avoid the gap between software component and the inspections is to eliminate the “broken phone” between the software developer, the documentation developer and the inspections developer. This presents an «inspection by creator» paradigm – inspections are developed in parallel with a software component (and in ideal case by the the same software developer), embedded within the component, and shipped with it.

Summarizing the basic requirements for such a framework:

  • Development simplicity: the inspection language should provide a way to create an inspections in declarative manner, rather than by reflection-style coding.
  • Lexical compliance: the inspections declaration language should be close enough to the syntax of programming language constructs inspections apply to (thus, there should coexist inspections framework implementations of the common functionality for the different platforms like Java and .Net and different per programming language extensions on the same platform like C# and VB.Net).
  • Multiple inspection sources: there should be and option for predefined inspections (shipped with the framework), vendor inspections (developed and shipped with particular software component) and ad-hoc custom inspections (in-house development of software component users).
  • Binding: there should be a way to associate the inspections with the related code structures (classes, methods, fields and properties) and ideally — keep and maintain them within the code.
  • Universality: inspections should be applied in «to subject» and «to object» manners (i.e. relate to the code structure associated with the inspection or to the code caller).

Upon meeting the two first requirements the last three can be easily accomplished by using existing standard mechanisms like annotations and attributes.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Reddit
  • Scoopeo

A new security blog around

Posted on June 5th, 2007 in EN | No Comments »

Imperva CTO, Amichai Shulman has launched his own security-oriented blog.

He moistly writes about enterprise security «metas», providing a lot of valuable background information resources. A must-read for any enterprise-level developer.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Reddit
  • Scoopeo

Back to hashCode() mutability

Posted on May 29th, 2007 in EN | 4 Comments »

My «HashSet.contains(): does your basket contain something?» post got too expected responses: «There is no way to avoid this behavior, why should you expect something else?».

Sure this behavior can not be changed — it’s in nature of any hashed collection. I do not expect anyone to tilt at windmills. What I do expect is, first, ensure I will never stuck with this bug again and, second, prevent others from falling into the same trap. And this is definitely the point I expect the software vendors to help me.
Let’s look one more into the root of the problem: hash code should not be mutable while the entity exists in the collection. Actually, since we can newer be sure it does not, the hash code should never change since the entity was created. Thus, hash code calculation should be independent of object state, i.e. of its mutable fields.

Thus, the following suspicious code patterns should get a special attention in this context (I’ll generally use Java notation, the C# variation is trivial):

  • Mutable hash code: hashCode() accesses fields that are not final, or calls methods that access fields that are not final or call methods that… and so on.
  • Using overridden hashCode(): an instance of class with overriden hashCode() is added into hash-based collection (or one of its interfaces). More general – to any collection instance.
  • Broken contract: hashCode() and equals() do not access the same fields or do not call the same methods (that do not access the same fields… and so on).

What can prevent or warn us about the patterns mentioned?

  • Language level: not really can be taken into account, since providing language-level object identity is almost equal to just forbidding hashCode() override.
  • C# 3.0 anonymous classes make use of similar approach – the hash code of an object is immutable since both equals() and getHashCode() are compiler generated and both fields and properties are read-only.

  • Compiler warning level: may be nice, also implementing recursive method inspection will require new paradigms definition and will add unnecessary complexity. In addition, this require implementing this functionality separate for each platform language.
  • Code inspection: the most desirable option that should act at bytecode level and can be easily integrated into existing IDEs.
  • IntelliJ IDEA 6 inspections list presents a good inspection for mutable hashcode, and something not so powerful for broken contract.

This small and annoying point is just a tiny part of features missing from existing IDEs (expected to provide developer with an ability to concentrate on application business logic development rather than on language or infrastructure implementation details).

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Reddit
  • Scoopeo