Stolen Valor and Bullying

There is nothing that burns a veteran’s buttons more than seeing someone who lies about their service record or the awards earned for the sake of garnering unearned respect or padding a resume. There are those who bilk the Veteran’s Administration out of money. There are elected officials who lie to gain the favor of an uninformed electorate.

The most effective police force is veterans, of course. We have a sort of “spider sense,” which is keyed by incorrect uniform arrangements in pictures, stories that fall flat on our ears, or anything accompanied by “I can’t really tell anyone about it.”

The Vietnam era vets seem to have it the worst. There are roughly between 600-700 former POWs alive in the United States, G-d bless them, and yet, there are exponentially more people telling stories of captivity than this. Every third Vietnam vet is a Navy SEAL, too.

The most troubling cases of Stolen Valor come, of course, from those who have never served at all. Our reaction is visceral, swift, and uncompromising. The general position is either admit fraudulence or suffer as much humiliation as the Internet can afford. Some make veiled threats or post addresses online.

In a way, it’s flattering. The most egregious cases of fakery emerge from those inhabiting the most marginal of existences. They may have been rejected for service, or failed out early, but not before they tasted the fruit of the Tree of Awesomesauce. They look in the mirror and loathe what they see so much that they encase themselves in fictional stories, often which resemble the pastiche of service they see in Chuck Norris films, and to all but the most gullible, end up in a pathetic feedback loop. That they see our service as the antidote for their inadequacies should tell us something about sanctity of our sacrifice. We need to identify and expose them, rather than allowing them to create false impressions of service to the uninformed.

However, a recent posting about a phony on Stolen Valor’s Facebook page raised some alarm bells for me. A young man, too young to be in Special Forces, let alone a 6 year vet, posted the following, claiming to be a first lieutenant.

Depressing information about this kid here.

Two years prior to this, this young man was the victim of cyber-bullying, to the point where four young men hopped into a car and drove to his house. A fight ensued, and this young man stabbed one of the assailants in the stomach with a 12″ knife and cut the other two. He was 16 or 17, tried as an adult, and sentenced to a year in prison.

Clearly, life has not been kind to this boy. I don’t know him, so I don’t know if he invited it on himself, but that’s not really the point for me. I swore an oath to protect the Constitution of the United States, and along with that implicitly, our citizenry—even those for whom I hold great disdain.

This young man is clearly troubled. Instead of piling on him in lieu of his laughably incredible claims, we should be, as soldiers, Marines, airmen, and sailors, asking ourselves, “what is our duty to this kid?” Is it to threaten and insult, or is it to say, “why?” and extend a firm but helpful hand and say, “what has you feeling so bad that you need to do this?”

I wrote to him thusly:

Mike,

I don’t know you, so pardon my familiarity.
I served from 1994 – 2011 in the US Army and the National Guard. I’ve been to Airborne and Air Assault school. I have distinguished myself in the service of the country. In the service of you, so you could grow up safe.
I don’t want to pile it on and insult you. I would like you to suspend your claims. Stop and apologize, get the angry vets off your back.
I read about the stabbing. Did they pick on you? Four kids show up at your house…let’s just say I know what it’s like to be bullied. I joined the service to get beyond the bullying I experienced. You don’t have to live like this. You don’t have to inhabit a lie to find things you like about yourself.

Please, Mike, I don’t want to see a young man who could still have a bright future do this to himself. Don’t invite the law into your life with the fake Army shenanigans. Get this behind you, get yourself to church or whatever faith you are, find a community that will bring you in and help you find the value that exists within you with or without service.

The only value service brings is the value you take into it to begin with. Manufacturing it won’t fill the empty spaces in your mind and heart.

Take some time and think about it, Mike, but know that there are veterans out there that rather than get angry at what you are doing, will extend the hand of compassion and concern. We will help you through this.

I have yet to receive a response.

I believe in protecting the meritorious and valorous service of veterans. I do not believe that pretending to be a veteran, current service member, or wearing military decorations unearned should be protected as free speech, as some argue using the “slippery slope.” I respectfully disagree, as the progression of lawful conduct always involves drawing new lines.

However, I do believe that we, as veterans, have an obligation to look beyond the indignity rendered us and consider where it is coming from. If someone is trying to profit or gain something to which they were not otherwise entitled, by all means, we should come down on him or her. In the case of clear mental health issues, we need to act in the interest of getting the party help or attention from the appropriate authorities rather than engaging in pillory.

Valor is not just about conduct on the battlefield. My regimental affiliation is with the Rakkasans from the 101st Airborne Division. The Latin motto on our insignia reads “Ne Desit Virtus,” or “Let Valor not Fail.” This isn’t just about soldiering. To paraphrase what I said to Mike, battlefield valor and merit in service lay dormant in all of us, and it’s not something that requires heroism in an award citation to evoke, though this is valor in its purest, most glorious form. A little bit of that honor and duty is in order now.

This is life, and if we honor what we are, we must attend to valor and merit in all our pursuits, not just the ones requiring a uniform. I saw comments on Stolen Valor encouraging this young man to take his own life. How is that worthy of valor any more than this kid’s middling falsehoods?

The Stolen Valor Act was a well-intentioned, feel-good attempt to distinguish our sacred service from profane and cynical hijacking. When our zeal to see honor protected outweighs our present interest in acting with dignity worthy of our oaths, one wonders what valor is there to be stolen.

Tags: ,
Posted in Development by admin. No Comments

SalesLogix Web Surrogate Entity Insertion

I had a case with Sage SalesLogix recently where I needed to insert an object into a secondary entity if certain conditions were met. I’m sure we covered this in the course, but I couldn’t remember how to pull this off.

Anyway, what I did was the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 public static partial class PotentialBusinessRules
    {
        public static void OnAfterInsertStep( IPotential potential)
        {
            if ( potential.Status == "Highly Likely" || potential.Status == "Registered") {
				Sage.Entity.Interfaces.IMCG_Course_Registrant registrant = Sage.Platform.EntityFactory.Create<Sage.Entity.Interfaces.IMCG_Course_Registrant>();
				registrant.Mcg_courseId = potential.MCGCourseID;
				registrant.GapPoint1UserID = potential.Owner;
				registrant.RegisterDate = DateTime.Now;
				registrant.DisiredOutcome = potential.PurposefulOutcome;
				registrant.PaymentMethod = potential.PaymentMethod;
				registrant.MCGCoursePriceID = potential.Tuition;
				registrant.CONTACTID = potential.ContactID;
				registrant.Status = potential.Status;
				// leave space to add potential id - does not currently exist
				registrant.Account_at_reg = potential.AccountID;
				registrant.Save();
				throw new Sage.Platform.Application.ValidationException("Registrant record has been saved.");
			}
 
        }
    }

Note the throw. This is the only way I could find that would let me popup some kind of JavaScripty alert within SalesLogix, but hey, it works.

ColdFusion 10 and REST: A Primer with Some Nuance

Oh heavens, I am in love.

Preliminary testing has been filled with fun. First, let’s get some details out of the way.

Your REST request needs to be phrased as http://{your url}/rest/{your appname in application.cfc}/{rest path}.

If you want to change that, as detailed here, you can modify what URL it’s listening for.

Nevertheless, if you are, like me, testing on both a local installation and your Hostek.com account, you’ll find something else is necessary, but I digress.

Here’s my Application.cfc:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
component output="false"
{
    this.name = "RestTest";
    this.applicationTimeout = createTimespan(0,1,0,0);
 
    this.restsettings.skipCFCWithError = true;
 
    public boolean function onRequestStart()
    {
        if(structKeyExists(url, "resetRest"))
        {
            restInitApplication(getDirectoryFromPath(getCurrentTemplatePath()), this.name);
        }
 
        return true;
    }
}

Another hat-tip to Mr. Gakhar here for the restInitApplication piece, or else you’ll be hitting your new service, wishing it would work, especially in a hosted environment where you don’t have assess to CFIDE/administrator. I recommend creating an empty index.cfm where this resides, for me, CF10 test, and then hitting that url with your URL key as above.

So, http://localhost:8501/CF10Test/index.cfm?resetRest=true.

On to the good stuff. I’m keeping it simple here. This one will return our array in XML or JSON.

1
2
3
4
5
6
7
8
9
component restpath="test" rest="true"
			{
				remote Array function getList() httpmethod="get"
				{
					var responsetest = ['hot','steaming','awesomesauce'];
					return responsetest;
 
				}
			}

I then hit this url: http://localhost:8501/rest/RestTest/test.

It by default seems to return XML. Probably some setting that will tell me how to change that as I delve deeper. Take a look.

<ARRAY ID="1" SIZE="3">
<ITEM INDEX="1" TYPE="STRING">hot</ITEM>
<ITEM INDEX="2" TYPE="STRING">steaming</ITEM>
<ITEM INDEX="3" TYPE="STRING">awesomesauce</ITEM>
</ARRAY>

Try this url: http://localhost:8501/rest/RestTest/test.json
And get this response: ["hot","steaming","awesomesauce"]

How awesome is that?

Let’s go a little bit deeper with the get response.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
component restpath="test" rest="true"
			{
				remote Array function getList() httpmethod="get"
				{
					var response = ['hot','steaming','awesomesauce'];
					return response;
 
				}
 
				remote String function getListItem(string listid restargsource="Path") httpmethod="GET" restpath="{listid}"
    			{
        			var response = "";
        			var arrTest = ['hot','steaming','awesomesauce'];
 
			        if(arrayFindNoCase(arrTest,listid) > 0)
			        {
			            response = arrTest[1];
			        } else {
			            throw(type="ListNotFoundError", errorCode='404', detail='Item not found');
			        }
 
			        return response;
			    }  
 
			}

With this, we have our array, and we check against it when we pass an additional parameter, now segmented after the get request like so:

http://localhost:8501/rest/RestTest/test/hot

This returns, as you would expect, “hot”.

This–http://localhost:8501/rest/RestTest/test/not–returns:

1
2
3
4
<STRUCT ID="1">
<ENTRY NAME="Detail" TYPE="STRING">Item not found</ENTRY>
<ENTRY NAME="Type" TYPE="STRING">ListNotFoundError</ENTRY>
</STRUCT>

This is going to call for more playing with, but this is awesome thus far.

Posted in Development by admin. No Comments

Quick and Dirty RSS Ticker with ColdFusion and JQuery

I was looking for a quick way to put a simple jQuery based news ticker on my home page that consumes an RSS feed and presented it in a cross-browser compatible format.

1. Right off the bat, we know that cross-domain pulls of RSS are non-starters with jQuery and browser security, so I use ColdFusion to create a feed proxy. This is well established how to do elsewhere, but I’m including it here to illuminate myself if I ever need to remember this.

1
2
3
4
5
6
7
8
9
10
<cfhttp url="{your feed url}" method="get" useragent="Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.7 (KHTML, like Gecko) Chrome/5.0.391.0 Safari/533.7"
result="httpresult"
redirect="false">
<cfif cgi.HTTP_USER_AGENT contains "Mozilla">
     <cfheader name="Content-Type" value="text/xml" />
<cfelse>
     <cfheader name="Content-Type" value="application/xml" />
     <cfheader name="charset" value="utf-8" />
</cfif>
<cfoutput>#httpresult.filecontent#&lt;/cfoutput>

We include a user agent in the CFHTTP call just in case the source is looking for evil.  We include the cfif/cfelse statements because IE8 and below, in the use we’ll see below, will not do what we need it to do without a correctly formatted content-type and charset in the header.  We merely then output the filecontent variable from the scope returned from CFHTTP.

2.  It goes real easy with jQuery and HTML on this one.  I’ve seen more complicated solutions, but the ability to parse XML in recent versions of jQuery renders them somewhat moot.  First, I create my HTML.

1
2
3
4
<div id="messagecontent">
     <span style="float:left;font-family:'Century Gothic',arial,helvetica,sans-serif;font-size:12px;font-weight:bold;color:#F00;margin-top:8px;margin-left:10px">Headlines:&nbsp;&nbsp;</span>
     <ul id="tickerul" style="width:500px;float:left;margin-bottom:0px;"></ul>
</div>

The empty UL element is what we’ll then populate with individual LIs.  The JavaScript that follows is fairly easy, too.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$.get('techfeed.cfm', function(data) {
     var $xml = $(data);
     $xml.find("item").each(function() {
          var $this = $(this),
          item = {
               title: $this.find("title").text(),
               linkref: $this.find("link").text(),
               description: $this.find("description").text(),
               pubDate: $this.find("pubDate").text(),
               author: $this.find("author").text()
          }
          $("#tickerul").append("<li style='display:none;'><a href='{linkref or your own link}'>"+item.title+"</a></li>");
          $("#tickerul li:eq(0)").fadeIn('slow');
     });
     var g = setInterval("tickerChange()",10000);
});
var h = 1;
function tickerChange() {
     var lis = $("#tickerul li");
     if (h > (lis.length - 1) ){
          h = 0;
     }
     $("#tickerul li").each(function() {
          $(this).fadeOut('fast');
     });
     $("#tickerul li:eq("+h+")").fadeIn('slow');
     h++;
}

And that’s pretty much it.  You can see it in action at my business site, www.bk-mp.com.

Posted in Development by admin. No Comments

In Response to Rabbi Boteach on Flags at Half Mast

Dear Rabbi,

I’ve seen this commonly bandied about now on the Internet, this artificial comparison between the honors bestowed on Whitney Houston vs. what is conferred upon Soldiers.

The difference is dignity.

As flags are lowered, the media is pouring over Houston’s life, looking for anything that they can relate to us in their banal, breathless manner.

In the meantime, the coffins of our war dead are serenely, anonymously, and in a manner filled with dignity, flown into nearby Dover AFB. A rabbinical chaplain, on the few occasions that have been unfortunately been required, tried to make sure that tahara was rendered as best could be for unfortunate American Jewish casualties.

When we buried two dear friends, one killed in Iraq, and one who took his own life after a tour in Iraq and Afghanistan, their home town and containing counties emptied out their workplaces. The first memorial was extended over two days to accommodate the mourners and well-wishers.

The bottom line is that the dignity and respect accorded to us troops is far *understated*. We don’t ask anyone to know the casualty count on any given day. Our own tradition, in fact, I need not remind you, places such a heavy disdain for counts of this nature. Whenever I had occasion to go to and fro in uniform, at airports, at events, just walking down the street, I got unsolicited “thank yous” at every turn, to the point where it was uncomfortable. We need no more thank you than the lawyers who went forth and fought to prevent Westboro Baptist Church from showing up, or the countless fundraisers held by civilians for military families when their loved ones are deployed. Whitney might have some people cry and lament her untimely death, but Americans demonstrate their affection for their service members where the rubber meets the road, in real service, in ways that have no parallel here.

We have Veterans Day and Memorial Day. There is no “tragic dead artists” day as a national holiday. We get hiring preferences, we get benefits long after having served through our service organizations, including my personal favorite, the Jewish War Veterans. Whitney has her day, just like Michael Jackson did, just like Kurt Cobain did. Their names may or may not go on memorials in their home towns as our war dead benefit from. In this war, especially, veterans are honored individually and in a manner often far more extravagant than even World War II. Thank G-d, this is because this war is not killing us in the numbers previous actions have.

Your son will soon experience this as well. Mazel tov on his acceptance at West Point, by the way. He’s eligible, soon, for a free in-service membership to the JWV. I recommend it highly!

Posted in Uncategorized by admin. No Comments

Opting out of Flash Development – Permanently

I did something I may or may not regret this past week.

Since I haven’t opened it for any reason across the last several months (almost a year), I uninstalled Flash CS5.

For my part, some of this is governed by need. My production arsenal includes two PPC Macs, one older PowerMac G4 and a G5 iMac, and the day where Flash development was relevant to either has long passed. The day will soon come when my daughter even finds the G5 iMac insufficient to her burdgeoning research needs. One of my continuing pet peeves is how much new rich media development, particularly in education, is still being produced using Flash.

So, this is another reason why I feel like Flash needs to go. Many school districts, especially now, are still running G3 iMacs in their computer labs. I don’t know if internal IT directors are picking up on TenFourFox as a viable alternative for education browsers, but one thing I resent is that a similarly dated Windows PC is still supported with the latest Flash plugin. I get that it’s all about marketshare, of course.

I’ve long resented the reality that Flash has been the lone path to mass-distributed rich media content. When I was developing graphic-based platform selectors for the CCTV industry, it was the only choice I had at the time. We had experimented with Microsoft-specific DOM manipulation for an internal project, and it worked well, as sort of a precursor to AJAX, but even the variety in versions of Internet Explorer made such an option untenable.

I realize now, that with jQuery, I could create a non-plugin dependent version of the same utility, with many of the visual effects, and with less time spent on building bridges between data sources and Flash. That aspect of Flash development has improved, yes. Yet I can’t shake the feeling that the cost to turn such a thing out is way too steep, commanding ridiculous fees from the pittance of vendors who serve that market.

I’ve been on an anti-Adobe kick lately. I left an Adobe Coldfusion experts group on LinkedIn because I’m terrifically jaded on how Adobe has done little to move the downward sloping needle on that product’s enterprise marketshare, and the knee-jerk wankery that ensues is disheartening. Similarly, I believe we have witnessed Adobe take a poor path with Flash. I say this without broad acrimony towards an organization that still seeds two of my favorite tools – Photoshop and Dreamweaver (the latter of which has only improved under Adobe, unlike many other products).

I have, too, in recent years, become somewhat of a cyber communist. I don’t ask for Adobe to make Flash development free or without cost, but given the wide distribution of the platform for content, I think they could look at embracing a model not unlike Apple or Microsoft. Apple offers their development tools for a song. Microsoft offers non-enterprise level development options for free, and there are decent open-source development paths as well.

Swish was swiftly closed out. It troubles me that such a widely used web medium is so closed. To me, it’s a model that invites low-end piracy and exclusivism when it comes to publishing rich media content.

So, I’m looking to exclusively leverage jQuery, HTML5 and CSS3 for rich media content moving forward. It has occurred to me that I don’t even need the expensive Flash IDE in order to publish multimedia content, even if I can still depend on the plugin, with offerings available. So, farewell, Flash. I will not miss you.

Posted in Uncategorized by admin. No Comments

jwPlayer & SMIL = No Repeats

http://developer.longtailvideo.com/trac/ticket/1216 – Looks like this is an identified problem with jwPlayer 5.6 for now and some time to come.  If you have a need to stream a multi-bit rate file via a SMIL through Akamai’s RTMP service, you may be frustrated to find out that users will not be able to repeat the video at the end of playback as expected.

Fortunately, I’ve found that adding the playerReady function indeed will work, especially if you just force the player to load the SMIL all over again when the state equals COMPLETED.

Here’s a sample:

var player  = null;
 
function playerReady(obj)  {
     player = document.getElementsByName(obj.id)[0];
     player.addModelListener("STATE", "stateMonitor");
}
 
function stateMonitor(obj){
     if(obj.newstate == "COMPLETED" ) {
          player.sendEvent('LOAD',{'file':'/videos/smil/smilfile.smil','provider':'rtmp'});
     }
}

Works like a charm.

Posted in Development by admin. 4 Comments

jQuery .clone

If jQuery were a woman, I would make sweet love to it.

How many other folks out there find themselves scratching their head about the complexities they are spared by using jQuery?

I ran into a situation where I needed to shift a quantity drop down from an input box to a select box with dynamic options, and back, using JavaScript.  I don’t care for it, but it’s the situation in which I find myself.

What I want to do – render an input box (in this case, we’re using cfinput at runtime), and then replace it with a select box based off an item selected in another select box, to constrain quantity.  ColdFusion is creating the array at run time which contains the select variables.

Convoluted?  Yes, but this is the world in which we live with enterprise-level e-commerce systems.

First, the variable, defined in a global scope.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
<input id="qty" type="text" />
 
<script type="text/javascript">// <![CDATA[
 
var ifinput = '';
var data ['
<option>3</option>
<option>6</option>
 
'];
 
function changeArroo() {
    if ( $("#qty").is("input") &#038;& data[1].length > 0 ) {
          ifinput = $("#qty").clone(); //I do this to preserve a copy of the original
          $("#qty").replaceWith("
<select id='qty'>"+data[0]+"</select>
 
");
    } else {
          $("#qty").replaceWith(ifinput);
          ifinput = '';
     }
}
// ]]></script>
Posted in Development by admin. No Comments

IPv4 Tools for ColdFusion

Our PHP friends have all the fun with their functions, like IP to long and what not.  We’ve duplicated some of that.

For a recent project where orders coming from IPv4 addresses outside the country are flagged in our system as fraud, I ran into the problem that the free databases that correlate ISO country code to IP ranges no longer include the CIDR data.

Web service calls were unapproachable for the volume of the update, as there are any number of free services out there that will find the CIDR for a range of IPs for you.

Here are a couple of functions I banged out to quickly calculate the net mask value from a range.  It’s not a catchall, mind you, there are always places where more subnets are applicable, but it seemed to work well for my purposes.  And at any rate, given the paucity of information out there on the web for performing this kind of function with ColdFusion, I believe it’s ultimately helpful.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Function: getOctet:  Takes in a piece of an IPv4 address and returns the appropriate length 
// binary string (i.e. 10101010)
function getOctet(ippart) {
     var octetpart = FormatBaseN(ippart,2);
     var addstring = "";
     if (len(octetpart) lt 8) {
         for ( i = 1; i lte (8 - len(octetpart)); i++ ) {
            addstring &= 0;
         }
     }
     return addstring & octetpart;
}
 
// Function: calcNetMask: depends on getOctet, takes in two IP addresses in a range and calculates 
// the subnet mask and CIDR for the range, only works for very specific ranges
// i.e. countries
function calcNetMask(ip1,ip2) {
     var Local = StructNew();
     Local.binary1 = getOctet( ListGetAt(ip1,1,".")) & getOctet( ListGetAt(ip1,2,".")) & 
          getOctet( ListGetAt(ip1,3,".")) & getOctet( ListGetAt(ip1,4,"."));
     Local.binary2 = getOctet( ListGetAt(ip2,1,".")) & getOctet( ListGetAt(ip2,2,".")) &
          getOctet( ListGetAt(ip2,3,".")) & getOctet( ListGetAt(ip2,4,"."));
     Local.subnet = '';
     for (  i = 1; i lte 32; i ++) {
          if ( CompareNoCase(  Mid(Local.binary1,i,1), Mid(Local.binary2,i,1) ) eq 0 ) {
               Local.subnet &=1;
               Local.netmask = i;
          } else {
               Local.subnet &=0;
               Local.netmask = i - 1;
               break;
          }
     }
     if (len(Local.subnet) LT 32) {
          addstring = "";
          for ( x = 1; x lte ( 32 - len(Local.subnet)); x++) {
               addstring &= 0;
     }
     Local.subnet = Local.subnet & addstring;
}
Local.SubNetMask = InputBaseN( Mid(Local.subnet,1,8),2) &amp; "." &amp; InputBaseN( Mid(Local.subnet,9,8),2) &amp; "." &amp; InputBaseN( Mid(Local.subnet,17,8),2) &amp; "." &amp; InputBaseN( Mid(Local.subnet,25,8),2);
// I like to clean up variables I'm not going to return
delkeys = 'binary1,binary2,subnet';
for ( n = 1; n lte listLen(DelKeys,","); n++) {
     StructDelete(Local,ListGetAt(delkeys,n,","));
}
Local.CIDR = ip1 &amp; "/" &amp; Local.netmask;
return Local;
}

You’ll note that final function returns a structure of data. I don’t know, you might want to know some of those other values for your own edification.

It makes you wonder, though…how many of these functions are going to be orphaned as we more widely embrace IPv6.  Right now, all I know about IPv6 are the issues I’ve had with DIG and DNS on Mac OS X.  We’ll have to see.

Tags: , ,
Posted in Development by admin. No Comments

Listing CF Scheduled Tasks

<cfscript>
   cron_service = createobject('java','coldfusion.server.ServiceFactory').getCronService();       
   services = cron_service.listALL();
</cfscript>

Blogging this because I always forget how to do this when it comes up.