I’ve decided to delete my Gmail email accounts for good. The UI to manage emails is completely worthless. Try isolating thousands of emails to move to a “label” and see what happens. Even though I have attempted to move the emails to a new label they still remain in my inbox! Dumb. Now I have to go through the painful process of downloading my entire message collection via POP for long term storage. This will consume precious hours of my time and I have Google to thank for this waste.
I’m now searching for an alternative email solution that will be sustainable and easy to manage. My preference at the moment is live.com. I’ve had a live.com address for years and it has remained easy to manage and frustration free. It seems like a logical transition.
If you know of other free email solutions, please let me know your thoughts.
Dark Water
The risk of insult is the price of clarity.
Wednesday, October 9, 2013
Friday, July 20, 2012
The Water Runs Dark Once Again
It’s been a long time since I’ve done any blogging. For years the water ran clear, but now it is darkened once again. Oh how the times change with the rapid succession of running water. The fuel that infuses our minds are sometimes cloudy and grim. We long for the clarity of pure water, but it never lasts long. We fight endless battles in our minds attempting to justify away the cloudy, murky fluid that fills our thoughts, but inevitably we succumb to the reality that chaos rules and clarity is merely a self-imposed illusion.
Thursday, April 23, 2009
Using Generics To Perform a Dynamic Cast in .NET WinForms
By Andrew D Green
UPDATE: I modified the article after tweaking the code some to make it more efficient. Instead of passing the entire parent control, I simply pass the control collection associated to the parent.
This is a solution I came up with to handle the issue of dynamic casting of controls. In this case I had a situation where I needed to be able to specify a control or form parent control collection and the name of the control I wanted to emulate and access the properties of. I wanted to be able to use a dynamic object to access the properties of an object embedded within a form without having to hard code any specific values associated to identifying that control.
Here's the actual class that implements the generic type that I will use to cast a located control from. The generic variable is itemType. I loop through the parent collection of controls and locate the control I seek to emulate as a Control type. Once found, perform a DirectCast to cast from Control type to the generic itemType. The function then returns the itemType specified in the object instantiation :
VB.NET
C#
Here's the code that accesses the class by specifying a control type. It's only two lines of code. In this case I am emulating a PictureBox that I used to act as a button. As you can see, I'm accessing the Enabled property of the control itself through the generic instance of the control:
VB.NET
C#
Here's another example with a TreeView control that was embedded in a SplitContainer panel control inside the form:
VB.NET
C#
As you can see you can directly access embedded controls even by passing in an emulated instance of the parent container control! Sweet...
UPDATE: I modified the article after tweaking the code some to make it more efficient. Instead of passing the entire parent control, I simply pass the control collection associated to the parent.
This is a solution I came up with to handle the issue of dynamic casting of controls. In this case I had a situation where I needed to be able to specify a control or form parent control collection and the name of the control I wanted to emulate and access the properties of. I wanted to be able to use a dynamic object to access the properties of an object embedded within a form without having to hard code any specific values associated to identifying that control.
Here's the actual class that implements the generic type that I will use to cast a located control from. The generic variable is itemType. I loop through the parent collection of controls and locate the control I seek to emulate as a Control type. Once found, perform a DirectCast to cast from Control type to the generic itemType. The function then returns the itemType specified in the object instantiation :
VB.NET
Public Class NewGenericControl(Of itemType As {Control, New})
Public Sub New()
End Sub
Public Function GetControlByName(ByVal controls As Control.ControlCollection, ByVal ctlName As String) As itemType
Dim newCtl As New itemType
' Loop trhough the controls on the parent to locate the desired control to manage
For Each ctl As Control In controls
If (ctl.Name.StartsWith(ctlName)) Then
newCtl = DirectCast(ctl, itemType)
Return newCtl
End If
Next ctl
Return newCtl
End Function
End Class
C#
public class NewGenericControl<itemType> where itemType : Control, new()
{
public NewGenericControl()
{
}
public itemType GetControlByName(Control.ControlCollection controls, string ctlName)
{
itemType newCtl = new itemType();
// Loop trhough the controls on the parent to locate the desired control to manage
foreach (Control ctl in controls) {
if ((ctl.Name.StartsWith(ctlName))) {
newCtl = (itemType)ctl;
return newCtl;
}
}
return newCtl;
}
}
Here's the code that accesses the class by specifying a control type. It's only two lines of code. In this case I am emulating a PictureBox that I used to act as a button. As you can see, I'm accessing the Enabled property of the control itself through the generic instance of the control:
VB.NET
Dim splitContainer As New NewGenericControl(Of ucQuestionManager)
splitContainer.GetControlByName(Me.TabPage2.Controls, "ucQuestionManager").JumpToQuestion(questionId)
C#
NewGenericControl<ucQuestionManager> splitContainer = new NewGenericControl<ucQuestionManager>();
splitContainer.GetControlByName(this.TabPage2.Controls, "ucQuestionManager").JumpToQuestion(questionId);
Here's another example with a TreeView control that was embedded in a SplitContainer panel control inside the form:
VB.NET
Dim splitContainer As New NewGenericControl(Of SplitContainer)
Dim newTree As New NewGenericControl(Of TreeView)
newTree.GetControlByName(DirectCast(splitContainer.GetControlByName(m_parent.ParentForm.Controls, "SplitContainer1").Panel1, Control).Controls, "treeAnswerList").Nodes(Me.QuestionId).Nodes.Add(1, m_answerValue)
C#
NewGenericControl<SplitContainer> splitContainer = new NewGenericControl<SplitContainer>();
NewGenericControl<TreeView> newTree = new NewGenericControl<TreeView>();
newTree.GetControlByName(((Control)splitContainer.GetControlByName(m_parent.ParentForm.Controls, "SplitContainer1").Panel1).Controls, "treeAnswerList").Nodes(this.QuestionId).Nodes.Add(1, m_answerValue);
As you can see you can directly access embedded controls even by passing in an emulated instance of the parent container control! Sweet...
Sunday, August 31, 2008
Why did John McCain vote against education programs designed to reduce the number of abortions when he claims to be pro-life?
In a world where sexually transmitted diseases are a growing concern as well as teen pregnancy, it's important to increase awareness of the risks of unprotected sex. It's easy for most of us to comprehend the risks and understand why it's important to educate our children and young adults. While I agree that much of this responsibility should fall on the parents, I also believe that it's critical for the government to assist in the participation of these efforts. Ask any teacher just how much co-operation they get from their parents. I think you'll be shocked by the answer.
In 2005 there was a bill proposed to increase the funding on this effort. John McCain voted against it. Here's the actual bill that he voted against:
Unintended Pregnancy Amendment
S AMDT 244 to S Con Res 18: To expand access to preventive health care services that reduce unintended pregnancy (including teen pregnancy), reduce the number of abortions, and improve access to women's health care.
Project Vote Smart's Synopsis:
Vote to adopt an amendment to the Senate's 2006 Fiscal Year Budget that allocates $100 million for the prevention of unintended pregnancies.
Highlights:
I'd personally like to know why John McCain feels that sex education programs are not important enough to deserve government funding. For a man who claims to be pro-life, why is he not interested in reducing the number of abortions? The root of the cause is lack of awareness and poor education. In the grand scheme of things, this is not a huge priority, but it is a big one none the less. It definitely deserves some strong government focus in my humble opinion. One of the lines in this bill's description that I find most important is "improve access to women's health care." Why is it that John McCain feels that this is an unworthy cause?
Conclusion, John McCain doesn’t get it. He just votes where his party tells him to vote without making any intelligent decisions on his own. This was only one of his voting blunders that I felt most disturbed about. Feel free to look at his entire voting history to see some of the others.
In 2005 there was a bill proposed to increase the funding on this effort. John McCain voted against it. Here's the actual bill that he voted against:
Unintended Pregnancy Amendment
S AMDT 244 to S Con Res 18: To expand access to preventive health care services that reduce unintended pregnancy (including teen pregnancy), reduce the number of abortions, and improve access to women's health care.
Project Vote Smart's Synopsis:
Vote to adopt an amendment to the Senate's 2006 Fiscal Year Budget that allocates $100 million for the prevention of unintended pregnancies.
Highlights:
- Increases funding and access to family planning services
- Funds legislation that requires equitable prescription coverage for contraceptives under health plans
- Funds legislation that would create and expand teen pregnancy prevention programs and education programs concerning emergency contraceptives
Source: http://votesmart.org/issue_keyvote_detail.php?cs_id=V3489&can_id=53270
See John McCain's full voting record: http://votesmart.org/voting_category.php?can_id=53270
I'd personally like to know why John McCain feels that sex education programs are not important enough to deserve government funding. For a man who claims to be pro-life, why is he not interested in reducing the number of abortions? The root of the cause is lack of awareness and poor education. In the grand scheme of things, this is not a huge priority, but it is a big one none the less. It definitely deserves some strong government focus in my humble opinion. One of the lines in this bill's description that I find most important is "improve access to women's health care." Why is it that John McCain feels that this is an unworthy cause?
Conclusion, John McCain doesn’t get it. He just votes where his party tells him to vote without making any intelligent decisions on his own. This was only one of his voting blunders that I felt most disturbed about. Feel free to look at his entire voting history to see some of the others.
Wednesday, August 20, 2008
I'll take boring over brainless anyday...
rac·ism (rā'sĭz'əm) n.
--------------------------------------------------------------------------------
spe·cies·ism (spē'shē-zĭz'əm, -sē-) n.
Many of my friends and family have simply refused to watch the video series that I recently blogged about called "Earthlings". They fear that the contents of these video's is so gruesome and disturbing that they simply won't be able to bear it. I don't blame them for fearing this material. This series contains some of the most disturbing content that I've ever seen, but what is the point of living in a world in which you are too afraid to face the truth and too afraid to educate yourself about the realities of humanity. It is fear that enables these disturbing acts to continue.
Imagine what our world might be like today if people had been too afraid to face the truth about human slavery. If you had the chance to live during a time in which humans were bartered and traded as slaves, would you have sat in silence and done nothing? Would you have taken it upon yourself in the face of ridicule and insult to fight back against something that you knew was wrong?
It saddens me deeply that we are ok with treating life forms as objects rather than living beings that have meaning and life of their own. People are too afraid to face the truth let alone actually do something to change it. That's why I am considering participating in a demonstration against the Ringling Bros. Circus that is coming to Austin. IDA (In Defense of Animals) will be sponsoring demonstrations at the events. You can read about the specifics at the IDA Website.
If you need a little motivation, try watching these videos...
- The belief that race accounts for differences in human character or ability and that a particular race is superior to others.
- Discrimination or prejudice based on race.
--------------------------------------------------------------------------------
spe·cies·ism (spē'shē-zĭz'əm, -sē-) n.
Human intolerance or discrimination on the basis of species, especially as manifested by cruelty to or exploitation of animals.
speciesist spe'cies·ist' adj. & n.Many of my friends and family have simply refused to watch the video series that I recently blogged about called "Earthlings". They fear that the contents of these video's is so gruesome and disturbing that they simply won't be able to bear it. I don't blame them for fearing this material. This series contains some of the most disturbing content that I've ever seen, but what is the point of living in a world in which you are too afraid to face the truth and too afraid to educate yourself about the realities of humanity. It is fear that enables these disturbing acts to continue.
Imagine what our world might be like today if people had been too afraid to face the truth about human slavery. If you had the chance to live during a time in which humans were bartered and traded as slaves, would you have sat in silence and done nothing? Would you have taken it upon yourself in the face of ridicule and insult to fight back against something that you knew was wrong?
It saddens me deeply that we are ok with treating life forms as objects rather than living beings that have meaning and life of their own. People are too afraid to face the truth let alone actually do something to change it. That's why I am considering participating in a demonstration against the Ringling Bros. Circus that is coming to Austin. IDA (In Defense of Animals) will be sponsoring demonstrations at the events. You can read about the specifics at the IDA Website.
If you need a little motivation, try watching these videos...
Sunday, August 17, 2008
Boycott Olympic Boxing…
I’m the first to admit I’m not a big sports fan. I don’t usually watch sports, but I’ve recently been sucked into the injustice that seems to be plaguing the Olympic Boxing events. If you’ve been watching these events then you already know what I’m talking about. The scoring process is severely flawed. Points are awarded inconsistently and it almost seems that certain countries are favored over others. The commentators of the boxing events made comments like “I can’t believe he didn’t get a point for that shot” or “this is unbelievable!” while laughing in a state of disgust at the poor scoring techniques employed by the judges.
I eventually reached a point where I could no longer watch this event because the scoring was so ridiculously all over the map that I just found myself getting more and more pissed off at the judges. I just had to change the channel. This is a complete joke and boxers who have worked hard and trained hard are being robbed of their hard work and dedication. While you’re watching this crap, you find yourself wanting to plead with someone to do something! I’m so disgusted that I would go so far as to say that the United States should boycott the boxing events for these Olympic Games. Seriously… This is ridiculous and so frustrating. I’m just disgusted.
Tuesday, July 29, 2008
A new path... Becoming a vegetarian...
Well, today was a very good day for me. In terms of learning experiences and self discovery, today was one of the best days I've had in a long time. Someone that I met online directed me to a video on You Tube that was a real eye opener for me. Some of you may have already seen it. It was difficult to watch the entire thing because of the disturbing nature of its content. At the end of the movie, I felt ill. Not just physically ill, but emotionally ill as well. I realized that something I had neglected to face was finally in my presence and I couldn’t run from it anymore.
As a human being and an inhabitant of the planet earth, I have a greater sense of reason and awareness than any other life form on this planet. That puts me and all of those who are like me in a position of great responsibility. It is up to us to care for and assist all the living creatures of this planet. It is our job to ensure their wellbeing and to protect them and do the best we can to give them a peaceful existence. In comparison to the simple life forms that exist on our planet, we are like living gods. Because of our self awareness and abilities to reason and comprehend pain and suffering, love and harmony, balance and instability, we have power over all things here. The life forms that exist around us rely on us to treat them as we would expect a living god to treat us. If you’ve ever believed in a higher power, then perhaps you already know what it’s like to want to reach out to something greater than us for help and guidance. We are in a position to give that to life forms that exist on this planet and any other planet that we explore or inhabit in the future.
Today I realized that becoming a vegetarian was no longer a choice of convenience, it is a choice to love. I choose to no longer support the barbaric practices that seek to support the harvest and torture of living creatures. There is so much suffering in this world, my choice will have little to no impact, but I believe in the future more humans will reach an enlightened state in which we all choose compassion over selfish desires, even our own selfish desire to survive. I realized today that the vegetarian life style is way ahead of its time. It’s composed of a minority of people who have the courage to stand up against those who are void of compassion and have the courage to accept their responsibility to protect the simpler life forms that we rule over. I find a fitting relation to those who have stood against human tyranny in our human history. Like the people who fought with their lives to abolish human slavery. We have much to learn as humans. We have so much power and so little wisdom to contain it.
If you’re interested in watching the video that I’m referring to, you can see it here:
Earthlings Part 1
Earthlings Part 2
As a human being and an inhabitant of the planet earth, I have a greater sense of reason and awareness than any other life form on this planet. That puts me and all of those who are like me in a position of great responsibility. It is up to us to care for and assist all the living creatures of this planet. It is our job to ensure their wellbeing and to protect them and do the best we can to give them a peaceful existence. In comparison to the simple life forms that exist on our planet, we are like living gods. Because of our self awareness and abilities to reason and comprehend pain and suffering, love and harmony, balance and instability, we have power over all things here. The life forms that exist around us rely on us to treat them as we would expect a living god to treat us. If you’ve ever believed in a higher power, then perhaps you already know what it’s like to want to reach out to something greater than us for help and guidance. We are in a position to give that to life forms that exist on this planet and any other planet that we explore or inhabit in the future.
Today I realized that becoming a vegetarian was no longer a choice of convenience, it is a choice to love. I choose to no longer support the barbaric practices that seek to support the harvest and torture of living creatures. There is so much suffering in this world, my choice will have little to no impact, but I believe in the future more humans will reach an enlightened state in which we all choose compassion over selfish desires, even our own selfish desire to survive. I realized today that the vegetarian life style is way ahead of its time. It’s composed of a minority of people who have the courage to stand up against those who are void of compassion and have the courage to accept their responsibility to protect the simpler life forms that we rule over. I find a fitting relation to those who have stood against human tyranny in our human history. Like the people who fought with their lives to abolish human slavery. We have much to learn as humans. We have so much power and so little wisdom to contain it.
If you’re interested in watching the video that I’m referring to, you can see it here:
Earthlings Part 1
Earthlings Part 2
Subscribe to:
Posts (Atom)