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...

Read More

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...

Read More

排序中国汉字字符 javascript – Datatables – jQuery

Jun 27

为了学习为jQuery 的 组件数据表写插件 ,我为其做了一个专门的网站http://sorting.lcube.se/ 。您可以尝试为不同的术语排序。我打算解释中国字符的排序,并告诉大家我的排序方法和在此期间遇到的麻烦。 我遇到的第一个问题是,我认为三是在二之后出现的。我曾经深信这是一个错误。但通过仔细思考之后,我意识到数字3三的部首里的笔画数少于二的部首数量,二的部首里有两个笔画。 今天,在JavaScript只有少许的几行代码 。诀窍是使用 localCompare ( 参考 )。然而众所周知这一功能在不同的网页浏览器存在这问题。DataTables 的作者Allan Jardine给我指出了这一点。我会在我的博客上进一步探索看是否给汉字排序带来问题。...

Read More

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...

Read More

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...

Read More

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...

Read More

Sortera kinesiska tecken i javascript

May 27

För att träna på att skriva plug-in till jQuery komponenten Datatables så har jag gjort en websida: http://sorting.lcube.se/ . Där kan man prova sortera på olika begrepp med min plug-in. Jag tänker förklara hur jag förstått hur kinesiska tecken sorteras samt utveckla hur jag gör  och vilka bekymmer som uppstår. Det första problemet jag hade var att jag trodde att 三...

Read More