ClosedXML det enkla sättet att exportera till Excel

Jul 23

I flera projekt har jag använt ClosedXML för att spara i Excelformat. Kan verkligen rekommendera den. Den förenklar OpenXML formatet betydligt. För ett exempel. Gå till den här demositen och klicka på Excel så laddas data som man ser till Excel. Lagerhantering. ClosedXML finns att hämta ned via Nuget eller codeplex. Det är bara att skriva: Install-Package ClosedXML...

Powershell run sql scripts

Jul 18

In my work today I have to run many sql scripts that other have written. We are talking 100 of them. They are configurations, T-SQL code changes, moving data, patches from developers. They can be in nested directories. Some times some of them fail for different reason. I have used Powershell for this. But decided now to try to refine the script and also make it...

Jun 27

Project Euler problem 4 T-SQL

Jun 07

Project Euler problem 4 was easier then 3. A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91*99 Find the largest palindrome made from the product of two 3-digit numbers. 1 2 3 4 5 6 7 8 9 10 11 12 13 USE tempdb WITH Scheherazade (i) AS ( SELECT TOP 600...

Project Euler problem 3 T-SQL Find Prime factors

Jun 06

Project Euler Problem 3 is: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? I thought of finding prime numbers and try to divide the number 600851475143 with them and then check if I found all the factors and finding the biggest one. For finding primes quickly under 10 millions Sieve of Eratosthenes is...

Sorting Chinese Characters in Javascript

May 27

To start learning to write a plug-in for jQuery component Datatables  I have made a webpage  http://sorting.lcube.se/. You can try to sort on different terms there. I plan to explain how Chinese characters are sorted and tell how I make the sorting and what troubles i get into. The first problem I had was that i thought  三 (san1) came after 二 (Er4). I was convinced...