2012-04-21

Sound Juicer - Increasing mp3 ripping quality

Complex interface, but once you get to the profile edit screen, just replace the mp3 profile with the following line if you want to encode using a 320 kbit/s quality.  Keep the rate to 44100 if you are ripping a CD, since that is the sample rate at which CDs are created (more would be overkill).

audio/x-raw-int,rate=44100,channels=2 ! lame name=enc mode=0 vbr=0 bitrate=320 ! id3v2mux

Sound Juicer is a free music ripper software product for Linux.
Only rip music you have the legal right to.

To learn more about compression and the mp3 architecture check Wikipedia, they have a great primer on it... http://en.wikipedia.org/wiki/MP3

2012-04-20

TSQL - Database objects and columns list


select
      -- Object
      o.name as [Object]
      , o.crdate as ObjectCreationDate
      , o.refdate as ObjectReferenceDate
     
      -- Column
      , c.colid as ColumnID
            , c.name as [Column]
      , c.colorder as ColumnOrder
      , c.type as ColumnTypeID
            , t.name as ColumnType
      , c.xusertype as ColumnUserType
      , c.length as ColumnLength
            , t.allownulls as ColumnAllowsNulls
      , c.collation as ColumnCollation
from
      -- Objects
      sysobjects o
     
      -- Columns
      inner join
      syscolumns c
      on
      o.id = c.id
     
      -- Column Types
      inner join
      systypes t
      on
      c.xtype = t.xtype
where
      -- Only tables, views, triggers and functions
      o.xtype in ( 'U', 'V', 'TR', 'TF' )
;

2012-03-19

Teradata - Parameterized Query


select
      *
from
      TABLE_NAME_HERE
where
FIELD_NAME_HERE = ?\PARAMETER_NAME_HERE
;

2012-02-29

Teradata - String trimming


select
      TRIM(
            LEADING
            ' '
            FROM
                  TRIM( TRAILING ' ' FROM FIELD_NAME_HERE )
      )
from
      TABLE_NAME_HERE
;

2011-12-23

Primary, secondary, tertiary, etc


01: primary
02: secondary
03: tertiary
04: quaternary
05: quinary
06: senary
07: septenary
08: octonary
09: nonary
10: denary
11: ?
12: duodenary

2011-12-16

TSQL - Full text search useful queries


-- Languanges
select
      *
from
      sys.fulltext_languages
order by
      name
;


-- Catalogs
select
      *
from
      sys.fulltext_catalogs
;


-- Indexes
select
      *
from
      sys.fulltext_indexes
;



-- Index browsing
select
      *
from
      sys.dm_fts_index_keywords(
            DB_ID('DATABASE_NAME_HERE')
            , OBJECT_ID('TABLE_NAME_HERE')
      ) as V1
where
      display_term <> 'END OF FILE'
;




2011-12-14

TSQL - How to create a full text catalog, index and search

use AdventureWorks
go


-- Create the catalog
CREATE FULLTEXT CATALOG AdventureWorksFullTextCatalog;
GO


-- Create the full text index on the desired column(s)
CREATE FULLTEXT INDEX ON Production.ProductDescription
(
      Description Language 1033
)
KEY INDEX PK_ProductDescription_ProductDescriptionID
ON AdventureWorksFullTextCatalog;
GO


-- Search sample
DECLARE @SearchWord nvarchar(30);
      SET @SearchWord = N'high-performance';
SELECT
      Description
FROM
      AdventureWorks.Production.ProductDescription
WHERE
      FREETEXT(Description, @SearchWord)
;