Buy Me a Coffee

Buy Me a Coffee!

Friday, November 16, 2018

Testing new syntax

A colleague used some syntax that I hadn't seen before so I thought it would be worth testing in isolation.  The notation is an extension of the ternary conditional operator known as the null-conditional operator that was added as part of C# 6.0 in 2016.  I believe I need to up my C# game.  Anyway, here is the sample program I built:

which outputs:
=>
=>Test2
We build our code using the null-conditional operator to avoid having to build out the more common tertiary version of the same code:

Wednesday, November 7, 2018

Stop RHEL from hibernating when laptop lid closes

Quick hit here, I installed Red Hat Enterprise Linux 7 on a decent, but old laptop to let me play with OpenStack in a semi portable way.  The only issue is that I want to close the lid and leave it running and still be able to attach to it.  Close the lid, power savings kick in.  To stop that, just edit:
/etc/systemd/logind.conf
and change:
#HandleLidSwitch=suspend
to:
HandleLidSwitch=ignore