Pages

Wednesday, May 25, 2011

Talend -=- Warning: Property storage name for 5 is empty - setting to Root Entry

Hi

I'm getting this warning while reading an Excel file (xls)
Warning:  Property storage name for 5 is empty - setting to Root Entry

I can't figure out why Talend give me this error but if open my Excel file, save it in xlsx format, and check the checkbox "Read excel2007 file format (xlsx)" in Talend, I don't have this error anymore...

Strange!!!

Wednesday, May 18, 2011

Windows XP -=- Enabling Remote Desktop

To enable Remote Desktop Connections in Windows XP:
  1. Click on the Start button.
  2. Right-click on "My Computer" and select Properties.
  3. Click on the "Remote" tab.
  4. Under "Remote Desktop" (the bottom section), check the box labeled "Allow users to connect remotely to this computer".

If you are running Windows XP Service Pack 2, you will also need to make sure Remote Desktop isn't being blocked by the Windows Firewall:
  1. Go to the Start button, to "Control Panel".
  2. Open the "Windows Firewall" control panel. If you don't see Windows Firewall listed, make sure that you're looking at the control panels in "Classic View".
  3. On the "Exceptions" tab, make sure "Remote Desktop" is checked.
  4. On the "Advanced" tab, select "Local Area Connection" and press the Settings button.
  5. In the new window that opens ("Advanced Settings"), make sure that Remote Desktop is checked.

Monday, May 9, 2011

EDI -=- List of Valid Interchange Qualifiers in EDI

Hi!

The interchange qualifier is used to describe the interchange identifier. For example, if we have a qualifier 12, it says that the interchange identifier is a phone number. Here's the list of all the valid identifiers in EDI (X12 - V004010)

  • 01 - Duns (Dun & Bradstreet)
  • 02 - SCAC (Standard Carrier Alpha Code)
  • 03 - FMC (Federal Maritime Commission)
  • 04 - IATA (International Air Transport Association)
  • 08 - UCC EDI Communications ID (Comm ID)
  • 09 - X.121 (CCITT)
  • 10 - Department of Defense (DoD) Activity Address Code
  • 11 - DEA (Drug Enforcement Administration)
  • 12 - Phone (Telephone Companies)
  • 13 - UCS Code (The UCS Code is a Code Used for UCS Transmissions; it includes the Area Code and Telephone Number of a Modem; it Does Not Include Punctuation, Blanks or Access Code)
  • 14 - Duns Plus Suffix
  • 15 - Petroleum Accountants Society of Canada Company Code
  • 16 - Duns Number With 4-Character Suffix
  • 17 - American Bankers Association (ABA) Transit Routing Number (Including Check Digit, 9 Digit)
  • 18 - Association of American Railroads (AAR) Standard Distribution Code
  • 19 - EDI Council of Australia (EDICA) Communications ID Number (COMM ID)
  • 20 - Health Industry Number (HIN)
  • 21 - Integrated Postsecondary Education Data System, or (IPEDS)
  • 22 - Federal Interagency Commission on Education, or FICE
  • 23 - National Center for Education Statistics Common Core of Data 12-Digit Number for Pre-K-Grade 12 Institutes, or NCES
  • 24 - The College Board's Admission Testing Program 4- Digit Code of Postsecondary Institutes, or ATP
  • 25 - American College Testing Program 4-Digit Code of Postsecondary Institutions, or ACT
  • 26 - Statistics of Canada List of Postsecondary Institutions
  • 27 - Carrier Identification Number as assigned by Health Care Financing Administration (HCFA)
  • 28 - Fiscal Intermediary Identification Number as assigned by Health Care Financing Administration (HCFA)
  • 29 - Medicare Provider and Supplier Identification Number as assigned by Health Care Financing Administration (HCFA)
  • 30 - U.S. Federal Tax Identification Number 31 Jurisdiction Identification Number Plus 4 as assigned by the International Association of Industrial Accident Boards and Commissions (IAIABC)
  • 32 - U.S. Federal Employer Identification Number (FEIN) 33 National Association of Insurance Commissioners Company Code (NAIC)
  • 34 - Medicaid Provider and Supplier Identification Number as assigned by individual State Medicaid Agencies in conjunction with Health Care Financing Administration (HCFA)
  • 35 - Statistics Canada Canadian College Student Information System Institution Codes
  • 36 - Statistics Canada University Student Information System Institution Codes
  • 37 - Society of Property Information Compilers and Analysts
  • AM - Association Mexicana del Codigo de Producto (AMECOP) Communication ID
  • NR - National Retail Merchants Association (NRMA) - Assigned
  • SN - Standard Address Number
  • ZZ - Mutually Defined

SQL -=- Records to CSV SQL function

Hi!

If you want to convert an SQL resultset to a CSV string, your can use the following function.
  
Function

CREATE OR REPLACE FUNCTION myschema.to_csv(query_to_convert character varying, separator character varying)
  RETURNS text AS
$BODY$
declare
    r RECORD;
    t character varying;
begin
    t := '';
    
    FOR r IN EXECUTE query_to_convert LOOP
        t := t || r.data || separator;
    END LOOP;

    -- We removes the trailing comma
    RETURN substring(t, 0, char_length(t)-1) ;
end;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE
  COST 100;

Function Call


SELECT myschema.to_csv('SELECT mycol as data  FROM myschema.mytable;',','); 

This will return a varchar containing all the records reparated with the specified delimiter, in our example a comma.

Friday, May 6, 2011

Car Fuel Efficiency -=- Good reference site

Hi!

I've found a good reference site for fuel efficiency. All make / model of cars a referenced and there a compilation of most / worst efficient cars. The URL is

http://www.fueleconomy.gov/

Yann

Thursday, May 5, 2011

ExtJS -=- Mandatory fields in red

Hi

If you want to show mandatory fields in red to visually distinguish mandatory fields and optional fields, you can do this override.


In your CSS stylesheet
.error {
    background-color: #ffeeee !important;
    border-color: #ff7870 !important;
}

.custom-form-item {
    display: block;
    margin-bottom: 0px;
    zoom: 1;
}

.custom-form-text {
    border: 1px solid #B5B8C8;
    padding: 1px 3px;
    height: 22px !important;
} 


In your javascript
/*
 * We overrides the Ext's FormPanel because there's a but using IE7-8, FormPanel and textfields (and derivatives).
 * IE try to render the field but the bottom and top border and invisible. We need to override the border width...
 */
Ext.override(Ext.form.FormPanel, {
    initFields : function() {
        var f = this.form;
        var formPanel = this;
        var fn = function(c) {
            if (c.isFormField) {
                f.add(c);
            } else if (c.doLayout && c != formPanel) {


                Ext.applyIf(c, {
                    labelAlign: c.ownerCt.labelAlign,
                    labelWidth: c.ownerCt.labelWidth,
                    itemCls: c.ownerCt.itemCls
                });
                if (c.items) {
                    c.items.each(fn);
                }
            }
        };
        this.items.each(fn);
    }
});



/**
 * Override the Ext.form.Field to add some functionalities like max lenght...
 * @author Yann Laviolette
 *
 */
Ext.override(Ext.form.Field, {
    onRender : function(ct, position) {
        /**
            * If we specify a maxLenght for a field, the field doesn't accept more than X characters...
            */
        if (this.maxLength !== Number.MAX_VALUE && (this.getXType() === 'textfield' || this.getXType() === 'numberfield')) {
            this.autoCreate = {
                tag: 'input',
                type: 'text',
                size: '20',
                autocomplete: 'off',
                maxlength: this.maxLength
            };
        }

        if (this.maxLength !== Number.MAX_VALUE && (this.getXType() === 'textarea')) {
            this.autoCreate = {
                tag: 'textarea',
                type: 'text',
                size: '20',
                autocomplete: 'off',
                maxlength: this.maxLength,
                onkeyup: "if (this.value.length > " + this.maxLength + ") { this.value = this.value.slice(0, " + this.maxLength + ") }",
                onchange: "if (this.value.length > " + this.maxLength + ") { this.value = this.value.slice(0, " + this.maxLength + ") }"
            };
        }

        Ext.form.Field.superclass.onRender.call(this, ct, position);

        if (!this.el) {
            var cfg = this.getAutoCreate();
            if (!cfg.name) {
                cfg.name = this.name || this.id;
            }
            if (this.inputType) {
                cfg.type = this.inputType;
            }
            this.el = ct.createChild(cfg, position);
        }
        var type = this.el.dom.type;
        if (type) {
            if (type == 'password') {
                type = 'text';
            }

            if (type == 'text') {
                this.el.addClass('custom-form-' + type);
            } else {
                this.el.addClass('x-form-' + type);
            }


        }

        this.invalidClass = "error";

        if(!this.allowBlank){
            this.cls = "error";
        }

        if (this.readOnly) {
            this.el.dom.readOnly = true;
        }
        if (this.tabIndex !== undefined) {
            this.el.dom.setAttribute('tabIndex', this.tabIndex);
        }

        this.el.addClass([this.fieldClass, this.cls]);
    },



    /**
        * Show the container including the label
        */
    showContainer: function() {
        this.enable();
        this.show();

        if (!Ext.isEmpty(this.getEl())) {
            this.getEl().up('.x-form-item').setDisplayed(true); // show entire container and children (including label if applicable)
        }


    },

    /**
        * Hide the container including the label
        */
    hideContainer: function() {
        this.disable(); // for validation
        this.hide();

        if (!Ext.isEmpty(this.getEl())) {
            this.getEl().up('.x-form-item').setDisplayed(false); // hide container and children (including label if applicable)
        }
    },

    /**
        * Hide / Show the container including the label
        * @param visible
        */
    setContainerVisible: function(visible) {
        if (this.rendered) {
            if (visible) {
                this.showContainer();
            } else {
                this.hideContainer();
            }
        }

        return this;
    }
});

Wednesday, May 4, 2011

ExtJS -=- DateField popup takes all screen width with Safari & Chrome

Hi!

There's a little issue with the DateField component with Safari. My version of ExtJS is 2.3.

My DateField component takes 100% of the screen's width and it is unusable...

In order to correct this, you just have to add this CSS class to your stylesheets

.x-date-menu {
   width: 175;
}

ExtJS -=- ComboBox TypeAHead useful hack

Hi

Here is a useful hack that disable the auto selection of the first record while searching data in a combo box with the Type Ahead functionnality.

If there is only one record, the combo will automatically selects the first record. You just need to add this override to your code.




/**
 * When we are looking for an item in a combo box by typing data in the combo
 * box, the combo usually used to take the first record and replace the actual
 * typed data. This override disable this functionnality so we can enter data
 * and use the filters.
 *
 * If there is only one result, the combo automatically selects the first record.
 *
 */
Ext.override(Ext.form.ComboBox, {
    onTypeAhead : function(){
        if(this.store.getCount() === 1){
            var r = this.store.getAt(0);
            var newValue = r.data[this.displayField];
            var len = newValue.length;
            var selStart = this.getRawValue().length;
            if(selStart != len){
                this.setRawValue(newValue);
                this.selectText(selStart, newValue.length);
            }
        }
    }
});

Tuesday, May 3, 2011

New PuTTY Mirror

Hi!

I've started a new mirror of the well known PuTTY software. You can get it by going to http://putty.icebergsofts.com

Yann