≡ Menu

Why is this Website Garbled?

I use Thesis from DIYthemes for this blog, and have found it to be a very versatile system for customizing their themes. However, I saw that my HTML 5 validation was failing due in part to the use of deprecated attributes on a link tag. I decided to report the problem via the DIYthemes website, and found something very strange!

DIYthemes site on Chrome

This is how the DIYthemes website looked on Chrome.

At first I thought that perhaps I had ended up on their page in a foreign language, or maybe their site had been hacked. When I viewed the HTML source, the text appeared as it should. If I selected some of the text and copied and pasted it into mt text editor, the missing letters were there! Perhaps a JavaScript was running that hid certain letters?

When I opened the page in Internet Explorer 11, the page looked correct:

DIYthemes on IE11

How the website looked on IE 11.

At this point, I took a look at the Chrome DevTools window (you can use F12 to get there) to see if that would yield the information I needed. I saw a warning in the Console pane that might lead to an answer: “Failed to decode downloaded font: data:application/font-woff…”

DevTools window on DIYthemes page

The Chrome Developer Tools window can be very helpful!

By turning off the font-family tags in the DevTools window, I watched the website begin to look normal, albeit in a more generic font than what the site is supposed to use. So apparently, if a font is not properly decoded by the browser, it can omit characters and cause the site to look like the first picture above.

I’m not yet certain why my Chrome browser did not decode the font, where IE 11 did. This could be a bug on the DIYthemes site, or a problem with Chrome. In any case, this error can happen for a number of reasons, and some of those reasons can be found on Stack Overflow.

EF Database First with ASP.NET MVC 5 and Oracle Database 12c

There is a great article called “EF Database First with ASP.NET MVC” by Tom FitzMacken that is part of Microsoft’s ASP.NET MVC tutorial.

I wanted to create a website using the steps outlined here, except instead of using a SQL Server database (as was presented in the article), I wanted to use an Oracle 12c database. Unfortunately, Oracle was not an option in the list of Data Sources as in the image below:

no Oracle option available

Oracle DB was not an option.

I had the basic Oracle setup on my development server, however, I found that I did not have Oracle Developer Tools for Visual Studio. I installed the 32-bit version and rebooted the server; I have not tested the 64-bit version for this particular project. Also, I changed the .NET Framework from 4.5 to 4.6. (From what I have read, 4.52 is the minimum that will work with the EF 6 / Oracle setup.) Lastly, I installed several NuGet packages:

  1. Official Oracle ODP.NET, Managed Driver
  2. Official Oracle ODP.NET, Managed Entity Framework Driver
  3. Oracle Data Provider for .NET (ODP.NET) Managed Driver
  4. Oracle Rdb Entity Framework Provider
NuGet Package Manager

NuGet Package Manager

I closed and reopened Visual Studio 2013, and reopened the solution I had created. Now, when adding a Model as in step 2 of the article, I had Oracle options in the Data Source list!

an Oracle option is available

Oracle is now an option!

After selecting the Oracle option, you can complete setting up the connection as below. TNS is available as an option; if you use this, the connection string to Oracle must bu set up in your TNSnames file.

Connection Properties dialog box

Select your Oracle schema.

After this is done, you can continue with the linked tutorial above!

Cloning a Repository from the Command Line with Bonobo Git Server

I recently set up Bonobo Git Server on a Windows Server running IIS.

I implemented Windows Authentication for the Bonobo Web interface as per the instructions on the Bonobo site.

I created a repository called “Test” using the Web interface, which — assuming you use the folder names in the instructions — is at http://servername/Bonobo.Git.Server.Interface.

However, when trying to clone the Test repository at the command line, I was getting nowhere when putting in the username as “domain\username”, as is the usual convention in Windows.

The URL for cloning this repository using “git clone” is http://servername/Bonobo.Git.Server/Test.git. By entering the username as “username@domain” (all lowercase, no quotes) at the username prompt, and entering the user’s password at the password prompt, I was able to clone the repository.

While I did not try this, I think http://username@domain@servername/Bonobo.Git.Server/Test.git as the URL should work as well.

Creating a Table on Oracle Database with an Identity Column

UPDATE: I was informed by an Oracle Database expert that starting with Oracle 12c, you can indeed have an identity column, and no trigger or sequence is required. The below post still applies to Oracle 11g and older.

If most of your database experience is with SQL Server (as mine is), you’re probably used to creating tables there with IDENTITY columns. For example:

CREATE TABLE [dbo].[tbl_Example](
	[unique_key] [int] PRIMARY KEY IDENTITY(1,1),
	[AuthUser] [varchar](50) NOT NULL,
	[AccessType] [varchar](50) NOT NULL,
	[SiteGrp] [varchar](50) NOT NULL,
	[Approval] [varchar](1) NULL,
	[EmailAddr] [varchar](50) NULL

If you wanted to create a table with the same attributes in Oracle, you must remember that there is no IDENTITY modifier. Instead, you must create a trigger that will fire before an insert to generate the equivalent of the IDENTITY value. However, before creating the trigger, you must create a sequence that will hold the numeric value that will be inserted by the trigger.

The table creation statement above, translated for Oracle usage, would look like this:

	AccessType VARCHAR(50) NOT NULL,
	Approval VARCHAR(1) NULL,
	EmailAddr VARCHAR(50) NULL



If You’ve Ever Wanted to Learn Regular Expressions…

Code School has a new class for that! I’d like to say at this point that I don’t now, nor have I ever, had any financial ties to Code School. I say that because I know I’ve done a fair amount of free advertising here for them. It’s only because their online classes are the best I’ve seen yet.

Regular Expressions, a.k.a. “regex”, is one of those subjects about which every developer should have at least a rudimentary understanding. There are plenty of books (such as Mastering Regular Expressions from O’Reilly) and websites (like RegExr) that teach the concepts and how to build them.

However, for someone that has never used them before, Code School’s Breaking the Ice With Regular Expressions is a great introduction that can be completed in a matter of hours.