Skip to main content

Pankaj Sharma's Library tagged knowledge   View Popular

24 Jan 08

Ruby on Rails - Wikipedia, the free encyclopedia

  • The fundamental Ruby on Rails principles include Convention over Configuration (CoC) and Don't repeat yourself (DRY).


    "Convention over Configuration" means a developer only needs to specify unconventional aspects of the application. For example, if there's a class Sale in the model, the corresponding table in the database is called sales by default. It is only if one deviates from this convention, such as calling the table "products_sold", that one needs to write code regarding these names.


    "Don't repeat yourself" means that information is located in a single, unambiguous place. For example, using ActiveRecord, the developer does not need to specify database column names in class definitions. Instead, Ruby can retrieve this information from the database.

21 Jan 08

Thousands of Oracle & DB2 & SQL people answering each others questions

  • you cannot TRUNCATE a table if it's the PARENT of
    another table (enforced by a referential constraint). Regardless of whether
    there's any data enforcing the constraint, it just won't let you truncate
    it.

    Only way is to disable the constraint. Truncate the table and re-enable
    the constraint.

    Following code will list the ALTER TABLE DISABLE CONSTRAINT code to the
    screen, copy and paste to disable and re-enable all.



    -- Disable constraints for a user

    select 'alter table '||table_name||' disable constraint
    '||constraint_name||';'
    from v_user_constraints
    where constraint_type = 'R'
    /


    -- Enable constraints for a user

    select 'alter table '||table_name||' enable constraint
    '||constraint_name||';'
    from v_user_constraints
    where constraint_type = 'R'
    /
17 Oct 07

Cricinfo - A field day for left-arm bowlers

  • Very nice bit of information....game of numbers.
    - landmine on 2007-10-17
  • For the first time in an ODI, left-arm bowlers took all ten wickets in an innings (six for Kartik, two for RP Singh, one each for Zaheer Khan and Irfan Pathan). The previous record was nine, also in Mumbai, and also in an India-Australia match: the last time the two teams played here, in 2003-04, Michael Clarke and Nathan Bracken took four each, while Brad Hogg chipped in with one. The 16 wickets by left-armers in this match is also a record, going past the previous mark of 11, which had been achieved three times - in the Mumbai game mentioned above, in Dhaka earlier this year when Bangladesh played India, and in an Australia-Sri Lanka game in Sydney in 2005-06.
1 - 20 of 27 Next ›
Showing 20 items per page

Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »

Join Diigo