Random Thoughts I woke up With Today

If life were a parent, I’d say thank you for raising me.
I’d apologize for not always being obedient, but appreciate you never giving up.

If life were but a friend, I would call him a dear friend.
One who has stuck by me, even as I had often contemplated casting him aside.

If it is a lover, I’d tell her I’m glad she is with me.
Though times can be tough, I always revel in new experiences to share.

I woke up with those three stanza’s in my head. Falling asleep to Brian Crain does strange things to the mind. I’m not sure if they are original, I may have just remembered them, but I wrote them down anyways.

A life lead in the pursuit of small attainable dreams/goals has lead me to be the man I am today. One who wants to remove all hardship from those he cares about, to protect them. I love amazing people by creating new things they didn’t think were possible. I dream of seeing the world. Over my life I have become a person who, though not required, prefers to write down his thoughts. Memory is triggered by seeing items from your past, and I like to be able to remember who I was. Not as a vague notion, but with a clarity of exactitude. It is similar to taking a picture of yourself every day to see how you age day by day, though mentally. Thus this website is, other than the odd technical tutorial, more for me than anyone consuming it. (Thank you random two people who always read my posts)

Scumbag Brain is a Scumbag – Afterword

I’ve recently been thinking a lot about my opinions on mental illness. You can ascertain plenty about a person’s belief about life, as well as philosophy, and perhaps even religion when listening to them speak about mental illness. Unfortunately though, that is another essay entirely that I’ll have to rewrite, that was lost in the great harddrive failure of quite a while ago. Perhaps you can see what I mean in an example of the logical flow of such a conversation.

As an example: It came to mind that if somebody believes that mental illness is not able to be overcome by will, then whatever causes the mental illness is a limitation of free will. If who you are is in your mind, and some piece of your mind has the power to limit your free will, then what are we? Are we slaves to the wiring we happened to get during childbirth? A rebuttal could then simply be to say that we made choices in childhood, and many of these illnesses are caused by experiences during childhood. Thus we are the cause of our own mental illness, in essence choosing to have something block our free will, and thus our free will is not actually stopped, but exercised. If a valid argument is to say that choices and who we are is not based on our mind, but the soul, then why might something in our mind limit the soul? …etc.

This circular style of argument could take branches and ultimately go on forever, while always coming back to the statement; “Ultimately, nobody knows for sure.” I think you can learn more about a person’s belief system by asking them about their opinion on mental health, than asking the common questions about religion. This also would be a more advisable topic if you wish to discover that information, as I have seen more eyes glaze over on the topic of religion than I am able to count.

It shows how much they have truly sat down and thought about who they are and where their thoughts come from. Where their sense of self truly resides. I believe it is a pursuit that all should take. Sit down and think about how you’re thinking.

-Ramblings of a nerd

XmlTransformer – Simplified XML / XSL Transformation in C#

XmlTransformer.cs

After a few days of trying to figure out how to manipulate XML with XSLT stylesheets in C#, I discovered it was slightly difficult. I personally don’t like difficult things remaining difficult, and promptly work on attempting to make them… less difficult.

If anybody wants to know how to apply XSLT to XML – I have included a class that is quite simple to use. Note though that it has only been used for my own purposes, and thus only tested for those purposes. If you do find bugs, or have xml/xslt that it does not work for, please send me examples of failures (if you are allowed) and I would be happy to fix any bugs.

 

If you have an XML document with processing instructions embedded:

1
< ?xml-stylesheet type="text/xsl" href="http://pathtoxslsheethere" ?>

Then usage is extremely simple:

1
2
3
4
5
6
 // optionally you can use XmlDocument:  XmlDocument doc = new XmlDocument();  and then load up the document
 XmlTransformer xmlToTransform = new XmlTransformer(doc,
      XsltAllow.DocumentFunction | XsltAllow.DtdProcessing | XsltAllow.ExternalResources);    
 //You can also explicitly set the settings in the properties of XmlTransformer
 string theTransformedDocument= xmlToTransform .ApplyTransformation();  
//Alternatively, you can pass in XSL or a URI to XSL or an XmlDocument object that has loaded an XSLT stylesheet.

If you do not have an XML document with processing instructions, the only part of the usage that changes is that you must add in a link/string/xmldocument pointing to or containing your XSLT to apply in the ApplyTransformation(); function.

Enjoy.

Return top

INFORMATION

I do not adhere to a schedule. I post when I have something to say. I'm a programmer who in my spare time enjoy contemplating the meaning of life, the universe and, everything. So there will be code as well as random little stories and essays.