Showing posts with label google. Show all posts
Showing posts with label google. Show all posts

Friday, April 5, 2013

Optional HTML, good idea?

B
ack along the trail I was following in my post on carousels and web design firms I stumbled across Google's HTML and CSS Style Guide. This is, of course, just one resource in a sea of options, and as the name suggests, "more like guidelines, anyway." I found it useful to glance over to get an idea of what to do with my code once I had grasped some of the basic stuff.

The Style Guide has some helpful reminders about indentation (don't mix spaces and tabs, indent child elements), plus general etiquette (stick with the previous author's style, be consistent). The whole thing can be summed up as: optimize as much as possible, made code easy for collaborators to scan through. Somewhere halfway down the page, though, I found a section on optional HTML tags.

In all fairness, both Google and the WhatWG HTML5 spec frame this concept with "you may" and "consider" and other non-mandatory type phrasing. But I thought, hey, here's another way to be kind of minimalist, keep things tidy, not have more clutter than is really needed. And indeed, I could simply be rid of the <html>, <head>, <body> and a whole pile of closing tags. But! the traditionalist and skeptic in me took a pause and said, "Should I really mess with this right now? I haven't noticed this implemented anywhere, and my classes/research have all indicated that closing tags are the basis of a well-formed markup language. Maybe this is best left for another day."

Well ok, inner-skeptic, but I still want to learn a little more. So, some questions:

  • What exactly constitutes a valid, well-formed markup language?
A markup language (ML just for now, though not to be confused with ML, the functional programming language I just couldn't deal with) is used to annotate and describe a document. I'm not going to go into the history and fascinating variety of MLs here, so suffice to say that in this case, for HTML or XML, the markup is intended to indicate what each tagged element contains. In HTML this could be a <header> or a <section>, which provide the browser with standard elements to display and style accordingly. XML uses tags to describe content, too, but is best suited to databases (DB). Since it is used in DBs, it is particularly necessary to have both starting and ending tags and to completely conform with the DB definition or else any references to each element would just fail. Not going into that here.

So a well-formed and valid bunch of whicheverML follows all the rules in the relevant specification and passes tests like the W3C validator. Well-formed generally refers to syntax, so elements that are arranged according the rules are syntactically correct. The traditional definition of well-formed includes closing anything that has an opening tag and properly nesting elements. A valid ML also follows its Document Type Definition (DTD), a sort of grammar dictionary for how to apply the language (here's the HTML4 DTD, for example). See the W3C validator's info here.

  • How much of a difference in speed does tag omission really confer? 
There's not a ton of this out there on the surface, but again, Google has been implementing, or rather, omitting, the optional tags to decrease file size. When every bit counts, taking out even just a few characters here and there can add up to a big difference. According to the Google Developers article and video on reducing HTML document file size, this can actually result in "5-20% savings" in load time.

There's a conversation on StackOverflow from 2010 about how much of a difference this could actually make. It's hypothesized that especially at Google's size, "</body></html> is 14 characters and at 3 billion searches per day, it amounts to approximately39.12 GB of data per day ignoring compressions, or around 26 GB if we take gzipping into account." And another discussion from about the same time that goes more in depth on the whole issue

  • Are there any arguments against tag omission on the whole?
Some people argue for tag omission for readability, others argue against tag omission for readability. So either way, people will eventually stumble through your code. The best reason not to omit is probably compatibility. Some browsers might not recognize an unclosed element properly, some scripts may get confused, it really depends what the content is expected to do. It winds up being a personal choice: you can include the superfluous, or you can be hyper meticulous and make sure you are only omitting tags that can be omitted and not getting confused in the process.

  • Is this just one of those crazy, Google-is-way-ahead-of-everyone-else-again things?
Hard to say. Tag omission is out there, but most people don't need the speed that badly. The implementation status on the HTML5 spec only suggests that tag omission hasn't been tested on the latest browser builds.

Monday, February 18, 2013

Gitifying the OneWeekWebsiteList

N
ote to self: document as I go, not after the fact. It felt a lot like I was running in circles trying to find documentation and n00b help as I was working on this, so I didn't take notes along the way. A lot of the point of this first step was to familiarise myself with a few new systems (Git, GitHub, Terminal, Unix command line, Vim), as well as just publishing my strategy for creating a bigger, better website for myself. The entire project is more about learning than having a finished product (although it would be nice to sell a photo again, someday), so each post is intended as a reference for myself, as you'll note from the links peppered throughout the text below.

I apologise in advance, too, for these posts likely being very dry, incoherent and plentiful. I'm often writing from the top of my head and focusing on developing and documenting rather than fine literary prose. Coincidentally, my horoscope for today:
Once you break down a task into manageable chunks, you'll discover that your challenges are not really that hard. You are absolutely capable of meeting the goal you projected at the beginning.
Essential breakdown of Gitification of The List:
  • Wrote project todo list.
  • Thought about purpose and use of list- dynamic, changing, updating steps as I go to keep track of overall process.
  • Translated list into HTML 
  • Created GitHub repository (repo) for new project, cloned repo onto local drive
  • Updated and committed ReadMe file on GitHub
  • Discovered that this threw my local clone out of sync, figured out basics of git pull.
  • Finally figured out how to control the vim editor in Terminal (thanks largely to the patient human who helped me with basic commands) to add messages to merges and commits when I forget to use the -m option .
  • At this point, the list was basically done, and pushed to GitHub. 
  • Researched how to publish a repo to the web so that it looks like an actual page. I had seen a friend do this with a basic design portfolio, but couldn't find a simple button to push in order to see repo files in anything other than raw code. 
  • Turns out I had to create an entire new branch in my repo, move everything, and when it still didn't seem to be working, realised I had left off the obvious !DOCTYPE declaration.  Actually, I could have just left it and popped in a reference or something. oh well.
  • Had also found this Google Style Guide, which mentioned that some element tags are optional in HTML5. So I guess my dunderheadedness over formatting my initial list file wasn't actually critical, but I haven't implemented the recommendations yet. Also ran it past a W3C validator
  • Meanwhile, I just need to get the published OneWeekWebsiteList.html into my blogpost, somehow, in a way that would save me from updating said blogpost every time I modified the original file. I found the embed element in the HTML5 spec to be a simple solution. Presumably there's some way I should have done this with PHP or scripting or one of those things I don't know how to do yet.
  • So, one properly sized embed element and a div element with simple border later, the list mostly worked as dynamic content. 

Unfortunately, I couldn't discover until after publishing that the embedded HTML file doesn't display in Google Reader. It's visible in the RSS feed itself, so the problem comes somewhere in the aggregator?

I would love to hear about better solutions to this problem, as I just went for the first option I could find in the interest of moving forward. I've also just now switched to an object element, since embed seems to be intended for non-HTML content. Any thoughts?

Monday, January 21, 2013

New Year, New Garden

fter a relatively successful summer of vegetables last year, this year I think I'll take a more studied approach. Well, somewhat more studied, really just building slowly on the last go-round and adding a few things. Mostly, I now have a large enough crop of compost to use for a bed or two, and I know how big those dang zucchini will get.

Unfortunately, this means I do need to dig a few new beds, possibly three or four. I already have a satellite view of the house to transform into a (to scale) chart of the yard in order to keep track of what was where which year. As most gardeners these days know, it's best to rotate which crop goes in what bed each year, so any pests don't get too cozy and the soil isn't depleted (can't find a good reference right now). I've heard lots of advice on keeping a garden journal of notes about each step of the process, how different plants fared, etc. Frankly, I didn't, it seemed like one more thing to do and for the first year, fine-tuning was not a big concern.

So, mapping aside, that leaves us with planning what plants and when. I'm still looking for a source for hops, sage and tarragon, seed or seedling, if anyone in the DC area wants to trade (I get most of my seeds from Johnny's Selected Seeds).

As you'll see below, quite a few things need to germinate indoors as long as eight weeks before the last frost (early April in Alexandria). My google calendar is now laden with "PLANT CANTALOUPE" and such. I'm going to try out a grow light this time as my seedlings got a little too sperky* last year, even on a South-facing windowsill. This does mean that I'll also need some sort of heat source underneath my seedling trays. Although the basement is a pretty regular temperature, it's only around 65F and seeds prefer something more like 68 or 70.

Anywho, I've put together this little chart for my own benefit, but thought it might be of use to some other backyard gardener. Feel free to copy the format or just get inspiration. Click the chart to see it full-size in google drive and to copy or peruse further.

seeds, spreadsheet, alexandria, va, garden, planning schedule



*I grew up using this word and only recently encountered several people who said "What?! 'Sperky'??" It means what it sounds like. Don't suppose anyone else uses it?

Wednesday, October 31, 2012

Frustrated Ramblings

his is not my usual style, and I don't like posting things like this, but I've spent too much of today irked with various Google products. Below is a version of a post I made to a Gmail Google Group. I could go into more detail and try to get across how frustrated I am that Google is making it more and more difficult to do simple things simply, rather than the other way around. I can't even easily find a basic "feedback on our new product" option anymore, which is pretty disappointing.

Google, what happened? Back in 2004 when we all got Gmail for the first time everything was so friendly and thoughtful, and now I get the sinking feeling that users are being left behind in the interest of a shiny new future. Stop pushing so hard.

So here's a couple thoughts on the trial version of the new compose setup for gmail:

1) I've seen way, way too many people saying "whelp, guess I'll get used to it" about this and other gmail/google changes. This seems wrong: the UI should conform to user needs, not the user to the UI. While some people may prefer this new layout, it's not right for everyone. Which brings me to:

2) Not all messages are going to be short little snippets that should be composed in a mini window, tucked over the inbox, or even popped out. Many people compose complex, lengthy emails and require the space both physically on the screen and mentally by having the new message be the only thing visible.

On top of that, hiding all the controls makes it much more difficult to see what's available at a glance, remember to add links or formatting, and as other users have said, to glance at the send list to make sure a recipients work/home email has been selected.

Therefore, perhaps the new compose could be implemented more like the priority inboxes, as a choice that each user can make and switch between based on actual, personal needs.


More from WebMonkey.com, ParisLemon (who wants still less), GHacks (which refers to people like me as "advanced users") and some snarky people over here. You get the idea.

Thursday, June 23, 2011

Social butterfly

s far as I can tell, the best thing about living in DC is that there are more events than one can ever hope to attend. Better yet, a good portion of them are entirely free to the public, funded by donation or (cough) your tax dollars. After discovering this last summer when attending the outdoor movie series on the National Mall and in Crystal City, I thought, hey, I should put together a calendar of some of the events I'm interested in and share it with people. Presumably, a fair chunk of my [iiiitty-bitty] reader-base is located in the DC metro area, so hopefully someone will find this useful.

The events contained within were discovered via the following:


The calendar will update on this page when new events are added, so check back, or use the "+Google Calendar" button on the bottom right corner to subscribe in Google Calendar. Alternatively, use this .ics file in ical or other calendar applications. 


    Suggestions for additions are welcome.

    ps. I'm trying out some schmancy drop caps at the top of each post. If they don't display/line up well, let me know. Blogger doesn't have much of a way to add something like that without it being an image, and because the settings for images (e.g. the border) are universal, I don't think I can change that for an individual post. 

    Tuesday, May 4, 2010

    Lessons learned

    Commenting and leaving your website/blog info here and there on the interwebs can actually generate traffic. So sayeth my recent interpretation of the data I've been collecting on this very blog. Before you freak out, no, I can't tell exactly who you are, and if you're on the web you're spreading information about your surfing habits all over the place anyway. I left a comment over on Meredith Farkas' blog, Information Wants to be Free after the CIL2010 conference along with my blog address, and got a few clicks off it. That's certainly one way networking works, and why we should form connections online. (There's a building slowly on top of foundations metaphor here somwhere)

    Posting links on certain days of the week, and times of day results in different levels of click-interest. I got a ton of clicks yesterday, and I suspect this is because people were le bored at work on a Monday. I'll have to devise a controlled experiment to test this theory. Maybe posting the same number of links of similar type every day? There are also notable changes in click frequency based on how I've "sold" the link in my tweet or text.

    People are more likely to respond to a post or a link if they can see that others have done so before them. Facebook posts with lots of comments or clicks get shuffled to the top in the "Top Stories" feed, and if there are several comments saying "omg, so cool" and "this is great!" everyone else will click, too.

    Which brings me to the irritating point that people are frequently more interested in visual content than in text. (this post is already screwed) This generally makes it difficult to communicate information to people because they are lazy or unwilling to go through all the trouble of reading. The blog Information is Beautiful takes advantage of this by posting awesome graphs, diagrams, charts and whatnot that are visually interesting, full of information, and make their point. I admit that I am also guilty of this trend. When I go through my Google Reader feed at lunch every day I beeline for the "pretty" items, the webcomics, and posts I know will be brief.

    I'll just conclude by saying that posting interesting, wordy content and creating a reader base isn't as easy as one might think.

    (if I put a kitten here, would you be more interested? another future study.)

    Saturday, March 6, 2010

    Googlevoice, or, Lost in Transcription

    So, in the interest of exploring the entire range of somewhat silly google products that may or may not improve my life, I signed up for googlevoice, and thereby googlevoicemail. I feel like I haven't explored all of the services involved (at least I think I haven't), but voice is definitely useful for when I'm at work without mys cellphone and need to make a long distance call. I just plug in the number I want to call online, and it rings my desk phone (which I had to set up, a simple procedure).

    The voicemail service, however, is basically a good thought that doesn't entirely float my boat. I would love to have transcriptions of my voicemails, but the transcription algorithm or whatever just doesn't work that great. At least not for message-leavers without perfect diction (or with a sense of humor). Here is the transcript of a voicemail from Dan, telling me that he was coming home, that it's very nice out, trying to figure out where I was, and subsequently saying heck with it, he was coming home anyway. More or less:

    Hey Pat, F, F, F, F. A. So, okay now. I've heard your message and I approved just trying to figure out where you are. It's a beautiful day. If you were over at the house thinking I was going to drop by if you could be a beautiful day, but I would go home. Viruses, Jeff, I was just like to away if you could do the big day, but it's I was. Barry.

    The "FFFFA" was actually him laughing. Thank heavens I can still playback an audio file, too.