Miscellaneous Ramblings on Hacking

May 23, 2012

SVN version into your Assembly.cs file

Filed under: Uncategorized — Zack Bethem @ 8:10 pm

I wanted an incrementing Assembly version, but I didn’t want to have to do it manually. Some quick Googling and I found this nice solution:

I’ve been using SubWCRev that’s in the TortoiseSvn installation (I think it’s downloadable seperately too).
First i create a “template”-file for the AssemblyInfo.cs called AssemblyInfo.cs.in
This is created as a copy of the exisiting one.
Then replace the parts you want changed with SubWCRev placeholders like this:
[assembly: AssemblyVersion(“1.2.3.$WCREV$”)]
Then create a PreBuildEvent to run SubWCRev with appropriate parameters:
SubWCRev <wcpath> AssemblyInfo.cs.in AssemblyInfo.cs

So, this is translated as follows:

  • my AssemblyInfo template file AssemblyInfo.cs.in reads as follows:
// Version Notes:
// Updated to 2.0.0 for .net4 switch over
[assembly: AssemblyVersion("2.0.0.$WCREV$")]
[assembly: AssemblyFileVersion("2.0.0.$WCREV$")]


  • And I tweaked the PreBuildEvent in VisualStudio to use Macros.. it reads as follows:
subwcrev $(ProjectDir) $(ProjectDir)\Properties\AssemblyInfo.cs.in $(ProjectDir)\Properties\AssemblyInfo.cs


Fun stuff indeed.


May 9, 2012

Unica Customer Insight–Creating custom Bins

Filed under: Unica — Zack Bethem @ 4:05 pm

Unica’s Customer Insight product can quickly generate an EasySet of data allowing a user to start mining their customer base. The problem comes into play when the out of box configuration doesn’t match what you want to display.

By default, CustomerInsight will take all numeric data types from the source table and create “bins”. The “bins” created sometimes do not align with the desired buckets that a business may be accustomed to. Follow this process to create your own bins.


We desire to set the bins for an attribute into 100 point increments to the following values:

  • 1 – 99
  • 100 – 199
  • 200 – 299
  • 300 – 399
  • 400 – 499
  • 900 – 1000

XML Modifications

File: cadimensions.xml

This file defines the bucket values that will be displayed. Within the existing <defaults><fields> tags, we will insert the following:

   1: <field name="ABILITY_TO_PAY">

   2:   <dimension name="ability_to_pay0" dimdisplay="Ability To Pay" singlefilterdisplay="Ability To Pay" multiplefilterdisplay="Ability To Pay" onlyincludedisplay="Ability To Pay" selectadisplay="%NTR_SELECTA_VALUE%" variable="ability_to_pay0code" filtertype="list" fill="true" keylookup="false" cgikey="abilitytopay0z">

   3:     <list source="self">

   4:       <item value="1" display="1 - 99" />

   5:       <item value="2" display="100 - 199" />

   6:       <item value="3" display="200 - 299" />

   7:       <item value="4" display="300 - 399" />

   8:       <item value="5" display="400 - 499" />

   9:       <item value="6" display="500 - 599" />

  10:       <item value="7" display="600 - 699" />

  11:       <item value="8" display="700 - 799" />

  12:       <item value="9" display="800 - 899" />

  13:       <item value="10" display="900 - 1000" />

  14:       <item value="11" display="0" />

  15:     </list>

  16:   </dimension>

  17: </field>

File: cavariables.xml

This file will create a variable for the translated codes. It defines the bins and maps those definitions back to the dimensions defined above. In the dimension definition above, note that we reference a variable ability_to_pay0code. This same variable name is used in the snippet below. The following would be inserted within the <defaults><fields> tags:

   1: <field name="ABILITY_TO_PAY">

   2:   <variable name="ability_to_pay0code">

   3:     <input type="db" entity="Fact1" element="ABILITY_TO_PAY">

   4:       <transformation type="intrange" destcolname="ability_to_pay0code" dbtype="int8">

   5:         <range start="1" end="99">1</range>

   6:         <range start="100" end="199">2</range>

   7:         <range start="200" end="299">3</range>

   8:         <range start="300" end="399">4</range>

   9:         <range start="400" end="499">5</range>

  10:         <range start="500" end="599">6</range>

  11:         <range start="600" end="699">7</range>

  12:         <range start="700" end="799">8</range>

  13:         <range start="800" end="899">9</range>

  14:         <range start="900" end="1000">10</range>

  15:         <range end="0">11</range>

  16:       </transformation>

  17:     </input>

  18:   </variable>

  19: </field>

File: caoutfmt.xml

This file defines the output format. Since we’ve modified the dimension and variables, the output format must also be defined. the following would be inserted within the <defaults><fields> tags:

   1: <field name="ABILITY_TO_PAY">

   2: <element name="ability_to_pay0" rowstoshow="10" showall="false" titleasc="Ability To Pay" titledsc="Ability To Pay">

   3:   <columns>

   4:     <column name="ability_to_pay0" type="listdimension" rankable="true" nowrap="true" trendable="true">

   5:       <header>Ability To Pay</header>

   6:       <format alignment="left" />

   7:       <exportfield>Ability To Pay</exportfield>

   8:       <datasettitle>Ability To Pay</datasettitle>

   9:     </column>

  10:   </columns>

  11:   <graph available="true">

  12:     <types>

  13:   <type default="true">bar</type>

  14:   <type>pie</type>

  15:   <type>line</type>

  16:     </types>

  17:   <crosstabtypes>

  18:     <crosstabtype>pathtab</crosstabtype>

  19:     <crosstabtype>barscape</crosstabtype>

  20:     <crosstabtype>barstacked</crosstabtype>

  21:   </crosstabtypes>

  22:   </graph>

  23: </element>

  24: field>

Create a free website or blog at WordPress.com.