Another Day in the Life of a Programmer Gal | To curiosity…

Mar/10

13

Blogger to stop FTP publishing…

Whatever was free once, is no longer free, after all, Google has to get money out of something else, other than ads…
I had used Blogger for a while, probably since their beginning when it was acquired by Google.
I never liked to host my blog on their servers though, and I still won’t. Hosting on my own account gives me the freedom of owning anything I post, whether it is a rant, an image or just random IT knowledge.
Blogger has cut down features little by little. First the labels on the blog, then the amount of available HTML/CSS themes, now the FTP publishing.
Bottom line, you either host with them or you’ll be eventually unable to use them.

I guess the conversion to WordPress is mandatory now. No more procrastination for me.

L.

PS. On the bright side, I’ll be able to close my gmail account, I never use it and it is full of spam. I won’t force the kind people who leave comments to have a Gmail account and I’ll have full control on my ramblings…and the infrastructure that supports it.

No tags

I found one single character from the French language that its binary representation is not the same for Unicode and Windows-1252. The oe ligature. Let me rant about it…

create table test_table
(name1 varchar (1) ,
name2 nvarchar (1) )

insert test_table
values (‘œ’, ‘œ’)

select * from test_table

select ASCII(name1), ASCII(name2), Unicode(name1), unicode(name2) from test_table

select COL_LENGTH(‘test_table’,'name1′) as Length1, COL_LENGTH(‘test_table’,'name2′) as Length2 from test_table

select char(156), char(339)

drop table test_table

This character is used in the word “eggs” in French
‘des œufs’ means some eggs…

These first two sets of characters from the Latin alphabet have identical Unicode and Windows-1252 (ASCII) character code.
(Basic Latin)
http://en.wikipedia.org/wiki/Basic_Latin_Unicode_block
and
Latin-1:
http://en.wikipedia.org/wiki/Latin-1_Supplement_Unicode_block

Their binary representation is the same as they all fit in one single byte or octet.

However, the extended Latin characters do not have the same Windows-1252 (ASCII) code and Unicode code.
http://en.wikipedia.org/wiki/Latin_Extended-A_Unicode_block

From this character set, French only uses the oe ligature though.

French accents and ligatures and how to type them with the number pad:
a with grave accent
à ALT + 133 À ALT + 0192

a with circumflex
â ALT + 131 Â ALT + 0194

a with tréma
ä ALT + 132 Ä ALT + 142

a e ligature
æ ALT + 145 Æ ALT + 146

c with cedilla
ç ALT + 135 Ç ALT + 128

e with acute accent
é ALT + 130 É ALT + 144

e with grave accent
è ALT + 138 È ALT + 0200

e with circumflex
ê ALT + 136 Ê ALT + 0202

e with tréma
ë ALT + 137 Ë ALT + 0203

i with circumflex
î ALT + 140 Î ALT + 0206

i with tréma
ï ALT + 139 Ï ALT + 0207

o with circumflex
ô ALT + 147 Ô ALT + 0212

o e ligature
œ ALT + 0156 Œ ALT + 0140

u with grave accent
ù ALT + 151 Ù ALT + 0217

u with circumflex
û ALT + 150 Û ALT + 0219

u with tréma
ü ALT + 129 Ü ALT + 154

French quotation marks
« ALT + 174 » ALT + 175

Euro symbol
€ ALT + 0128

The Windows-1252 encoding can be seen here:
http://www.visibone.com/htmlref/char/webascii.htm

For more, see Joel on Software rant :-p

As most questions in technology, the answer is: it depends.

http://stackoverflow.com/questions/35366/varchar-vs-nvarchar-performance

Performance wise, varchar is more efficient, less memory space, 20% to 30% smaller indexes.
Most database drivers will interpret the incoming stream and convert to Windows-1252 encoding, if the server code page is Windows 1252.
If you use way too many characters in the extended Latin group, you have no choice but using nvarchar…if you deal with other languages that are not Romance Languages, you have no choice but nvarchar.

Cheers!

No tags

No tags

Coming from a C# world I’m trying to get a grasp on the Java language, mostly for comparison purposes and to see if really the grass is greener on the other side of the fence.

What I like so far of the Java 1.6 that I see C# might benefit from:
1. The main one is cross platform portability. I wish Mono would have more support.
2. Enums are more complex, but I’m wondering if we ever really use that complexity…
3. Static imports, but do they really add to maintainability or make it worse?

What I find confusing in Java vs C#:

1. Checked exceptions: In Java, the exceptions that a method throws must be declared and are part of a method’s public interface. They were left out from C# on purpose. Here’s an interview made by Bruce Eckel (Thinking in C++) to Anders Hejlsberg (lead C# architect and Turbo Pascal creator, I should point out I wrote my first program in Turbo Pascal :-p)…
2. Initialization blocks, not the static ones that are similar to c# static constructors but instance initialization blocks…why would you ever use them? I’m still puzzled…

No tags

Jan/10

5

Cuban flag with an HDR touch


We drove to St Agustin while visiting Florida these holidays and to my surprise they had a museum with Martí and the Cuban flag :) … mi bandera.

No tags

The reason why I published this link is because a coworker had a problem with viewing a PDF on IE6 when the cache was set to no-store over https.

The problem does not happen with Internet Explorer 7 or above or with FireFox, but the old IEs fail to retrieve the files when the cache directive is no-store or no-cache.

More of this on:

Internet Explorer file downloads over SSL do not work with the cache control headers

Unable to Open or Run Files if “Cache-Control: No Store” Header Set

and

Prevent caching when you download active documents over SSL

And another good reading on Caches on the web:

Caching Tutorial for Web Authors and Webmasters

No tags

I’m coming across more and more projects that make heavy use of xml for data integration or data exchange that lack of schema files.

First case:
My team was POC-ing the integration with a third party web service. I won’t mention names but this company is one of the main sources of collected data for rating. After a purchased subscription for monthly text files with data dumps we are also able to access their web service. This web service provides a restricted interface to the data available on the text files. The service call is an http request with some parameters passed via POST (I would say it looks REST-ful). There is no WSDL published and the service returns an XML.
The main problem here is that the documentation on the XML is a PDF, yes a PDF! that will give you examples of the XMLs obtained in the response. Yes, samples with real data and a data dictionary, for instance the Product Element means XYZ, the codeA element means DFG.
All that amount of documentation looks fancy for the untrained eye, and most business analysts look puzzle when we say the documentation is not complete… why? There is a 200 pages PDF there!!!
Yes, but is there a schema that will validate all possible combination of XML responses? No.
Will the service consumer be prepared for all possible combination of XML responses? with luck and a lot of trial and error…

From W3schools:

The purpose of an XML Schema is to define the legal building blocks of an XML document, just like a DTD.

An XML Schema:

* defines elements that can appear in a document
* defines attributes that can appear in a document
* defines which elements are child elements
* defines the order of child elements
* defines the number of child elements
* defines whether an element is empty or can include text
* defines data types for elements and attributes
* defines default and fixed values for elements and attributes

Second case:
The second time this month I came across a similar xsd-less approach was in a data exchange project. The project consisted of extracting data from two databases, building a huge xml file and applying transformations to that file to comply with CSIO standards. The transformed XML would be consumed by several external applications.
After seeing a few of the initial xml files with with the data dumps I asked, where’s the schema definition? and the answer was, there is none… Apparently the the development of the transformation engine had been contracted to a third party company that had advised the tweaks to be made on the xml to be able to transform into an AL3 file. All by trial and error…

Third case:
This case was actually some years ago. I recall suffering the consequences of an xsd-less approach when I was in charge of uploading data batches into a database to power an online quoting tool.
The XML file was provided periodically by a third party company and registered the sale prices of pre-owned models produced by that manufacturer. The data exchange wasn’t fancy, they would send me the 2GB+ xml file by secured email.
I was in charge of parsing that DOM, transform it to a schema the online tool could consume, get the differential data and dump it (via a SQL Server DTS) into the database the online tool will be fed from.
As it was a .NET project I used XPathNavigator heavily to avoid loading all the DOM in memory with an XmlDocument, my machine at the time had 512 MB.
The first two attempts worked fine, but the subsequent data batches were not so straightforward. My XPath expressions kept failing. Why?
The differences were minimal, anyone that hasn’t parsed XML or deserialize XML will consider them nuances:
One child node was before another one while in the previous document they were in reverse order, one piece of data that was before in the text area of an xml element was now an attribute of the parent element . Some elements were null sometimes, while sometimes they were completely omitted from the file and the list goes on.
I learned the lesson the hard way, we told the other end, no, we need to agree upon a schema and if the file you sent us cannot be validated against the schema we won’t acknowledge the reception…
I still jitter when I see XML exchange without an XSD…but it seems to be a recurrent theme.

No tags

I came across this article

Why use the Entity Framework? Yeah, why exactly?

refuting a marketing like article by one of the EF team members.

After using NHibernate for a while and looking into JPA and old JDO on the Java world, I don’t think I’ll get my hands on the EF any time soon, if I can avoid it.

Why? The main reasons are summarized on this site:

ADO .NET Entity Framework Vote of No Confidence

I will mention the most compelling ones to me:

  1. Main focus on the data aspect
  2. Lack of Lazy loading, hydration, dirty flagging
  3. Lack of persistence ignorance…The tight coupling of the persistence infrastructure to the entity classes largely eliminates the ability to efficiently use very tight feedback cycles on the business logic with automated testing.

As Peter Ritchie summarizes on his comment:
…if I’m a traditional TDD methodologist (for lack of a better term) and I’m building up my code base with test-first mentality then it’s all about the code. The automated tests are used for documentation of things like requirements, user stories, etc. Agile folk try to avoid documents like conceptual models, our conceptional model is the code, it’s our classes. I don’t need another conceptual modeler and I don’t need to have a modeler create new classes for me, I don’t need it to modify my classes, the classes I’ve defined for my application do exactly what they need to do.

As we build up our classes to reflect what the domain is, as we know it now, we eventually want to add the ability to persist those objects to a store of some sort. It’s at that point we being to think of OR/M. But we want to keep that persistence separate from our abstractions, keeping true to the single responsibility principle and separation of concerns. All the trappings of persistence are abstracted somewhere else.

Just my opinionated opinion…I have the gut feeling EF is sending ADO.NET back to the 1.1 version with Typed DataSets that were mere replicas of the database schema…

Ignorance is bliss and in this case persistence ignorance is a bliss I won’t give up on.

No tags

Oct/09

27

RIP Geocities

http://geocities.yahoo.com/
http://www.cnn.com/2009/TECH/10/26/geocities.closing/index.html

I had my first free sites posted there back in the late 90s…

This is how the web used to look like back then :-p

http://web.archive.org/web/19961022173245/http://www.geocities.com/

No tags

The nasty truth about misapplying duct tape solutions in serious software development is that the duct tape solution ends up creating unnecessary additional complexity because it doesn’t address the whole problem, just the symptoms. This isn’t unique to software development, but if duct tape solutions are used to achieve short term gains, then future solutions are built on a foundation of duct tape instead of some sound organizational method.

For more read: Debunking the duct tape programmer discussion on CodeProject.com

It is the work of the architect and team leads to ensure the solutions are not addressed with duct tape/patch programming approach, but there is a design and long term planning associated to every project.

I’ve seen too many solutions already that fail on deployment due to data center constraints the developer was not aware of, where were the architects here?

No tags

<< Latest posts

Older posts >>