Archive for July, 2014
Posted by jpluimers on 2014/07/15
Any web developer should know how to capture and trace HTTP traffic.
I’ve written about Fiddler before, but that’s a Windows specific tool.
Time to have a small list of posts and links to tools that work on various platforms.
I’ve left out Java based tools as there have been too many security issues with Java over the last couple of years.
Tools: Read the rest of this entry »
Posted in *nix, Apple, Development, Fiddler, Linux, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, OS X 10.8 Mountain Lion, Power User, SOAP/WebServices, Software Development, SuSE Linux, Web Development, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | 2 Comments »
Posted by jpluimers on 2014/07/14
via: What’s the difference between F5 and F8 at the boot screen? – The Old New Thing – Site Home – MSDN Blogs.
F5 has become F8, and with Windows 8, a (sometimes automatic) reboot option, even for getting into the BIOS settings.
–jeroen
Posted in BIOS, Boot, Power User, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Leave a Comment »
Posted by jpluimers on 2014/07/11
Like a lens cap, lens hoods are also easy to misplace, loose or break.
For most DLSR lenses, there are Free printable cardboard lens hoods.
–jeroen
Posted in LifeHacker, Nikon, Photography, Power User | 1 Comment »
Posted by jpluimers on 2014/07/10
In case I need to export DocX in .NET again: DocX – Home which is also at github.com/WordDocX/DocX
(I did it both with Word Automation and OOXML, they were a pain).
–jeroen
Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, Development, Office, Office 2007, Office 2010, Office 2013, Office PIA, Software Development | Leave a Comment »
Posted by jpluimers on 2014/07/09
If you ever had a Windows SVN tool like TortoiseSVN remember your password on Windows, then look under this directory (thanks ee.):
%AppData%\Subversion\auth
Part of the trick is %AppData%, which points to your user profile (which might not be on your C: drive, or not on a drive at all).
Under that directory, is a set directories creating credentials that depend on the authentication method (thans M4N who pointed me to the TortoiseSVN authentication section on the docs): Read the rest of this entry »
Posted in Development, Software Development, Source Code Management, Subversion/SVN | Leave a Comment »
Posted by jpluimers on 2014/07/08
Small batch file that shows you the files on the path. It is a simple version that does not take into account built-in commands of cmd.exe, DOSKEY macros or PATHEXT environment variable: it just matches a name of an executable. Rob van der Woude has a complete which.bat (text version here) that does take into account all of the above. This is the poor man’s version:
@echo off
for %%f in (%1) do @echo. %%~$PATH:f
goto :eof
It uses this little trick from the FOR command:
| %~$PATH:I |
Searches the directories listed in the PATH environment variable and expands %I to the fully qualified name of the first one found. If the environment variable name is not defined or the file is not found by the search, this modifier expands to the empty string. |
–jeroen
Posted in Batch-Files, Development, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2014/07/07
I tried Tame.it for a while to condense my twitter timeline and separate noise from information.
It looks like my tweeps are so disparate that Tame finds it hard to distill the information.
But if you have a similar tweeps, Tame.it could do a much better job.
–jeroen
via Tame | Your Twitter timeline.
Posted in Power User, SocialMedia, Twitter | 2 Comments »
Posted by jpluimers on 2014/07/04
At first sight you’d think that getting the weekday name of a date in Excel is as easy as this simple example using the [Wayback/Archive] WEEKDAY function as an intermediate:
A1 cell: 1/8/2009
B1 cell: =TEXT(WEEKDAY(A1),"dddd")
This will, for the given date, print the corresponding day.
The outcome for the 1st of August 2009 (we do dd/mm/yyyy over here) is Saturday, and you might think it is the right way to do it.
Well, as [Wayback/Archive] AdamV explains in [Wayback/Archive] it is not: the outcome is OK on certain systems, but not OK on other systems.
The actual solution is even simpler, but before we go there, lets first explain what is potentially wrong with the above code:
A1 has a date value
=WEEKDAY(A1)
obtains an integer value
in this case: 7
=TEXT(7, "dddd")
obtains the weekday name of the integer value 7
in this case: SATURDAY
- The latter is only because of two things:
- First the way
TEXT operates:
=TEXT(B1,"dddd, yyyy-mm-dd")
returns this full date:
Saturday, 1900-01-07
Which means that if you don’t fill in a month or year, it uses January of 1900.
- Second:
Excel thinks the 1st of January 1900 is a Sunday (actually, it is Monday)
so for Excel, the 7th of January 1900 is a Saturday.
Excel has a [Wayback/Archive] bug where weekdays before the 1st of March 1900 are wrong (it is the famous 1900 problem, which somewhat is the inverse of the – also famous – [Wayback/Archive] 2000 is not a leap year problem) which won’t get fixed as [Wayback/Archive] Excel wants to stay compatible with Lotus-1-2-3 which also has the bug.
So it is by luck that Excel gets the above way right.
To make sure it is always right, just format your date as "dddd" as AdamV suggests:
=TEXT(A1,"dddd")
This is much shorter than the first example, and always works well.
--jeroen
PS – via: worksheet function – How do I get the day name into a cell in Excel? – Super User.
Posted in Excel, Office, Power User | Leave a Comment »
Posted by jpluimers on 2014/07/03
Joseph G. Mitzen posted a very interesting (and elaborate <g>) comment on a post from me in 2009: Delphi – for … in on enumerated data types « The Wiert Corner – irregular stream of stuff.
The crux of his post is about consistency of your tools. And clearly, the Delphi team has some work to do in that regard especially when compared to the Python world where consistency is key (and takes a lot of time to introduce new features as a side effect).
He refers to the ADUG post For-in Enumeration | Australian Delphi User Group Members by DaddyHPriest that lists a number of areas where Delphi does not have enumerator support for.
Which reminds me I promised to publish some more enumeration demos showing what kind of code could be eliminated if things became more consistent.
Hopefully this summer gives me a bit more time for that (:
–jeroen
via: Delphi – for … in on enumerated data types « The Wiert Corner – irregular stream of stuff.
Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Software Development | 4 Comments »
Posted by jpluimers on 2014/07/03
I’ve done quite a bit of VB.NET maintenance lately.
Most of that code was riddled with CType, both for conversions and casts. Quite a bit code had Option Explicit and Option Strict Off. A lot of those CType constructions had empty Try / Catch / End Try blocks around them.
Those empty catch blocks are a code smell. They pretend to be able to survive any exceptional disaster, but in practice you can’t. You have to indicate what kinds of disasters you can handle, for instance if a meteorite hits your data center (thanks George Stocker).
Turning off Option Strict can be OK under many circumstances (the default is off), but having Option Explicit off is usually a code smell as well, just like On Error Resume Next (which was also in plenty of the source code).
I do understand a lot of VB.NET source comes from people having programmed in VB 6, VBScript or VBA for a long time where those constructs were more common. But writing code in the 21st century is much more about writing code that you can prove to be right. Having proper error handling and compiler type checking is a big part of that.
It pays to go with the idiom, for example read the good and bad ways of vb.net – Safest way to check for integer.
Back to CType: basically you have do distinguish between conversions and casts. The reason is that when you know it will be a form of cast, CType is way to expensive. And if you know you will be doing conversions, than casting is not what you want.
Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, Development, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 7.0, VB.NET 7.1, VB.NET 8.0, VB.NET 9.0 | Leave a Comment »