A Dark Pattern is a type of user interface that appears to have been carefully crafted to trick users into doing things, such as buying insurance with their purchase or signing up for recurring bills.
We developers have a big responsibility. Martin Fowler and Erik Dörnenburg (both ThoughtWorks) did a great presentation about that at the GOTO Aarhus 2014 Conference.
A quote:
“The developer who wrote that code is every bit as responsible as the person who told them to do it. You have a choice. You have a responsibility to ensure that your users are well treated and to reject dark patterns,” says Fowler. “We have a whole profession of people writing software and doing enormous things to change the way we live in the world.”
I’ve been experimenting with the Delphi hinting directives lately to make it easier to migrate some libraries to newer versions of Delphi and newer platforms.
Up to Delphi 5 you didn’t have any means to declare code obsolete. You had to find clever ways around it.
Warnings for hinting directives
When referring to identifiers marked with a hinting directive, you can get various warning messages that depend on the kind of identifier: unit, or other symbol. Read the rest of this entry »
After that, reset all your Git repositories in ContinuaCI.
To view all the repositories on the server, follow either of these steps:
A:
Logon as an administrator with the rights to view all repositories on the Continua CI server.
Click on the shield icon in the top bar.
Then click on “CI Server”.
In the list on the left, scroll down and click “Repositories”.
B:
Logon as an administrator with the rights to view all repositories on the Continua CI server.
Note the URL in the address bar of your browser (for instance http://localhost:8080/ci).
Replace the /ci part of your URL with /administration/ci/repositories (so you end up at something like http://localhost:8080/administration/ci/repositories).
Go to that URL.
Now you are in the repositories section, where you see all the repositories configured on the Continua CI. Each repository has a [Reset] link in the right most column.
On StackOverflow very few people even noticed the question, probably wondering “why?”.
I’m using these links for positive and negative testing of some http / https handling code that needs to be good at coping with positive and negative responses.
In my testing life, I’ve learned the hard way that both negative and positive tests are core part of your suite, hence the question.
Bosak posted an interesting piece of code on StackOverflow last year. His particular code was in C#, but it does not matter what kind of compiler you use:
Sometimes a compiler will complain about unreachable code, for instance when it thinks a function never returns a value.
But you know the program logic does.
Simple solution: When you have code that never should be reached: throw an appropriate exception.
public static int GetInt(int number)
{
int[] ints = new int[]{ 3, 7, 9, int.MaxValue };
foreach (int i in ints)
if (number <= i)
return i;
return int.MaxValue; //this should be unreachable code since the last int is int.MaxValue and number <= int.MaxValue is allways true so the above code will allways return
}
It turns out that question is a lot harder in .NET than it is in Delphi. I already had a gut feeling of this when at clients I saw many more .NET applications leaking WINWORD.EXE stray processes than Delphi applications, even though both kinds were calling Quit on the Word application object.
Delphi has a deterministic way of coping with interfaces (hence you can do a One-liner RAII in Delphi, or make a memento): Interface references are released at the end of their scope.
.NET has non-deterministic finalization of the Common Language Runtime (CLR) and has Runtime Callable Wrappers (RCWs) around your COM references which are sometimes created “on the fly”.
The combination of non-deterministic finalization and RCWs can be very confusing, so lets start with the parts first. Read the rest of this entry »