How to quickly remove duplicates from MongoDB

The fastest way to remove duplicates from Mongo is to fix whatever is adding them to mongo, but if you’re reading this you probably want to remove the duplicates that are already there. I had this problem as well and google wasn’t much help so here’s my solution. From here on I’m assuming you’re using MongoDB and NodeJS but if not you can apply this concept to any language; Hash your documents So as a human to find duplicates I would find documents that have exactly the same content, the easiest way for a computer to do this is to hash the document. »

Michael Francis

Joys of Embedded day 2

Well it’s that time again, it’s the second day since I decided I should blog about my (mis) adventures is embedded hardware development. Today’s adventure was implementing a few common functions without the use of stdlib or the math libraries. Most people would argue against rewriting functions that already exist. Existing packages have been vetted, have had all their bugs worked out and hey they exist to be used right? Well unfortunately these existing libraries are designed to cover everyones use case and most (if not all) corner cases. »

Michael Francis

Raveshirt Update two!

Well as promised, I got up early to head to the lab to test out the circuit and the news is…. we have success! …well sort of. Of course there was some problems. So the first thing was I made a dumb mistake in the code, the pwm write takes a float between 0.0f and 1.0f instead of a int so the first thing was the output from the MCU was always high. »

Michael Francis

RaveShirt First Update

Well that was quick! Right after posting about the project this morning, I came home and found that all the parts had arrived. After double checking the voltages and connections with my simulation (seen below) I wired up the circuit on a breadboard and I was almost ready to go! I wrote a quick loop on the MBED to increment the value and wait. My plan is to check that all the LED light up and can be controlled before I proceed to writing anymore code. »

Michael Francis

RaveShirt, the beginnings

So I’ve been toying with the idea of creating a Rave Shirt™ which would basically flash LEDs to the beat of the music. The idea is to eventually have this built into a shirt of some kind. How I imagine this will work is I’ll attach a microphone to a microcontroller, use the ADC to get the data in then perform a FFT on the signal. Once that’s done I’ll run a quick loop over the results and find high amplitude signals then use those to drive the PWM output on the microcontroller. »

Michael Francis

The REAL problem with 'The Cloud'

‘The Cloud’ really is just a buzzword, but it holds tremendous power. With the advent of always connected smartphone and tablets, which, by design have little onboard storage, the ability to store and retrieve documents and content from anywhere in the world has gone from a neat idea to a necessity. As more and more people buy smartphones ‘the cloud’ will become more and more ingrained in our lives. Whenever I talk about ‘the cloud’ to pretty much anyone who knows what that term means, they usually start telling me why it will never succeed. »

Michael Francis

Why Responsive Design is totally worth it

Recently (about 5 days before this writing) an author made a post detailing why responsive design is “not worth it”. After reading his article I had to agree that he made some good points however I feel like his overall conclusion was wrong. Here’s why It defeats users expectations (and that’s a good thing) The author makes the point that basically users want to see the same site they’re used to whether they’re on mobile or not. »

Michael Francis

How the Nexus Q will probably be used in the future

So I got a Nexus Q not too long ago, and after a few days of using it for its intended purpose, I got bored. Alright all it can really do is stream music from Google Play right now, so it’s easy to get bored, but after installing a launcher I realized that not only was it a normal android device, but the only thing stopping you from using it as a normal android device was the is no good way to control it. »

Michael Francis

Why the current generation of portable gaming handhelds will be the last

I just wrote up a big comment on G+ (which you should follow me on if you don’t) about why this is the last generation of portable handhelds. Even prior to the recent kickstarter success of the ‘OUYA’ gaming system I’ve been thinking a lot about the idea of an Android powered gaming system. While I don’t think the OUYA is a great idea, I do think it will capitalize on the shift from console gaming to PC gaming. »

Michael Francis

Apple's almost perfect marketing plan

One thing that always impresses me about apple is how strong their product positioning and marketing are. One of the the things that apple does to ensure a premium customer experience from the get go is keep their product line simple so that the consumer doesn’t have to worry about the specs. For example, If I wanted to run Garageband on the go, all I have to do is go out to best buy and pick up the latest iPad and I know it will run it; I don’t have to google around and see what the spec requirements are for it. »

Michael Francis