Wednesday, August 20, 2014

Control your Network Connected Devices

Today I want to tell you about a little epiphany I had a few weeks back. I realized that I could connect firebase to a local nodejs server and a public facing website, and control my roku.

Most people read this and think....well duh you can already control your roku using your phone. At this time (please prove me wrong) you need to be on your Intranet. Your Intranet is the network in your house that your roku is on, so basically you have to be on the same wifi as your roku.

This means you can setup a website using firebase to authenticate you, connect to a common data point in your database and now control things in your house from ANYWHERE as long as both have an internet connection. So I could be in Hong Kong and change the channel on my roku.

Ok, big deal why should I care? Well what if I told you that your roku isn't the only device that connects to the internet? You can query for all these devices, setup commands for them, and control them from anywhere! Forgot a light on in the house when you left? With (some) devices you can check the status and turn it off/on. This kinda makes that whole "internet" of things a lot closer to reality without completely opening up your network, the only "failure" point here is if your firebase gets hacked or something.

But you want code....

https://github.com/onaclovtech/MediaController

Here is the side that runs in your house (and you could also just run this on a raspberry pi or something instead of a dedicated full blown computer).

Right now I have my own rolled roku controller, but I think there is one in npm already that I haven't checked out. You can control your Chromecast this way. Possibly smart tv's etc.


Details for the people who are interested:

Node Side:
1. Start server
2. Server does a query for network devices and adds them to a list.
3. Server pushes list to myfirebaseurl/mediadevices
4. Server then sets up a callback to trigger when a child changes (state specifically).
5. Server sets up functions to handle deleting devices in mediadevices when it closes (this is to ensure that the devices are always accessible).

AngularJS side:
1. Connect to myfirebaseurl/mediadevices
2. Associate NG model to a dropdown (that's how I'm swapping between, if you have other ideas I'd love to hear them).
3. When a button is pressed, it looks at which device is selected and changes it's state to whatever mode that button is designed to accomplish.
4. If the server is removed then mediadevices is empty and the dropdown goes away.




Let me know what you think! If you have a chromecast, amazontv, etc that you want to build this on, or want to lend me to build it on, lemme know I'd love to chat!

Tyson


Friday, August 15, 2014

Can we make web apps less reliant on network?

So I was thinking a little about how I was using bootstrap for some of my sites, and with it being a pretty commonly used code across sites it got me thinking.

Could we somehow share these resources across domains reducing the need to download, which causes us to slow things down normally.

Here is my thought.

When parsing a .html file you come across a script tag with a src a la

script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.6/angular.min.js"

When it downloads the file it (maybe?) puts it in memory so it can be used (I could be wrong here).

What I was thinking is that we maybe generate a key value store, and it does something like this:

{"https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.6/angular.min.js", "pointer to memory that this resides"}

Now instead of simply downloading a .js file, it looks at the lookup (or hash table) and finds that that EXACT path file exists in memory and just uses that instead of downloading the file again.

Caveats.

1. I don't know if it would be possible to modify that memory.
2. I wouldn't expect this caching to be indefinite, but should be do-able across pages during an active session.

As long as the downloaded data isn't capable of being modified in memory, then doing a string lookup in a local hash *should* give us a decent startup decrease because we don't need to re-download the file(s) and I can't see how we would have any problems with safety/security since you're literally using the exact same file as you downloaded earlier, you just don't need to re-download.

I'm sure I'm missing something here, but I would think that this should be possible. Got any ideas? hit me up on twitter (@onaclov2000) or leave a comment here

Wednesday, August 6, 2014

Movies Oh My

I've been a busy boy.

In my quest to generate a boatload of Angular Services (for angularjsservices.com, dont hate the site it is terrible, if you want to help build it let me know!).

I wrote up another library but this time for my movies.

https://github.com/onaclovtech/movielibrary

The cool thing here is I built a rottentomatoes.js angular service for it.

https://github.com/onaclovtech/rottentomatoes

I got it all nice looking and then discovered omdbapi and guess what? now we have one for that too.

https://github.com/onaclovtech/omdbapi

You can substitute them and get your data.

Now the bad news. (but potentially good news).

The JSON returned is different between the two. So something I'm thinking about that would be really slick is if we could essentially take the format from each and push the data to a title,picture,etc variables, then we simply return our search and it contains an object with the appropriate fields in a standard location. I think this would be huge for ALL of my Angular Services to basically build a JSON format that will be consistent, and the service will manage converting.

If you're interested in helping out with coming up with standards for this I would love it. If you're interested in helping build angularjsservices to what it SHOULD be, I would love that.

In the mean time I'm building building building.

Join me and build an angular service too? (trust me they're surprisingly easy, and they make using angular even more fun)

I'm using Firebase to store off the data just like my book library. Firebase sure is handy.

While playing with this I realized something....I can control my roku with a webpage and I don't need chrome's special stuff (that the chromecast is using) I can just use a local nodejs server and firebase and host my site anywhere. I will be working on that next. Can you figure out how to do it? I think I've given some good hints :)

Tuesday, July 1, 2014

Emailster

+
+
=
Emailster

Today I'm planning to talk about SendGrid, AngularJS and FireBase. SendGrid is an email delivery service which supports a REST based interface for sending emails to customers, FireBase manages JSON data and syncing that data between clients really fast. Finally AngularJS provides us with a client side framework that has great databinding and is pretty fast and easy to use.

My goal was to make a client side only app and send emails from it as well as determine the validity of those email addresses.

I created a service called email and it's located in a file called sendgrid.js.
Now in theory anyone who can manage sending emails via REST or other web technology can be inserted in place as long as the function prototypes match. In this case I have a function called "send" that takes the parameters of api key/user, who the message is going to, what the subject is, what the body will say, and who the message is from. I'm working on a site called angularjsservices.com which I hope to collect all these services we can interchange and use for creating amazing client side only applications.

I am marrying Firebase by keeping track of what emails are valid, AngularJS to manage routing for the Firebase "ID" the user is assigned and setting it's validity in Firebase.

The whole reason I came up with this idea was because sometimes you have an idea you want to see if there is interest for. So you want to collect valid emails, or you want to give something away if someone provides a valid email address, this can be accomplished using these client side only technologies.

In Firebase I create a data structure like this:

{
  email: jon@doe.com,
  name: Jon Doe,
  valid: false
}

Next I setup routing in angularjs

webpage.com/:id

where :id is the firebase data element.

So now we can do something like this
firebaseurl.com/:id

to point to the specific firebase entity.

When the user clicks on their link webpage.com/:id it sets the validity of the email to true:
it becomes this:
{
  email: jon@doe.com,
  name: Jon Doe,
  valid: true
}
And there you have it, you can collect emails from a client side only application.

API Key and User
When you make a REST call to SendGrid it's passes your API Key and User in plain text, when you have a server application it's not *nearly* as big of a deal, however when you have a client side ONLY application, this becomes a big problem since your API Key and User are the User/Password to SendGrid's website.
I have a few suggestions. The first is Stop using the same User/Password as your API key, and allow you to generate new ones if you happen to require changing yours. This would prevent people from running off with your keys and logging in and changing settings. It would also allow you to change it if someone decided to grab your API Key and user in your client side only app and start using them. The second thing that could happen is similar to FireBase you could enable security settings for requests from specific domains. This solves the API Key and User name in the client side only app because we'll only be able to "send" and email if you're ON that domain. Either way splitting the API Key and User from the login credentials is a critical issue for me (and if I'm wrong PLEASE PLEASE let me know and I'd be happy to update this post).

XMLHttpRequest
Second is that when you make a REST post using my Angular Service I get a XMLHttpRequest cannot load [sent REST message url]  The 'Access-Control-Allow-Origin' header has a value ... that is not equal to the supplied origin. Origin 'null' is therefore not allowed access. If you click on the link the value in the browser says this:
{"message":"success"}

Which I find very surprising since it appears I got an error, I'm not sure if this is a mistake on my side or theirs, but either way I am able to send a message successfully so somethings up here. Again please contact me if you're able to help out.

You can see the application as it is here:
https://github.com/onaclovtech/Emailster
I'll slowly be cleaning it up and making it fancier, but I really wanted to show it off right away!


What other apps can we make that traditionally require a server side component, but we can write as client side only now?

Friday, June 27, 2014

Depth First vs Breadth First programming and stubbing

Originally I wanted to title this saying TDD instead of stubbing, but really the reason this topic came up is due to chatting with a friend about writing dummy functions to get TDD to pass, which lead to me commenting that sometimes I want to stub something out so I can say "well let's pretend that works" and move on and get the code I'm actively working, on working.

Breadth First Programming Style
This style of programming is writing the highest level (user facing we'll call it) code first, any calls to functions that should do something or get data or whatever should be quickly written as stubs with something to get you moving in your current function. The next step is moving into the first (or last depending on the order you'd like to go) and managing that functionality. If that calls down into nested functions then you follow the same organization, finish all the functions at the n-1 level of your earlier function and go on.

Depth First Programming Style
This style of programming is writing code that always works at each step. If you start writing and you come across a function you need, you simply drop down and implement it, and if that has functions it calls, you do the same. This keeps happening until you've finished everything down to the bottom, when you move up you do the same thing on the next function until you finally reach the top level and move along again.

Mixed Style
I like to work in a Mixed style. When you're working a complicated algorithm on your main thread of work it makes sense to say, well lets assume we get this data correctly and move on and continue working the algorithm, however if it's a relatively easy problem to solve and dropping into the function the function is a bear, it might make more sense to just implement that function first then move back up to your higher level.

TDD Aside
Since I brought it up I should talk a little about TDD. TDD is to me more of a Depth First style of programming. You write up a test, then you implement a high level of it, and yay it passes, then you write another test and drop back down to the function level you were at and "fix it" and keep doing that. I almost would compare this to a Yo-Yo strategy, you start at the top with a test, and throw your Yo-Yo, then when it gets all the way through the pass you start again at the top. You don't move forward until things are as right as you can make them.

How do you work what is your style? What do you think TDD is like? Are there any other programming styles you can think of  in this context?



Wednesday, June 25, 2014

Ordered Entry of Form Data UX

As a follow up to this post: Stacking Enabled/Disabled States

I am going to show you a working example.



So now when combobox selected index changes it disables and clears all the form fields AFTER textbox1 (so textbox2, and button1)

Additionally you could set up a similar situation for adding data to comboboxes. If you enter in some data and move to the next field, you could call the same thing and have function pointers for the data on the "next" item in the list (so instead of pointing to 2 down you point to 1 down the list).

Good luck and do you have any tips for Ordered Entry of Form data?

Thursday, June 19, 2014

Stacking Enabled/Disabled States

I get annoyed when working with forms that require data to be entered in steps, this is usually how the code works.

1. Write a "on changed" event handler for the field.
2. When fired Set all fields below to disabled.
3. Enable only the next field.
4. Repeat.

All I can think about here is DRY (Don't Repeat Yourself) but how can we accomplish it?

I'm thinking you build an ordered list of all the fields, then when an on change event handler fires, it finds where your field is in the list, and disables all below it. So from there you simply make ONE function call in ALL cases, and pass it your current field, it'll then follow the rules.

What do you think? How do you manage ordered data entry and how you select appropriate fields?

I'll try implementing this and when I finish I will post here what my results were (pains/gains).

This is a rough idea, (not an actual implementation, but should be very close)


Tuesday, June 3, 2014

Using zip on the command line

I was trying to find zip on the command line, I don't know all the parameters that are available. However, a little guessing I added -r but anywho, this is the command.

zip -r filename.zip foldername

That's it.

Good luck

Monday, May 19, 2014

How Did I Get Here

I blogged for work.....that's crazy right?

Check it out.

http://aerospace.honeywell.com/blog/how-did-i-get-here-my-path-to-honeywell

Wednesday, May 14, 2014

Saving user data without requiring login

Saving users data without requiring a login can be a tricky problem, but with firebase and a framework that supports routing it doesn't have to be.

I have a friend who has a site called http://www.infantchart.com/. He mentioned one time that people don't like to have to login, or link to a google account so they can save their data. I think we've done this so many times and we understand the reasoning why, that it was hard to understand why someone wouldn't want to do that.

I have been playing with Firebase a ton, and I love it. Just last night I wrote a VERY simple app that adds elements to my data store. I had nearly forgotten that when I add a JSON object to my store, it'll generate a unique id (like a primary key in a typical database). Having worked with Angular JS, I know you can use routing pretty easily. So I now have a solution for his problem.  When a user enters in some data, generate a "new" key for them, and redirect to that page for any further input. Now when the user visits infantchart.com/[unique id from firebase] using the ability to route, you simply open a firebase connection to [firebaseurl]/[uniqueid]

How do we get the user to go to that site though? They're probably not going to remember HvawoinvNOINRV to be able to get to their data. Adding a "share" option and really highlight it so they share with friends, this will attract new visitors, as well as help them find their way back. More than likely if they can't remember the path, they'll remember they shared it with friends and find the link that way. Additionally you can store that unique id into local storage so when they visit from the same device it automatically goes to the right link, this way they can always find their way back.

Giving users the ability to save their data without having to actually login/link will help retention and reuse, resulting in a more useful site and a little more intuitive I'd like to think.

Disclaimer: Don't use this approach for sensitive data since finding other peoples data is a matter of cycling through different combinations (it might be a pain and hard to find stuff, but it's not impossible).

Do you have other ways to save user data without requiring a login, love to hear about em in the comments.

Monday, May 5, 2014

The Passionate Programmer

I found this to be a pleasant book with a lot of useful tips to improve how you approach your job as a career.



I've really enjoyed reading this, and highly recommend the book!

Wednesday, April 2, 2014

How do we stop loved ones from clicking on spam/phishing links?

Do not let them ever get the links.

Problem

Ok I am just being a little facetious. I have kind of grown up on the internet, I am suspicious of all kinds of things (and I am sure I make mistakes all the time), but there are some cases that are just so obvious. However, here is the problem I have, things that are obvious to me, are not obvious to everyone. 

Is there a reason that in the history of your email, you have NEVER sent a link to Botox to your friends, in fact, you have NEVER sent an email to ALL your friends, nor have you sent the same email (or close enough) to EACH of your friends in different emails? I am willing to bet you have not sent the same email (or similar) to more than 10 friends in your contacts which falls into the HUNDREDs or possibly even THOUSANDS.

Solutions

Send filter

Google reads your inbox, Yahoo reads your inbox, and the NSA reads your inbox. I suspect they read your outbox too. Why not read them for good too.

What I propose is that the companies who are sending the email do a simple filter. IF we are trying to send links to a BUNCH of people, OR multiple emails of the same link to a bunch of people, we just simply hold onto the email, and wait a few days. Simply popping up a notification probably will not help, since the person who hacked the account would just as likely hit "OK". However, if you leave it in your sent box with a reminder for say 3 days (this should be enough as MOST people check their email at least 1 time in 3 days), that says "Hey you sent this email to a bunch of people x days ago, I can still cancel it if you'd like". 

Alternately, we could add some kind of are you a real person test (CAPTCHA), so now instead of sending 100 emails all at once, (or say more than 3) you have to put in a CAPTCHA for every so many, which would slow down anyone sending spam. Make it a poor enough Return on Investment (ROI) for the spammer, but a sufficient enough ROI for the person legitimately sending emails.

Training

Suppose whenever a link comes through that *might* be a spam account, before you can look at the email, you have to do some kind of training (this is along the lines of PhishMe, but it is not corporate guided, so this is more "inform the masses"). Once you finish the training, we could HIGHLIGHT links with big arrows that say "THIS MIGHT BE SPAM OR SOMETHING NOT GOOD, WE DON'T RECOMMEND CLICKING".

How would this help?

Prevention

Each of the email providers has to scan each email as it arrives for spamminess. (Yes, I just made this word up). Imagine if instead of having to parse 300 incoming emails, it only has to parse one outgoing, deemed it as spam, and never sent it (of course there would be ways to work around this, but basically it should involve more work than spammers a spammers Return on Investment). Cut it off at the source, less outgoing spam means less incoming spam, and it is a multiplier when you stop it at the source.

Knowledge

People who don't understand safe browsing behavior will either be prevented from even being able to click on links from people they trust (but who weren't sent from people they trust), or simply make it really obvious when you might be subjected to Spam. By informing them repeatedly, it might just become second nature.

Hope you had a fun time reading this.
I would love to hear your feedback.


Monday, March 17, 2014

Convert Hidden text to Regular Text Word 2007

Came across a problem this morning converting Hidden text in word 2007 to normal text.

1. Enable the hidden text

 a. windows ribbon, start menu, word options

b. Select Display, then Make sure Hidden Text is selected:


2. On the ribbon, in the editing box (typically far right), select the select drop down, then Select Text with Similar Formatting.

3. On the ribbon in the styles box click the arrow with the bar above it

    and select clear formatting

There you go, now you know how to clear the formatting, there are some other ways floating around the internet explaining how to make hidden text normal text, but they didn't work for me. This worked.

Good luck and let me know if you find any other solutions that are easier (short cut keys would be awesome too).

Sunday, February 16, 2014

Localstorage using AngularJS

I found a really nice demo app (and associated .js file as a service) at http://gregpike.net/demos/angular-local-storage/demo/demo.html

Unfortunately when I went to update my app recently, I noticed that my localstorage was getting clobered for some reason.

I after bringing up the debugger and stepping through, I found out that when the $watch was being called on the demo values, it was passing value as a null value. Now as to why this was happening I don't know, however to fix it I reverted from $watch to ng-change, so here's how.

(if you're literally using his page identically, then do a view page source and we'll move from there):
Here is the before:

And here is the after:
Note:
I added an ng-change attribute to the input field. Then in the controller, I added a call to update the variables we want to use, and added a function called change, inside that function I attempt to store the data (as before) and update the variable we are using for our text (as before).

If you've been having problems getting localStorage to work hopefully this will get you moving along.

Monday, February 10, 2014

5 ways to think more like an Engineer

1. Read Technical Documentation.
If you write software, read about new languages, or techniques. If you design buildings, learn about new techniques, materials.

2. Read Context Documentation.
Understand your customer, when you see the pain points of customers, you can understand better how to solve the problems they are experiencing.

3. Think Wider.
If you are trying to solve a problem, try to solve it in more than one way. Aim to meet the same end result with each option. Look at how each can work for and against your end goal.

4. Be social, share
Talk to other engineers, particularly others that are always furthering their knowledge, sometimes you'll find that they understood a subject differently than you, which is good, this gives you another view. Also if you share stuff you build, you might find others are interested in helping out, and show you new ways to solve your current problems.

5. Test your assumptions.
Create a hypothesis about everything you do, and then prove your hypothesis is correct. Do this one day a week. Whether its writing code, simulating the tensile strength of a set of materials you're considering using. Find ways to prove that your understanding of the system is right, even if you are 'certain' you're right. See if you can 'break' what you thought was a certainty.

Good luck, do you have any other ideas of How to think more like an engineer? Share them in the comments.

Saturday, January 4, 2014

Xbox Kinect, google glass

What if we took an Xbox Kinect, scanned an entire room then we proceeded to design the room in a 3d modeling system where the wall hangings, furniture, etc are already integrated. when the time comes to implement, you put your glasses on you look at the wall and you see the holes and you proceed to drill holes or hammer in the nails.

Moving furniture into place is as easy as looking down, and adjusting to match what you see in your glasses. I think the Kinect will have to be involved in some way to match your orientation to the room and head position etc cetera.

What if we incorporated blue prints into this design builders could see the wall that will be built and see where wires will go as well as where things will go eventually.  homeowners even might know where power lines are for safe drilling if the blueprints are made available.

I really want Google glass to provide true value and actually be an extension of ourselves not a pure consumption device. What ideas do you have that glass what allow you to produce things easier and consume less. And by consume and produce I mean providing real true value to other human beings not shallow status updates.

Thursday, January 2, 2014

Keeping Track

So I have a problem, If you work at a large corporation you just might understand. When I come up with something I want to do, that is out of the norm, I frequently get a "talk to X or Y" recommendation.

That leads to talk to A or B recommendation, and on and on, sometimes multiple levels deep.

I had an epiphany today, MIND MAP, so now I center the mind map with the topic I'm looking into, then I map the name(s) of who told me to talk to someone, then map them, so eventually you get a nice map of who you've talked to (and I'll usually note a date, or whatnot), and who you haven't.


This has the added benefit that if you come across a similar situation, you *might* be able to get away with chasing down the individual at the end of the map, not at the beginning (unless that's taboo, and you're supposed to follow the chain, but come on, who does that? We just want to get stuff done).

Good luck.

Tyson

Monday, December 23, 2013

Angular And Firebase Routing and Small Data Sets

I was learning how to use Firebase with Angular recently, and I ran into a problem, when I asked a question on stack overflow I received an answer basically saying to call firebaseurl/ of the data, well I can get the index, but I wasn't sure how my second controller could get that data ( so when my router swapped to the new page, I didn't know how to get it). Thanks to a generous soul at Open Hack last night, we discovered $routeParams, apparently when you use :id in your router config, when you use $routeParams in your "new" controller, you can access whatever that : was, so in this case $routeParams.id gave me the id, which is precisely what I needed. 

I just wanted to point this out in case anyone else had issues. So long story short,

First Page had this:
<a href="http://www.blogger.com/blogger.g?blogID=4424951240484003947#/blah/{{index}}">Blah </a>(Where index is my id)

the router config looked like this

path="/blah/:id"

the "new controller" added a reference to $routeParams (like where we reference firebase, just add a comma and go).
Then I did

"firebaseurl" + $routeParams.id to capture a smaller set of data.

Friday, December 20, 2013

On Government Involvement with Hardware Standards

I asked Phil (@civissmith, +Phil Smith ) if I could repost his email on my blog, I thought it was a very coherent argument to the Government getting involved and forcing manufacturers to follow certain standards (Read: USB Plug on Phones). Enjoy! If you have anything to say about it, I(we) would love to hear!

In regards to our conversation yesterday about the EU and whether micro-USB is required in new devices:
The latest news I could find about the subject is that, at this point, it is still only a working consortium. The EU parliament has made a proposition to start working towards formalizing a law, but as of 26-Sep-13, there does not seem to be anything official [1].

As it stands, manufacturers in the EU have voluntarily agreed to work towards a common goal but there is no legal requirement. Even without formal legislation, Apple is apparently accommodating the EU market by releasing a micro-USB to Lightning port adapter [2]. This sets up a very interesting situation. On the one hand, an engineering team has designed and implemented a product and on the other, a non-technical governing body is pushing towards making a different, licensed technology a standard. I believe this is a very dangerous situation - the government is about to start driving design.

Let's take this out of the context of Apple vs. "the world", mostly because Apple is not the only manufacturer to create their own charging system. This is the cable used to charge my Toshiba Excite tablet [3]. Instead let's look at the underlying question, should a government body even be considering this legislation? If governments become involved at this level, I fear that technology will ultimately be hampered because the people constraining the design would be unfamiliar with how to create new technology - in some cases, they may not even be familiar with current technologies.

The prima facie appeal of the law is that it will reduce consumer waste and enhance ease-of-use. While, I agree that these ends are admirable, let's examine the means. A company is designing new "radio equipment device" to compete with the latest generation. During the design phase, this legislation would require the company to use USB as their power connector. This means the company must pay somewhere between US $1,750 US $4,000 per year just to carry the USB logo [4]. If the device is designed to have any media playback capability through a cabled interface, then the company must design a second interface. The device that could have had it's own hardware interface designed to do all in one must now ship with two cables - one USB and one proprietary. This scenario would be asking for consumer waste. Let's assume that the company doesn't want to run the risk of designing a second, proprietary interface. The media playback would then most likely have to be the de facto media standard, HDMI. To implement the HDMI solution will cost the company US $10,000 annually plus a per-unit royalty fee [5]. The saddest part of this scenario is that a device that could have done all of this in one cable must now use two. It's inter-operable, but is that easier to use?

This legislation will also only push the waste from the consumer level up to the manufacturer level. Nothing in consumer electronics is made-to-order which means that HDMI cables and USB cables will still be produced at a certain capacity until trend data suggests that manufacturing should slow down. The end result is still thousands or millions of surplus cables. The only real difference is that the cables never made it to consumers to be thrown away, instead they were thrown out by the manufacturers when a newer interface came along and the antiquated equipment was no longer needed. But speaking of newer interfaces, what does the legislation do to technology growth?

The current USB 2.0 specification only allows for a maximum data transfer rate of 480 Mbs [6]. As technologies get faster and data storage gets cheaper, it's a logical conclusion that 480 Mbs will eventually be too slow to be usable by the average consumer - look at what happened to the 14.4 kbps modem when 56 kbps modems came out. And, in turn, look what happened to the 56 kbps modem when DSL and cable technology became consumer-grade. Granted, these technologies took years to trickle from R&D to commercial to consumer, but artificial standards would have only slowed things down. Lets imagine what would have happened if "to put an end to cable chaos" for consumer desktop computer users, the EU had standardized the network interface card. The de facto standard in 1995, as I'm sure you remember, would have been the RJ-45 connector. The question that I would have to ask is how long would the additional legislation have taken to bring down the RJ-45 standard and replace it with RJ-11 so that consumers could start making the transition from dial-up modems to high-speed Internet? We see it in our legal system now where laws promote lobbyists and large lobbies have a lot of swing. When you have a consortium of companies that all make RJ-45 connectors and chips that talk dial-up - would RJ-11 have ever made the transition? In that 1995, the companies touting the benefits of higher speed through RJ-11 and Cat5 would have to not only overcome consumer skeptic, but also legal dead weight - neither of which is an easy obstacle to overcome. Worse yet, the RJ-45 consortium would only need to convince the legislators that the transition is bad - then the consumers would have never even seen the new technology. Additionally, when the hardware connector for USB 2.0 becomes too obsolete to allow faster data transfers, what happens with the legislation? How long will it be before new technology can start to compete? Will it even be worth while for any companies to undertake the R&D? If your design is not chosen by the legal team, you've wasted all of that time and money - you never even get the chance to vet your design against the public to see what they think. I would liken that to being administratively disqualified, even if your design was superior. The real judges never even got to evaluate your product.

I think Sony and Toshiba both have a couple of catastrophic design failures that prove that consumer support should be the guide, not legislative oversight. Let's look back on the failures of Betamax and HD-DVD. Betamax was technically superior to VHS, but Sony didn't want to play ball with the consumers. Now Betamax is nothing more than a blemish on A/V technology history. Similarly, the format wars between HD-DVD and Blu-ray had a short era of intense competition, but then the standard was chosen by people that were impacted by the technology - not by the government.

At a certain level, I believe this is how technology should be. As an engineer, I want to design things that people want to use. If the people want to use my product, I think they should ultimately be allowed to decide. I don't think the government should be levying requirements on the manufacturer to steer them towards other technology - especially under the guises of environmental good or consumer protection. The government is not only steering manufacturers towards a licensed technology, but they're also requiring the use of OLD technology. The micro-USB "B" form factor has been around for a long time in technology terms and, although it can be used to charge a USB 3.0 device - that's the limit of it's usefulness. As more consumer electronics start to adopt USB 3.0, we'll be left with another split market that will ultimately leave an electronic mess. At some point, people will stop wanting USB 2.0 cables altogether.

It's incredibly seductive to say that the government should step in and force all of the designs into one box, but the other danger to consider is the obtuseness of the government. Officials that aren't in touch with their constituency could potentially side with the lobbyists and not the people. Back in the original context, imagine if the officials are all loyal iPhone users - would everyone pushing for this commonality be happy if Lightning bolt was selected as the new standard? Every new Android, Tizen or Windows phone must now use Lightning bolt. Or better yet, why not make a common OS? That would be the pinnacle of interoperability and ease! The EU... no the world must now use Tizen!

I've seen what happens when the government makes technical decisions and it rarely works out efficiently. In this case, I honestly don't think "designed by committee" is something the people will enjoy if it is ever made official.

Ref:
[1] http://www.europarl.europa.eu/sides/getDoc.do?pubRef=-%2f%2fEP%2f%2fTEXT%2bIM-PRESS%2b20130923IPR20617%2b0%2bDOC%2bXML%2bV0%2f%2fEN&language=EN
[2] http://www.technobuffalo.com/2013/09/29/microusb-mandatory-european-union/
[3] http://www.toshiba.com/us/accessories/Tablet-Power/USB-Charging-Cables/PA3996U-1CAB?src=ANEM&cm_mmc=SF_GooglePLS&CAWELAID=1466835490&catargetid=400007100000003265&cadevice=c&cagpspn=pla
[4] http://www.usb.org/developers/vendor/
[5] http://www.hdmi.org/manufacturer/terms.aspx
[6] http://www.usb.org/developers/usb20/faq20/

Learning something New for the first time

I work with an individual on my team who does administrative tasks. She's been here 27 years, I've been here about 6, in the last few years, she's asked about my job and what we do (our team). I don't think many people have bothered go into any kind of details to tell her about what we do, since her main job is most definitely not programming. She has commented that she would like to learn more about what we do, and I've tossed the standard "go check out Udacity" or "go checkout Coursera" out there (from a programming perspective). But, that is poor form on my part.

This morning I decided to change that. It only took 5 minutes, and she did her first "hello world" in perl. Her eyes lit up, and she about jumped up and down she thought it was so cool to have written her own program. After the new year we'll have a few more sessions. I hope she has more fun, and the excitement sticks around!

There was an XKCD comic that really hits the nail on the head.


I think I'd rather be excited showing someone something for the first time than to "write them off" (if you're reading this, I didn't write you off).  I guess it hadn't occurred to me to just sit down and write hello world with you, it was easier just to say go read this book, or listen to this lecture, then to say "Lets do this right now", I'd like to change that in the future.

If I know something you want to learn, ask me to sit down and show you, right now. I will, if I can't we'll schedule a time. This is important to me and you.

Thursday, December 19, 2013

How I use Virtual Machines

So sometimes it's nice to have custom environments to play with "new" toys. For example I decided the other day I wanted to install Ruby and play with it. Of course I can download the installer (if i'm using windows) or sudo apt-get install, however what happens when I forget about it and don't want to play with it anymore, do i want to deal with the hassle of uninstalling? Do I want to leave it and let it bog down my PC? of course not. So this is where virtual machines come in. Virtual machines can be costly in terms of space though, so today I'm going to teach you about linked clones.

Here is what I did.

I bought a Sandisk Cruzer Extreme (these things rock).

1. Download the ubuntu Server instance (this will keep memory low)
2. Install VirtualBox.
3. Create that virtual machine and install (pointing to your usb drive, or if you already have an SSD then that I suppose).
4. Basically we want a very minimal install, so don't put any of the LAMP stuff in, basically if it says "Hey should I install this extra wiz bang thing?". Say no
5. Install samba (sudo apt-get install samba)
6. Setup a configuration similar to the following:
    6a. Create a folder (whatever you want to name it) in your home folder.
    6b. chmod the shared folder to this:  sudo chmod 777 folder
    6c. Update samba configuration (from /etc/samba/smb.conf) replacing path with the folder you created in 6a.
 
7. Once that was all setup, I start making linked clones for various tasks, I.E. Ruby Machine, NodeJS Machine, etc (be sure that network is set to NAT, in this case I have a HTTP Proxy that is a hassle, so this is my workaround, you may have a better way and I'd love to hear it.)
  7a. So select your Ubuntu Server, right click clone,
  7b. Give it a good descriptive name when it asks,
  7c. When prompted select LINKED clone, this gives you a standard setup, but clean environment!
8. Logging in I see that occasionally my network takes FOREVER to come up, so that's because of some oddball thing so remove this file and it should resolve it, you're welcome to google around but you'll probably find that deleting this file is the solution:
sudo rm /etc/udev/rules.d/70-persistent-net.rules
9. after installing everything you need. halt the machine, shut down, and change the network adapter to Bridged, boot your VM up again, your local machine should be able to see the samba drives at \\\shared_folder (or whatever you called it in the smb.conf file).

Now whenever you want to work, you can startup the Linked Clone and start playing (and reference the folder you setup so you can work from your local machine with all your custom setups, just to play).


Monday, December 16, 2013

DRM of the Future

Digital Rights Management isn't new. It's been around for a while (wow, the late 90's, http://en.wikipedia.org/wiki/Digital_rights_management), and while back in the early 2000's the concept of controlling media was the idea, in practice it's not something that was managable, however with each and every iteration of technology creeping into our lives, the stranglehold gets easier and easier to maintain. This piece is spawned from this article http://boingboing.net/2013/12/15/amazon-takes-away-access-to-pu.html). Lets begin.


Slowly my eyes begin to adjust, my alarm didn't go off. I look at my phone, oh I guess I was wrong, turns out for some reason the Beastie Boys didn't appreciate that I woke up to them, so they revoked my rights to listen to their music as an alarm. Whatever, I stand up walk to the bathroom and begin getting ready. I finish up head to the kitchen and get ready to check the news. Today feels like it's going to be rough. I check my news reader app, weird, something wrong with my account, I don't feel like messing with it. The news is depressing anyways. I look up some recipes and download them to my 3D printer. Pancakes and syrup sound nice. I finish up breakfast and head into work.

I sit down at my desk and turn on my monitors and computer. I wait for it to boot, the camera takes a snapshot and see's it's me, it proceeds to load some advertisements while I wait for the computer to boot (how nice). I work for a while go to lunch and come back. Once the computer attempts to login I'm told that the license for my OS is out of date and I need to pay to renew it. Bleh, call up Ted, "Ted, license is expired again, can you renew it for me?". "No can do, I guess our word processor got too popular, they refuse to re-license our PC's" said Ted. "Wait, are they legally allowed to do that? I mean isn't that a monopoly or something?" I asked. "Nope, we're free to compete, but we just can't use their products to compete, so no monopoly, although it looks like we'll have to start over if we want to continue, since we can't get into the PC's for the source code and the hard drives are encrypted." Ted explained,  "I think I'm going to pack up and go home, you might want to do the same, nothing for us to do here".  "Better update my resume" mutters Ted as he walks out the door.

Slowly I pack my things and walk out the door, as I climb into my car and tell it to drive me home, I ponder why we decided to develop on that OS. In fact I begin to ponder a lot of things. Why can't I listen to Beastie Boys whenever I want to? Why can't I just read the news? Why can't I just use the PC and the Operating System that I paid for? My head is hurting, I reach for an aspirin and look out the window. "Wait, this isn't the right way home". "Where are we going?". "Back to the dealership, I'm afraid they caught wind that the store shutdown, and they're revoking your lease" rattles off the car. We arrive, I guess I have to walk home, it's only 10 blocks better get going before it gets dark. I head home.

Exhausted I walk in the door and decide that tonight I need a break, I've been working a lot of overtime to get our app out the door. Tonight I am going to relax. I look up the spaghetti and meatballs recipe I bought a few months back, and program my printer to make it. I walk to the living room and turn on the television. I scroll through looking for the Sherlock Holmes Series I bought last month digitally but never got around to watching. I can't find it. I call up tech support, and I'm told that the new Sherlock Holmes is on The Onion, and since they own the original they decided that their customers should really be watching the new Sherlock Holmes when it's on, not the older Sherlock Holmes. "Great, so I can't watch it even though I bought it?".  "Nope" replied the tech. No apologies, like I'm expected to know this. I hang up in frustration, walk out to kitchen to grab my food and find that there is no food printed. I check the display, "Two options available Sherlock Holmes Bangers and Mash, Sherlock Holmes Fish and Chips", I call up tech support for my printer. "Hello, I am trying to print out some spaghetti and meatballs, there appears to be some kind of error on my printer", "Let me take a look real quick, it says here that you're planning on watching Sherlock Holmes tonight, is that correct?" "I was planning on watching the old Sherlock Holmes, but I'm not allowed to", "So you'll be watching the new one?", "No, I just wanted to eat and go to bed", "I'm sorry but The Onion has paid for advertising at this time, we'll only be able to make those two items, until 9pm after that you can cook whatever you want again". "Are you kidding me? I can't even cook what I want to eat, with food that I already paid for with a recipe I already paid for?", "Nope", I hang up irate.



All the things start small, DRM to protect the copyright owner from losing revenue by pirating. A little leeway for a corporation here, a little leeway there. Initially DRM was a nuisance, but not a big deal. When DRM was on DVD's corporations would have to chase down every person that bought a DVD and take it back (if they really wanted to recall their product). When these laws were first enacted, not many of us could have even envisioned corporation X stopping by our house and saying "I want my DVD back". We all just laughed it off, and didn't worry about it. As we move to digital content, it's easy to realize that with the click of a mouse everything you "lease" can be taken away from you. I will never buy a Movie, Song, or other digital relic, as long as someone somewhere can type a few words and take it all away. This needs to stop. Refuse to buy anything digital that contains DRM. Start making companies that compete with these companies, and offer DRM free. Show the world and these corporations that we refuse to sit down and take what we're given. They have the right to put DRM on any and all of their products, but we have the right to not buy it. We have the right to produce works of art that aren't taken away from the world at the whim of a president of a company.


Thursday, December 5, 2013

Tool Smith

I'm known at work as a "tool guy" I write tools for everything. I was just reading "The Bastards book of Ruby" and the author put it extraordinarily well.
But even if you never look at that program again, here's the key advantage: For 57 of those minutes (the other two minutes being used to actually type the code), you were actively thinking, researching, and learning how to solve a problem. You may never reuse that exact code. But you've become a better programmer and thinker. The next program might take just 5 minutes to think about and write.
I think it needs repeating, when you spend the same amount of time learning something versus mindless repetition, YOU WIN, you always win, because the next time it might take you 56 minutes and you've saved yourself 1 minute of drudgery, and 2 minutes the following, you've made more connections in that noggin of yours, and you've made yourself just a little bit more valuable to your company and others around you.

Chime in I'd love to hear your thoughts.

Wednesday, December 4, 2013

To Lead or Not To Lead That is the Question

This post was inspired by a tweet one of my old professors re-tweeted. The tweet basically said this:
"wahh my teammates dont work". I don't want to hear that. I tell them suck-it-up. If you're a leader u make it work. @ProfessorF and @olga_lavrova
This will mostly be from the perspective of a student, however I will go over a real world example. 

Working in a team is hard. Even when you can pick your teammates it can be tricky. Unless you've worked with them before and you have a good idea what their work ethic is like, its really like shooting fish in a barrel. You're essentially trying to pull off something that companies have a hard time doing with dedicated staffs, with weeks, resumes, phone and  in person interviews, all in about 5 minutes at the end of class, or worse yet you're TOLD who you should work with. Like companies, you don't discover that the person was the wrong choice until you're far enough along you can't just get rid of them and get someone new. The cost is too high, the deadline is too tight. Training a new person just isn't feasible.

This leaves you with very few choices. You can just ignore the person and absorb their work. You confront the person and sometimes that works, but more often then not you absorb their work (and if you weren't irritated before now you're way more irritated that you've told them they're not pulling their weight AND you're still having to do their work). Or you drop them from the team, they get a bad grade and you have to absorb their work. Do you see a pattern here? It's a lose lose situation for the "leader/teammate" in almost all cases. (This is assuming the leaders job entails more than simply telling the others what to do, if that's the case, the leader never loses, because he is doing his job).

I had a similar problem back in college, confronted the individual, and nothing changed, I've had that problem in the real world at work, the (high level) recommendation I got? Keep micromanaging them. I have my own work to do, I'm not a manager, but we brought someone in to help with a tight deadline and I would be expected to micromanage them while still maintaining my tight schedule? What options would I have (I'm not a manager remember), I have no authority. My ONLY authority is the ability to annoy the person, and if I want to get my job done, I don't have time to do that, so what happens? That person slides along, and nothing changes, eventually the work reverts back to myself or another person who gets work done. The next assignment they get, they can do the same thing, the only time they have to actually show a specific output is if their job is on the line (this is not the case for all people, I'm just giving an example).

What makes this problem worse is that *most* people who chose to go into engineering/software development, have an aversion to conflict, and/or dealing with people. While it's great that we are expected to learn how to deal with it, (nothing wrong with learning to go outside your comfort zone on occasion), no one teaches how to deal with this problem. That behavior simply compounds the problem, because we would rather see work get done than deal with other people, those people are allowed to continue that behavior. If you drop them from the project they *usually* find another team that will let them just skate along and still can continue their behavior anyways, if not, they repeat the course and guess what, find another team to not do anything on. The scary part is that sometimes those people somehow become managers and now the person who does the work is being told by the person who really hasn't done any work in their life what to do, how to do it, AND when to have it done by. (I'm fortunate in that I have a manager who is very technically competent and can understand most questions related to my field and offer useful suggestions). 

We are taught how to think (in theory) but we're not really taught how to handle working with other people when everything is great, everything is terrible, and everything in between. Why is that? If we enjoyed dealing with this interpersonal relationships, communicating, etc, we'd get a MBA (I'm being facetious), but we didn't, we have a curiosity for how things work. As long as they're not people. I suspect that teachers hear these complaints all the time, if the answer is figure it out, then what's the point, we should be fixing this problem from the beginning? This behavior is unacceptable, from Why Can't Programmers Program, it's pretty obvious we're letting more and more people who would rather do nothing slide through the system. I'd love to rant why, but I'll leave that for another time. As Professionals, Teachers, we have a moral obligation to fix this, otherwise our society will continue to our trend of being high volume consumers, but low value producers, and from a economic standpoint that's devastating. The reason for the claimed "engineer shortage" is because we are not training engineers we're training 1:2 engineers:managers when we think we're training 1:1 engineers (and that 2 is a conservative estimate, I'm willing to bet it's more like 1:5 or something crazy).

My challenge to you the reader is to think about how we can solve this problem. What "algorithm" can we tell our engineering students to follow to achieve success in this (seemingly) always losing game?

I would rather not lead, I'd rather have a team that has momentum and can carry themselves where they need to go. Where "leading" isn't so much leading, as it is guiding a solid set of people where they never thought they could go.

People who write blogs are supposed to have all the answers. I don't in fact I think my questions outweigh my answers by orders of magnitude, I'd love to hear your input, maybe WE can solve the problem. (sometimes asking the right questions leads to the right answer, even if you don't realize it).

Friday, November 8, 2013

Learning From Requirements

Learning to use a system from requirements is much like learning how to drive by reading how the engine works, it's limitations and what it does, (as well as all the other components). I have done some learning by reading code, and that helps some, but it's still a similar scenario (but possibly much lower level). Of course sometimes just playing with the system helps, but there are lots of things that you don't have a clue how to do.

In my opinion, along with any set of requirements, there should be a general "Theory of operation", or a Driving manual if you will. Then people new to your organization will have a little better idea what's going on. If you don't you're just making more work for them trying to extrapolate how to use a system by what it can and cannot do.

Another thing that would be nice, is to take an approach similar to the web, if you try to enter data in and it doesn't match, try giving an example of the "type" of data you're looking for.

If you're putting in a number but it has to be range limited, then say what that range is!

Anywho, thanks for listening, I have a few interesting posts that I am preparing for my readers (you), so hang tight. They'll be here eventually.

Monday, October 14, 2013

Unusual R&D Companies

When you think of Disney what do you think about?

Movies, books, maybe a theme park right?

Did you think about them as an R & D company? I know I didn't.

But lately they've been coming out with some really interesting things. The latest being Paper Generators.

http://www.disneyresearch.com/project/paper-generators/

The theory behind it is that you rub paper and it generates electricity to light up things, (or deal with e-ink displays/etc)

I'm really impressed, I wonder what other companies are doing some interesting R&D that you wouldn't expect. Do you know of any? please tell me!

Wednesday, October 9, 2013

Hacker Scouts

I love the idea, and I would be interested in supporting (teaching?) if someone wanted to get something like this kicked off and running.

http://www.garratt.info/blog/hacker-scouts-is-awesome-technically/

Tuesday, October 8, 2013

Data Books

Here is a list of good books for Machine Learning, Data Analysis, etc.

http://blog.yhathq.com/posts/ten-data-books.html


Open source Natural Language Processing book too (linked above anyways, but I don't mind duplicating)

http://nltk.org/book/

Thursday, October 3, 2013

HN post on getting the word out on an idea links

Seems like some good ideas, biggest takaway is to figure out your target audience, and make sure to market to them as your primary source, but sometimes other areas find them interesting too.

https://news.ycombinator.com/item?id=6488822


This is kinda my way of bookmarking something I'm interested at the same time, hope you find it an interesting read like I do.

Tuesday, September 24, 2013

Is it a job?

When you go to work, is it easy to fall into and discover half (or all) of your day gone? If not, are there times that happens? 

When I get to work and start solving a problem, and follow up with building it, I find myself hours later not realizing its time to go home.  Other times I come in and dread doing some of the work, for me as long as the times I am doing what I love happen more than the not, I consider that a win, and sometimes wonder if it is even a job I'm at. Is it just some one who wants to pay me to keep doing my hobby?  Many people say that of you make your hobby your job then it won't be fun anymore. I guess my question is this, does your hobby excite you? Do you find passion in it? I personally would be surprised to find out you are.

Then again I have an addictive personality (why I stay away from bad stuff :)), when I like something I'll keep doing it until I'm forced to stop, I love building things and engineering things, and unless someone makes me stop I'll probably just keep on trucking.

What do you love doing, could you make that a living? I think there are all kinds of possibilities out there. Don't think you can find a way to make it work? Ask me, maybe I'll have an idea!

Monday, September 23, 2013

Cc2541 ti bluetooth mcu

This may work for a replacement to my arduino/Bluetooth combo for music glove, need to install eagle to view for size http://t.co/nzGrj1LBKa

And may need to adjust circuit, ideally I would like coin battery usage

Pressure Sensor

Don't have time to watch this right now but may be a solution for my fingertip buttons http://m.instructables.com/id/eTextiles-How-to-Make-a-Pressure-Sensor/

Wednesday, September 18, 2013

My thoughts on Projects and Learning

While I was mentoring one of my good buddies, we talked about projects and the like a lot. It was interesting, and I came to the conclusion that there are 2 primary types of learning when you're out there on your own. There is learning for the sake of learning, and learning to accomplish a goal (which is not learning in this case). I'll talk about each a little and what I think about them.

School Learning
Learning for the sake of learning is going through an entire API just to read up on it. Learning all the details of a language just to know it. One of the benefits of doing this is that you end up having a deeper toolbox to give you more understanding of the underlying structure.  In some cases this learning may actually give you ideas because you didn't even know that particular aspect of an API or language worked that way or existed. Often times it simply allows you to recognize patterns of problems as well, if memorization is involved. The downside is that it's slow, if you spend the time to read every little bit of an API, or language, by the time you are ready to use the language (or API) they may be out dated.

Real Life Learnin
When you start a job in the real world, you don't just take the tools you learned in school and use them and nothing else. You start picking up new things constantly, and usually (unless you work at a really cush job) you won't be given the time to spend reading every bit. What you find is that you define your problem, break it into pieces, determine what pieces you know and which you don't. From there you research enough about each piece to complete it. The benefits of this approach is the quick feedback loop. You discover quickly what works what doesn't, what's easy what isn't. You also can start hitting a wider variety of items in your toolbox. You don't get the depth of school learning, but unless you are writing a very complex piece of software, or debugging, a cursory understanding is sufficient to complete the task usually.

When you set out to learn what approach do you find most useful? Do you use one or the other? Maybe a hybrid approach?

Why I decided to become an Engineer, or Why do I do what I do

When I was going to school, I would ask other students occasionally why they chose Engineering. Often times the answer was "My father or mother is an engineer, so that's why I decided to be an engineer". Occasionally, I would get a "I liked to take things apart so I figured ...>Engineer". Rarely I would get a "I don't know, someone said I should be".

While there is no right or wrong answer, doing it just because someone told you to just doesn't seem quite right. Doing it because you look up to someone is a pretty cool way to get into it, although without that curious nature I think you're pretty limited. I'm sure there are tons of awesome engineers who are engineers just because someone they looked up to is an engineer. And I'm sure people look up to them even now (which is pretty cool). If I were to pick a reason someone should become an Engineer I would have to go with the second choice personally. If you have a curious nature and like to look at how things work, thats headed in the right direction for what I think makes a Rockstar Engineer.

But this post is about why I decided to become an engineer, so I'll tell you (by the way, if you are an engineer, or well anything, tell me about what made you decide that career choice!). Way back when, I moved to Albuquerque to work on Flight Simulators for Lockheed Martin, it was a pretty cool job, but I was hired as a Tech, and thus was supposed to do "tech" stuff. This meant only hardware, even if I looked at the software and found a problem I wasn't allowed to fix it. A "degreed" engineer was supposed to fix it. I really loved how you could control something physical with software (re: I/O and robots, and lots of embedded stuff). I decided going back to school was the only way I would get to play with that stuff professionally. Back I went.

A number of years later (working full time and occasional semesters of full time) I managed to get my Computer Engineering degree from UNM. Just having that piece of paper opens a lot more doors I think. However, if you don't have a curious nature and want to learn more and more. You'll start running into more and more doors closing as time goes on. Just having a piece of paper might get you to an open door and talking to someone (especially in the early days of your degree), but if you're not constantly bettering yourself, and pushing yourself to learn more, you'll find you're falling behind.

Why do you do what you do?

Monday, September 16, 2013

Class Inheritance Problems In Python

I was trying to play around with classes a little the other day I ran into some problems.

I tried to call a function on a child, that calls the parent and uses the self attribute. It wasn't having it.
I got the error
AttributeError: Class Instance has no Attribute ''

After some searching I came across this post, it was a little confusing but I think I finally got it.

http://stackoverflow.com/questions/16528171/attributeerror-child-object-has-no-attribute-name

Here is an example of the result in action:


*Notice I had to do Animal.__init__(self) for the function to work. It took me quite a while to figure this one out.

Tuesday, September 10, 2013

School, Learning, And What to do with it.

People complain about having to take classes they don't think they'll ever use. And I fell into that camp for a long time, in fact until about 2 days ago I fell into that camp. What changed?

I became a little more enlightened. You see, I don't need to use almost anything I learned in school, except for some of the solid basics, you know, reading, writing, arithmetic. Its when you start trying to solve harder problems that people don't ask you to solve, that you discover that using those tools makes things easier.

I'll give you an example.

I was working on testing some code, it's pretty complicated, and it requires lots of inputs, it outputs 3 values. Now to figure out how to get a particular output can get kinda tricky. So analyzing the function, if you can reduce the number of inputs that change the particular output that will make your job easier.

One way of solving this problem is attempting to plot the inputs, and the outputs and look for commonalities. This was my first attempt at solving this problem. After speaking with a fellow colleague (You know who you are, if you want to be credited I'd be happy to link to you), he suggested that I could write a search algorithm. You see, I had completely forgotten about finding "maximum" and "minimum" values, I even think I heard about it in my Machine Learning class, but unless you are actively searching out these problems it's easy to forget that there are solutions you've already learned about.

Even better my colleague suggested that that particular line of code might be to prevent the variable from causing out of bounds (WITHOUT EVEN LOOKING AT THE CODE, THAT'S HOW GOOD HE IS). How did he know this? He listened to the signals. I mentioned things like Cosine and Sine were being used in the function. He knew at a high level what KIND of calculations were going on. So he made the guess that it could be protecting. He was right!

So all I can tell you is to keep actively seeking out those problems and using those tools we were taught. I was wrong. I can admit it.

On Converting Ada to Python Pt 1

So rather than using Overloaded operations on each kind of "type" you would want to make the class (which I'm using as types now) have the operation.
I.E.
Ada:
   function Convert_to_Something(This : in Dog) return Animal is
   begin
      return This.Animal
   end Convert_to_Something

Python

(in class definition)
class   Dog:
   def Convert_To_Something(self):
      return self.Animal


How they're called:
Ada:
   Convert_to_Something(This)
Python
   .Convert_To_Something()

Thursday, August 29, 2013

My New Hammers

Sometimes you come across something that you just find really interesting. Like making lists out of lambdas. While playing around with sets in python at work I came across map, filter, and reduce functions, I thought these were neat but at the time had no use for them. Lo and behold, I decided I needed map a few days ago.

Map
Suppose I've got a fun list like this: (In Perl)

@a = ("blarg.raw","blewy.raw","breqs.raw","blraw.raw");

suppose I want to strip .raw off each element of the array?

@a = map { s/\.raw//; $_ } @a

Guess what @a looks like now? Yea you guessed it:
@a = ("blarg", "blewy", "breqs","blraw")

I happened to need this in perl, so thus the perl syntax.

Filter
While talking to a buddy he mentioned that he was taking two lists, finding the smallest element of one list, and then kicking any elements that were smaller from the second list. Sounds like a job for Filter to me!

I haven't tested it but based on my understanding something like this should work:

lowestElement = 10
yourList = [1,2,3,10,45,6,7,8,876,543,3245]

yourList = filter((lambda x: x > lowestElement), yourList)

guess what yourList looks like now?

yourList = [10,45,876,543,3245]

Pretty awesome right?

Now I hadn't suggested it to my buddy but I'm thinking that we can somehow use reduce.

Update: (12/5/13)
If you want to "mimic" a similar functionality as filtering you can kind of use map, in this case here is an example:
@a = map { m/.*\.raw/ () : $_} @a;
so in this case if we match "raw" in the name, then we can toss it out, otherwise we can store off the value.This allows us to reduce to only a set of files that don't already contain .raw, we can also do other operations.in place of the regex match, but I wanted to keep this around for reference (I actually needed to use it today)

Reduce
I'm not even remotely sure if this could work, but reduce keeps using elements in your array.

Something like this *might* work for him

firstList = [2,3,4,5,6,7,8,10]

firstList = reduce((lambda x, y: y if x>=y else x), firstList)

So the idea here is that we compare each element, to eachother, find the smaller of the two, and then get rid of the other.

I think that's pretty neat, and I expect the result to be 2 in the above example.

Thursday, August 15, 2013

Communication through space

I have to assume that communication through space will have to be limited by the speed of light (unless black holes will somehow provide "warp points" to send data faster through space, or shortcut it I suppose).

I was thinking about if we took a space craft and gave it a bunch of little beacons whose job is to simply transmit any message that it receives to any other beacon it can reach. We could put a time stamp on it (using our Absolute Time we have calculated), and each beacon when it see's it can determine if it's forwarded it on or not. This is all cool and stuff, but if we assume that we're restricted to even radio waves for speed (not light), we could conceivably send something out that is constantly transmitting, eventually due to distances and these restrictions, when we receive things from it will begin to distance themselves. Imagine listening to transmissions from years in the past that are being heard for the first time? Imagine if someone took off from earth, and once they were say a distance of 50 earth years transmission time (so we get their transmission 50 years after transmission), we start hearing a new form of music, or hearing about discoveries. We would literally be listening to echoes from the past. New discoveries from the craft could be getting transmitted to us and we would be discovering them years in the future. I for one find this facinating.


Some of the upcoming posts are a bit inspired by Elon Musk's big ideas, If you don't know who he is take a look at his wikipedia page, I think some of the goals he has are amazing, and I agree that we as a society need to start focusing our efforts on big ideas, and not on the next fart app. A collegue and I have been chatting about space travel and how amazing it would be to make it to Mars, so we started looking into it, I don't know much of anything about it, but who knows, maybe I'll learn something, and maybe you will too.Either way, knowing more about a wider range of technologies makes us better as a human race, fart apps, don't. 


Wednesday, August 14, 2013

Navigation in Space

I don't know much about this subject and most of these thoughts are things that just came to me as I was thinking about it.

Aircraft have flight management systems to determine how/where to go and in the most economical ways, etc. I can only assume that the same goes for space. The biggest differences being that on earth we travel and we have gravitational constants that are known, and we can estimate different things like drag, etc, we have to determine where we are with respect to other aircraft in order to stay safe (I believe this is ADS-B stuff, correct me if I'm wrong). In space you have to worry about other aircraft (assuming space gets busy out there), still, but now you have to calculate where you're going to be at different times, where other planets are going to be (this is for long distance space travel). Gravity of each of those planets, using our current systems we can determine what speeds we need to increase/decrease to in each phase of our travel (I won't call it flight, because to me that implies aerodynamics and dealing with things like drag/etc),so we can miss a planet, all together, or avoid the most of it's gravity, also we could use them to our advantage to make turns while maintaining forward thrust only (don't waste fuel on pushing side to side). Obviously my last post Absolute time plays a part in this whole mess, if we don't have a constant time wherever we are, calculating these things will get very tricky.

Some of the upcoming posts are a bit inspired by Elon Musk's big ideas, If you don't know who he is take a look at his wikipedia page, I think some of the goals he has are amazing, and I agree that we as a society need to start focusing our efforts on big ideas, and not on the next fart app. A collegue and I have been chatting about space travel and how amazing it would be to make it to Mars, so we started looking into it, I don't know much of anything about it, but who knows, maybe I'll learn something, and maybe you will too.Either way, knowing more about a wider range of technologies makes us better as a human race, fart apps, don't. 

Tuesday, August 13, 2013

Absolute Time

According to wikipedia...

Absolute, true and mathematical time, of itself, and from its own nature flows equably without regard to anything external, and by another name is called duration: relative, apparent and common time, is some sensible and external (whether accurate or unequable) measure of duration by the means of motion, which is commonly used instead of true time ...
https://en.wikipedia.org/wiki/Absolute_time_and_space

So this got me to thinking, suppose we were really into space travel, suppose our super fancy atomic clock that was set back on Earth to the relative time there, and our super fancy clock broke. Uh Oh, how can we know where earth will be at any moment in time?

Some things that I think need to be overcome to determine an "absolute" time:

  1. Mapping trajectories of ALL universes
  2. Planet/stars etc.
I think if you have those two things we could then say that if a particular planet we were nearby is in a particular location with respect to another say 2-3 planets/universes, we could then triangulate where we were with respect to the rest of space. Unfortunately I just don't see a way of getting around using "relative" positions in space to determine absolute time.

One thought I had was suppose we took a radioactive item, encased it so it was safe for human use, and then we setup a monitor, and on day 1 it read the decay and we initialized the value, then as we move through space we have a pretty accurate clock, that isn't dependent on factors such as magnetism, or other things, the problem goes back to "what if it breaks", how can we get back?

Taking off from somewhere in deep space and "hoping" that a planet isn't in your way when you take your straight line path is going to be problematic.This is why we need an absolute time calculator. With that you can create a "FMS" of sorts for space that will calculate positions of planets in your trajectory, as well as different gravitational pulls as you move through space. (in Theory)


Some of the upcoming posts are a bit inspired by Elon Musk's big ideas, If you don't know who he is take a look at his wikipedia page, I think some of the goals he has are amazing, and I agree that we as a society need to start focusing our efforts on big ideas, and not on the next fart app. A collegue and I have been chatting about space travel and how amazing it would be to make it to Mars, so we started looking into it, I don't know much of anything about it, but who knows, maybe I'll learn something, and maybe you will too.Either way, knowing more about a wider range of technologies makes us better as a human race, fart apps, don't. 

Sunday, August 11, 2013

Some thoughts on attempting success in a large organization

Large organizations typically are all about the benjamins. (Some are not ONLY about the benjamins, but ultimately in the end, at least enough benjamins to stay afloat).

If you want to do well in a company like this you need to think of ways to do one of two things.

1. Make them more money.
This is where having ideas for new products and ways to bring in more revenue come into play. Look for areas of opportunity, what things do potential customers struggle with daily, that you/your company can fill the hole with a "new" product. Sometimes this happens because you've found something that you do daily that could be made easier and boom new idea. I think this is sort of how Trello came along, it was frustrating keeping track of where everyone was on projects/etc, and Fog Creek came up with something to make it easy. Now it's a product their customers can use.

2. Save them more money.
I HATE sitting around on my butt doing things that computers should already be doing. Working in a software company, there are too many times I have to watch test scripts run and do things when they pause. Finding ways to "fix" these pauses, so you don't have to have your butt in a seat is a money saver, and companies like that. One of my latest "money savers" was writing a wrapper that used auto hot key, so now whenever a script needs the user (note: me/collegues) to do something, we just have the auto hot key utility do it for us. It saves engineer hours, and sanity (if you're anything like me you hate the idea of wasting your precious time sitting and waiting for some "dull" event to occur just so you can do some dull thing to make the next event occur!).

How do you do these things?
Always be cognizant of your surroundings, look for opportunities. If you see something you think would be neat to try, go for it. If you have to do it a little on your own time to get a proof of concept by all means. Now if you're spending months of it, I would at least bring the idea up to see if it sparks interest, and possibly get paid specifically to do it (otherwise you're giving away your time to a company that has no vested interest in you other than "Wishes to avoid training someone new" which I may talk about someday).

Every day when I sit down and look at what I'm doing, I think to myself, how can I avoid having to do things that I don't find fulfilling, I can't always automate things, but I'll be darned if I don't try whenever I think it makes sense. We are engineers, not monkeys, and to be honest making us sit in front of a PC and act like monkeys just doesn't make sense. So lets do something about it, make a change and see what happens. I think you'll find that if you make it simple (easy for everyone to use), and it works, you'll at least attract some attention, and maybe even some more interesting projects. I have always said, you make the work you do what you want it to be. So make it!