Monday, April 11, 2016

FakeSMTP: A Mail Server Emulator

FakeSMTP is a java (jar) application that you launch on your development environment that can act as an SMTP server (receive mode) for testing email functionality in your applications.  You can open up the emails in FakeSMTP, which will launch your email client for viewing.




Example of a ColdFusion web service for AngularJS using $http and JSONP

A small example of a ColdFusion JSONP Web service using $http, that expands on Ben Nadel's excellent article on Using JSONP With $resource In AngularJS.

Form Submit Code for the AngularJS Controller

$scope.onSubmit = function(){
      $http(
        {
          method: 'JSONP',
          url: 'http://your_site/your_cf_jsonp_service.cfm',
          params: {
            callback: "JSON_CALLBACK",
            data: $scope.formModel
          }
        }
      ).then(
        function successCallBack(response){console.log("returned");console.log(response);},
        function errorCallBack(response){console.log("error"); console.log(response);}
      );
  };

Sample ColdFusion AngularJS JSONP Service

<cfsetting showDebugOutput="No">
<!--- Configure the Access Control header for your environment --->
<cfheader name="Access-Control-Allow-Origin" value="*">

<cfparam name="url.callback" type="string" default="angular.callbacks_0">
<!--- Do processing logic, create objects, etc.
then serialize it
Just going to send back a time stamp for this example --->
<cfset result = Now()>
<cfset response= "#url.callback#(#serializeJson(result)#)">
<cfcontent type="text/javascript; charset=utf-8" variable="#charsetDecode(response,'utf-8')#" />

Sunday, April 10, 2016

Editor Conundrum

VI, Pico, NotePad++, HomeSite, ColdFusion Studio, DreamWeaver, Eclipse, CFBuilder, Atom, Brackets, Sublime 2/3, and on and on...

I've used them all.  Some are specific to the OS and never go away (VI,Pico), some become so aged that you must toss, and others you just keep around.    There's never a perfect blend, those with that one feature that you'll need to go back to.   Sometimes you're in code mode, where it's all about the language your working in, code completion, snippets, color syntax, and then there's the visual side, where you need to make a change and see the result.

The progression of HomeSite -> ColdFusion Studio, switching to Dreamweaver, then to Eclipse with the cfeclipse plugin.  The shift to eclipse was primarily because I had switched from the type of employment (working for a software manufacturer) where the the perks of free software dried up.  Forking out over a hundred bucks for an editor often leads to a do-with-out approach on some features.  Yes, I'm cheap that way.

With Eclipse, I have the various configurations for Java, PHP, and ColdFusion.  But as with anything Eclipse is a bit persnickety and often hangs with that awful opaque white overlay as it's trying to do something and you HOPE it comes back.  You end up having to turn off many features that you find useful when the files you're editing have more lines they they probably should have.

Recently I did fork out $70 for Sublime, which was under my $100 think about it threshold.  It's fast, extensible, styles well.   A very good editor.  I added a plugin to launch a browser, all well and good.

But I wanted more....

I wanted side by side live preview for a particular bit of code I was working with.  I performed a small search for live preview, but it's all about opening up a new browser window which it happily does on my other screen that I'm multi-tasking on, right on top of everything.

Well, I've also happen to have Atom installed, which is chromium based. I search for live preview and Ding Goes the Bell!



So for the current task of the day, I'm switching to Atom.  Once I go back into pure code mode, Sublime takes over again.
  

Saturday, April 9, 2016

Google Domains So Far

Google Domains and/or Blogger still has a bit of work to do on their redirect.  The interface to redirect is fine, it's just that using the desktop times out regardless of network used, but with my iPhone, no problems occur with both m=0 and m=1 for the mobile setting (using WiFi).    Initially this setting worked when I first set it up, then it died.  

The problem is it isn't anything I've done.  It's just going to Google Domains, and connecting the Blogger account, and Google Domains/Blogger do the rest.

I've disconnected the the redirect and the old intersuite.blogspot.com works fine, in fact it worked fine yesterday.  Today I'm having problems again.  so I followed the same disconnect/reconnect, and desktop chrome (and other browsers) are timing out.     

Since the iPhone can connect perfectly, mobile or desktop version, but the m=1 automatically shows up on the iPhone.  It almost seems there's something in the client detection that fails.

So this time I've disconnected it again, deleted the synth record.  and tried a standard redirect of intersuite.com to intersuite.blogspot.com.  This keeps the blog working only the redirect will not function.  when a custom domain is setup on Blogger, it disables in the standard {domain}.blogspot.com url.

Friday, April 8, 2016

Running JSBin Local

I'm a big fan of JSFiddle, but unfortunately, being a SaaS solution, I can't run it local on my laptop for those situations where internet isn't an option.     I started looking at some alternatives, such as the older jsbin.    jsbin is both open source and SaaS.  However it does have one big issue, it doesn't install well on ANY operating system with the latest version of Node.jsand npm.

I spent hours trying to get everything running, first I tried Windows after making sure I had all the development dependencies in place, Visual Studio, the correct version of .Net Framework, the sdk's and so forth and then the latest version of NodeJS and npm.  Then following that which what should be the easiest install (In administrator mode)   npm install -g jsbin.

ERR!

First, there are a couple (maybe more) issues with Node.js, and npm on Windows.

First is the rather onerous task of getting all the Windows development pre-reqs in place just so the  node-gyp add-on build tool is in a somewhat workable state.

Second is the default usage of using the users AppData/Roaming folder for npm modules.  This particular folder has policies applied that npm just doesn't like, such as CryptoLock prevention (at least on my system).  Which is a good thing, given some of the security issues with NodeJS currently, but it's a mish-mash of configuration settings trying to set up NodeJS/npm to use something other than that folder, setting the prefix and so forth.

After going down that rabbit hole, I opted instead to fire up a vmware of the debian sort; Mint KDE.  Which has most of the development dependencies already there.  MySQL and MySQL Workbench installed without any issues with openssh-server, and easy installation of the others through apt-get along with the added benefit of being sandboxed and snapshots.

Again,  sudo apt-get install nodejs, sudo apt-get install npm, sudo npm install jsbin

ERR!

The solution,  uninstall nodejs (or in my case revert snapshot), sudo  apt-get install nodejs-legacy (which uses a symlink) , sudo apt-get install -g npm, and then sudo npm -g install jsbin.

and then the crossed finger moment: jsbin....

Success.  

The next step is to try and make mods to the jsbincode. The github jsbin repo  doesn't build currently so more troubleshooting.  I still need to update the resource strings to point to the local versions, with expansion of some newer js and css libraries, which I'll place on the VM Nginx.   o

I know the folks over at jsbin don't have a lot of incentive to update their open source project and instructions to the latest Node.js and npm since they have a paid model, but I sure wish they would.


Thursday, April 7, 2016

OnStar vs iPhone

OnStar top tier pricing is rather expensive.  To get the whole kit and kaboodle, which is  Guidance, Security, and Protection, it costs $35, let me correct that, $34.99 because $35 sounds too expensive.

The bottom two plans are reasonable at $19 and $24, which to me has some value but not enough to pull the trigger.  The problem is what I want is the top tier, but since I have an iPhone with Google Maps, Yelp, and so much more, I just can't see the need to pull the trigger on the top plan either.  I also have an older Garmin which is still usable and for $349 bucks (the cost of year of OnStar Guidance Plan) I could get a really sweet upgrade to a new Garmin with lifetime maps and traffic, and have road visuals, Turn by Turn is mostly audio with a large icon showing the direction of turn.

https://buy.garmin.com/en-US/US/on-the-road/automotive/2015-line/nuvi-2789lmt/prod154718.html



I fully understand the call center cost model of agent/hour.  The problem is that a large portion of the the services of OnStar are fully automated or a section of what they do is, such as crash detection which brings an OnStar rep on line.  and while there's a whole other discussion on minimum wages or outsourcing (some consider slave wages), It's all about what people are willing to pay for, or choose to do without.

What I don't know the the average amount that people actually use OnStar.  During the first 6 months I had it free, I only used it a few times, mostly because I didn't really want to talk to someone for assistance.  I'm a guy, that's pretty much typical.   That lack of use is probably a good indication of usage stats of OnStar in general since it's a huge cash cow for GM.  I would also imagine the monthly charge just happens for a lot of people along with the cell phone bill, XM Satellite, Cable/Dish/Internet addon after addon until people suddenly wonder where all their money went.

I'll just stick to my iPhone and Garmin and limit some of extra charges.

Thursday, March 31, 2016

Ransomware and the Importance of Backing Up Your Data

When should you backup your computer?  Simple, when the data you have isn't replaceable or it's not cost/time effective to replace lost data.  With recent news of a hospital paying out ransomware, its a good time to think about backup.  Not just data, but recovery.

I tend to have multiple local backups as well as a cloud strategy.  For local, one of my methods is to have a bare metal backup, which is a complete disk image.  This provides the capability of a complete recovery to the state in time that the backup was made.    Most of the data is in the cloud, which provides recent information.  I only need to perform a bare metal every few months or when I install a major software package.    One of the tools I like to use is Active@ Disk Image.  


(This is not a paid endorsement, just sharing the love of a great product)

Wednesday, March 30, 2016

NPM and Security


So I decided to expand my learning a bit with npm and just as I start diving into it,  lo and behold, one of the major tenants of Open Source has been abused, "Trust".  An individual unpublished a bunch of their popular modules, which promptly broke a many developer builds.    Not only did this cause an uproar, but also some serious discussions about the inherent security issues of the current npm community process.    

Right now it's very easy for a npm newcomer to just run "npm install some_package" that was previously a trusted source, but is now compromised and end up with nefarious code that could seriously affect their system.  If you work with github at all, you might download a project that has many npm module dependencies, enough that going through a serious code review before you try to launch it would take a considerable amount of time.  

IMHO, here's what I think needs to happen, assuming it can be communicated effectively with enough advanced warning.  Admittedly, I'm very new to npm, so some of my suggestions may not be perfectly tuned, so please forgive me. 
  • On npmjs.com, make it easy to flag a module that has an issue.  You have to be a member to flag and set a threshold on the number of flags before it's deactivated and sent for review.  Additionally add a new parameter to the npm config that enables the npm install to ignore flagged modules with a level threshold setting.    Typical warning messages would occur on install of a flagged module.
  • Consider changing  --ignore-scripts   to --enable-scripts with a configuration setting that can be changed to the old behavior.  
  • Breakup the main repo into multiple repos consisting of;
    • Core modules that are provided by the npm team.   Other npm modules could be added to the core only through a vetting process after submission by the author.  Once submitted and included, all rights transfer over to the npm team.
    • Move all other modules to a developer  repo, also owned by the npm team.    A developer would need to specifically add that repo to their configuration.  

Tuesday, March 29, 2016

Packt Publishing Daily Free eBooks

Packt Publishing offers a daily free programming related eBook. The marketing must work as I've bought additional books from them

Monday, March 28, 2016

How Hot Dogs Are Made

Right out of high school, I was trained as a meat cutter, working in a grocery chain in California. This was the type of meat cutting where sides of beef hung on hooks.  We would then break the beef down into the various cuts of meat that make summer BBQ's so enjoyable.  Meat cutters call it breaking, chef's call it fabricating.  I learned an incredible amount during my time there and gained a deeper understanding of the farm to plate process. The training was the start of a life long interest/hobby in food processing, especially "From Scratch" techniques.

 A lot of folks often say why not just buy it at the store, it's cheaper. As true as that may be, it's the learning process that's important. I'll try to cook/make/fabricate anything at least once, or a few times to perfect it. Often that will continue on, and in some cases, might be the end of that particular avenue of food exploration.

Below is an interesting video on how to make Hot Dogs. It might turn some people off, but it's nothing more than a very fine blended meat product. Most deli meats follow a similar type of process such as Braunschweiger and Bologna, just to name a few. A bit coarser grind and you have salami and bratwurst. Ever had a Gyro? That meat spinning on the spit is a blend of beef and lamb.

 If you're concerned about the quality of ingredients used, you can always make it yourself and learn something in the process.

 

Wednesday, March 16, 2016

Turning off jQuery DataTables pagination when all the records are displayed.

This bit of code when added to your jQuery DataTables configuration will turn off pagination if all the records are displayed on one page.

,drawCallback: function(settings){
     if(settings._iRecordsDisplay >= settings._iDisplayLength){
          $('.dataTables_paginate').show();
      }else{
      $('.dataTables_paginate').hide();
      }
}

Tuesday, March 15, 2016

Coding since MCMLXXIX - An Introduction

After a long hiatus, I've relaunched the "Inside Out Outside In" blog.  This blog will be my primary place to post information related to my profession as a software developer, but will also include a wide range of other internet related technologies.   I'll also throw in a smattering of things I find amusing or possibly upsetting enough that I just need to rant about it.

I've been developing software since 1979.  My first computer was an "Exidy Sorcerer", followed by numerous Apple computers and a few Windows and Linux systems.   I've worked for Apple Computer, Intelligent Environments, Allaire, Macromedia, and Abbott Labs.  

Best Regards,

Chris