Posted by: Mike P. | July 4, 2019

Chaos Those Who Coded It

Chaos And Those Who Coded It

Advertisements
Posted by: Mike P. | August 15, 2015

Updating Taranis X9D Plus Firmware

This was very helpful. I wasn’t getting the boot loader updated.

DIYglenn - Learning by doing

There’s a lot of guides and posts about updating OpenTX firmwares, and a lot of them can be complicated. If you’re like me, and bought a new Taranis X9D Plus, which already has a 2.0.x firmware installed, the process is as easy as it can be.

View original post 565 more words

Posted by: Mike P. | April 3, 2015

Python argparse and option subparsers

So, now I am moving a different space – Python programming.

A common issue that seems to crop up is how to make use of the argparse module
but have the program continue if no subcommands are present in the argument
list.

The most common case is:


import argparse

p1 = argparse.ArgumentParser( add_help = False )
p1.add_argument( ‘–flag1’ )

s = p1.add_subparsers()
p = s.add_parser( ‘group’ )
p.set_defaults( group=True )

ns = p1.parse_args()

print( ns )

And it prints:


$ python b.py -h
usage: b.py [--flag1 FLAG1] {group} ...
b.py: error: too few arguments

So, my solution uses two argument parse objects, and a parent linkage as follows:


import argparse
import sys

p1 = argparse.ArgumentParser( add_help = False )
p1.add_argument( ‘–flag1’ )

p2 = argparse.ArgumentParser( parents = [ p1 ] )
s = p2.add_subparsers()
p = s.add_parser( ‘group’ )
p.set_defaults( group=True )

( init_ns, remaining ) = p1.parse_known_args( )

if remaining:
p2.parse_args( args = remaining, namespace=init_ns )
else:
print( ‘Enter interactive loop’ )

print( init_ns )

This allows:


$ python a.py -h
usage: a.py [-h] [--flag1 FLAG1] {group} ...

positional arguments:
{group}

optional arguments:
-h, –help show this help message and exit
–flag1 FLAG1

So, we get the full help.


$ python a.py --flag1=a
Enter interactive loop
Namespace(flag1='a')

So, no sub-command so we enter the interactive loop, but the flag was seen. And finally:


$ python a.py --flag1=a group
Namespace(flag1='a', group=True)
$

A subcommand was found and processed, and the program exited.

Neat! Lots of questions on this in various places.  Please excuse the lack of indents in the code.  There are only two such lines.  I need to fix this blog so it prints code properly.

Posted by: Mike P. | January 21, 2015

Limited Time

“Your time is limited, so don’t waste it living someone else’s life. Don’t be trapped by dogma – which is living with the results of other people’s thinking. Don’t let the noise of other’s opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.”

— Steve Jobs, 1955-2011

Posted by: Mike P. | May 12, 2014

INTJ

INTJ

Always a fun test: http://www.humanmetrics.com/

Posted by: Mike P. | September 24, 2013

I Created a God

A friend recently posted a revelation about herself that she had not thought about in many years.  I have been thinking about how long I “might” have been an atheist as part of this thinking back.  I also posted a minor criminal scam I had going when I was very young.  Maybe I should delete that.  Anyhow.  I remember coming to terms with the idea of atheism about 3-4 years ago.  But then I remembered how I created God about 30 years ago.  Anyone who creates god is either god or an atheist.  Sadly, I have to go for atheist.

So, what’s this “I created god stuff”?  In the early 80s, I worked as a programmer on a “Plato ™” system.  When you logged on to the system, those of us who were programmers were presented with a prompt.  At this prompt, you could type the name of a program to execute.  It was more graphical in nature that a typical Unix shell prompt, and not nearly as powerful as a bash prompt, but the basic concept is the same.  Run the program.

Well, predictably enough, there was no program called “god”, so I created it.  And hence I created “god.”  This would be a stupid story if it ended here.  It may still be a stupid story, but at least it does not end here.

The main reason I felt that the program should exist is that I didn’t feel an operating system should be able able to express the opinion that “god does not exist.”  I decided that the users should get to decide.  So, I created an interactive program that allowed you to change the state of whether god existed or not.  If any user changed the state, then the displays changed for anyone running the program.  In 1982 or so, this was cool, believe it or not.

People went batshit crazy over this program.  It was by far the most popular program on the system.  The state was changed tens of thousands of times.  And remember, this was pre-internet.  I would guess only 25-50 people could run the program.  Maybe a few more.  It was very interesting to watch people log on to two screens.  One to work on, and one to change the state of god.

One day, I got mad, or maybe I just needed disk space, so I deleted god.  No one else ever created god, either.

 

P.S.

I changed the title to “…a God.”  I like that better.

Posted by: Mike P. | January 28, 2013

Assualt Weapons Were Used at Sandy Hook

There appears to be a misconception on what weapons were used at the Sandy Hook shooting.

This is the latest information I’ve been able to find and it clearly states assault weapons were used, and not just pistols of one sort of another.

The Today Show video clip being placed around the internet is actually from December 15th and is taken from a story earlier on that day. The clip as seen here shows an update link.

The updated video states that many of the victims were shot with a rifle. The original video that states hand guns only were used. The earlier video has been edited to remove the update URL and is now being posted to YouTube and linked to in blogs as “new information” when in fact it was broadcast on December 15th, 2012. Many people are now using this to claim that “mainstream media missed the story” without realizing that they are using a Dec 15th erroneous video to back their claim. In fact, the media was “out in front” a little too far and wrong as a result.

Many conservative and guns rights websites are picking up and amplifying the story, which gives credence to the story unless you know how to research. But, I can pretty calmly say that the recent story is a hoax.

Here is a Jan 23rd, 2013 statement by the CT State Police as reported by NBC stating that an assault weapon was used inside the school.

Posted by: Mike P. | January 21, 2013

More Gun Control, Sigh.

Interesting that my first post here is also about gun rights.  It’s not really a huge interest area for me.  I enjoy shooting sometimes, but I live in an area with a lot of guns, so the issue comes up a lot.  This is what I wrote to a friend recently:

I’m not terribly worried about the gvt. taking away all my rights to own a gun. It’s pretty well set in the 2nd amendment.

 

The issue is: “Where is the line between a musket and a bazooka.”

 

We all pretty much agree that privately owned muskets are OK, especially if the owner is background checked. Most of us don’t want people owning bazookas. So, what’s the line?

 

Admittedly, owning a working bazooka would be cool.

Um, I don’t suggest anyone let me have a bazooka any time soon.  Unless I am in a desert far, far away from any cars that someone values.

Posted by: Mike P. | March 19, 2012

Cowboys Carrying Guns

Via http://motherjones.com/politics/2012/03/what-happened-trayvon-martin-explained:

“In championing the law, former NRA president and longtime Florida gun lobbyist Marion Hammer said: “Through time, in this country, what I like to call bleeding heart criminal coddlers want you to give a criminal an even break, so that when you’re attacked, you’re supposed to turn around and run, rather than standing your ground and protecting yourself and your family and your property.”

No, no, no.  You do not have to retreat and leave your family unprotected.  If all of you can retreat, then, yes, this is preferable to shooting someone.

Remember, when you shoot correctly, your target is dead.  It’s not about “coddling” someone.  It’s about not killing people unnecessarily.

Posted by: Mike P. | October 7, 2011

Firsts…

I mostly did this because the person I copied it from said “probably no one else would do it” and I feel like proving her 1/2 wrong today.

1. Who was your FIRST prom date?

Never went to a prom.

2. Do you still talk to your FIRST love?

Nope.

3. What was your FIRST job?

Paper boy.  Up at 5am 6 days a week, about 100 papers.  Made a lot of money for a kid of that age.

4. What was your FIRST car?

My first car was a 1969 Mustang.  The first car I drove was a 70s Ford station wagon.  Did you know that if you hold it first, it can accelerate reasonably fast and looks pretty scary screaming through residential areas?

5. Who was the FIRST person to text (IM) you today?

No IMs today.  First direct tweet was from Miranda.

6. Who is the FIRST person you thought of this morning?

My wife… the alarm went off, and I didn’t want to roll on her to hit the snooze.  But, she had already gotten up.

7. Who was your FIRST grade teacher?

Sister Zoe.  Good reading teacher.  The only nun I had who felt was a good teacher.  I was only in catholic school through fourth grade, and I’m pretty sure grades three and four were taught by lay teachers.  So, I do not have a large sample size.

8. Where did you go on your FIRST ride on an airplane?

Boston to Philly during the summer in-between 6th and 7th grades.  Or maybe 5 and 6th.  I forget exactly.

9. Who was your FIRST best friend & do you still talk?

Rick, and no, we don’t.  But, that is largely because we parted ways because the group we hung with was heading down a bad path.  He’s still in the area and there is no reason I wouldn’t talk with him.

10. Where was your FIRST sleep over?

I don’t really know.  Huh.

11. Who was the FIRST person you talked to today?

Wife or daughter… not certain.

12. What was the FIRST thing you did this morning?

Pushed my alarm on snooze. (I didn’t actually type that.  Same thing the person who wrote had for this answer!)

13. What was the FIRST concert you ever went to?

Probably Yes.

14. FIRST tattoo?

None.  May update this someday.

15. FIRST piercing?

Nail through the sole of my boot and into my foot.  Has since healed.

16. FIRST foreign country you’ve gone to?

Canada.

17. FIRST movie you remember seeing?

Wizard of Oz (on TV).  Mary Poppins, I think, in a drive-in.

18. When was your FIRST detention?

I don’t recall. I was always sneaky enough to not get caught.  (Copied!)

19. Who was your FIRST roommate?

Steve.  Good guy.

20. As a kid, what was the FIRST thing you wanted to be when you grew up?

I loved fighter jets and space travel – the usual stuff.

21. What happened the FIRST time you were incapacitated?

My appendix was removed.

22. Did you marry the FIRST person to ask for your hand in marriage?

Well, I married the first person I asked to marry me.

23. What was the FIRST sport you were involved in, aside from physical education classes at school?

I ran track for about 2 months in high school.

24. What were the first lessons you ever took?

Horseback riding lessons.

25. What is the first thing you do when you get home?

Take out the laptop from the backpack.  I use the same computer at home as work.

26. How old were you when you had your first child?

38.  “Had” not being very accurate since I am male.

27. Who do you think will be the FIRST person to post this after you?

I dunno.  Maybe Michaela if she is not too busy.

Posted by: Mike P. | September 7, 2011

Is the Governor of New Jersey a Flat Out Liar?

From NJ Governor Chris Christie’s Address to the Koch Crowd where he speaks on President Obama’s 2011 State of the Union Address:

So we sat down and listened to his speech and ironically the President, you might remember, that night said, it was time for America to do the big things. Exact same phrase. Three weeks after mine. [laughter] Except the difference between me and Barack Obama is on full display tonight because here’s what he said the big things were. He said the big things were electric cars [scattered laughter], high-speed internet access and high-speed rail.

Well, I just can not find those words in President Obama’s speech.

I can find traces of what Christie is talking about. The words electric car do appear in President Obama’s speech. And President Obama does laud broadband. But, in no case did the President list the big things.

Indeed, the words big things were a quote from a worker at a company who helped rescue the Chilean miners. As best as I can tell, the rescue was in October, 2010, and the worker probably uttered the quote well before Christie’s speech.

This makes Christie’s main point in his own state address plagiarized. Well, probably not. But, the small portion of Christie’s speech to the Koch crowd was so obviously a lie, why do I want to waste my life reading the rest?

Chris Christie lies.


Source material from http://motherjones.com/politics/2011/09/audio-chris-christie-koch-brothers-seminar

Posted by: Mike P. | August 24, 2011

Monopoly Is Only Fun With Certain Rules

This post sums up why the wealthy in the US would do well to rethink their current policies. Clearly some of the wealthy class understand this concept. The typical teabagger is clueless on the topic and is the dangerous one in the room.

Posted by: Mike P. | August 19, 2011

The Market

I’ve been lamenting the stock market lately. I invest primarily through a 403(b), which basically acts like a 401(k). Every two weeks, some amount of money goes into a set of funds that I choose from among a larger set that is available.

The recent spikes in the market are obvious. Every few days, everyone panics and sells. Wouldn’t it be nice if I could invest on those down days?

Any then it hit me: why not convert my purchases to cash funds? Allow some amount to accumulate, and then buy on these ridiculous downward days?

I think I am going to start doing that.

Posted by: Mike P. | August 11, 2011

To Senator Mikulski on DOMA

Senator Mikulski,

Marriage should not be limited to a man and a woman as interpreted by a reading of certain religious texts. While you may personally believe this to be the case, I am asking you to act as a leader.

As a leader, you must do what is right for those you lead. Doing what is right does not mean doing what is popular or what will get you re-elected. It may even mean taking a step back from your own personal beliefs.

Marriage is a contract between two people who love each other and wish to announce this to society. In return, it is expected that society will respect this contract the couple has entered into. A same-sex marriage in no way impinges on a heterosexual marriage. The entire concept of DOMA is non-sense and can only be understood when viewed under the ugly, glaring light cast by homophobia.

I am not suggesting you are homophobic; I am asking you to take the extra step of being an active partner in the repeal of DOMA. Please consider supporting a repeal of DOMA and participating in the discussion.

Thank you for your time,

Michael J. Porter

Posted by: Mike P. | May 23, 2011

Maryland SB 167 – Part 2 – Who Qualifies

Please start with Part 1 if you have not already read it.

Much of the information discussed here comes from the fiscal and policy note prepared by the State of Maryland.

Various groups opposed to SB-167 like to characterize the people who will benefit as Illegal Aliens and hence criminals. I do not feel extreme by bolding the term criminal. Read the talking points at MDPetitions.com designed to turn voters against SB-167 which are based on a variety of disinformation and partial information.

Who are these people? First, they are undocumented individuals. The specifics of undocumented individuals will be covered in another posting. But, please read on. They are not who you think they are.

  1. Starting with the 2005-2006 school year, the student must have attended a Maryland secondary school for at least three years. In other words, the students involved have not recently hopped the border and flocked to Maryland. They have lived in our community for a number of years.
  2. Starting with 2007-2008, the student must have graduated from a Maryland high school or received an equivalency diploma. In other words, the individual graduated high school. These students are not high school drop-outs looking for a place to hang out and waste money.
  3. Provide documentation that the individual or the individual’s parent or legal guardian has filed a Maryland income tax return annually for the three years while the individual attended a high school in the State, during any period between high school graduation and registration at a community college, and during the period of attendance at the community college.
  4. Register at a community college within four years of high school graduation.

So, we have high school graduates (it is illegal to deny public education to undocumented individuals), whose parents pay taxes. Yes, that is correct. We are extending a benefit to taxpayers. While these people may be undocumented, they are earning money, and they are paying taxes. The benefit being extended still requires a substantial contribution from the individual or their family. Therefore, if a student is taking advantage of SB-167, money is being earned, taxes paid, and proof of tax filing must be provided.

So, what else is in the bill? Let’s quote from the Fiscal and Policy Note:

An individual who qualifies for an exemption and is not a permanent resident must also provide an affidavit stating that the individual will file an application to become a permanent resident within 30 days after becoming eligible to do so. In addition, an individual who qualifies for an exemption and is required to register with the Selective Service System must provide documentation of the required registration.

So, the student must take steps to obtain legal status, and do so as soon as possible. Additionally, the student must register for the draft and be prepared to defend our country.

Another interesting component to the bill is that a student must obtain a 2 year degree at a community college prior to moving to a four-year degree granting institution. This has several effects. It limits the overall cost for the education since community college tuition is cheaper. Additionally, should the student prove to be unable to obtain a degree, and fail do so within the first two years, the loss is minimized. Fewer slots at four-year degree schools are occupied, limiting the impact of this bill on documented individuals.

The tuition at the community college is subsidized by the state at the in-county rate, and is subject to the rules stated above. The precise impact to the institutions involved is analyzed in the Fiscal and Policy Note mentioned at the top of this post. The details are complex, so it is best to consult the document directly. The bill does have a provision that the number of students admitted must be reported to the state on an annual basis. Therefore, the impact can be tracked and the bill adjusted if needed via future legislature changes.

So, to sum up: Who are these people: Taxpayers who have lived here for some time, whose children have demonstrated a desire for education, are able to afford in-state tuition, and the students are willing to take the steps needed to become documented.

There are some downsides, of course. The specifics vary by institution and type of institution (community vs. four-year).
Clearly there is a cost to the state, and for some institutions, a possible revenue loss unless adjustments are made. Most institutions have enough leeway to handle any potential losses. A few could experience lower income.

The question is: is educating and embracing this group of undocumented individuals who lie outside the post-secondary educational system worth the cost? The trivial talking points of calling these people “criminals who suck up our tax dollars and that should be deported” is just that: trivial talking points made by short-sighted individuals looking to make a political point at the expense of educating potential future citizens.

Older Posts »

Categories