Monday, February 26, 2007

Preparing for fab

This last week I've been working with my favorite circuit board design software. It's no secret to many who know me that I'm a serious nerd so it should come as little surprise that I'm finally getting one of my projects I've worked on fabricated.


It's a power control board. I'll hook it up to a computer serial port and issue the PIC16F688 commands to enable and disable power through any one of the 4 relays on the right side of the board.

I've never done this before. In fact... I'm not even sure it's going to work. Sure, I'm confident enough to spend $78 for a run of boards and $35/board on parts, but really, do I KNOW it's going to work?

Keep reading to see how Shaun's first steps into embedded design go.

Sunday, February 18, 2007

Trust

I have been talking to a fried who has had some legal trouble within the jurisdiction of holaday city.

Between this and the legislature being in session it has caused me to ponder what is going on with our laws. They're pretty messed up.

I think it's a matter of broken trust.

We as citizens need to be able to trust all three branches of our government.
We need to trust the legislative that it will pass laws for our benefit, but not to the point of controlling us and our behavior.

We need to trust the executive that the police officers that are doing enforcement are doing so for our benefit and not for selfish reasons of having power over others.

We need to trust the judicial that it will take the time to understand the intent of the laws and that there may be real justice for all; both for the accuser and the accused.

Finally, these branches of government need to trust that the people they serve (for they exist only to serve these people) are capable of doing what is best for their own lives or living by the consequences of their actions.

I have come to the realization that what really has gone wrong is that this trust is broken.

The legislature doesn't trust that we can be aware enough to be responsible for our selves so they pass laws that make decisions about personal liability criminal infractions.

We no longer trust the legislature that they are listening, and that our representatives understand the proper role of government.

We no longer trust our law enforcement that they will respect our rights as citizens.

We no longer trust our judges that they will, with full fairness, consider the law or even be available without great expense.

Most of all, we no longer trust each other.

How many of us are there that will have a conversation with our neighbor before seeking for remedy by calling the police?

How many of us seek to change annoying behavior by having a law passed?

How many of us will try to force someone to change because we think what they are doing is foolish?

I firmly believe that every person has the ability to determine for themselves what is right for them. I also believe that it is not the place of government to stop someone who is on a path of self-destruction; it is possible that trying to force them to stop may perpetuate it further. It is the place of the people in the community to reach out to those that are harming themselves by their actions.

I don't think people in this country understand what it means to be free anymore, or what it requires. Many don't believe they can allow others to be entirely free because they don't trust anyone to use freedom responsibly.

The trust in all directions has been broken.

Tuesday, February 13, 2007

Ward websites

I'm the ward website administrator for my ward. This means I'm supposed to update the calendar and do other helpful things.

Today there was a training meeting where we discussed the proper use of the ward websites. I being the restless person that I am decided to figure out how to automate exporting the calendar. It took about an hour.

Here's how I did it. wget is a wonderful tool. It's good for downloading web pages.

wget --keep-session-cookies --save-cookies cookies.txt\
--post-data="username=&password="\
https://secure.lds.org/
wget --load-cookies cookies.txt\
"https://secure.lds.org/?monthIndex=&currentYear="

You find the loginForm target path by looking at the source of https://secure.lds.org/units/

You find the path to the calendar by observing the calendar link target.

The monthIndex and currentYear variable are required. You will end up with an error page if you don't supply them.
I generate their values using the date command:
MONTH=`/bin/date +%m|sed -e s/0//g`;
YEAR=`/bin/date +%Y`;

The sed command is meant to strip the leading 0 off of the month number.

The final thing I do is
grep `date +%m/%d/%y` calendar.csv
This returns the list of records for the current date. This is going to allow me to generate an RSS feed so that I can see each activity on the day when it comes up.

I just won't be able to tell you where the feed is. I have to keep it to myself because this data doesn't have easy public exports (like RSS feeds and ical subscriptions) for confidentiality reasons.

However, this does not diminish the coolness of the hack.

I can supply the shell script (passwords removed) to anyone interested in downloading their calendars in an automated way.

Disclaimer: This is in no way supported by the LDS church. If you use this information to automate the downloading things from your ward website it is up to you to act responsibly and not break the terms of use. This information was obtained by viewing the source of the main login page and reading the wget(1) man page.

Saturday, February 10, 2007

Moving

This week I decided to rent a room and move in with my grandpa.

The first thing that this means is that I need to go through my crap and throw a bunch of it away.

The second thing it means is that I'm not going to run for holladay city council this year. It probably would have been fun, but I don't think I would have time with my job at backcountry.com. Either way, I can still run for state legislature. I could support the de-retardation of our state's laws.

It's still 6 weeks away, but it should be exciting.

Sunday, February 04, 2007

Lisp is my calculator

Today I was trying to calculate e.

I find that when I try to calculate things that involve either large exponents or sums of large series regular calculators just don't seem to cut it.

Today's calculation was for e using the formula given with limit notation:

e = lim x -> infinity (1+1/x)x

To do this I decided to select a value of x that is large enough to give a reasonable approximation for the first few digits... 25000

I don't know about you, but I havn't found many hand calculators that like to do things like raise numbers to high powers. Most graphing calculators can, but I don't always have one of those around.

The other thing I really appreciate is being able to work with rational numbers without introducing rounding error with floating point.

If I divide 3 by 4 in most calcualtors I would get .25. In lisp I get a fractional number of 3/4. In instances where you really care about rounding error this is a great feature.

The only down side is the calculation time. While I know I'm getting a good number, it can take a little longer. I have generated numbers multiple screens long. When you're dealing with these large numbers without loss you can get into trouble where you are maintaining accuracy you don't need.

For instance, in cryptography when you are trying to find C=PE (mod n) you can apply mod n to each step of finding PE. This keeps the number small enough to be operated upon.

Lisp may not be the best calculator around, but it sure helps get the job done when you need to operate on rational numbers.

Saturday, February 03, 2007

Getting back into things. (Plus a rant)

I haven't been blogging in almost a month. Really, I would have liked to, but how exactly blog about looking for work when you would be leaving multiple jobs at the same time?

Well, backcountry.com ended up offering me a job. It's great, I'm surrounded by smart people. Plus, it's a jump in pay. My main job that I just left was bought last month. You can read sarahbellum's recent thoughts on the matter. Suffice it to say, being a programmer and otherwise curious guy there wasn't much point to me sticking around to do sysadmin, helpdesk, or anything that involves user support.

You might say I've gone to a better place...

For what it's worth, I don't plan on working anywhere that is subject to FDA regulations ever again. It's not that I have any problem with laws that are meant to make people safe.

(I do have some problems with laws that make us more "safe", but that's no my FDA problem.)

No, being a citizen of this fine country I have taken it upon myself to be educated as to its operation. For those of you who may not be from around here, or who never took a civics class here's the breakdown of how laws are made (simplified):

The congress passes bills by voting on them.

The president signs bills into law and manages the departments that do enforcement.

The judicial branch looks at those laws and provides a process for making sure that the laws and their enforcement are within the scope of authority of what the congress and president can do.

Now this system works pretty well. If there is a rule that anyone is bound by there has to have been some unit of government (city, county, state, etc...) that has undergone the due process to make it follow this pattern.

The legislative makes the laws.
The executive enforces the laws.
The judicial determines if the laws are correct/valid.

Well, here we have the FDA. It was created by an act of congress, signed into law by the president, and allowed to continue by the judicial. Everyone dropped the ball.

Why is this a problem?

The congress has the authority to make laws by way of simple majority with the president's signature, or with a 2/3 majority overriding the president.

The congress was not granted authority to delegate its law making authority.

The FDA has a rule making process. The people who make the rules have been placed there by congress, but they are not subject to reelection as are the members of congress. These rules are enforced with the same effectiveness as other laws, but in the case of infractions you are subject to other FDA rules or laws that have been passed by the congress. It's kind of messy.

The biggest problem with this is that if you break an FDA regulation the only remedy is to work with the FDA. There is not a judicial due process in place.

That is to say, when a regulation is broken there is not a judicial line of authority (appeal process) that leads to the supreme court. This precludes regulations from being judged as to their constitutionality.

For what it's worth, I really like our form of government. It would work really great if we used it the way it was designed.

Before we can really be free enough to have a real constitutional government people have to respect the boundaries that are so important to keeping it going. Even worse is that the current iteration we are living under now will have to collapse under its own corruption before it can be replaced by good people who will not support such corruption.

Is my dearest hope that I may one day be worthy to live among people who can abide by a constitutional form of government the way it was meant to be used.