singalen: (Default)

Originally published at Fiberglass flowers. You can comment here or there.

Google Buzz
  • Grails doesn’t reload scaffolding on-the-fly if you change local templates. But you can open a Groovy console inside application and run in it:
    org.codehaus.groovy.grails.scaffolding.view.
        ScaffoldingViewResolver.scaffoldedViews.clear()

  • In order to change default g:fieldValue formatting for, say, BigDecimal, have a CustomEditorRegistrar in your resources.groovy, and register custom PropertyEditor:
    registry.registerCustomEditor(BigDecimal.class, 'myProperty',
        new OurBigDecimalEditor(BigDecimal.class))
    Tags:
    singalen: (Default)

    Originally published at Fiberglass flowers. You can comment here or there.

    Google Buzz

    A friend of mine defended Fortran against half-literate coders on an example of Prim’s allgorithm.

    Good pretext for another language comparison. Let’s see Groovy vs Java vs good old Fortran.

    Great Fortran implementation

    Great Java implementation by Bruno R. Preiss, P.Eng. and scientist.

    Some beginner’s C+ implementation (or is it just a link farm? Whatever).

    And here’s the algorithm in Groovy, copied as precisely as possible from pseudocode in Russian Wikipedia article.

    Read the rest of this entry »

    Tags:
    singalen: (Default)

    Originally published at Fiberglass flowers. You can comment here or there.

    Google Buzz

    I’m thinking of precise Redmine burdown chart, which is not so simple.

    • It has to build burdown chart for a given sprint (Version in Redmine).
    • It has to account issues added to Version and removed from during the sprint.
    • It, after all, has to account for what is considered “closed” status, which might be one of non-stock, custom statuses.

    There are couple of Redmine addons, but for now I’m precautious about installing them. They are:

    For now, I do it by hand. I put together a SQL query to get me the data:

    Read the rest of this entry »

    Tags:
    singalen: (Default)

    Originally published at Fiberglass flowers. You can comment here or there.

    Just published a library I created on one of past jobs out of Updater Application Block and WiX’s ClichThrough component.
    Please meet: DotUpdater
    It can auto-update an application, just create a RSS feed of updates and Windows Installer (MSI) binaries.

    Tags:
    singalen: (Default)

    Originally published at Fiberglass flowers. You can comment here or there.

    Imagine a task (actually, quite common), if you have:

    • a nodes (articles, ads, whatever) taxonomy in Drupal,
    • a taxonomy-based url path rewrites, like /monkeys/primates/homosapiens
    • and want to show a block/page View with articles only from current path term (and, maybe, its subterms).

    It might be a hard time finding out the current term. One could try having two nested views, passing a current term as a parameter to nested view, like Dustin Currie did.

    Though, Views has several pre-defined solutions. Just go to /admin/build/views/ and enable this one: “Default Node view: taxonomy_term”, (clone it to play safe), voila!

    You got a View for the current term.

    Tags:
    singalen: (Default)

    Originally published at Fiberglass flowers. You can comment here or there.

    In case you, like me, need to compare version of Office documents (under Windows), just know that TortoiseSVN got a pretty set of scripts for that.
    It works out of box!
    YES!
    You can compare Office documents just like plaintext files!.
    Just tried it and it worked. If you were afraid of trying, like me - don’t be.

    Tags:
    singalen: (Default)

    Originally published at Fiberglass flowers. You can comment here or there.

    We’re trying Grails, Rails-like web application framework for Java.
    It’s fine, just that Groovy debugger support is, er, imperfect, even in the best Gruoovy IDE – IDEA.

    And, if you want to unit test, you won’t have fancy domain class methods addTo* – like Customer.addToOrders().
    They’re generated by Grails on startup.
    In order to have addTo*(), inherit from GrailsUnitTestCase and call mockDomain(Customer) in setUp().

    Oh, if you get "NullPointerException: Cannot invoke method containsKey() on null object", add super.setUp() to yout testcase’s setUp().

    Having proper save() is more tricky. Implementation from mockDomain() works to some extent: it won’t save connected objects.
    So, in order to get save() working, you have to do something like this:

    Read the rest of this entry »

    Tags:
    singalen: (Default)

    Originally published at Fiberglass flowers. You can comment here or there.

    Just dealt with another Visual Studio 2008 “feature”.

    You can specify all the necessary “Project Dependencies” in Visual Studio, but will get “CSC : error CS0006: Metadata file FooBar.dll could not be found“. Even if your csproj files have correct references to other solution projects, msbuild will fail.
    Maybe it appears only if project output path is outside of project directory.

    It appears that Visual Studio keeps the dependencies in two ways, only one of which is read by MSBuild. I see that because I still can specify dependencies in GUI, copy solution to other machine and build it with VS in correct order.

    Not with MSBuild.

    The data needed by MSBuild is a “ProjectSection(ProjectDependencies) = postProject” section of SLN file. Like this:

    Read the rest of this entry »

    Tags:
    singalen: (Default)

    Originally published at Fiberglass flowers. You can comment here or there.

    I just won a bet for $10 by solving a quiz:

    Check the correctness of a braces, brackets and parentheses sequence. The solution should be of linear complexity (to say more, it’s 1-pass).

    For instance, these expressions are correct: “()”, “()()[]“, “([][][]{})”, “([])()[]“, and these are not: “][”, “())(”, “(()”.

    Ten dollars

    It’s basically solved in 15 lines, all others being auxiliary. Can you reproduce the algorithm?

    The solution follows.

    Read the rest of this entry »

    Tags:
    singalen: (Default)

    Originally published at Fiberglass flowers. You can comment here or there.

    Whenever you implement own datasource for .NET GUI binding, you’lll have the choice - whether to implement IList or IListSource.

    IListSource is a simplistic interface with two members: IList<T> GetList() and bool ContainsListCollection;

    MSDN help about IListSource.ContainsListCollection states it’s “indicating whether the collection is a collection of IList objects”.
    MSDN is not true here.

    If IListSource.ContainsListCollection is false, GetList() just returns your IList.

    If IListSource.ContainsListCollection is true, GetList() is expected to return ITypedList, which needs to provide a collection of PropertyDescriptor-s for every field of your collection.
    Its purpose is to provide field names (including by-name field access) in runtime.

    Quoted below is a code piece from a Microsoft newsgroup that resolves both cases to a data list (field values list, in second case).

    And yes, if you’re planning to mutate the UI-bound collection, use IBindingList<> instead of IList<>.

    Read the rest of this entry »

    Tags:
    singalen: (Default)

    Originally published at Fiberglass flowers. You can comment here or there.

    I’m going to start with reposting my older articles written in Russian.
    To be honest: It’s a self-promotion blog which has the chance to be commercial.
    OTOH, this also means the articles will be carefully reviewed, filtered and refined. I promise that I’m intending to maybe do it :)

    Tags:

    April 2017

    S M T W T F S
          1
    2345 678
    9101112131415
    16171819202122
    23242526272829
    30      

    Syndicate

    RSS Atom
    Page generated 21/7/17 18:40

    Expand Cut Tags

    No cut tags