LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

Window Clippings 3.0 versus Gadwin

Introduction After reading “Taking Proper Screenshots in Windows for Blogs or Tutorials” by Scott Hanselman I decided to give Window Clippings 3.0 a go. I have used Gadwin Printscreen in the past and blogged about it. I will try to compare the two. Window Clippings v Gadwin Window clippings like Gadwin has many settings but the one setting that I like the most is this. You can remove he background and keep the shadows of your window. As you can see above that gives some good results. Nice and clean. Compared to the normal printscreen below.

Read More...

RavenDB and changing our model

Introduction I have been messing with RavenDB over the past few days. Nothing serious, just getting a feel for it. [Trying out RavenDB with VB.Net][1] [Trying out RavenDB with VB.Net and images][2] And I wanted to know what happens when I change my model, add properties and remove properties. I know I expected these two to just work but one always has to test it’s theories and not take things for granted.

Read More...

Trying out RavenDB with VB.Net and images

Introduction So [yesterday I started to play with RavenDB][1] and today I wanted to add images to my document database. Testing So first thing I did was to adapt my model. Namespace Model Public Class Plant Public Property Id As String Public Property LatinName As String Public Property EnglishNames As ISet(Of String) Public Property FlowerColor As String Public Property PlantImage As Image End Class End Namespace``` And then I added a test. ```vbnet &lt;Test()&gt; Public Sub CanAddImageToPlantAndRetrieveIt() Dim service = New PlantService(RavenDBSession.GetTestSession) service.AddPLant(New Plant With {.PlantImage = Image.FromFile("Testsfilesfagus.jpg")}) Dim plant = service.GetPlant("1") Assert.IsNotNull(plant.PlantImage) End Sub``` Since I prefer for this to be a bit more lifelike I choose to copy an image to my project and see if I can load that. And yes that worked. Easy as pie. ## For real Of course the test just shows me I have something there but now I need to try if I can show that image too. So time to hook up a winform. So I created a form. <div class="image_block"> <a href="https://lessthandot.z19.web.core.windows.net/wp-content/uploads/users/chrissie1/ravendb/RavenDB1.PNG?mtime=1303629797"><img alt="" src="https://lessthandot.z19.web.core.windows.net/wp-content/uploads/users/chrissie1/ravendb/RavenDB1.PNG?mtime=1303629797" width="438" height="382" /></a> </div> And added some code to it. ```vbnet Imports Plants.Model Imports Plants.Services Public Class Form1 Private _service As PlantService Public Sub New(ByVal service As PlantService) InitializeComponent() _service = service End Sub Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click Dim _OpenDialog1 As New OpenFileDialog If _OpenDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then picPlantImage.Image = Image.FromFile(_OpenDialog1.FileName) End If End Sub Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click _service.AddPLant(New Plant() With {.LatinName = txtLatinName.Text, .PlantImage = picPlantImage.Image}) End Sub Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click Dim plant = _service.GetPlant("1") txtLatinName.Text = plant.LatinName picPlantImage.Image = plant.PlantImage txtNumberOfPlants.Text = _service.NumberOfPlants.ToString End Sub Private Sub btnEmpty_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEmpty.Click txtLatinName.Text = "" picPlantImage.Image = Nothing txtNumberOfPlants.Text = "" End Sub End Class And some startup code so I can inject the service.

Read More...

Trying out RavenDB with VB.Net

Introduction If you don’t know what a document database is you should go to Google and find out quick smart. I’m not saying document database are the future, but they are a part of it and they will suit some situations better than RDBMSes. I already did some blogposts about MongoDB in the past. [Time to try MongoDB][1] [Trying out MongoDB persisting objects][2] [MongoDB persisting System.Drawing.Image][3] And now I’m going to try out [RavenDB][4] by [Ayende Rahien][5] and his minions. RavenDB is native .Net.

Read More...

Difference between a Cumulative Update and Service Pack for SQL Server

I read a #SQLHELP tweet that stated it would have been nice if the SQL Server team would have waited to announce SQL Server 2008 SP1 CTP release for testing before releasing SQL Server 2008 SP1 Cumulative Update 7. To me, the tweet didn’t make much sense given the differences between a Service Pack and a Cumulative Update. A Service Pack does include all previous hotfixes that were included in Cumulative Updates. However, the difference in a Service Pack is they include actual changes or new enhancing features. Cumulative Updates are primarily released for hotfix purposes.

Read More...

SQL Server 2008 R2 SP1 CTP Available for download

Just got this in the email and I decided to share The Microsoft SQL Sustained Engineering team is pleased to announce the availability of SQL Server 2008 R2 Service Pack 1 CTP. Both the Service Pack and Feature Pack updates are available for download on the Microsoft Download Center. Service Pack 1 for SQL Server 2008 R2 includes customer product feedback, fixes to key customer issues, and hotfix solutions provided in SQL Server 2008 R2 RTM Cumulative Update 1 to 6.

Read More...

Should SQL Server Professionals Learn Oracle?

Yes, absolutely! I strongly feel that all SQL Server Database Administrators and Developers should not only learn the basics and fundamental internals of Oracle, but should expand that to others such as DB2 and Sybase. Why? SQL Server is my mojo after all. There shouldn’t be much reason to venture into Klingon territory and maybe start a database server uprising. There actually is one major reason it should be a requirement to know more than SQL Server: Not everyone runs SQL Server. (Although they may want to)

Read More...

Unit tests are not enough for validation of your method in scientific applications

Introduction A while ago I wrote a little application that could be useful in our research (forensic fiber examination). I have a bunch of unit tests and integration tests that prove that what I do works on a programmatic scale. This was the easy part. If you print the whole application I guess it would all fit on 10 pages (haven’t tried, so pure guess work). And now comes the hard part. I have to validate my method in such a way that it becomes useful for our lab to use in a routine analysis.

Read More...

Use DDL Triggers To Track Table Changes

Someone wanted to know when and by who a certain table was dropped, I told the person that you can do this with a DDL trigger.Wouldn’t it be nice if you could track exactly all the DDL statements that were executed on a table in your database? Well, you can by using DDL Triggers, DDL Triggers were added in SQL Server 2005. DDL triggers are a special kind of trigger that fire in response to Data Definition Language (DDL) statements. They can be used to perform administrative tasks in the database such as auditing and regulating database operations. A DDL trigger can be created on the database level or on the server level. In this post I will create a database level DDL trigger that will listen for the ALTER TABLE command.

Read More...

SQL Saturday

As of the date this blog post is published, there are 45 days left until this year’s SQL Saturday in Pensacola. The previous Pensacola SQL Saturdays have always sounded like much more than the everyday SQL Saturday. This was easily seen from twitter feeds and recaps posted by presenters and attendees over the last 2 years. This coming June 4th, Pensacola is doing SQL Saturday once again and I’m very excited as I’ve been picked to be part of the scheduled presenters.

Read More...