Monday, September 14, 2015

Aedificamus: Product Review: LoseIt! Health-o-meter

I should've seen this coming. When I decided to check out the Lose It!! app, I figured I'd be content with just weighing myself, tracking calories, and seeing what happened. I wouldn't be seduced by other offers, or other technology… especially not some tricked-out Bluetooth data sharing scale. Not me. Oh no. Oh, who am I kidding?!





Yes, I am now the proud owner of a LoseIt! Health-o-meter. Well, the proud part I might have to work on, but I most certainly now own one ;). The intrigue factor overcame the slightly creeped out factor. Yes, I admit it, the thought that my smart phone can get all sorts of information from a scale, store it, analyze it and give me advice about it just seems a bit... odd, but the "oh wow, how cool is that?!" aspect ultimately won out in the end.


So how exactly does this work? The scale uses Bluetooth to interface with a smart phone (iPhone in this case), and specifically with the LoseIt! app. Part of me considers that a little bit of a letdown, because it is a dedicated device for a dedicated app. Still, the ability to gather data, crunch it, and do something interesting with it always brings a smile to my face.


What doesn't bring a smile to my face, however, is the level of precision that I can now be provided. Prior to today, I was content to have a scale that rounded in half pounds. Now I have a scale that is accurate to a 10th of a pound. But wait, there's more! I can now also get a reading (through the electrical impedance pads) of my overall hydration levels, my body fat percentage, and my body mass index (BMI). I used to take comfort in the fact that these were nebulous numbers; they just existed in the ether someplace and, oh, they might be derived through some inconsistent formula on a web site some place or another. Now, I know what they are… in vivid, gory detail.







Yep, there it is… I can't pretend it's something else any longer (LOL!).

Now, to be frank, there's a lot of ambiguity to these numbers even as they're presented. How precise are these values, really? They may be accurate, they may be off. However, for what I am planning to do, they're a good enough heuristic (i.e. rule of thumb) to be useful. I'm not really doing anything (competitive sports, bodybuilding, etc.) where they have to be super precise. They just need to do one thing… trend downward over time.


On a technical level, the set up is simple; go into the app, pair it with the health-o-meter, press a button on the underside of the scale to pair the devices, create a scale profile for yourself, step on (barefoot, of course), let it get your measurements, transfer data, and then it is there in the app, ready to be logged and sync'd with the app's other algorithms. Each day you weigh in, the pairing profile does the rest. The scale itself feels fairly sturdy. For a day-one comparison, it does the job well.


Bottom Line:


This product pairing fills me with equal parts dread and wonder. I'm weirded out by the level of detail it provides, and the fact that my phone can carry this and share it with a whole bunch of different apps. On the other hand, I'm super intrigued to see if this level of granularity and focus with the data will make me more efficient, or more aggressive, when it comes to weight loss, nutrition and exercise.

I guess you'll have to stay tuned for that latter part ;).

Friday, September 11, 2015

Book Review: Practical Web Development

Does it seem like I am starting off a lot of my posts lately with an apology? If so, it's because it feels like I've fallen off the wagon of things I should be doing (and stopped doing) because life interfered. One of those areas is the book reviews I pledged I would do more of this year. It's gotten so bad that I had to basically tell a number of publishers to hold off on titles they send to me until I can get through my back log. Don't get me started on the figurative stack of Python books I'm looking at right now (I can't say literal because they are PDF's, but trust me, there are a lot of them!). Also, as many of you well know, I do not do short reviews ;).

Still, the best way to get back on a horse is to just climb back on, so without any further ado...

At this point in time, programming for the web is a multi-faceted endeavor. There are so many choices and approaches that can be used, and technologies that can be called into action, that it is impossible to master them all. Gone are the days of basic HTML and some CGI scripts being all you’d need to deliver a web experience. Don’t get me wrong, there are still sites out there that are basically this simple, but they are outnumbered by sites that offer much greater interaction, customization and the ability to display on multiple platforms. To do that effectively, more is needed.

The challenge with most web development books (or programming books of any type, actually) is that it takes several hundred pages to cover everything needed, or the books end up being lean and abstract, with the reader having to do a lot of their own research and tinkering to create examples of their own or make the samples provided work.

"Practical Web Development" by Paul Wellins (Packt Publishing) takes a slice down the middle. It doesn’t pretend it will be able to show you everything in great detail, but it does looks to give some "practical" examples with the most common elements and some exercises to work and build on. Wellins progresses from basic HTML, CSS and JavaScript to using PHP, MySQL jQuery, AJAX, History API, XML & JSON, MongoDB, Responsive Design, Foundation framework and Node.JS. Make no mistake, that’s a lot of ground to cover in 276 pages.

So how well does Paul traverse this formidable mountain range of topics?

Part One of the book focuses on the central elements of a “stack” that allows a web site to exist in the first place, and gives an overview of the technologies that work with that web server.

Chapter 1 covers THE WORLD WIDE WEB, specifically where it’s been, where it is, and where it looks to be going. It’s a whirlwind history lesson that covers a lot of technologies that we take for granted today. For the purpose of the book, the emphasis is being placed on HTML, CSS, JavaScript and PHP, with a back end database using SQL. Therefore, up front, five “languages” need to be learned to be effective and use the book. Fortunately, the amount of each language that is needed to be learned will grow with each subsequent chapter, so you get a chance to use each of them as the book professes.

Chapter 2 focuses on the basics of HTML and the most common tags used for markup of pages. Rather than give an exhaustive run down of all the tag elements, Paul gives us the ones that are the most useful and likely to be used when developing a basic site (headings, paragraphs, links, form elements tables and divs, which are best described as self contains rectangles of HTML). Paul also makes the distinction between the structure of a document (which is done with HTML) and the styling touches, which are handled in the next chapter.

Chapter 3 covers what Paul feels are the most useful aspects of CSS, which is all about the syntax that affect the overall look and feel of your pages. The structure of the box model is central to CSS and being able to manipulate the data in a variety of boxes (often the aforementioned HTML div’s) helps to keep the style elements both contained and optimally configured. A recommendation for the use of Firebug or Development Tools in your respective browser is also recommended, as there are a lot of possibilities within CSS and ways to apply them.


Chapter 4 takes us on a tour of JAVASCRIPT with a dose of Programming 101, and builds on some of the basic building blocks of of all programming languages while focusing on the core elements that make JavaScript useful in web pages and applications, specifically as a client side programming language. Variables and variable declarations are covered, manipulation of strings and numbers, operators, control flow, functions, and objects all get a brief but focused examination. The final part of the chapter talks about using the Document Object Model (DOM) and ways to work with objects, properties methods and events. Again, it’s a high level view, but one in which you feel like you can relate to what’s being presented.

Chapter 5 introduces PHP, which is a language designed specifically for server side interactions. Again, like the previous chapters, this section focuses on what most users would need to make something work on the server using PHP, not a complete rundown of the syntax. This chapter also goes through the basics of what you need to do to check if your web host is set up to support PHP and what to do if it isn’t.


Chapter 6 adds more about PHP, specifically in conjunction to working with a MYSQL database. The chapter starts with a basic understanding of databases in general ,and then MySQL in particular. It introduces the way that databases work and how MySQL fits into the web stack. phpMyadmin is covered as well, which allows you to administer a SQL database via the php utility. It also walks the user through several commonly used database commands and fundamental queries.

Part II of Practical Web Development aims to help us break away from the model of multiple pages where a few will suffice, and to get away from static pages to those that are more interactive, dynamic and responsive to the platform it is being displayed on.

Chapter 7 covers JQUERY, which is a JavaScript library that emphasizes a small footprint. It uses CSS selector style syntax that specify DOM elements. Again, the coverage is not exhaustive, but it give enough to show the general approach to using jQuery as part of your page development and the most likely to be used aspects of the library.

Chapter 8 focuses on AJAX (Asynchronous JavaScript and XML) which is really a handful of different techniques that allow for data to be retrieved in small pieces without requiring the entire web page be reloaded. jQuery has several methods that allow for AJAX to be used. $.load and $post both allow for portions of the screen to be replaced with fresh HTML, dynamically generated or programmatically placed.


Chapter 9 covers THE HISTORY API, which becomes very important when you start creating a site that is based primarily around a single page. rather than direct a user to the previous site they were on before coming to ours, the History API allows the users to navigate back to states of the page, or to allow for a bookmark URL to represent the state of the page bookmarked.


Chapter 10 focuses on using XML (extensible Markup Language) and JSON (JavaScript Object Notation) as data formats to be used as an alternative to HTML.

XML files can be seen as small databases. XML Schema defines the structure XML files, while XSLT creates stylesheets for converting XML into different formats. SimpleXML allows for paged to be created and processed using PHP. JSON is a lean format that gets processed like JavaScript objects in the browser, and therefore requires much less overhead.


Chapter 11 introduces us to MONGODB, which is a type of NoSQL (not relational) database. It’s more readily known as a document database, and it stores JSON objects that are grouped into collections. Web applications are capable of communicating with the MongoDB using PHP.
.
Part Three of the book moves away from the underpinnings of the technology and deals with methods that help the loo and feel of the users experience, regardless of the platform being used.


Chapter 12 focuses on MOBILE FIRST, RESPONSIVE DESIGN WITH PROGRESSIVE ENHANCEMENT (go ahead, say that ten times fast ;) ). The key idea is that, based on the platform it is being displayed, the page will dynamically tailor itself to display optimally for that device. Desktops, tablets and phones have radically different screens and needs, and Responsive Design aims to help with that. One of the key aspects of this chapter is to encourage you to focus on mobile development and display first, and then work back. Additionally, another JavaScript library called EnhanceJS allows for different experiences to be displayed depending on the browser being used or the platform accessing the content.

Chapter 13 introduces FOUNDATION – A RESPONSIVE CSS/JAVASCRIPT FRAMEWORK. The idea behind Foundation is that it lets us focus on developing a site without having to reinvent the wheel on the responsive part. By using a grid system, you can determine how many areas can be used depending on the size of the screen, so that the site expands and reformats based on the grid. Foundation also includes a number of UI enhancements that make it easier to put together navigation, image display and other details that make interacting with a site easier based on the available real estate.

Chapter 14 closes out the book with an introduction to NODE.JS, which is, at its core a fundamental break with all of the rest of the web development options discussed in the previous chapters. Rather than require a whole host of technologies, everything can be written within Node, which then translates everything to native JavaScript (and by extension HTML, CSS, etc.). This can be done using the Express framework, which is described in basic detail, and the idea of templating (which is what PHP does), using handlebars.js.


An Appendix section describes BOOTSTRAP - AN ALTERNATIVE TO FOUNDATION. The same exercises Paul described in Chapter 13 he tackles here, but uses Bootstrap.JS. It meets a similar goal, i.e. making a mobile-first, responsive site without having to reinvent the wheel to provide the responsive part.

Bottom Line:

The title of the book is Practical Web Development, and a special emphasis needs to be placed on the “Practical” part of the title. Paul has strived to make a book that is accessible, easy to follow, and lean enough to be usable without getting the reader lost in the weeds. I’ve long been looking for a book that would be a soup to nuts title, one that could be the starting point for someone to start with developing for the web, and have a single source to get up and running. Is this that book? It’s pretty darn close! There’s lots of additional areas that could have been covered, but to his credit, Paul has made a title that hits the high points, and a few divergences that are interesting if not mandatory. For a lean and straightforward primer on modern web development approaches, this is a great place to start.

Wednesday, September 2, 2015

Aedificamus: I'm Ready to LoseIt

I shall apologize to anyone who doesn't really want to read about my quest to modify my shape from what resembles an abstract pear to one that I vaguely remember from my younger days. If you fit the description of one who doesn't really care or have the slightest interest in this type of stuff, you are welcome to stop reading here.

Still with me? Awesome!

It's the start of a new month, and I've been mentally toying with a few ideas related to trying to get back into shape. I'm a firm believer in the idea that you should tackle one goal at a time, or at least get familiar and comfortable enough with a goal that adding another one will not be disillusioning. My first set of goals were around scheduling in 10,000 steps per day, then doing them all at once, then upping the ante to 15,000 steps as a daily goal. 15,000 steps is roughly eight miles, and about two and a half hours of time commitment per day. So far, my routine has been as follows:

- walking from home to train station (1.5 miles, about 30 minutes)
- train station to work (0.5 to 1.8 miles or 10 to 35 minutes, depending on if I get off in Palo Alto or Menlo Park)
- fifteen minute walk in the morning as a break (roughly 0.5 to 0.75 miles)
- an hour walk at lunch (average of 2.5 miles)
- another fifteen minute walk in the afternoon as a break (again roughly 0.5 to 0.75 miles)
- walk from work to train station and finally train station to home
- work to train station (again, 0.5 to 1.8 miles or 10 to 35 minutes, depending on station)
- train station to home (1.5 miles, with a significant hill at the very end)

Added to this is another habit I've started. I bought a large SmartWater bottle (no particular reason for that brand, just that it is a large and easy to carry bottle that can hold 1.5 liters). I fill this bottle three times a day, and add a flavor packet just for some variety (drinking that much water each day can get *very* boring). By talking a sip every few minutes while walking, the water just disappears, I don't feel forced, and I genuinely feel way less hungry during the day.

The third habit I started was a daily weigh in. I'll do my best to not get TMI here, but for those who have wondered, if you want to do this, I wholly recommend doing it after you first wak up and go to the bath room. That's been my baseline the past few weeks, and there is something borderline primal about the excitement of "making weight". For those who ever participated in high school or college wrestling programs, you may well have taken part in some of the insanity to make sure you could compete in your desired weight class. Doing lots of active running, taking sauna baths, sweating as much as possible (and yes, I've even gone as far as using over the counter diuretics... I know, bad TESTHEAD), but the joy at standing on that scale and seeing that you "made weight" was pretty hard to beat. so it is here as well.

I know that my weight can fluctuate as much as seven pounds in any given day, so a daily weighing may see drops, may see plateaus, and may even see upward ticks in weight on some days. I try not to let it get to me, but hey, there's a natural euphoria when you see the scale trend down, and a tough of disappointment when you either can't move the needle or it trends upward again. The benefit of daily weigh-in allows me to mentally focus on what I need to do. If I trend down. Awesome. If I don't move, give it a little time. If I trend up, examine what I may have eaten that could have caused that reversal (usually, the scene is eating at a restaurant or outdoor place, and the primary culprit is sodium). nevertheless, when I see a downward trend week over week, that's what really matters, and so far, that's what is happening.



A recent addition to my arsenal, and one I happen to like quite a bit, is an app called LoseIt. LoseIt has a number of tools that help you to figure out your weight and exercise goals, your food intake, and lots of tools to help manage al of that. A personal favorite feature is the "scan app". Place your camera over a bar code on the food item (if it has one) and you have the full macronutrient breakdown for that product. It's awesome because it's so fast. It's demoralizing because it's so fast (LOL!). LoseIt also allows users to set up details about themselves (weight, height, gender, target weight, etc.) and from that it determines a likely Basal Metabolic Rate. Based on your activity level and your set goals, the app configures a daily caloric "budget". That budget is measured daily, but it also projects weekly as well. By logging the food you eat, and comparing to the budget, you can determine how close you are to meeting the limit or if you have room to spare. adding exercise to the equation (the steps measured by the device are store in the Health app and shared with LoseIt if you choose to). By calculating the BMR and the estimated expended calories, it makes deductions and also adds small bonuses if you meet a particular step or activity goal. The net result is a nice graphic that shows how many calories you have left in your budget (the greater the deficit, the larger the remaining calories count, and very 3500 is equivalent to a pound of bodyfat!).

One additional option that is available is the Bluetooth body density scale that is made to work with LoseIt. I haven't decided yet if this option is awesome or creepy. It uses insulating and conductive plates to send a small current through your body. The resulting resistance gives a figure to your bodyfat percentage (I don't consider these tools to be all that accurate, but for ball park numbers and personal goals, I think they work fine). By having these measurements, you can get closer to a real figure of your lean body weight, your bodyfat percentage, and a rough approximation of how much bodyfat you have (and more importantly, how much to lose). The scale can be set to automatically sync with your mobile device, no entry needed (this is where I vacillate if I should be impressed or horrified ;) ). NO i haven't purchased one, but I will confess, I am intrigued.

In any case, the information informs me of how close I am to my target budget, or how far away I am. Most of all, it gives me a reality check as to both the amount of calories my body can burn (a good amount, but nowhere near what I'd like to achieve in the time I'd like to invest) and the calories I consume (wait, a serving size is how big?!!). The tools themselves do not do the work, each of us does it. The tools, however, can give us some control and visibility, and make us aware of our choices and what we need to trade one way or another. Don't get me wrong, I love chocolate, really good soda pop, and a variety of foods that would best be described as "calorie laden", but when I am aware of the fact that I spent three hours moving and doing stuff to "afford" those items, I'm less likely to partake in them. that awareness, coupled with deliberate action, does the work. It's not magic... but it sure can feel like it at times :).

For those curious, 243.5lbs as of this morning. That's down 16.5lbs. from my weight when I started. Expecting the progress to start slowing any day now, and the real work to pick up in earnest. Onward!!!