Search This Blog

Saturday, March 24, 2012

Installling NSIS 2.46


I'm busy setting up builds of DRC 3.0 on a new Windows 7 64bit workstation using VS2010 and NSIS 2.46

Always an intertesting adventure setting up a new Development workstation especially when you didn't take the time to document your setup.

Setting up NSIS 2.46 on Windows 7 64 bit
  1.   Run nsis-2.46-setup.exe
  2.  Run Venis setup VenisIX225.exe
    1.  Run Venix, click register menu
    2.  Add name and license.
    3.   First time running Venix, Use file menu to open Nsi script directly.  After that, Windows will open Venix when double-clicking on script file.  (Not sure why this does work w/o first running Venix right after install.
  3.   Add Plugins
    1.        Registry
      1.  Copy Include to NSIS\Include
      2.  Copy Example to NSIS\Examples
      3. Copy Plugin to NSIS\Plugins
Venis IX 2.2.5



Thursday, March 22, 2012

Things I learned this week

At work, current project is nearing release as the calendar nears the end of the quarter.

(A random thought, think of the money that could be saved in business would adopt trimesters instead of quarters...  public companies would only have 3 releases for numbers + annual statements to be made.  I think the savings in worthless red tape would be significant.  What the percent different between 1/3 vs 1/4?)

Some of these items I already knew but relearned them this week again.
  • Scope_Identity() works locally not via a linked server.
  • spIDs are also local for processes running and should not be correlated over a linked server.
  • Always and I mean always specify country ID when looking up State codes even if you current design only supports US only. 
  • When you get a new 64bit development machine, build properties on a C# project specifying CPU type is no longer insignificant.
  • Many people are happily using 64bit version of Windows 7 and don't even realize it.
  • SysWOW64 is still the dumbest name for a folder to date.
  • There is more to life than work.
  • I enjoy singing more than I would have ever guessed.
  • Lunch is my favorite part of the weekday.



Friday, February 24, 2012

I love stackoverflow.com

I needed a query to use Rank() row counters within a Group

Here it is:  http://stackoverflow.com/questions/1139719/sql-server-query-for-rank-rownumber-and-groupings

Here is my query and resultset


SELECT
    Rank() over (Partition by EncounterID Order by EncounterID, RefPhysID)+1 as ranks
    ,EncounterID
    , RefPhysID
FROM 
    tbEncountersCourtesyCopies
Group By
    EncounterID, RefPhysID, RefPhysOfficeID 
Order by
    ranks asc

ranks    EncounterID    RefPhysID
2        9              1022
2        12             1095
2        18             91
3        12             1279


Monday, February 20, 2012

Windows 7 Activation Problems.

I've been struggling with Windows 7 license issues.  After hard drive changes (not the boot drive), one of my test machines keeps have the Windows 7 Pro license invalidated.  This is odd since I thought I had a real license key for the machine and not one of those tech-net, it expires in a year licenses but I'm not really sure anymore.

My solution was to purchase a discounted license from a non-Microsoft website whose claimed to be a Genuine MS Partner.  Initially the key I received did not work but I used the following steps and I was able to activate Windows 7 Pro using automated phone registry.

From http://social.microsoft.com/Forums/en-US/genuinewindows7/thread/dd8f477a-07a7-42b5-b5bb-5079a5fd8140


First off, try these alternate steps to change the product key
1)    Click the Start button
2)    Type: slui.exe 3 and hit the Enter key
3)    Type in the Product key from the sticker on your computer
4)    Click the Next button.
5)    You will be asked if want to Activate, click ok
6)    It will attempt to Activate by the internet and will return an Invalid Key error (this is ok, continue to step 7)
7)    Click the Start button
8)    Type: slui.exe 4 and hit the Enter key
9)    Select your location in the drop down menu and click the Next button
10) The next screen provides the number to call to Activate by Phone
If that doesn't work, try these steps that will recreate Windows 7's Licensing Store.  When it recreates the file, Windows will need to repopulate it with Licensing Information so will ask you to enter the Product Key and to Activate (use the Activate by Phone method)
1) Open an Internet Browser
2) Type %windir%\system32 into the browser address bar.
3) Find the file CMD.exe
4) Right-Click on CMD.exe and select 'Run as Administrator'
5) Type: net stop sppsvc  (it may ask you if you are sure, select yes)
6) Type: cd %windir%\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform
7) Type: rename tokens.dat tokens.bar
8) Type: slui
9) After a couple of seconds Windows Activation dialog will appear. You may be asked to re-activate and/or re-enter your product key.


Lastly, if neither set of steps resolves the problem, download and run the Genuine Diagnostics tool (MGADiag.exe) at this linkhttp://go.microsoft.com/fwlink/?linkid=52012. Click "Continue", click the "Copy" button then “Paste” the report into a reply message in this thread.

Thursday, February 9, 2012

How to take 1 record from an INNER JOIN

Hit a problem moving data between systems where there is legitimate duplicate mappings between the two systems but I need just one.  and It really does not matter which one.  basically I want to take SELECT TOP 1 on records coming off a join:
I should use this approach more but it can be slower under some conditions

SELECT
        A.RetailerID,
        X.RetailerIDTheirs
FROM TableA AS A
CROSS APPLY (SELECT TOP 1 B.RetailerIDTheirs FROM TableB B WHERE B.RetailerID = A.RetailerID 
ORDER BY B.RetailerIDTheirs ASC) AS X