language - Dave's Blog

Search
My timeline on Mastodon

Tweet from David Risney

2016 Jun 2, 4:40
Answering the important questions: Tab v Spaces https://ukupat.github.io/tabs-or-spaces/  Broken down by programming language & using GitHub as population
PermalinkComments

Tweet from David Risney

2016 Apr 8, 4:52
@_lance_leonard @ericlaw First thought was confusion as to why Logo was getting used in production https://en.wikipedia.org/wiki/Logo_(programming_language) 
PermalinkComments

Retweet of chaosprime

2016 Jan 11, 7:41
As a native speaker of several dialects of computer, the idea this = natural language proficiency is horseshit. https://twitter.com/davidjrusek/status/686955968224034816 …
PermalinkComments

Retweet of benchirlin

2015 Mar 1, 8:56
RE: anti @WordPress "There are 2 types of programming languages: the ones ppl complain about and the ones nobody uses." -Bjarne Stroustrop
PermalinkComments

CSS Vocabulary

2014 Apr 17, 4:05

Lovely visualization for learning the names of CSS parts. Great concept and would like to see it applied to other languages.

PermalinkCommentstechnical css visualization

URI functions in Windows Store Applications

2013 Jul 25, 1:00PermalinkCommentsc# c++ javascript technical uri windows windows-runtime windows-store

Welcome to TypeScript

2012 Oct 1, 6:41

TypeScript is a typed superset of JavaScript that adds interfaces, and type safety and compiles to JavaScript. In VS this means you get much better auto completion suggestions.  Watch the Channel9 video.

PermalinkCommentstechnical javascript typescript Microsoft programming programming-language

JSON Hypermedia API Language

2012 Jul 1, 1:52

The JSON Hypermedia API Language (HAL) is a standard which establishes conventions for expressing hypermedia controls, such as links, with JSON.

PermalinkCommentsjson uri url link technical standard ietf

Indicating Character Encoding and Language for HTTP Header Field Parameters

2011 Nov 24, 7:45

From the document: ‘Appendix B. Implementation Report: The encoding defined in this document currently is used for two different HTTP header fields: “Content-Disposition”, defined in [RFC6266], and “Link”, defined in [RFC5988]. As the encoding is a profile/clarification of the one defined in [RFC2231] in 1997, many user agents already supported it for use in “Content-Disposition” when [RFC5987] got published.

Since the publication of [RFC5987], two more popular desktop user agents have added support for this encoding; see http://purl.org/
   NET/http/content-disposition-tests#encoding-2231-char for details. At this time, only one major desktop user agent (Safari) does not support it.

Note that the implementation in Internet Explorer 9 does not support the ISO-8859-1 encoding; this document revision acknowledges that UTF-8 is sufficient for expressing all code points, and removes the requirement to support ISO-8859-1.’

Yay for UTF-8!

PermalinkCommentstechnical http http-headers ie9 internationalization utf-8 encoding

Features of image type input tags in HTML

2011 Nov 21, 11:00

A bug came up the other day involving markup containing <input type="image" src="http://example.com/.... I knew that "image" was a valid input type but it wasn't until that moment that I realized I didn't know what it did. Looking it up I found that it displays the specified image and when the user clicks on the image, the form is submitted with an additional two name value pairs: the x and y positions of the point at which the user clicked the image.

Take for example the following HTML:

<form action="http://example.com/">
<input type="image" name="foo" src="http://deletethis.net/dave/images/davebefore.jpg">
</form>
If the user clicks on the image, the browser will submit the form with a URI like the following:http://example.com/?foo.x=145&foo.y=124.

This seemed like an incredibly specific feature to be built directly into the language when this could instead be done with javascript. I looked a bit further and saw that its been in HTML since at least HTML2, which of course makes much more sense. Javascript barely existed at that point and sending off the user's click location in a form may have been the only way to do something interesting with that action.

PermalinkCommentsuri technical form history html

Elements of Modern C++ Style (herbsutter.com)

2011 Nov 15, 11:59

Summary of some of the new C++ features with comments and suggested usage.  Not sure I agree with the take on auto.

‘“C++11 feels like a new language.” – Bjarne Stroustrup’

PermalinkCommentstechnical c++ programming

SRU: Search/Retrieval via URL -- SRU, CQL and ZeeRex (Standards, Library of Congress)

2011 Apr 18, 4:27"SRU is a standard XML-focused search protocol for Internet search queries, utilizing CQL (Contextual Query Language), a standard syntax for representing queries."PermalinkCommentsstandards search library metadata xml uri technical library-of-congress

JavaScript & .NET interop via WebBrowser Control

2011 Apr 5, 10:00

For my GeolocMock weekend project I intended to use the Bing Maps API to display a map in a WebBrowser control and allow the user to interact with that to select a location to be consumed by my application. Getting my .NET code to talk to the JavaScript in the WebBrowser control was surprisingly easy.

To have .NET execute JavaScript code you can use the InvokeScript method passing the name of the JavaScript function to execute and an object array of parameters to pass:

this.webBrowser2.Document.InvokeScript("onLocationStateChanged",
new object[] {
latitudeTextBoxText,
longitudeTextBoxText,
altitudeTextBoxText,
uncertaintyTextBoxText
});

The other direction, having JavaScript call into .NET is slightly more complicated but still pretty easy as far as language interop goes. The first step is to mark your assembly as ComVisible so that it can interact with JavaScript via COM. VS had already added a ComVisible declaration to my project I just had to change the value to true.

[assembly: ComVisible(true)]

Next set ObjectForScripting attribute to the object you want to expose to JavaScript.

this.webBrowser2.ObjectForScripting = this.locationState;

Now that object is exposed as window.external in JavaScript and you can call methods on it.

window.external.Set(lat, long, alt, gUncert);

However you don't seem to be able to test for the existence of methods off of it. For example the following JavaScript generates an exception for me even though I have a Set method:

if (window.external && window.external.Set) {
PermalinkCommentsjavascript webbrowser .net technical csharp

JavaScript Garden

2011 Mar 14, 1:33A great intro to the details of JavaScript for developers familiar with other languages but only a passing knowledge of JavaScript.PermalinkCommentsjavascript tutorial programming reference technical

Bidi in URLs - Macchiato

2010 Dec 20, 3:15PermalinkCommentsbidi url uri language blog idn technical

Word Lens augmented reality app instantly translates whatever you point it at -- Engadget

2010 Dec 17, 6:17
PermalinkCommentsiphone app translation video language phone mobile augmented-reality

RFC 5987 - Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters

2010 Aug 13, 11:47Other characters sets for HTTP headers: "By default, message header field parameters in Hypertext Transfer Protocol (HTTP) messages cannot carry characters outside the ISO-8859-1 character set. RFC 2231 defines an encoding mechanism for use in Multipurpose Internet Mail Extensions (MIME) headers. This document specifies an encoding suitable for use in HTTP header fields that is compatible with a profile of the encoding defined in RFC 2231."PermalinkCommentsrfc language localization charset http technical reference http-header

Shepard Fairey - Interview Magazine

2010 May 10, 8:59Iggy Pop interviews Shepard Fairey, including his Obama HOPE poster and AP lawsuit:

"... but the American public is generally pretty superficial, so an image like that just allows them to project whatever limited idea they have onto it. Obviously, not everyone is like that—I actually think there were a lot of people who were bummed by the image because they felt it was shallow propaganda."

"If I spend time conceiving and making a piece of art and somebody else sees that it has market value and replicates it in order to steal part of my market, then that’s not cool. But the way I make art—the way a lot of people make art—is as an extension of language and communication, where references are incredibly important. It’s about making a work that is inspired by something preexisting but changes it to have a new value and meaning that doesn’t in any way take away from the original—and, in fact, might provide the original with a second life or a new audience."
PermalinkCommentsart legal law ip shepard-fairey obey interview

Kevin Frei @ NWCPP: Exception Handling Cost

2010 May 10, 7:23"Kevin Frei - Exception Hanlding Cost September 2006 meeting of the Northwest C++ Users Group. Discussion of the assembly language cost of exception handling on the x86 Windows and x64 Windows platform"PermalinkCommentsC++ programming language exception microsoft windows performance technical video

INTERCAL -- the Language From Hell

2010 May 10, 5:21An old article by Charles Stross on INTERCAL the satirical programming language. It contains great features such as 'come from' the inverse of 'goto'.PermalinkCommentsc programming humor technical language software charles-stross intercal goto
Older Entries Creative Commons License Some rights reserved.