Month: November 2019

Exchange Mail & Calendar In Teams (duct tape approach, not official MS solution)

The Exchange web client renders in the Teams website tab now – Chrome and Chromium-based Edge. I use the nightly build of FireFox and it says ‘Blocked by X-Frame-Options Policy’

This isn’t a way to get new mail notifications in Teams – you’ve got to click over to the tab. But it does let you send a quick message without leaving Teams.

It’s a little inconvenient, though, to have to navigate over to the right channel to find the website tab. You can also create a custom Teams application to access the Exchange website. That’s a little more complicated, but you basically need a manifest.json with static tabs to the inbox and calendar.

Install and open “App Studio” in Teams. Create a new app. Fill in the details — use the generate button to get an app ID. Since you’re not going to publish the app to the Microsoft app store, the info you use isn’t super important … the privacy and terms of use, specifically, aren’t something anyone is going to read.

And

In the “Capabilities” section, add a personal tab

Add a tab for the mailbox:

If you wish, add a tab for the calendar – I prefer the weekly view, but you can replace “week” with “workweek”, “day”, or “month”.

In the “Test and Distribute”, click “Download”.

You’ll get a zip file that you can side-load (i.e. it’s not an app published across the company). In “Apps”, select “Upload a custom app”

Locate the downloaded ZIP file and open it

Verify that your app looks right – the permissions are base permissions for all apps (we didn’t add anything special)

Click “Add” and you’ll be able to select the new app from the ellipses in Teams.

And you’ll have an app that can access your mailbox

Or a week view of your calendar

 

Direct Representation

I always wanted to run for federal office on the platform of direct representation — more a technology than a platform. Develop a system that allows constituents to log in and vote for any legislation — basically like proxy voting for shareholders. I’d deliver summary and full text content of anything in advance of the vote, and I’d cast my vote as dictated by my constituents. And constituents could see the vote totals for each piece of legislation to prove that I am voting based on real input. Obviously, this platform suffers an immense privilege problem — it’s great for a demographic with free time to read through legislation and convenient Internet access. It also suffers a civic disengagement problem — does anyone actually want to read through the text of everything that’s coming up in my committees and to floor votes? It’s quite possible that I’d be voting against the National Law Enforcement Museum Commemorative Coin Act (H.R. 1865) because five people bothered to lodge an opinion … and only to troll the entire idea behind direct representation. And none of that considers the threat of malicious actors.

Once there is a platform available for one legislator, expending it to others in the same chamber is trivial. Adding the other chamber or state legislatures is an undertaking from a content-development standpoint (what *is* on schedule for the Oregon Senate today?), but the underlying development effort is the same. Somewhat like the National Popular Vote compact is an end-run around formalizing the eradication of the Electoral College, this would be an end-run around indirect representation.

But I’ve thought, of late, that starting at the Federal level is misguided — if for no other reason than the incredible amount of money it takes to run a campaign for federal office. But also because getting the six million or so Ohio voters set up for direct representation by their state Senator would be a logistical nightmare. It seems better to begin implementation at the local level — run for school board or a Township Trustee position where you are concerned about a few thousand voters. Use local offices as small proof-of-concept experiments. Maybe it doesn’t work out — maybe no one cares enough to check what’s being discussed and vote for their position. Maybe running and supporting the platform is too expensive or time consuming. Hell, maybe no one is interested enough in direct representation for a direct representation candidate to win in the first place.

Local Politics

I’ve had a few reminders recently that civic engagement is more than focus on national politics. Bonus: local Trustees, School Board members … even state Reps and Senators … hear from far fewer people (e.g. I get personal responses from these folks and a form “thanks for your opinion” messages back from my federal officials).

Ohioans can find their state Rep and Senator at https://www.legislature.ohio.gov/legislators/district-maps

***********************************

I am writing to express my vehement objection to GA133 HB-164

I appreciate the desire to allow students to express religious beliefs in their school-work. Allowing a student to select the Torah for their book report is one thing, but this legislation seems to have the unintended consequence of allowing religious-based beliefs to inform “correct” answers. While it is factual to say “scientists believe X, and some people do not concur due to religious beliefs”, and it is useful to teach our children this truth, how can a science class be taught when scientific answers are discounted? And what constitutes a valid religious belief? Something like 18 USC § 1093 is so vague that we’ll find a new “religion” that strongly believes that division by zero equals five. Or that vowels are an abomination which must be struck from the language.

Even restricting “religious expression” to religions with a large, arbitrary number members creates issues. The proposed legislation will put schools in the difficult position of either telling students their purported religious beliefs do not “count” or allowing offensive and subversive content to be expressed. Where I attended school, some individuals ran for school board on the platform of pushing religious issues — primarily allowing high school students to read a prayer as part of the morning announcements. These individuals assumed this meant we would all hear a Christian prayer each morning. While I was certain there were some high school students eager to read the expected content, I was equally certain there would be some high school students eager to read a Druid/Buddhist/Scientologist prayer in the morning. At which point the school administration either needed to prohibit those students from reading unwanted content (and the risk of litigation such a prohibition entailed), telling kids that they’re not actually Raelian and thus need to wear a shirt to school (and how exactly do you prove or disprove one’s affiliation with a religion?!), or allowing the expression of religious beliefs by anyone who wanted to purport a religious belief. I was quite confident that the Board members who were pushing to allow a morning prayer would be horrified to have their kids listening to Satanic invocations. Were there enough students ready to read a ‘mainstream’ prayer that the school could just claim the time was all booked up? This legislation seems to suffer the same problem — except without the possibility that all of the “religious expression slots” will be taken by the “right” type of expression. The new Board members withdrew their proposal after I questioned how it would actually work, and I hope you will vote against this bill should it come to the floor.

Modifying Shared PHP Function

We needed to modify a shared function to include additional information … but didn’t want to coordinate changing all of the calls to the function as one change. Simplest way to accomplish that was to set a default value for the new parameter — either to NULL and just not do the new thing when the parameter is NULL or some value that indicates that we’re not yet gathering that data.

<?php

function testFunction($strOldParameter, $strNewParameter=NULL){
     echo "The old parameter is |$strOldParameter|\n";
     if($strNewParameter){
          echo "The new parameter is |$strNewParameter|\n";
     }
}

testFunction("first", "second");
testFunction("justFirst");

?>

Did I miss something?!

I’ll admit that I was only halfway paying attention to Survivor tonight, but it sounds like some women lied about someone’s physical contact making them uncomfortable (exaggerated their discomfort?) and then lied about their lying. They discuss the harassment, bond over the shared (miserable) experience. And then I hear “You tell her how uncomfortable you are … like, you have a very open mom/daughter moment about how uncomfortable you are. Right now, that’s our only play.” Our only play?!?

After someone else got voted off the island, Janet explains to Dan why she “turned” on him. Reasonable move, and if (as the show claims) they had a group meeting about respecting personal boundaries and an individual meeting with Dan that included a warning about his behavior … I’m not sure how it’s news to the dude why people were voting for him. Dan talks to Missy and Elizabeth and is told that Janet is lying to him. I mean, I know that the narrative gets built in editing and all … but it’s not like they’re selectively including the three times someone mentioned it to make it seem like something that’s a constant topic of conversation and the person says “I mentioned it once or twice, but I wasn’t making a huge deal about it”. If you never said that … there wouldn’t be footage to include. I was glad that Janet got all four of them together instead of allowing the other women to tell different stories to different people, but the ultimate resolution of their discussion seemed to be “well, Janet, you misunderstood and it got blown out of proportion”. Not “yes, I lied about this”.

Now, I’d understand if they decided that, yeah, dude makes them uncomfortable. But they were going to suck it up to retain their position in the game. I don’t want my alliance to think I’m untrustworthy, so I cannot vote out “one of us”. That would have been a rare bit of actual reality in “reality tv”. I’ve endured uncomfortable situations because I wanted to keep getting a paycheque. But the discomfort was truth. And I didn’t band together with a group of women, agreeing to discuss the problem with HR, only to tell HR that I never saw anything inappropriate.But the entire situation was disgusting – gee, why are people hesitant to believe someone who claims to be harassed – and I have a bad feeling that the “drama” is meant to be a hook for the show.

Microsoft Teams: Private Channels Arrive

WooHoo! When creating a channel, I have a privacy setting!!

Individuals who do not have access to the channel do not see it in their Teams listing, and posts made to a private channel cannot at-mention the Team or individuals who do not have access. I’m glad Microsoft landed on the side of privacy in their implementation here.

It would be awesome if MS would have added the ability to move channels into other Teams with this rollout so we could consolidate Teams that were set up to restrict access to content. But at least we’ll be able to consolidate general-access and restricted-access content in a single Teams space going forward.

 

Preventing erronious use of the master branch on development servers

One of the web servers at work uses a refspec in the “git pull” command to map the remote development branch to the local remote-tracking master branch. This is fairly confusing (and it looks like the dev server is using the master branch unless you dig into how the pull is performed), but I can see how this prevents someone from accidentally typing something like “git checkout master” and really messing up the development environment. I can also see a dozen ways someone can issue what is a completely reasonable git command 99% of the time and really mess up the development environment.

While it is simple enough to just checkout the development branch, doing so does open us up to the possibility that someone will erroneously  deliver the production code to the development server and halt all testing. While you cannot create shell aliases for multi-word commands (or, more accurately, alias expansion is performed for the first word of a simple command is checked to see if it has an alias … so you’ll never get the multi-word command), you can define a function to intercept git commands and avoid running unwanted commands:

function git() { 
     case $* in 
         "checkout master" ) command echo "This is a dev server, do not checkout the master branch!" ;; 
         "pull origin master" ) command echo "This is a dev server, do not pull the master branch" ;; 
         * ) command git "$@" ;; 
     esac
}

Or define the desired commands and avoid running any others:

function git(){
     if echo "$@" | grep -Eq '^checkout uat$'; then
          command git $@
     elif echo "$@" | grep -Eq '^pull .+ uat$'; then
          command git $@
     else
          echo "The command $@ needs to be whitelisted before it can be run"
     fi
}

Either approach mitigates the risk of someone incorrectly using the master branch on the development server.

Handling PHP Execution Timeout

There’s no straight-forward way to handle execution timeout in PHP 5.x — it’s not like you can try/except or something. The execution time-limit is exceeded, the program terminates. Which, thinking from the perspective of the person who maintains the server, is a Good Thing … bugger up the ‘except’ component and now that becomes an infinite loop.

But I’m looking to throw a “pretty” error to the end user and have them try again with a data set that will take less time to process. Turns out, you can use a shutdown function to display something other than the generic PHP time limit exceeded page.

<?php

function runOnShutdown(){
     $arrayError = error_get_last();

     if( substr($arrayError['message'], 0, strlen("Maximum execution time of")) === "Maximum execution time of"   ){
          echo "<P>Maximum execution time";
     }
     elseif($arrayError){
          print_r($arrayError);
     }
}

function noOp($iInteger){
     for($z = 0; $z < $iInteger; $z++){
          $a = $iInteger * $iInteger;
     }
     return $iInteger;
}

register_shutdown_function('runOnShutdown');
ini_set('display_errors', '0');
ini_set('max_execution_time', 2);

// for($i = 0; $i < 10; $i++){
for($i = 0; $i < 10000; $i++){
     $j = noOp($i);
     print "<P>$j</P>\n";
}
print "<P>Done</P>\n";

?>

And the web output includes a customized message because the max execution time has been exceeded.

 

Upcoming Features from Ignite 2019

  1. Private channels should be coming this week … not my tenant yet, but soon
  2. Multi-window functionality where chats, calls, and such can pop out into another window
  3. Live captioning should land later this year — this is an obvious great feature for people with reduced hearing or frequency loss, live “closed captioning” is awesome if you’re working from a noisy location too
  4. Microsoft Whiteboard moved into general availability — it’s been a preview for quite some time now
  5. “Attendee” roll will prevent people from inadvertently sharing their screen in the middle of a meeting
  6. My Staff portal that allows managers to perform password resets (and maybe unlocks) for their employees. This is something I’ve done as custom code in IDM platforms, but it’s nice to see Microsoft incorporating ideas that reduce down-time due to password challenges.
  7. I’ll be curious to see if the healthcare-specific features move into other verticals — MS rolled out a feature that allows you to designate a contact when you’re in surgery (basically redirect all of my messages to Bob because I’m busy right now) that seemed like it would be quite useful in enterprise or education uses. The “patient coordination” feature they talk about might work as a contact management tool out of the medical realm too.
  8. URLs in Teams will be protected like the links in other Office 365 programs — if you click on a link and see something about “Advanced Threat Protection” … that’d be why 🙂