Profile

Cover photo
Joel Elliott
Lives in Missouri
47 followers|185,150 views
AboutPostsPhotosVideos+1'sReviews

Stream

Joel Elliott

Shared publicly  - 
 
What if we could make corruption reform be the primary issue in the presidential election next year? I would like to see that happen.
"Lessig 2016. Equal Citizens First"
http://youtu.be/CaqrQz71bMk
1
Add a comment...

Joel Elliott

Shared publicly  - 
 
Ahh the slinky, still able to provide amusement after all these years
It's a powerful metaphor for something or other, from the good folks at woodgears.ca, with build notes for your own Slinky-torturing pleasure. (via JWZ)
1
Add a comment...

Joel Elliott

Shared publicly  - 
 
Xml Serialization Without Namespace and/or "nil" Attributes

Working in .NET with a lot of XML, I have come to hate namespaces. Unfortunately I cannot always ignore them, but sometimes I can remove them! So I wrote the below code which seems to work correctly, where removing namespaces is a simple parameter.

Also, I have found that in .NET when I want to serialize an object as XML, it is often an object that was created from XML in the first place, and the main difference between the original XML and the serialized output is that these nil="true" attributes get thrown in all over the place. So I also have a parameter for getting rid of those.

Credit to http://stackoverflow.com/questions/625927/omitting-all-xsi-and-xsd-namespaces-when-serializing-an-object-in-net for the basis of this code, especially the form of XmlWriterWrapper.

Public Class ExampleSerializer
    Public Function Serialize(value As Object) As String
        Using sw = New System.IO.StringWriter()
            Dim xs = New System.Xml.XmlWriterSettings()
            xs.OmitXmlDeclaration = True

            Using xw = New MyXmlWriter(XmlWriter.Create(sw, xs), RemoveNamespaces:=True, SkipNilAttributes:=True)
                Dim thisSerializer = New System.Xml.Serialization.XmlSerializer(value.GetType())
                thisSerializer.Serialize(xw, value)
            End Using
            Return sw.ToString()
        End Using
    End Function

    Private Class MyXmlWriter : Inherits XmlWriterWrapper
        Public Sub New(baseWriter As XmlWriter, RemoveNamespaces As Boolean, SkipNilAttributes As Boolean)
            MyBase.New(baseWriter)
            _removeNamespaces = RemoveNamespaces
            _skipNilAttributes = SkipNilAttributes
        End Sub

        Private _removeNamespaces As Boolean
        Private _skipNilAttributes As Boolean
        Private _skippingNilAttribute As Boolean

        Public Overloads Overrides Sub WriteStartElement(prefix As String, localName As String, ns As String)
            If _removeNamespaces Then
                _writer.WriteStartElement("", localName, "")
            Else
                _writer.WriteStartElement(prefix, localName, ns)
            End If
        End Sub

        Public Overloads Overrides Sub WriteStartAttribute(prefix As String, localName As String, ns As String)
            Const nilNamespace = "http://www.w3.org/2001/XMLSchema-instance"
            If _skipNilAttributes _
            And localName = "nil" Then
                If ns = nilNamespace _
                Or (Not String.IsNullOrWhiteSpace(prefix) AndAlso prefix = _writer.LookupPrefix(nilNamespace)) Then
                    _skippingNilAttribute = True
                    Return
                End If
            End If
            If _removeNamespaces Then
                _writer.WriteStartAttribute("", localName, "")
            Else
                _writer.WriteStartAttribute(prefix, localName, ns)
            End If
        End Sub

        Public Overrides Sub WriteEndAttribute()
            If _skippingNilAttribute = True Then
                _skippingNilAttribute = False
                Return
            End If
            _writer.WriteEndAttribute()
        End Sub

        Public Overrides Sub WriteString(text As String)
            If _skippingNilAttribute Then
                'For consistency should add this If check to all the other "Write..." methods,
                ' but right now only using it to skip just xsi:nil="true", so only needed for WriteString()
                Return
            End If
            _writer.WriteString(text)
        End Sub
    End Class

    Public Class XmlWriterWrapper
        Inherits XmlWriter
        Protected _writer As XmlWriter
        Protected Sub New(baseWriter As XmlWriter)
            _writer = baseWriter
        End Sub
        Public Overrides Sub Close()
            _writer.Close()
        End Sub
        Protected Overrides Sub Dispose(disposing As Boolean)
            DirectCast(_writer, IDisposable).Dispose()
        End Sub
        Public Overrides Sub Flush()
            _writer.Flush()
        End Sub
        Public Overrides Function LookupPrefix(ns As String) As String
            Return _writer.LookupPrefix(ns)
        End Function
        Public Overrides Sub WriteBase64(buffer As Byte(), index As Integer, count As Integer)
            _writer.WriteBase64(buffer, index, count)
        End Sub
        Public Overrides Sub WriteCData(text As String)
            _writer.WriteCData(text)
        End Sub
        Public Overrides Sub WriteCharEntity(ch As Char)
            _writer.WriteCharEntity(ch)
        End Sub
        Public Overrides Sub WriteChars(buffer As Char(), index As Integer, count As Integer)
            _writer.WriteChars(buffer, index, count)
        End Sub
        Public Overrides Sub WriteComment(text As String)
            _writer.WriteComment(text)
        End Sub
        Public Overrides Sub WriteDocType(name As String, pubid As String, sysid As String, subset As String)
            _writer.WriteDocType(name, pubid, sysid, subset)
        End Sub
        Public Overrides Sub WriteEndAttribute()
            _writer.WriteEndAttribute()
        End Sub
        Public Overrides Sub WriteEndDocument()
            _writer.WriteEndDocument()
        End Sub
        Public Overrides Sub WriteEndElement()
            _writer.WriteEndElement()
        End Sub
        Public Overrides Sub WriteEntityRef(name As String)
            _writer.WriteEntityRef(name)
        End Sub
        Public Overrides Sub WriteFullEndElement()
            _writer.WriteFullEndElement()
        End Sub
        Public Overrides Sub WriteProcessingInstruction(name As String, text As String)
            _writer.WriteProcessingInstruction(name, text)
        End Sub
        Public Overrides Sub WriteRaw(data As String)
            _writer.WriteRaw(data)
        End Sub
        Public Overrides Sub WriteRaw(buffer As Char(), index As Integer, count As Integer)
            _writer.WriteRaw(buffer, index, count)
        End Sub
        Public Overrides Sub WriteStartAttribute(prefix As String, localName As String, ns As String)
            _writer.WriteStartAttribute(prefix, localName, ns)
        End Sub
        Public Overrides Sub WriteStartDocument()
            _writer.WriteStartDocument()
        End Sub
        Public Overrides Sub WriteStartDocument(standalone As Boolean)
            _writer.WriteStartDocument(standalone)
        End Sub
        Public Overrides Sub WriteStartElement(prefix As String, localName As String, ns As String)
            _writer.WriteStartElement(prefix, localName, ns)
        End Sub
        Public Overrides Sub WriteString(text As String)
            _writer.WriteString(text)
        End Sub
        Public Overrides Sub WriteSurrogateCharEntity(lowChar As Char, highChar As Char)
            _writer.WriteSurrogateCharEntity(lowChar, highChar)
        End Sub
        Public Overrides Sub WriteValue(value As Boolean)
            _writer.WriteValue(value)
        End Sub
        Public Overrides Sub WriteValue(value As DateTime)
            _writer.WriteValue(value)
        End Sub
        Public Overrides Sub WriteValue(value As Decimal)
            _writer.WriteValue(value)
        End Sub
        Public Overrides Sub WriteValue(value As Double)
            _writer.WriteValue(value)
        End Sub
        Public Overrides Sub WriteValue(value As Integer)
            _writer.WriteValue(value)
        End Sub
        Public Overrides Sub WriteValue(value As Long)
            _writer.WriteValue(value)
        End Sub
        Public Overrides Sub WriteValue(value As Object)
            _writer.WriteValue(value)
        End Sub
        Public Overrides Sub WriteValue(value As Single)
            _writer.WriteValue(value)
        End Sub
        Public Overrides Sub WriteValue(value As String)
            _writer.WriteValue(value)
        End Sub
        Public Overrides Sub WriteWhitespace(ws As String)
            _writer.WriteWhitespace(ws)
        End Sub
        Public Overrides ReadOnly Property Settings() As XmlWriterSettings
            Get
                Return _writer.Settings
            End Get
        End Property
        Public Overrides ReadOnly Property WriteState() As System.Xml.WriteState
            Get
                Return _writer.WriteState
            End Get
        End Property
        Public Overrides ReadOnly Property XmlLang() As String
            Get
                Return _writer.XmlLang
            End Get
        End Property
        Public Overrides ReadOnly Property XmlSpace() As System.Xml.XmlSpace
            Get
                Return _writer.XmlSpace
            End Get
        End Property
    End Class
End Class
1
Add a comment...

Joel Elliott

Shared publicly  - 
 
IKTSUARPOK: the feeling of anticipation that leads you to keep looking outside to see if anyone is coming
1
Add a comment...

Joel Elliott

Shared publicly  - 
 
Video of the Earth from the ISS, it's awesome
Urthecast has installed two high definition cameras on the International Space Station and will soon begin streaming footage directly to the web.
1
Add a comment...

Joel Elliott

Shared publicly  - 
 
+Diego Imperius, finally a mug made for you!
The 12oz mug is dishwasher/microwave-safe: $13 at Thinkgeek.
1
Add a comment...
Have him in circles
47 people
John Elliott's profile photo
Nathan Happel's profile photo
Jonathan Blocher's profile photo
Heather ChElliott's profile photo
James Smith's profile photo
Scott Rempel's profile photo
POP ELCA's profile photo
Michael Jahnke's profile photo
Vinny “The Spaniard” TheSauce's profile photo

Joel Elliott

Shared publicly  - 
 
Windows Update == Fail

I have a laptop with Windows 8. I am not on the internet very often, so I made a point of bringing it to where there is good WIFI, and try to download the Windows updates. There were I believe 88 "non-optional" updates to apply. After around 30 minutes, they had still not finished downloading. On a second trip, I finish downloading them, and then of course it says you must reboot to install. I say ok, "Reboot". After 30 minutes of installing and 3 reboots (during most of which time it just says "Shutting Down", an obvious lie during a software install), it says that the updates failed, and it must back them out. After another 35 minutes, I am back where I started.

I then downloaded and installed just one update before I had to leave again, and that did work, but of course it required a reboot. I can't help wonder how many of the 88 will require a reboot; I am not ok with it taking over 7 hours of relatively interactive computing and a good internet connection just to keep my laptop secure. Microsoft: this is no way to service your customers.

(And no, I don't want to "upgrade" to Windows 10, where in all likelihood there would be more frequent updates, and my machine would be even more dependent on the internet.)
1
Add a comment...

Joel Elliott

Shared publicly  - 
 
Tie your shoes the Ukrainian way!
I'm going to try this, it looks like a much better way than I've always done it.
The "Ukrainian lacing" method puts a pair of loops in both sets of top eyelets, cross-laces to the bottom, and anchors the laces with a pair of hidden knots, so that you can slip your foot into a "...
1
Add a comment...

Joel Elliott

Shared publicly  - 
 
Amazing! I guess we will finally be able to answer whether "androids dream of electric sheep". Scroll to the bottom for images I can only compare to computer generated fractals based on reality.
1
Add a comment...

Joel Elliott

Shared publicly  - 
1
Add a comment...
People
Have him in circles
47 people
John Elliott's profile photo
Nathan Happel's profile photo
Jonathan Blocher's profile photo
Heather ChElliott's profile photo
James Smith's profile photo
Scott Rempel's profile photo
POP ELCA's profile photo
Michael Jahnke's profile photo
Vinny “The Spaniard” TheSauce's profile photo
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Missouri
Links
Contributor to
Story
Introduction
Abacus, big headed, grew up in Africa
Work
Occupation
Computer Programmer
Skills
Without C people would code in Basi, Pasal and Obol. (I have skills including Visual Basi, Pasal, obol, and many more)
Basic Information
Gender
Male
Joel Elliott's +1's are the things they like, agree with, or want to recommend.
Print Friendly & PDF
chrome.google.com

Print Friendly and PDF any Webpage

Build with Chrome
www.buildwithchrome.com

Now you can build with LEGO® bricks using Google Maps as your baseplate. Imagine. Explore. Build online in Chrome.

Stay Alight®
market.android.com

Feel yourself in role of bulb world saver with arcade game Stay Alight®!Meet Mr. Bulb, who is gonna free planet from cartoon microbes with y

Where can I report spam "gmail" accounts? - Google Product Forums
productforums.google.com

SidV, 4/28/09 5:49 AM. A lot of people use google accounts (gmail) for send spam, or use it for spammer's business. How (or where) can I rep

Grimm
plus.google.com

The official Google+ profile for NBC's Grimm. Fridays at 9/8c.

Five Iron Frenzy
plus.google.com

We are an undead band from Denver, CO.

BBC News
plus.google.com

News, features, analysis from the BBC

Saturday Night Live
plus.google.com

The official Google+ profile for SNL. Saturdays at 11:30/10:30c on NBC

THE HOST
plus.google.com

What if everything you love was taken from you in the blink of an eye? "The Host" is the next epic love story from the creator of the "Twilight Saga," worldwide bestselling author, Stephenie Meyer.

The Daily Show
plus.google.com

Jon Stewart and the Best F#@king News Team Ever. Comedy Central, Monday - Thursday at 11/10c

Notepad++
plus.google.com

We code therefore we are.

BBC America
plus.google.com

The Biggest Names in British Television

Doctor Who
plus.google.com

This commercial page from BBC Worldwide helps to fund new BBC programmes.

Jeremy Camp
market.android.com

One of the leading artists on the contemporary Christian scene, Jeremy Camp has gained a sizable fan following for his passionate, well-craf

Third Day
market.android.com

Influenced by the Southern rock of Lynyrd Skynyrd and other artists such as U2 and Rich Mullins, Third Day were originally formed by vocalis

Newsboys
market.android.com

One of the more media-exposed Christian rock bands of the '90s, Newsboys formed in the late '80s around a core of John James, Peter Furler,

Jars Of Clay
market.android.com

Jars of Clay were the breakout band of the so-called alternative CCM movement of the '90s, scoring an enormous mainstream hit with the debut

Audio Adrenaline
market.android.com

With their fusion of rock, rap and funk, Audio Adrenaline emerged as one of the most popular CCM acts of the 1990s. The group was formed on

All Star United
market.android.com

Shop Google Play on the web. Purchase and enjoy instantly on your Android phone or tablet without the hassle of syncing.

Public - a month ago
reviewed a month ago
Tasty, seems authentic (but I don't know Lebanese food all that well).
Public - a month ago
reviewed a month ago
Delivery only after 10pm
Public - 3 months ago
reviewed 3 months ago
Awesome food, friendly, fun! Try the carne asada. And the guacamole and tortilla chips are my favorite in the city.
Public - 4 months ago
reviewed 4 months ago
30 reviews
Map
Map
Map
Decent food, fun trivia nights. WiFi password is "welovebeer".
Public - a month ago
reviewed a month ago
Nice place, experienced dentists, friendly people. Wifi password is "Toothbrush"
Public - 4 months ago
reviewed 4 months ago
I always found the employees to be friendly, helpful, and knowledgeable. But the lines are almost always horrible - why would there be a long line on a Tuesday in March at 3pm? I would guess that they are understaffed (or possibly just poorly managed -- maybe they have 5 employees and no lines at 9am?).
Public - 6 months ago
reviewed 6 months ago