Subscribe: Jeffry Houser's Blog
Preview: Jeffry Houser's Blog

Jeffry Houser's Blog

Jeffry Houser's Blog

Published: Wed, 16 Aug 2017 09:11:54 -0600

Last Build Date: Fri, 11 Aug 2017 06:19:00 -0600


This code uses FlexBox for display: .flex { display : flex; height : auto; min-height : 100%; } It also contains a trick. The height is set to auto and the min-height is set to 100%. That, combined with the body's height of 100vh will extend this div through the full height of the page. Finally, create our left nav bar inside our Flex div:
Some Text and other things
This is styled with a specific width, but no specific height. I also specified the color .somebar{ width : 150px; background-color:blue; color : white; } Check out the
code here. I've been doing a lot of HTML CSS work for a client, but I'm working on some longer programming based articles which will be coming out soon.

Can I create an HTML Background with an inline Image?

Fri, 04 Aug 2017 11:05:00 -0600

I'm working on a site for some clients, and one of their complaints was that the left nav bar was not extending the full height of the page. The nav div was set to expand to its content, which meant it stopped when it ran out of content. On some pages it looked fine, on others the nav bar ended too early. As a programmer, I don't often deal with design issues like this, so I pulled in the project's designer and we put our heads together to find a solution. First, the problem was very generically like this: Title body { margin : 0px; } .nav{ background-color : #0000FF; width : 200px; height : 50%; color : #ffffff; } .nav a { color : #ffffff; } Some info in the nav bar Some Link Our code was much more complicated, using Flexbox for complicated layouts, but this is simple enough example to demonstrate the problem. We were not able to use a simple height:100% in CSS because some parent containers used Flexbox styling and did not stretch the full height of the page. My designer friend recommended tiling a background image. We can change the CSS for the body tag to something like this: body { margin : 0px; background: top left url(blue1x200.png) repeat-y; } The blue1x200.png is an image with just the color blue in it which has a height of 1 pixel and a width of 200 pixels. The repeat-y clarification tells the browser to repeat this image on the y axis, meaning up and down. This solved our issue, so whatever was happening to the page nav or the page content it would not prevent the left 200 pixels on the page from showing up the same color as the background. Using the url attribute to the background CSS will force the page to spawn another HTTP request to load the image. My designer had a trick for that too. He converted the image to a Base64 string representation and replaced the URL: background: top left url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAABCAIAAAAU3Xa1AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lD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sNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN[...]

Goodbye Flash

Thu, 27 Jul 2017 09:35:00 -0600

Adobe announced an End of Life for the Flash Player. I've written things in defense of Flash in the past and thought it would be worth it to revisit those statements today. Who Am I? If you came across this without knowing me, I am arguably one of the best Flex Developers in the world. I tied my business and professional life to the Flash Platform, and Flex, more than a decade ago. Here are some of my credentials: I produced two Flex podcasts. a href="">The Flex Show presented highly edited community interviews. and The Flextras Friday Lunch was a live demo with Q&A. I created Flextras, a business selling Flex components. I was editor in chief of the short-lived Flex Authority magazine. I spoke at dozens of Flash based user groups and conferences. I answered a ton of questions on StackOverflow and still retain the top spot in the Flex user charts. I became an Adobe Community Professional due to my work in the Flash community. I was one of the founding PMC members of the Apache Flex team. Back then, I bet that Flex would provide a better application building experience than anything HTML could offer. I thought it would rule the world. I wanted to get in early and ride the wave to success. I took a calculated risk that turned out to be wrong. Why Does Adobe's Decision Makes Sense? Browsers have slowly been shutting down their plugin APIs and Flash Player was a plugin. Flash was able to get around this because it is widely used and Adobe was able to negotiate to add Flash directly into the browser. Both Microsoft Edge and Google Chrome are distributed with Flash. These APIS have slowly become more restrictive over time and the future of the web will be plugin-free. Since HTML is finally adding a native form of DRM, the bulk of the major content providers no longer need Flash's proprietary nature to protect their content. This removes the last commercial obstacle which I suspect has been keeping the Flash player alive. Jeffry, How does this Affect You? Personally, I spent a couple hours last night playing Bloon Tower Defense one of my favorite casual browser games. I hadn't touched it in years, but I'll miss it when it is finally gone. Professionally, this doesn't affect me all that much. I refactored my business more than five years ago to focus on alternate technologies. In the HTML world, I really like Angular, but I've touched on a lot of different technologies. I never turn down the Flex work that comes my way, and people still find me based on my past history. But, I am not actively pursuing it. If you need help migrating your Flex applications to an HTML5 platform, I'd be glad to help, so reach out and we can discuss. How does this Affect you? Adobe will stop distributing the Flash Player in 2020, but the Adobe Flash Platform will live on through Adobe AIR. Given AIR's use as a cross platform mobile app development platform I expect that to be around for a long time. If you still have Flash applications in production, now is the time to start planning a migration of sorts. You have, roughly, 2 years to plan your strategy. What migration strategies can you use? Distribute to the Desktop as an Adobe AIR application. You can use all your existing code and the migration will not take long. Distribute as a Mobile Application with Adobe AIR. This has the benefit of using the same code base, but you'll probably need some UI rework to accommodate for the different screen sizes. Rework to HTML5: You can rework your application into an HTML5 application. You should be able to reuse a lot of your services and database code, which means you'll just be writing a new UI. Some technologies such as FlexJS or Haxe allow you to use your ActionScript skills in the process I'll be more than happy to help you with any of these tasks, so give me a call. What Next? I had a fun ride with the Flex community and met some new lifetime friends. I'm sorry to see Flash go, but the world has[...]

How can I revert a Git directory without affecting all changes?

Mon, 17 Jul 2017 09:00:00 -0600

I have been working on a specific code change with a client for about two weeks. This included about a dozen commits to the git repository before making a pull request. The client reviewed the pull request before merging, and requested I roll back a few changes. I had made these commit 8 commits ago, and from the dozens of files changed I only had to roll back two. How do you do it? I didn't see an obvious way to roll back just those files using SmartGit, my tool of choice, so I had to drop back to the command line. This did it: git checkout SHA-Value /c/path/to/repo/root/path/to/subdirectory/with/rejected/changes The SHA is the unique identifier for each commit. I opened up SmartGit, viewed a change log, found out which commit I changed these files, went to the commit before that, clicked 'details' and the SHA value is listed right there. You can also get the SHA value from GitHub if you prefer. Go into the Pull Request, and select commits. The value is in the table, to the right of the commit message. The path to the directory is your local system path. I had to use the absolute path. Since I'm a Windows user that started with the C drive, drilled down into my project folder, to the repository. And then I drilled down deeper into the repository to find the specific subdirectory I wanted to revert. Reverting the subdirectory is easier than reverting all the files individually. I executed the line inside of GitShell. Everything worked. I found a bunch of posts covering this topic, but most of them confused me. Hopefully this helps someone. Let me know!

How can I control the parameter order when doing a HTTP POST call from Flex?

Tue, 11 Jul 2017 09:40:00 -0600

I've been working on a legacy AIR application for a client. It integrates with a backend I have no control over. According to their documentation, we need to pass the form parameters in a specific order. This seems unusual for a form post, which contains key-value pairs and is probably not accessed in parameter order. But due to other problems integrating with this service, I decided to see what I could do to specify the parameter order and remove that as a possible point of failure. I wrote about my attempts in this StackOverflow question.

What Didn't Work

This is what we were doing. First, create an HTTPService: Then, create the parameter object in code: var parameters : Object = new Object(); parameters.firstParameter = "firstOne"; parameters.amount = 100; parameters.otherParameters = "Other Random Misc Data"; parameters.lastParameter = "LastOne"; When the parameter object is created for the service call, I added the parameters to the object in order. Then make the call: var call : Object = this.service.send(parameters); call.addResponder( this.responder ); You may have already guessed why this won't work. Object parameters, or keys in a dictionary, are by definition, not in any specific sort order. When the Flex code looped over all parameters to add them to the outgoing service, it was accessing them in alphabetical order. However, that is not something I would bet my life on happening every single time due to the unordered nature of object properties. I also noticed that the outgoing request in the Flash Builder network monitor had the parameters in yet another order. Something with them changed between the Flex code and the server hit. So, what am I to do?

Using Lower Level APIs to make this work

The final solution was to use lower level APIs. I created the request using URLRequest and URLLoader classes. Instead of passing an object to the request I also had to manually create the request body which is very similar to a URL parameter string. First, create the parameter string: var parameters : String = ''; parameters += "firstParameter=firstOne&"; parameters += "amount=100&"; parameters += "otherParameters=Other Random Misc Data&"; parameters+= "lastParameter=LastOne"; Then, create the URLRequest: var r:URLRequest = new URLRequest(yourURLHere); = parameters; r.method = URLRequestMethod.POST; r.contentType = "application/x-www-form-urlencoded"; The data is set to the parameters string. The method is set to POST and the contentType is set to 'application/x-ww-form-urlencoded'. And finally, create the URLLoader: var l:URLLoader = new URLLoader(); l.addEventListener(Event.COMPLETE, myResultMethod); l.addEventListener(IOErrorEvent.IO_ERROR, myFailureMethod ); l.addEventListener(SecurityErrorEvent.SECURITY_ERROR, myFailureMethod ); l.load(r); After doing this I could see in the outgoing requests that the parameter order was retained. So, things were good and my issue was solved! This is a lot more tedious than using the HTTPService, but at least I eliminated it as a possible error.

How do I right align a div inside a div?

Thu, 06 Jul 2017 09:00:00 -0600

I was working with a client to create a specific layout on the page and I wanted to align a div inside another div. But, I couldn't use text-align because I didn't want to right align the text elements in the inner div. How do you do it? First, create the outer div and inner div:
This is Text in the inner div
Some other Text
A simple div is inside another div, and the inner div has some text. The outer div's only purpose is a wrapper for positioning purposes. Both the outerDiv and innerDiv have CSS Styles attached. This is the CSS for the outerDiv: .outerDiv { display: flex; float : right; } It enables the outerDiv to use flexbox styling and floats the content to the right. Flexbox is an advanced way to position CSS elements. The innerDiv doesn't need any special CSS styling to make this work, but let's give it a background color: .innerDiv{ background: #e6e6e6; } Play with the code here. The implementation is really simple once you figure it out; but sometimes getting there is a stumble.

How do I fix "Filename too long' error on SmartGit on Windows?

Thu, 29 Jun 2017 09:00:00 -0600

I've been working with a client on a project that uses AEM and ran into a problem committing code changes to their git repository. The error told me that the filename was too long. The error was something like this: error: unable to create file 'really long path to file' Filename too long I banged my head on this for a bit, but eventually found a solution. I had to change a flag with the version of Git that was included with SmartGit. Open up a console window. Move to your SmartGit install directory. For me that was: C:\Program Files (x86)\SmartGit\ You should have a git subdirectory in there. Switch to it, and drill down into the bin directory. My full path would be this: C:\Program Files (x86)\SmartGit\git\bin Now run this command: git config --system core.longpaths true And try the commit again. Things should work fine.

Why does reloading my Angular 2 App return a 404 error?

Tue, 20 Jun 2017 09:00:00 -0600

I've been having some issues with Angular 2 [now Angular 4] and the RouterModule. I put together this screencast to demonstrate the problem and how I fixed it: width="560" height="315" src="" frameborder="0" allowfullscreen>

How do I move ColdFusion Configuration to Another machine without Exporting Settings?

Tue, 13 Jun 2017 09:00:00 -0600

I've written in the past about migrating ColdFusion instances from one machine to another. Most of the time when I have to do this it is because of a hardware failure and I'm setting up a machine from scratch. This seems to happen every 4-6 years. Despite it's impending immediate death, 20 years running, I still do a quite bit of ColdFusion development. It's the devil that I know on the server side. Without a working machine, I can't sign into the CF Administrator and export CF Admin settings, so I have to go to other methods to get my config up and running. I've written about similar experiences with ColdFusion 8 and migrating from ColdFusion 8 to 9. But, time moves on and most of my production clients use CF10, so that is the version I have installed on my local. How do I get the old CF configuration set up the new machine when all I have access to is the old CF installation directory? this is how I did it. Install Apache: ColdFusion is useless without a web server, so first I installed and configured the Apache web server. Install ColdFusion 10: Get ColdFusion 10 from the cfmlRepo site. More specifically, go here. be sure to download app the patches. And send thanks to whomever takes care of that site. Install CF Hotfixes: Next, install all the ColdFusion hotfixes. You'll have to install the first few manually before you can use the update feature inside the ColdFusion administrator. Uses these instructions, but basically do this: C:\ColdFusion10\jre\bin\java -jar hotfix_008.jar I installed hotfixes 7-13. The rest I updated through the ColdFusion administrator. Compare Directories: Now compare your old ColdFusion install directory to the new ColdFusion install directory. You'll be surprised at how many of the files will be flagged as identical. Those aren't the ones you need to worry about. I focused on the config files in cfusion\lib\*.xml, and copied them over from the old directory to the new one. These are the configurations I moved: new-cron.xml: Not sure what this one is for. neo-datasource.xml: this file contains DSN configuration information. neo-debug.xml: This contains CF Debugging settings. neo-logging: This contains log related settings. neo-mail.xml: This contains mail server settings. neo-metric.xml: I couldn't figure out which settings this one contains, but I copied it anyway. neo-runtime.xml: This file contains misc settings. I was making some educated guesses here. I think Neo was the code name for ColdFusion MX, so it is funny to see the name still kicking around. Restart ColdFusion: After the restart, you should find all your CF settings restored. Change DNS Passwords: I did notice that I had to reenter the passwords for all my data sources. Overall, the process worked a lot better than I would have hoped. Keep up to date by reading DotComIt's Monthly Technical Newsletter First Name Email Address * [...]

How do I do a search and replace in SQL?

Tue, 06 Jun 2017 09:00:00 -0600

I recently upgraded this blog to run exclusively on SSL. The first thing I noticed is that many of the links and image references inside blog posts were not HTTPS and the browser would show one of those 'this page is not secure errors'. The reason that the text of my posts use absolute links instead of relative is so that they'll show up properly for those who consume the blog via RSS and read it elsewhere. I spent a few hours white boarding a bubble sort algorithm before deciding I was getting nowhere, I decided to try a Google Search for the answer. In SQL Server, which is my blog's data store, you can use a replace function to make the change. I can do a simple search for text inside a column and replace it with something else. Perfect, that is what I need. Here is a StackOverflow answer with more details. The query they recommend is: update my_table set column = replace(column,'oldstring', 'newstring') Of course, when I did that I immediate got a conversion error. The body of these posts are stored as ntext fields inside the database. and the replace() function will not work on ntext or text fields. Thankfully, there is a solution to that too. A simple cast addressed the issue. update my_table set column = cast(replace(cast(column as nvarchar(max)),'oldstring', 'newstring') as ntext) If you use BlogCFC and need to do this on one of your blogs, here is the final script I used: update tblBlogEntries set body = cast(replace(cast(body as nvarchar(max)), '', '') as ntext) where body like '%' update tblBlogEntries set morebody = cast (replace(cast(morebody as nvarchar(max)), '', '') as ntext) where morebody like '%' I hope this helps someone.
Sign up for DotComIt's Monthly Technical Newsletter

Watch For Code Changes - Building Angular 2 Applications with Gulp - Part 10

Tue, 30 May 2017 09:00:00 -0600

This is part of an ongoing series about building Angular 2 TypeScript applications with Gulp. Start with Part 1, and then read Part 2, Part 3, Part 4, [...]

Creating a Production Build - Building Angular 2 Applications with Gulp - Part 9

Tue, 23 May 2017 09:00:00 -0600

This is part of an ongoing series about building Angular 2 TypeScript applications with Gulp. Start with Part 1, and then read Part 2, Part 3, Part 4, [...]

Creating a Clean Build - Building Angular 2 Applications with Gulp - Part 8

Tue, 16 May 2017 09:00:00 -0600

This is part of an ongoing series about building Angular 2 TypeScript applications with Gulp. Start with Part 1, and then read Part 2, Part 3, Part 4, [...]

Creating a Simple Build Task - Building Angular 2 Applications with Gulp - Part 7

Tue, 09 May 2017 09:00:00 -0600

This is part of an ongoing series about building Angular 2 TypeScript applications with Gulp. Start with Part 1, and then read Part 2, Part 3, Part 4, Part 6. In previous parts of this series, we created a lot of different build tasks. One for validating the TypeScript, one for compiling the TypeScript, and a few tasks for copying JavaScript and HTML files. What if we want to run them all in one command? This article will show you how. It is pretty simple to create a Gulp task which will run multiple other Gulp tasks: gulp.task("build", ['buildTS', 'copyJSLibraries', 'copyAngularLibraries','copyHTML']); This creates a new Gulp task named build. The argument to the task is an array and each element of the array is a string which represents another Gulp task. We saw this approach with buildTS task built in Part 3. In that part, the tslint task was executed as part of the buildTS task. In this case, the build task does not have its own functionality it just combines together the existing tasks. Run this task: gulp build You'll see something like this: (image) All the tasks are run, creating a build.

What's Next?

The next part of this series will show you how to delete everything in the build directory before creating the build. I call this approach a clean build. All the information is already available, so sign up for our newsletter to start reading right away.
Get our expanded 38-page version: Building Angular 2 Applications with Gulp.

Minimizing the JavaScript Code - Building Angular 2 Applications with Gulp - Part 6

Tue, 02 May 2017 09:00:00 -0600

This is part of an ongoing series about building Angular 2 TypeScript applications with Gulp. Start with Part 1, and then read Part 2, Part 3, Part 4, and [...]