The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for May, 2012

Searchable UTF8 Unicode Characters

Posted by jpluimers on 2012/05/31

Brilliant: site where you can Search UTF8 Unicode Characters.

If you know part of the name of a Unicode character, you can now try and find it, then copy/paste it from that site.

Edit: 20160403: that site disappeared, but this one works: Unicode Character Search and Shapecatcher.com: Unicode Character Recognition still works.

–jeroen

Posted in Development, Encoding, Power User, Software Development, Unicode, UTF-8, UTF8 | Leave a Comment »

Pointers to value and to reference types (was: delphi – Why does TValue.Make require a pointer to an object reference? – Stack Overflow)

Posted by jpluimers on 2012/05/30

Delphi seemingly makes the distinction between reference and value types disappear, especially because it hides the ^derefererncing operator for most usages:

  • there is no ^ dereferencing operator when following “class” type object instances, “interface” references and “object” type object instances, strings, open arrays and dynamic arrays: the dereferencing is implicit
  • usually you do not need the ^ dereferencing operator when

Rudy Velthuis wrote a great article on pointers in general. Though it was in the Delphi 2009 timeframe, almost everything is very valid. A few things are missing, some additions are below.

I’m not going into deep detail here right now, just a few notes to get people interested going.

Hopefully I will some time in the future to either go into more detail, or point to articles that do.

  1. “object” style object instances.
    Those have been deprecated since Delphi 1 (which introduced “class” style objects), but there are still libraries that use them, and (almost unbeleivable): they are supported in Delphi x64
  2. anonymous method references
  3. Events (method references) aka the “procedure … of object”/”function … of object”
    are implemented using the underlying TMethod type from the System unit
    always use the “Assigned” method to check if both the Data and Method field are non-nil

Even with those additions to Rudy’s list, I’m not 100% sure everything is complete now (:

–jeroen

via: delphi – Why does TValue.Make require a pointer to an object reference? – Stack Overflow.

Posted in Delphi, Development, Software Development | 4 Comments »

What you need on your Mac to develop for OS X or iOS using Delphi XE2

Posted by jpluimers on 2012/05/29

Just a few notes on things I told Delphi cross development students over the last nine months or so.

For Mac OS X apps:

  • The Platform Assistant Server that ships with Delphi XE2

For iOS apps:

Steps:

  1. Become a registered Apple Developer
  2. Download and install xCode 4 when you run on OS X 10.7 Lion or higher, or
    Download and install xCode 3 when you run on OS X 10.6 Leopard
  3. Download and install FreePascal 2.4.4
xCode includes the iOS SDK
Delphi uses the Delphi compatibility mode of FreePascal.

–jeroen

via: Developer Tools Overview – Apple Developer.

Posted in Delphi, Delphi XE2, Development, Software Development, xCode/Mac/iPad/iPhone/iOS/cocoa | 1 Comment »

Interesting: Electric Imp with Arduino (via: electric imp – developer kits)

Posted by jpluimers on 2012/05/28

Electric Imp – that wants to power The Internet of Things using imps – is introducing some really interesting hardware, one of the devevelopment kits combining Arduino and Imp on one board:

Duino: Arduino, with Imp

Featuring an ATMEGA328 processor, this board is compatible with the Arduino Uno but instead of having a USB-serial port on it, it has an Imp socket. You can use a modified version of the Arduino IDE to update the ATMEGA code from anywhere in the world when an Imp is plugged in, and use simple serial commands in your Arduino programs to control other Imp devices.

The ATMEGA will operate standalone when no imp card is inserted.

Dimensions: 72mm x 54mm x 14mm

Power supply: USB Mini-B socket (5v) or 2.1mm barrel jack (7-12v)

Price: $20

Some must read links:

–jeroen

via: electric imp – developer kits.

Posted in Arduino, Hardware Development, Hardware Interfacing, USB | 2 Comments »

How much USB power does a device use or provide? Apple Computers and Displays: Powering peripherals through USB

Posted by jpluimers on 2012/05/28

Two quotes:

Apple peripheral devices may request more than 500 mA (Milliamps) at 5 V (Volts) from a port to function or to allow for faster charging. Such Apple peripheral devices include:

  • Apple MacBook Air SuperDrive (when connected to supported computers)
  • Aluminum Wired Keyboard*
  • iPod
  • iPhone
  • iPad

Open System Profiler to find more information about peripheral power requirements, or contact the manufacturer of your peripheral. For the most accurate information about power usage, make sure your device is connected directly to your Apple computer or display before opening System Profiler.

All this because of the iPad charging challenge.

–jeroen

via: Apple Computers and Displays: Powering peripherals through USB.

Posted in Apple, Gadget, Power User | Leave a Comment »

Happy Towel Day – Today is the 11th towel day in remembrance of a truly remarkable author.

Posted by jpluimers on 2012/05/25

Today is the 11th towel day in remembrance of a truly remarkable author.

–jeroen

PS: not sure if this is legal, but I just came across a H2G2 PDF.

Posted in Opinions | Leave a Comment »

Some on-line XPath testing tools that support namespaces and XPath functions

Posted by jpluimers on 2012/05/24

In the previous post, you saw some XPath to find the ProviderManifestToken attribute in an .edmx file.

Writing XPath queries can be quite consuming, so it is nice of you can test it somewhere on-line.

Out of the on-line XPath testers, these two worked best:

Both of them support namespaces, including these XPath functionslocal-name and namespace-uri.

These failed:

If you have more on-line tools that work: please let me know!

Edit (20120524T0930):

Danny Thorpe tweeted an interesting comment:

@jpluimers If you’re compiling XPath support, make note of whether it’s XPATH 1.0 or 2.0. I think .NET only implements XPATH 1.0

Indeed, .NET only supports XPath 1.0, and worse, .NET 4 introduced a couple of issues with XSLT (see XPath and XSLT 2.0 for .NET? – Stack Overflow).

Luckily there are some goot XPath 2.0 libraries for .NET (see XPath 2.0 Libraries for .Net – Stack Overflow).

–jeroen

via: XPath tools on not-another-blog

Posted in Development, Software Development, XML, XML/XSD, XPath | Leave a Comment »

The ADO.NET Entity Framework and SQL Server 2000: the ProviderManifestToken attribute and selecting it with XPath

Posted by jpluimers on 2012/05/23

Yes. Dorothy. There are people using the ADO .NET Entity Framework with SQL Server 2000  in parallel of moving towards a more modern Microsoft SQL Server version.

Entity Framework is lovely for developing data-centric applications.

By default, Visual Studio 2010 will target SQL Server 2008 as a database. That is fine, but it is kind of invisible it does: there is no property or dialog where you can change this.

What you have to change in order to have the Entity Framework send SQL Server 2000 compatible queries is to:

  1. Right click your .edmx file
  2. Choose “Open with”
  3. Choose the “XML (text) editor”
  4. Find the  ProviderManifestToken attribute
  5. Change the value (usually from “2008”) into “2000”
  6. Save the .edmx file
  7. Build and run your application

A few caveats:

Read the rest of this entry »

Posted in .NET, .NET ORM, C#, C# 2.0, C# 3.0, C# 4.0, Development, EF Entity Framework, Software Development, SQL Server, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012 | Leave a Comment »

How do I disable the fault-tolerant heap? – The Old New Thing – Site Home – MSDN Blogs

Posted by jpluimers on 2012/05/22

Raymond Chen:

what if you don’t want the fault-tolerant heap? For example, during program development, you probably want to disable the fault-tolerant heap for your program: If the program is crashing, then it should crash so you can debug it!

–jeroen

via: How do I disable the fault-tolerant heap? – The Old New Thing – Site Home – MSDN Blogs.

Posted in Development, Software Development | Leave a Comment »

Excel 2010/2007: Convert text to a table or vice versa (via: Word – Office.com)

Posted by jpluimers on 2012/05/21

The introduction of the Ribbon in Office 2007 and 2010 often makes me ask “why are things so complicated now, that were so easy until Office 2003”.

One of the things that were very close together in Word 2003, was converting text to and from tables: they were in adjecent menu items.

Not any more, as you can see in the Convert text to a table or vice versa  topic on the Microsoft site. There is even a Dummies article on this topic.

Summarized:

Convert text to a table

  1. Tab Insert,
  2. Group Tables,
  3. click Table,
  4. then click Convert Text to Table.

Of course the keyboard shortcuts are “easy” to remember: Alt, N, T, V

Convert a table to text

  1. When you have a (portion of a) table selected, you get a new contextual tab set called Table Tools.
  2. Tab Layout,
  3. Group  Data,
  4. click Convert to Text.

Of course the keyboard shortcuts are “easy” to remember: Alt, J,L, V

Word 2007/2010: Convert Table to Text

–jeroen

via: Convert text to a table or vice versa – Word – Office.com.
Naming of ribbon UI elements
Naming of ribbon UI elements

Posted in Keyboards and Keyboard Shortcuts, Office, Power User, Word | Leave a Comment »