Subversion – check state of local work copy

Using “SlikSvn” (and most other svn clients), you can relatively easily check the state of your locally checked out copy on a Windows pc.

  • Are some objects not yet committed
  • Are some objects not yet added to Subversion

Add this to a .CMD file in Windows. In the output it will list objects that needs to be handled – most likely:

  • Commit Add/Change to Subversion
  • Release lock
CheckSVNState.CMD
——————————-
@ECHO OFF
SET DT=%DATE: =0%
SET TT=%TIME: =0%

SET OUTFILE=EDI_Local_Svn_%DT:~-4%%DT:~3,2%%DT:~0,2%.txt
C:\bin\SlikSvn\bin\svn status S:\SVNLocal | FIND /V “? ” > c:\temp\%OUTFILE%
——————————-

You can also check for objects that should have been added to Subversion, but have been missed:

CheckSVNMissingAdd.CMD
——————————-
@ECHO OFF

REM
REM Find all files in a given local working-copy that are NOT under version-control
REM

C:\bin\SlikSvn\bin\svn status S:\SVNLocal | find “? ” | find /v “\bin” | find /v “\obj” | find /v “.vs” | find /v “btproj.user” | find /v “csproj.user” | find /v “\UpgradeLog” | find /v “.btp.cs” | find /v “.xsd.cs” | find /v “.btm.cs” | more
——————————-

The files excluded by the various FIND commands needs to be adapted to the type of files you work with. The command above was create for Biztalk development.

Inspired by SO

Limit number of simultaneous connections to a WCF host

General method (works also for HTTP)

BizTalk MaxConnections

BizTalk enables users to configure WCF host to limit the maximum connections to a particular address.

The connectionManagement element in the btsntsvc.config file is designed to specify the number of connections to a given address. By default BizTalk allows for 2 connections for any given WCF host.

How to limit number of connections

https://stackoverflow.com/questions/3591283/biztalk-how-to-limit-number-of-connections-to-a-wcf-service

Throttling

https://docs.microsoft.com/en-us/biztalk/technical-guides/optimizing-biztalk-server-wcf-adapter-performance

Add the ServiceThrottlingBehavior service behavior to a WCF-Custom or WCF-CustomIsolated Receive Location and use the following settings:

PDF generation from C#

The free (MIT License) library PDFSharp can generate PDFs programmatically using C#.

It cannot (itself) convert HTML to PDFs, but some 3rd party solutions exist for that purpose

HTML to PDF using PDFSharp

It can also handle some CSS (but it requires a specific syntax – ie. not all valid CSS is usable here)


Another option is Essential Objects PDF which contains an inbuilt HTML->PDF converter. This is NOT free, but an evaluation version is available.

It works very well, but contains an entire HTML engine, and hence, consumes quite a lot of memory. So much in fact, that you have to put a limit to the amount of simultaneous executions if you use it in an integration-scenario

On the positive side, it generates PDFs which looks very nice

Compilation of Biztalk graphical map results in OutOfMemory

After upgrading our UBL schemas from 2.0 to 2.1, our maps utilizing that schema would not compile any more. All of them – except one – would build for a long-long time, and would finally result in an OutOfMemoryException. The map that was not affected, was a pure XSLT map.

The UBL schemas have now gotten so big, that Visual Studio can generate an OutOfMemory while building a Biztalk graphical map (pure XSLT maps are not affected). It also takes quite some time before the OutOfMemory occurs – in the mean while, you can see the VS process continually allocating memory.

Open the .BTM file in Notepad, and change the GenerateDefaultFixedNodes attribute from “Yes” to “No“.

Save and build again

Ref: Biztalk map – Infinite loop

Subversion – get latest file but do NOT checkout

You may want to get the latest version of a file in a subversion repository, but NOT checking the file out (which will then create the .svn directory, enabling you to later on updating and committing changes)

To get the latest version of a Subversion file – enabling you to update and commit afterwards:

svn checkout URL PATH

To only get the latest version of a Subversion file – NO updates and commits possible (a so-called unversioned tree):

svn export URL PATH

Where are Windows Sticky Notes stored in the filesystem

Windows Sticky Notes in the filesystem / How to back them up

In Windows 7, they were stored in a propritary binary format here:

%AppData%\Microsoft\Sticky Notes\StickyNotes.snt

In Windows 10 they are stored in a SQLite database her:

%LocalAppData%\Packages\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe\LocalState\plum.sqlite

https://www.winhelponline.com/blog/recover-backup-sticky-notes-data-file-windows-10/

 

Philips Hue – Simple Control page

I have been looking for a simple control-page for Philips Hue lights for several reasons. I really do not like the app and not the least that you are only able to control the Hue lights from the two main “smart”phone brands. Secondly, if you want a control-panel in the livingroom, you primarily want the simple actions – turn on and off with an immediately recognizable functionality.

Inspired by this work, the download is sadly not available any more.

I have made a similar page, which can be downloaded here.

Inside the .html file, you only have to modify these two lines

 bridge='10.0.0.1' // Set ip-address or DNS name of your Hue bridge 
 hash='Hue user-hash' // Set the username-hash which is registered on the Hue Bridge

To use it, you can either run it directly for your own pc, or place it on a server inside your own network.

Cannot add resource to Biztalk – No .CLB data in the memory or stream

We are running a Biztalk 2016 env., and here I have experienced issues when adding a BiztalkAssembly to Biztalk using the rightclick + “Add Resource” on an Application in the Biztalk Admin Console. It gives this error:

It currently only occurs with a single DLL, containing a schema, where there are LOTS of maps that Biztalk want to remove (and redeploy afterwards) before adding this schema.

It gives exactly the same error, if I try to add the resource using BTSTASK

BTSTASK AddResource -ApplicationName:"Object.Invoice" -Type:"System.BizTalk:BizTalkAssembly" -OverWrite -Options:GacOnAdd,GacOnImport,GacOnInstall -Server:biztalkdev01\dbinst01 -Database:BizTalkMgmtDb -Source:c:\dll\BizTalk.Object.Invoice.Schemas.CDM_Invoice.dll

It also makes no difference, if I run the BTSTASK in a standard CMD or as “Administrator”

The only thing that works, is if I add the resource from another directory, than the one I added it from the previous time. In the example above, it works, if I change the source to “c:\dll2\……” (and copy the DLL there)

[srs_total_visitors]

 

Controlling non-reachable Philips Hue Lights

Like so many others, I am from time to time affected by my lights going non-reachable.

Even when the light is “reachable”: false, the light is surprisingly still controllable by the hue bridge (if you specifically ask the bridge to eg. turn the light on via the Hue API)

It is somewhat strange, how the bridge can do that, if it thinks that the light is not reachable. It is of course possible, that it just send the command in the blind.

But what sadly does not work, are the rules and the schedules, which only (seem to) work on “reachable”: true lights.

I have not found any way to make rules work on non-reachable lights, but schedules works just fine, if you just add the light to a group, and make the schedule operate on the group in stead.

For instance:
Make a group:

{
  "lights": [
    "9"
  ],
  "name": "SpecialLights",
  "type": "LightGroup"
}

the group were created with id “5”

Make a schedule on the group:

{
  "name": "SpecialLight-On-18",
  "description": "SpecialLight on around 18",
  "command": {
    "address": "/api/<apikey>/groups/5/action",
    "body": {
      "on": true
    },
    "method": "PUT"
  },
  "localtime": "W127/T18:01:00A00:16:00"
}

Now the schedules work just fine – even when the light is “reachable”: false

[srs_total_visitors]