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,861 other subscribers

Archive for 2013

Resolving base-conflicts installing samba on OpenSUSE 12.x

Posted by jpluimers on 2013/09/02

When installing samba on a “minimal” server openSUSE 12.x can give you a funny error that the install process conflicts with a “patterns-openSUSE-minimal_base-conflicts” package as for instance described in OpenSUSE 12.2 Samba Standalone Server With tdbsam Backend | HowtoForge – Linux Howtos and Tutorials.

The first time I got that message, I was confused, and it took me a while to find out about the meaning of the base-conflicts package, as it was hard to get a Google search query with really meaningful result.

At last I found a Gitorious entry describing the minimal_base-conflicts package:

create a separate minimal_base-conflicts pattern

this allows to keep the minimal_base pattern upon installing a conflicting package. A better solution would be weak-conflicts but we don’t have that atm

From there I found the security request openFATE – #312150: weak conflicts/softlocks/no-recommends for patterns:

Installation of a pattern also draws in packages that are not in the pattern but only recommended by those listed in the pattern. For the “minimal” pattern this behavior is not desirable though as one really wants a minimal installation without the optional stuff.

So basically, the minimal_base-conflicts package allows the minimal_base package to reference package without pulling in a truckload of package (that would basically violate the idea of a “minimal_base” install).

If you want to install one of the truckload (samba is one of them), then you need to uninstall the minimal_base-conflicts package.

–jeroen

via: OpenSUSE 12.2 Samba Standalone Server With tdbsam Backend | HowtoForge – Linux Howtos and Tutorials.

Posted in *nix, Linux, openSuSE, Power User, SuSE Linux | Leave a Comment »

XSD/XML Schemas: resolving `Namespace ” is not available to be referenced in this schema` (via: StackOverflow)

Posted by jpluimers on 2013/09/01

While working on my Delphi: First try on an XSD for .groupproj files, I bumped into an error `Namespace ” is not available to be referenced in this schema`.

I added a targetNamespace attribute to the GroupProj.xsd so the .grouproj files would use the right namespace.

That resulted into two funny errors:

  1. Namespace ” is not available to be referenced in this schema.
    Visual Studio (which I normally use for editing XSD) would only throw this error on these elements:
    <xsd:element ...>
    So it would not throw them on nodes using the empty namespace.
    That was really confusing!
  2. When validating .grouproj files using this GroupProj.xsd, I would get this error for all .groupproj files:
    System.Xml.Schema.XmlSchemaValidationException: Type ‘<type>’ is not declared. (in this case for ‘<type>’  ‘ProjectType’).
    That was odd too: the ‘ProjectType’ was indeed declared, and should be valid.

I could hardly find any information about the latter error, but the former gave a few useful hits.

Thanks User weston – Stack Overflow. for answering this: it made me smack to my head (like usual, a case of EBCAK). Read the rest of this entry »

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development, XML/XSD, XSD | Tagged: , , | 2 Comments »

Delphi: First try on an XSD for .groupproj files

Posted by jpluimers on 2013/08/31

Delphi introduced the .groupproj files to support MSBUILD.

I couldn’t find an XSD for it, but need to do some fiddling with those files, so I created one. It’s not very detailed, I think it gets most of the definition right.

The checkin is on my BeSharp.net mercurial repository on BitBucket:

First try on an XSD for .groupproj files.

–jeroen

via: jeroenp / BeSharp.net / commit / c122bbdef42e — Bitbucket.

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Leave a Comment »

Yuko Nakamura – Google+ – How do you search movies? Trick: “Movie poster images by color” #googlesearch #movie #trick

Posted by jpluimers on 2013/08/31

I was aware of Finally, proof that all movie trailers use the same color palette.

Now I know that movie posters differ there palettes according to the genre of movie.

Thanks Lars Fosdal – Google+. for re-sharing this: How do you search (Google) movies?  

It got me doing some searching myself, and the colour distribution has been researched before too:

Back to the shared post, as it adds genre to the colours:

Trick: “Movie posters” by color on Google Images

  1. Type “movie posters”
  2. Click images  > Search tools > Color

[Movies by Colors]

Posted in Google, GoogleSearch, Power User | Tagged: , , | Leave a Comment »

Some notes on how VMware Workstation/Player “Easy Installs” SUSE Linux

Posted by jpluimers on 2013/08/30

When VMware Workstation/Player does an Easy Install of SUSE Linux (and most other Linuxes), it does this:

  • mount a CD drive with the autoinst.iso image
  • mount a floppy drive with the autoinst.flp image

For Linux, both of them contain autoinst.xml files to automate the boot process.

It has a few drawbacks including a hardcoded boot partition size and unmount problems, so if you don’t want those, follow the guidelines at How to Stop Easy Install in VMware Workstation.

–jeroen

Posted in *nix, Linux, openSuSE, Power User, SuSE Linux, Virtualization, VMware, VMware Workstation | Leave a Comment »

More Delphi PDF manuals (via: Cape Cod Gunny Does Delphi: The One Manual Every Delphi Programmer Should Have!)

Posted by jpluimers on 2013/08/29

Cape Cod Gunny found the PDF of the Delphi 7 Developer’s Guide (1100+ pages of good reading): Cape Cod Gunny Does Delphi: The One Manual Every Delphi Programmer Should Have!.

There are in fact quite a few more PDF manuals of older Borland/CodeGear/Embarcadero products:

site:http://docs.embarcadero.com/products/rad_studio filetype:pdf

These I like most: Read the rest of this entry »

Posted in Delphi, Development, Software Development | Leave a Comment »

Delphi: about 3 weeks ago, the XE5 branch was added to the RadStudioDemos repository:

Posted by jpluimers on 2013/08/29

Too bad the Sourceforge does not do stats pages any more, so you it is a lot harder to correlate project activity with potential release dates any more.

But: about 3 weeks ago, the XE5 branch was added to the RadStudioDemos repository:

http://sourceforge.net/p/radstudiodemos/code/788/tree/branches/RadStudio_XE5/

–jeroen

via: Correlation of Delphi Release/Update dates and activity on SourceForge project “RAD Studio Demo Code” « The Wiert Corner – irregular stream of stuff.

Posted in Delphi, Delphi XE5, Development, Software Development | 2 Comments »

Visual Studio: break on all CLR exceptions, not only the unhandled ones.

Posted by jpluimers on 2013/08/29

When you have a layered exception handling (for instance to translate general exceptions into domain or business exceptions, and want to control which exceptions trickle up to where), then from a debugger perspective, most exceptions  actually handled.

However debugging those layers, it often makes sens to be able to break where all these exceptions are actually fired.

The screenshots (click on each to enlarge) are for Visual Studio 2010, but it works in any Visual Studio version and (since it is a debugger feature, not a language one) for all .NET languages I tried so far.

Note that as of Visual Studio 2010, if you disable these, it still breaks when exceptions are thrown from code called through reflection. This seems intentional and has 3 workarounds, but it might have been reverted in Visual Studio 2012.

This is a setting stored on the Solution level (.suo file) in Visual studio which by default is turned off. Luckily, it is very easy to turn this feature on, for instance for CLR (.NET Common Language Runtime) exceptions:

  1. In the “Debug” menu, choose “Exceptions” (or Press Ctrl+D, E),
  2. Wait a few moments for the dialog to appear
  3. Put a checkmark in the “Thrown” column for the “Comon Language Runtime Exceptions” row.
  4. Click the “OK” button. Read the rest of this entry »

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, F#, Prism, 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 | 1 Comment »

On Windows: Do not install the Android SDK ADT bundle in a path with spaces

Posted by jpluimers on 2013/08/28

Some 20 years after someone thought it was a nice idea to allow spaces in path names on Windows, it still is a bad idea to rely that just “works” for everything.

Today I tried to see if it still applied what I mentioned 2 years ago during the German BASTA! Fall conference in the Rheingoldhalle when talking about cross platform .NET development using MonoDroid/MonoTouch/Visual Studio:

Android SDK
– http://developer.android.com/sdk/index.html
– Windows:
- http://dl.google.com/android/installer_r13-windows.exe
- http://dl.google.com/android/android-sdk_r13-windows.zip
Do not install in a directory with spaces (not C:\Program Files, but C:\android-sdk)

And it does still apply: though not mentioned in the Android SDK/ADT documentation, most of the batch files in the Android SDK ADT bundle are not compatible being stored in a path that has spaces.

Unquoted referrals to paths like this are used in most SDK batch files:

cd /d %~dp0

The only way to run these batch files is with the current directory being the directory of the batch file itself, or referring to them in their fully quoted form.

Another correct way would be to use short names, but that’s only done in find_java.bat:

%~dps0

Summary of the batch files and how they are affected:


+ …\adt-bundle-windows-x86-20130522\sdk\build-tools\android-4.2.2\dx.bat
+ …\adt-bundle-windows-x86-20130522\sdk\tools\android.bat
+ …\adt-bundle-windows-x86-20130522\sdk\tools\ddms.bat
+ …\adt-bundle-windows-x86-20130522\sdk\tools\draw9patch.bat
+ …\adt-bundle-windows-x86-20130522\sdk\tools\hierarchyviewer.bat
+ …\adt-bundle-windows-x86-20130522\sdk\tools\jobb.bat
+ …\adt-bundle-windows-x86-20130522\sdk\tools\lint.bat
+ …\adt-bundle-windows-x86-20130522\sdk\tools\monitor.bat
+ …\adt-bundle-windows-x86-20130522\sdk\tools\monkeyrunner.bat
+ …\adt-bundle-windows-x86-20130522\sdk\tools\traceview.bat
+ …\adt-bundle-windows-x86-20130522\sdk\tools\uiautomatorviewer.bat
– …\adt-bundle-windows-x86-20130522\sdk\tools\lib\find_java.bat
+ …\adt-bundle-windows-x86-20130522\sdk\tools\lib\post_tools_install.bat
* …\adt-bundle-windows-x86-20130522\sdk\tools\proguard\bin\proguard.bat
* …\adt-bundle-windows-x86-20130522\sdk\tools\proguard\bin\proguardgui.bat
* …\adt-bundle-windows-x86-20130522\sdk\tools\proguard\bin\retrace.bat
– …\adt-bundle-windows-x86-20130522\sdk\tools\templates\gradle\wrapper\gradlew.bat
– compatible with spaces in path
+ incompatible with spaces in path
* won't run at all when current directory is different from directory of batch file

view raw

gistfile1.txt

hosted with ❤ by GitHub

(Side note: most incompatible batch files correctly do `for %%i in (“%cd%”) do set prog_dir=%%~fsi`)

So: make sure “…”  is a path not containing spaces.

–jeroen

Posted in Android, BASTA!, Conferences, Development, Event, Mobile Development, Software Development | Tagged: , , , , , , , | Leave a Comment »

.NET/C#: extension method shows what SQL + parameter values are sent to the server (via StackOverwlow)

Posted by jpluimers on 2013/08/28

Every once in a while you are in situation where you are not allowed to use SQL Server Profiler, nor to see any query plans, but you still want see the SQL going from your .NET apps to the database server.

With that SQL, you can feed it through your favourite database tool, and see where the culprit is.

There are various ways of getting rudimentary or a bit more advanced SQL out of this. Flapper posted a solution that is specific for SQL Server (and requries both ObjectExtensions.cs and StringExtensions.cs from the DotNetX library), but posted more ready to use SQL.

I opted – and wanted to hank Justin Harris – for this piece of code on StackOverflow, which works on any IDbCommand (so you can use it for any ADO.NET data provider, like SQL Server, OLE DB, Oracle, etc):

While you will not be able to plug is into something like Enterprise Manager to run it works for logging.

public static string ToReadableString(this IDbCommand command)
{
    StringBuilder builder = new StringBuilder();
    if (command.CommandType == CommandType.StoredProcedure)
        builder.AppendLine("Stored procedure: " + command.CommandText);
    else
        builder.AppendLine("Sql command: " + command.CommandText);
    if (command.Parameters.Count > 0)
        builder.AppendLine("With the following parameters.");
    foreach (IDataParameter param in command.Parameters)
    {
        builder.AppendFormat(
            "     Paramater {0}: {1}",
            param.ParameterName,
            (param.Value == null ?
            "NULL" : param.Value.ToString())).AppendLine();
    }
    return builder.ToString();
}

answered Apr 12 ’10 at 20:26; juharr

You saved my day! Not being allowed to use the profiler, this is a great way to get the actual SQL, then run it from SSMS or the Enterprise Manager. – Jeroen Wiert Pluimers

I pasted it in a DataExtensions class like this: Read the rest of this entry »

Posted in .NET, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »