24 April 2014

The Ruby Reflector

Topic

XML

  Source Favicon
Email

…IIS's equivalent to the .htaccess file on Apache. It has a different syntax that is XML based and takes some getting used to.

My web.config file does two things:

Points to a custom 404 page at the root of my websites folder.

Redirects all requests for www.carpeaqua.com to carpeaqua.com (no www).

Technically, you could consider this an optional step, but I think the no-www looks cleaner. I wouldn't skip it personally.

Pushing Changes To Azure Web Sites

Now that everything …

carpeaqua.com Read
  Source Favicon
Email

…mechanism to pass messages. When you post a message to one of your boards, the web role generates a new XML payload in one of our storage queues that the Notification Role listens for to handle the processing.

Sometimes this queue and the processing gets extremely backed up. Usually the CPU usage spikes to around 90% or higher for long periods of times which can lead to message postings being delayed for several minutes (in some cases I've seen hours) at a time. This is no …

carpeaqua.com Read
  Source Favicon
By Patrick of Kalzumeus Software 15 days ago.
Email

…THE bug or the other bug? The YAML bug. Wait wait the YAML bug in the XML handling or the class of bugs caused by YAML deserialization? Man, would that have been an easier month if we had all been talking about DeserialKiller.

Names which don't involve arcane trivia like " OpenSSL 1.0.1g" are also easy to communicate with non-technical stakeholders. If you had a launch yesterday, and you were forced to choose between making the launch date and fixing Heartbleed, …

kalzumeus.com Read
  Source Favicon
Email

…shp, . shx, .dbf) format. Openstreetmap uses its own XML format ( OSM ) and/or Protocolbuffer Binary Format . We can convert this to MySQL with GDAL server (on Linux) and ogr2ogr utility. To convert Shapefile any version of GDAL will work, however, for OSM/PBF we will need to use v. 1.10. The easiest way to get the GDAL 1.10 is to use Ubuntu + ubuntugis-unstable repo.

Here are the commands I've used to install: apt-add-repository ppa:ubuntugis/ubuntugis-unstable …

mysqlperformanceblog.com Read
  Source Favicon
Email

…how the code behaves differently depending on which child class receives the parse method. Both the XML and JSON parsers modify GenericParser 's behavior, which raises an exception.

Duck Typing

In statically typed languages, runtime polymorphism is more difficult to achieve. Fortunately, with Ruby we can use duck typing .

We'll use our XML and JSON parsers again for this example, minus the inheritance: class XmlParser def parse puts 'An instance …

robots.thoughtbot.com Read
  Source Favicon
By Jason Garber of Viget.com Blogs 3 months ago.
Email

Save that XML to a file named ieconfig.xml , throw it in the root of your project, and link to it using the meta element from the earlier code block. Fire up your favorite Windows 8/8.1 device and you'll be able to pin your site to the Start screen.

All Set!

Device assets are by no means hard to implement, just tricky. There's been significant implementation changes over the last year or two as devices shift toward high-DPI displays. The landscape has shifted so quickly and …

viget.com Read
  Source Favicon
By Julian Dunn of Chef Blog 5 months ago.
Email

…Just as software developers do not fork and modify an XML library if they want to parse XML, infrastructure automation developers should be able to depend on high-quality, well-maintained, reusable infrastructure-as-code components.

What is a Wrapper Cookbook? Why Might I Use One?

A wrapper cookbook wraps an upstream cookbook to change its behavior without forking it.

There are two main reasons you might want to do this:

Codifying the standard settings for your organization or business …

opscode.com Read
  Source Favicon
Email

Reads an XML "changelog" file that has the schema changes

Verifies which changes have yet to be applied

Applies the changes in serial to the tables

Records each change in the version control table as it happens

While this is a very powerful tool, as you dataset grows, this can be problematic. As each change is run as an independent ALTER statement, consider a large (several million row) table that you are updating with multiple indexes - this can result in several lengthy …

mysqlperformanceblog.com Read
  Source Favicon
Email

…compression of assets served from heroku in addition to the HTML, JSON, XML and other content your app returns.

Rails 4 assumes you're serving assets from a CDN or via your webserver (and not your Rails processes) so ActionDispatch::Static middleware isn't enabled by default. If you try to insert Rack:: Deflater before it, you'll get errors.

spec 'ing

Controller specs skip Rack middleware. You need to assert that content is compressed / not compressed …

robots.thoughtbot.com Read
  Source Favicon
Email

…If you are dealing with data on the web, you are probably most familiar with JSON and XML. Less common nowadays is CSV, but if it's all you have, and the alternative is screen scraping, then you are thankful.

Imagine we have some data in CSV: Year,Make,Model,Description,Price 1997,Ford,E350,"ac, abs, moon",3000.00 1999,Chevy,"Venture ""Extended Edition""","",4900.00 1999,Chevy,"Venture ""Extended Edition, Very Large""",,5000.00 …

technicalpickles.com Read