Archive for the ‘Random’ Category

Vedas

Vedas by Nicholas Alan Cope and Dustin Edward Arnold

Vedas by Nicholas Alan Cope and Dustin Edward Arnold

From their blog:

Vedas is an ongoing project broadly based on the theme ‘knowledge’. Specifically the changes in thought established by Copernicus’ De revolutionibus orbium coelestium (On the Revolutions of the Celestial Spheres). One of the earliest documents of the scientific revolution. It re-assessed man’s place in the cosmos and placed him at no greater value than other creatures on earth.

Knowledge, it seems; is at once both expansive and contractive. It is a value exchange. For some it shakes foundations, de-stabaizes values and opens up the sheer terror of possibility. For others it signifies hope, advancement and discovery.

MegaRace

One of the earliest computer games I played was MegaRace, which came bundled with a Quantex Pentium 60Mhz PC by dad bought sometime around the end of 1994. It was a cheesy game (really cheesy), but it was fun to play. The FMV race tracks were visually impressive for the time and the combat racing was exciting despite only being able to move cars side-to-side.

MegaRace: Particle Accelerator

The chiptune soundtrack, composed by Stéphane Picq, was particularly memorable. For those interested, this fan site has Ogg Vorbis encodings of the music for the race tracks as well as an MP3 of an FMV ending sequence. Well worth a listen.

Master disks for Doom

Caught this tweet from @idSoftware showing the original master disks for Doom:

Doom master disks

Native vs. HTML5 hybrid

Facebook recently released a new version of its iOS app in order to fix a number of issues with the previous releases. The Facebook app has been notorious for being slow, buggy, and simply lackluster overall. The problem touted by many was the fact that it was not a native iOS app in that it relied on UIWebView containers to display content; this post brings such speculation front and center. However, I’m not sure I agree that the blame lies with UIWebView. The problems with the Facebook app, as far as I could tell, centered around lag in loading content, or or simply not loading content due to connection timeouts. Two comments in the post, I think, point out the real issues:

This article is ridiculous. Not caching data is [the] fault of the developers, not Uiwebview. And seriously, blaming the slowness on HTML? What does the format of the data have to do with anything? There is no reason their dev cycle isn’t compatible with a decent iOS app. iOS development at Facebook is not a priority. Period. That is the only reason the app sucks. It sucks because they wrote a shitty app. Not because of Uiwebview. Not because they use HTML. Because they wrote a shitty app.

Late to the conversation here but Robert Jacobson makes an excellent point: your criticisms are specific to the implementation of the FB app and not the concept of hybrid HTML5 apps. You specifically point out inefficient and inconsistent web service calls that cause many of the problems. Even a native app will be at the mercy of a poorly written web service. I appreciate all the research you’ve done for this article but it is disappointing that it is getting referenced elsewhere on the web for an example of why HTML hybrid apps are bad. You’ve got a good critique of the Facebook iOS app implementation here. This does not even come close to a fair analysis of HTML5 hybrid mobile applications as an implementation strategy.

The last quote brings up an important point, many are now soured by the idea of a HTML5 hybrid mobile application, which is unfortunate because it’s a architecture that would work well for many developers and alleviates the burden (at least to some degree) of supporting multiple mobile platforms.

Looking ahead, I’d bet on HTML5 and web technologies in general. You’ll never get native performance, but as mobile devices become more powerful the tradeoff, platform flexibility and ease-of-development in exchange for lower performance, will become a non-issue for all but the most intensive applications (e.g. games). I toyed around with PhoneGap (before it was bought by Adobe and split off into PhoneGap and Apache Cordova) last year and was pretty happy with the results. I did have a number of frustrations, but those weren’t due to performance, but to bugs and rendering issues in a number of HTML5 mobile frameworks (jQuery Mobile, jQTouch) and webkit mobile itself (support for position:fixed; not available in iOS 4 at the time, supported in iOS 5 which had just hit the market); I’m not pessimistic here, these are things that will improve (or have already improved) as mobile software development matures.

View from the ISS at Night

Absolutely stunning,

View from the ISS at Night from Knate Myers on Vimeo.

Gotham

Gotham City by Anton Furst,

Gotham by Anton Furst

From The Architecture of the Comic Book City:

Of Gotham City’s later iterations, the city undergoes a great transformation into fully-realized dystopia, as evidenced by the Gotham of Batman: The Destroyer Series and Anton Furst’s conceptual drawings for Tim Burton’s Batman. In the Destroyer comics, which themselves acted as a tie-in to the Burton film, Batman navigates a dying metropolis, a monochromatic world of crumbling infrastructure and derelict monuments.

Ellipsizer

A significant number of projects I’ve worked on have, at some point, involved truncating text and tacking on an ellipsis. The problem is, it’s difficult to do it precisely, as doing so requires exact metrics for fonts used and exact dimensions of whatever area the text is contained within; information usually not readily available. So it’s usually necessary to do some sort of approximation of the maximum number of characters that can fit within the container. However, this method only works well for fixed-width fonts; with variable-width fonts the result is a significant error/over-estimate (so the string is cut off well before it needs to be), as the width of characters can be significantly different (e.g. “i” vs “m”).

One idea I had to reduce this error was to specify a relative width (i.e. weight) for certain characters. In general, most characters would have a width of 1.0, but whitespace, period, comma, lowercase ‘i’, semicolon, etc. would have a width less than 1.0. With these widths, a length function can be defined which is a sum of the character widths, and the result is a value that indicates the length of the string relative not only to the number of characters rendered but also to the width of the characters rendered. A maximum threshold is still needed, but it no longer specified an absolute maximum number of characters, instead it’s the maximum number of full-width (width = 1.0) characters that can be rendered in the given area.

Of course, someone else had the same idea, but I didn’t like the code presented – the String.replaceAll() call every iteration made me cringe. Even with immutable strings, this is something that can be done in O(n) time as long as you can reference individual characters and grab a sub-string. However, one issue presented in the post that I didn’t think about was that strings should only be truncated at certain points (a space, a hyphen) and not simply chop off words in the middle.

My solution is in Javascript, but the operations should carry over easily to any language.

Ellipsizer class

Ellipsizer = function(_maxLength) {

    
this.maxLength = _maxLength;        

    
this.getLetterWidth = function(letter)
    {                
        
if(letter == '.' || letter == ' ' || letter == ',' || letter == '|' || letter == '\'' || letter == ':' || letter == ';' || letter == '!')
            
return 0.25;
    
        
if(letter == 'j' || letter == 'l' || letter == 'i' || letter == '^' || letter == '(' || letter == ')' || letter == '[' || letter == ']' || letter == '"')
            
return 0.5;
    
        
return 1;
    }
    
    
this.isCharCutpoint = function(ch)
    {
        
if(ch == ' ' || ch == '-' || ch == '.' )
            
return true;
            
        
return false;
    }
    
    
this.cut = function(str)
    {
    
        
var strWeightedLength = 0;
        
var lastCutpoint = 0; // point of whitespace, hyphen, etc. (point where we can cut string)
        
var curSubStr = '';
        
for(var i=0; i<str.length; i++)
        {
            
var letter = str.charAt(i);
            strWeightedLength +=
this.getLetterWidth(letter);
            
            
if(this.isCharCutpoint(letter))
            {
                lastCutpoint = i;
            }
            
            
if(strWeightedLength >= this.maxLength)
            {
                curSubStr = str.substr(0, lastCutpoint);
                
break;
            }
        }
    
        
var result = curSubStr + "…";
        
return result;
    }
    
}

Example

$(document).ready(function() {

    $(
'#ellipsize').click(function() {
    
        $(
'#text-to-cut p').each(function() {
            
var str = $(this).text();
            
var ellipsizer = new Ellipsizer(64);                    
            $(
this).text( ellipsizer.cut(str) );                        
        });
        
        
return false;
    });                
});

Maximum length of 64 to provide for the following constraints:

Ellipsizer

Ellipsizer

Live Demo

There’s quite a bit that can be improved here, mainly in recognizing more characters as quarter- or half-width characters, or having more classes of widths (0.3, 0.75, etc.) and assigning characters to them. However, for a first-pass, this seems to work pretty well and it’s important to remember that this is still a pretty rough approximation.

Baby duck syndrome

Browsing Wikipedia and came across this interesting tidbit,

In human–computer interaction, baby duck syndrome denotes the tendency for computer users to “imprint” on the first system they learn, then judge other systems by their similarity to that first system. The result is that “users generally prefer systems similar to those they learned on and dislike unfamiliar systems.” The issue may present itself relatively early in a computer user’s experience, and has been observed to impede education of students in new software systems.

baby duck

Bridge in fog

Bridge in Fog II by oriontrail,

Bridge in fog II

Subway relics

Old, dirty, and one-third of them don’t work

Subway Payphone