orca

Stories submitted by orca

Papercut vs smtp4dev - Testing mail sending locally(www.improve.dk)

submitted by orcaorca(820) 1 year, 10 months ago

Testing mail functionality in code using external mail servers has always been a hassle. If the mail manages to dodge antispam and various other mischievous services, it'll probably take several minutes to receive. On our Exchange servers it'll typically take 10-15 minutes before a locally sent mail actually arrives back in my inbox. We can do better! read more...

add a comment |category: |Views: 39

tags: another

Bundling image requests for increased performance(www.improve.dk)

submitted by orcaorca(820) 1 year, 11 months ago

A common scenario in RIA's is to show a large amount of small pictures on a single page. Let's say we want to show 100 images in a grid. While the simplest approach is to just put in 100 image objects and load in the images one by one, I believe it can be done smarter... read more...

add a comment |category: |Views: 8

tags: another

Writing a calculator in C# using SableCC(improve.dk)

submitted by orcaorca(820) 2 years, 7 months ago

Writing a calculator is a simple task - just add nine buttons labeled 1-9 and add a plus and minus button and we're almost good to go. In this entry I'm going to write a calculator called SimpleCalc that does not have a GUI, instead it'll take in an arbitrary expression and calculate the results of it. The input I'll use as my immediate goal is: 25-37+2*(1.22+cos(5))*sin(5)*2+5%2*3*sqrt(5+2) read more...

add a comment |category: |Views: 33

tags: another

Combining paths with multiple parts(improve.dk)

submitted by orcaorca(820) 2 years, 8 months ago

Improving on Path.Combine to more easily enable the combination of multiple path parts. read more...

add a comment |category: |Views: 2

tags: another

The cost of latent logging code(improve.dk)

submitted by orcaorca(820) 2 years, 8 months ago

Logging is an integral part of most applications, whether it's for logging performance metrics or causality data. Avoiding performance hits due to logging can be tricky though as we don't want to spend CPU cycles on the logging infrastructure when logging is disabled, while still keeping the full logging ability when required. read more...

add a comment |category: |Views: 8

tags: another

Implementing a simple genetic algorithm(improve.dk)

submitted by orcaorca(820) 3 years ago

In this blog post I'll give a quick introduction to what genetic algorithms are and what they can be used for. We'll implement a genetic algorithm that attempts to guess an RGB color by evolving upon a random set of initial guesses, until it at some point evolves into the correct RGB value. read more...

add a comment |category: |Views: 499

tags: another

Solving deadlocks through locking hints(improve.dk)

submitted by orcaorca(820) 3 years, 1 month ago

Deadlocks in any database can be a hard beast to weed out, especially since they may hide latently in your code, awaiting that specific moment when they explode. An API website, exposing a series of webservices, had been working fine for months, until I decided to run my client app with a lot more threads than usual. read more...

add a comment |category: |Views: 19

tags: another

Using Squid as a reverse proxy with a .NET url rewriter(improve.dk)

submitted by orcaorca(820) 3 years, 1 month ago

Once you start receiving visitors from all over the world, a new kind of scaling issue arise. This article looks at how we can use the open source Squid proxy to alleviate the problem. read more...

add a comment |category: |Views: 10

tags: another

Sorting projects and solution folders in VS 2008(whoknew.dk)

submitted by orcaorca(820) 3 years, 2 months ago

How to get projects & folders sorted correctly in VS2008! read more...

add a comment |category: |Views: 39

tags: another

Deciphering a SQL Server data page(improve.dk)

submitted by orcaorca(820) 3 years, 2 months ago

SQL Server stores all of it's data in what is basically a large array of "pages". Each page is exactly 8kb and can contain various kinds of data, depending on the page type. In this entry we'll explore how to decipher a data page. read more...

add a comment |category: |Views: 6

tags: another

Query Optimization - A Case Study(improve.dk)

submitted by orcaorca(820) 3 years, 2 months ago

What is the normal process of determining the need of an optimization, and how to actually do it? This is a case study from today. read more...

add a comment |category: |Views: 15

tags: another

Utilizing transactional NTFS through .NET(improve.dk)

submitted by orcaorca(820) 3 years, 2 months ago

We're used to using transactions when dealing with the database layer. Transactions ensure we can perform multiple queries as one atomic event, either they all succed or they all fail, obeying the rules of ACIDity. Until Vista, performing transactional file operations haven't been possible. read more...

add a comment |category: |Views: 118

tags: another

Generic Dijkstra's Algorithm(improve.dk)

submitted by orcaorca(820) 4 years ago

Through various projects, I've had to do some shortest-path finding in a connected graph. An efficient and straight-forward way to do this is using Dijkstra's Algorithm. While I've used the algorithm on several occasions, it's only now that I've rewritten it in generic form. read more...

add a comment |category: |Views: 229

tags: another

Spawning threads in ASP.NET can be dangerous(improve.dk)

submitted by orcaorca(820) 4 years ago

In my earlier blog post about the dangers of using Response.TransmitFile, I gave an example of a workaround involving spawning a new thread in the ASP.NET page. While this does solve the issue at hand, it presents us with a new way to kill our application even quicker than last. read more...

add a comment |category: |Views: 10

tags: another

Mapping datareader to objects using Reflection.Emit(improve.dk)

submitted by orcaorca(820) 4 years ago

I've previously written of how to automatically map a DataTable into a strongly typed collection of objects. There's a problem though, it's not fast... I wanted to improve on it, and this is what I ended up with. read more...

add a comment |category: |Views: 182

tags: another

Response.TransmitFile + Close will kill your application(improve.dk)

submitted by orcaorca(820) 4 years, 1 month ago

Just before last weekend I noticed that a website I'm responsible for started spitting out "Server is busy" messages, not something you want to see on a website with millions of visitors per day. The quickfix was to recycle the application pool, and thus I solved the symptoms by setting a 15 mins recycle cycle on all the application pools. Not exactly optimal, but sometimes pissing your pants is the way to go. read more...

add a comment |category: |Views: 72

tags: another