Monday, 12 August 2013

Removing weekends from the TFS Sprint Burndown report

This blog describes how to remove weekends from the Sprint Burndown report in TFS.

Essentially:

Open the report in SQL Server 2012 Report Builder. Save As a new report filename in order to keep the original intact!

Right click outside of the white report canvas and select Report Properties.
Select the Code tab item.

Add the following function:
Function NumberOfDaysToAdjustForWeekends(ByVal valNow as Date, ByVal startOfSprint as Date) AS Int32

  Dim valCurrent As Date = startOfSprint
  Dim weekendDaysPassed As Int32 = 0

  Do While valCurrent < valNow

  valCurrent = valCurrent.AddDays(1)
  If (valCurrent.DayOfWeek = DayOfWeek.Saturday Or valCurrent.DayOfWeek = DayOfWeek.Sunday) Then
  weekendDaysPassed = weekendDaysPassed + 1
  End If

  Loop

  Return weekendDaysPassed

 End Function

Click on the chart, Select Work_Item_Count from the Values fact table and edit the Expression.
Change it to:

=Code.Burndown
(
Sum(Fields!Remaining_Work.Value),
Fields!DateValue.Value.AddDays(-Code.NumberOfDaysToAdjustForWeekends(Fields!DateValue.Value, Parameters!StartDateParam.Value)), Parameters!EndDateParam.Value.AddDays(-Code.NumberOfDaysToAdjustForWeekends(Parameters!EndDateParam.Value, Parameters!StartDateParam.Value))
)

Now the today line is out as it is not taking into account the weekends.
Turn on the Properties Tool Window if it is not already.
Select View menu tab and tick the Properties checkbox.
Click on the date axis.
In the Properties tool window find the Striplines property.
Edit the collection and the IntervalOffset property.
Enter the following value:
=CountDistinct(Fields!DateValue.Value, "dsBurndown") - DateDiff("d", Today(), Max(Fields!DateValue.Value, "dsBurndown")) - Code.NumberOfDaysToAdjustForWeekends(Today(), Parameters!StartDateParam.Value)

Save the report back to the server.

Monday, 17 June 2013

Removing bevel on radio button in Adobe Acrobat Forms

If you convert a PDF document into an editable PDF form using Adobe Acrobat, it creates a small solid border around the radio buttons.

However sometimes you have to add your own, in by default they come with a bevelled edge.

How do you remove this? At first it looks like you can't. However you can.

Choose a border colour and a fill colour. At this point the Line Style becomes enabled and is set to "Inset". Change this to solid, and then set the border colour and fill colour back to "No colour". Bingo!

Tuesday, 11 June 2013

Installing the Android Emulator

  1. Download the Android SDK and copy it into a folder, e.g. C:\Program Files (x86)\Android SDK
  2. Create a folder for your SDK home, e.g. C:\Android.
  3. Set the system environment variable ANDROID_SDK_HOME=C:\Android
  4. Run "SDK Manager.exe" and download any additional targets as required.
  5. Create a new Android Virtual Device (AVD). It will save to  C:\Android\.android\avd. 
  6. Open a new command prompt as administrator. 
  7. Run C:\Program Files (x86)\Android SDK\sdk\tools\emulator -avd <My AVD Name> -http-proxy <server>:<port> -dns-server <DNS Server> 
  8. Start the device.
  9. Go to settings->Wireless & networks->mobile networks->Access Point Names. Press menu button. an option menu will appear. 
  10. From the option menu select New APN. 
  11. Click on Name. provide name to apn say My APN. 
  12. Click on APN. Enter www. 
  13. Click on Proxy. enter your proxy server IP. you can get it from Internet Explorer's internet options menu.
  14. Click on Port. enter port number in my case it was 8080. you can get it from internet explorers internet options menu. 
  15. Click on User-name. provide user-name in format domain\user-name. generally it is your systems login. 
  16. Click on password. provide your systems password. 
  17. press menu button again. an option menu will appear. 
  18. Press save this and try to open your browser.





Tuesday, 4 June 2013

"Always Running" WCF Service

A WCF service hosted in IIS is activated whenever a message is received. It processes the message, and then the service implementation is available for garbage collection. If the application pool is idle for more than the timeout period (with a default of 20 minutes), then the worker processes serving the pool are terminated.

Some services may need to perform some pre-work before they begin accepting requests (like loading in some static data). They may want to activate the application pool before any requests are made to ensure there is no delay when the first request comes in. This can be done with the AlwaysRunning settings on the application pool.

 But what about hosting a Service Bus application in IIS? A Service Bus client must create a connection to the server and keep it open for the duration of the lifetime of the application. The request-based activation does not work here.

This article describes how the application pool is automatically started, how an AutoStart Provider is used to invoke startup code to create a connection to the service bus, and how the service is restarted in the event of an application pool stopping.

References
Death to Windows Services - Long Live AppFabric

Tuesday, 7 May 2013

Minecraft Service

Download Minecraft Server
Download the latest Minecraft Server
Run it, and check that it is the correct version.

Download CraftBukkit
Download CraftBukkit
Edit the batch file RunServerWithMods.cmd:

@ECHO OFF
SET BINDIR=%~dp0
CD /D "%BINDIR%"
"C:\Program Files (x86)\Java\jre7\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit-1.5.2-R0.2-20130608.060232-13.jar -nojline

Test the server
Test the server by running RunServerWithMods.cmd. Check that the latest client will work with the new server.
Install Summary - Download yajsw and extract to any folder.
- Open task manager and find the "java" pid under processes. This is most likely your minecraft server.
- Open a command prompt and browse to the "bat" folder under yajsw. (ex. D:\yajsw-beta-10.3\bat).
- Run genConfig.bat  (ex. genConfig.bat 2467).

Note that the config writes the value
wrapper.java.app.jar = craftbukkit-1.5.2-R0.2-20130608.060232-13.jar

for future updates to Minecraft you just need to change this line entry pointing to the new bukkit version.

wrapper.conf
- Browse to "conf" folder (ex. D:\yajsw-beta-10.3\conf) and open wrapper.conf in a text editor.
- Set the working directory (wrapper.working.dir) to your minecraft .jar server file. (ex. \minecraftserver\ for D:\minecraftserver\).
- Uncomment wrapper.app.password and enter your admin account password. Make sure the username on the line above is correct (mine was MinecraftService).
- Fill in service name and descriptions (wrapper.ntservice.name)

Create/Install Service
- Run installService.bat from the bat directory. (ex. D:\yajsw-beta-10.3\bat)
- Open Services Manager through administration tools.
- Right click the server, properties.
- Browse to "Log On" tab.
- Change to "This Account" and use the same account in your wrapper.conf.

Start the service.

You may want to create a new user account for the service. In this scenario, go to Computer Management > User Rights Assignment and Configure for Logon as a Service. I also made my service account a member of the administrators service.

Saturday, 4 May 2013

Bootable USBs - IMG to USB, ISO to USB

Option: Balena Etcher

Option
ISO to USB: use the Windows 7 USB/DVD Download Tool.

Option
IMG to USB disk imager: Win32 Disk Imager - http://sourceforge.net/projects/win32diskimager/?source=dlp

Option 3 (worked the best)
Manual steps for IMG or ISO to USB for Windows 7 or 8 is described here:
This approach involves creating the bootable USB separately from copying the files over.

Plug in your USB Flash drive if you have not already done so.
Start a Command Prompt as an administrator (click the Start button and type CMD, right-click on cmd.exe and select “Run as administrator" and accept the UAC prompt, assuming you are using Windows Vista or Windows 7)

Type diskpart and then press ENTER For each line, type the parts on BOLD and press ENTER after each entry, the notes are for reference only

DISKPART> list disk (note: this will list the disks on your system. Typically look for the one that matches the capacity of your USB flash drive)
DISKPART> select disk x (note: x is the number for your USB flash drive you obtained from the list command above)
DISKPART> clean (note: this will erase your USB flash drive)
DISKPART> create partition primary (note: this will create a new primary partition on the USB Flash drive)
DISKPART> select partition 1 (note: this will select the partition you just created)
DISKPART> active (note: this will set the new partition as active, which identifies it as a valid system partition)
DISKPART> format FS=NTFS QUICK (note: this will perform a quick format on the USB Flash drive)
DISKPART> assign (note: this will assign a drive letter to the partition)
DISKPART> exit

d, Now we need to put the boot files from the ISO image you downloaded earlier on to the USB Flash drive. You will need to mount the ISO image using SlySoft’s Virtual CloneDrive. To do this, right-click on the ISO image you downloaded (i.e. Windows8-ConsumerPreview-64bit-English.iso) and select “Mount”. If you do not see the “Mount” option, it may mean that the Virtual Clone Drive (or similar) tool is not installed. Once you have selcted “Mount”, a drive letter will be assigned to the ISO image. Make a note as to what drive letter has been assigned to the ISO, in my case drive “F:”.

Next, you will need to start a Command Prompt as an administrator (click the Start button and type CMD, right-click on cmd.exe and select “Run as administrator" and accept the UAC prompt, assuming you are using Windows Vista or Windows 7).

Navigate to your ISO drive, in my case “F:” and type the following:

cd \boot (thanks Ron T for pointing this out)

bootsect /nt60 y: (note: where y: is the drive letter assigned to your USB Flash drive – this will copy across the boot files)

e, Lastly we will need to copy the installation files across from the ISO image to the USB Flash drive. To do this, type the following:

XCOPY X:\*.* Y:\ /E /J /H (note: where x: is the drive letter assigned to your ISO image and y: is the drive letter assigned to your USB Flash Drive)

You should note have a Windows 8 Bootable USB flash drive.

NEW: Option 4

Use WinUSB Maker:

http://blog.powerbiz.net.au/online-tools/how-to-create-a-bootable-usb-from-windows-8-1-and-windows-server-2012r2-iso-media/