Posts

Steps to create and activate Python virtual environment

Some rough steps below pip install virtualenv virtualenv --version virtualenv my_project cd my_project/Scripts activate https://virtualenv.pypa.io/en/latest/reference/ virtualenv -p C:\Python27\python.exe mypython27 cd mypython27/Scripts activate deactivate

Format Excel MailMerge Date fields

MERGEFIELD  Form_Deadline  \@ dd-MMM-yyyy

Useful Raspbian commands

Check Raspbian version cat / etc / os - release

Google Chart - Add percentage to PieChart

https://stackoverflow.com/questions/19178029/want-to-show-percentage-data-in-legends-of-google-pie-chart 8 down vote accepted You can do this two ways; either set the formatted values of the labels in the DataTable to include the percents, eg: // assume sleep is row 4, "sleepPercent" is the percent for sleep data . setFormattedValue ( 4 , 0 , data . getValue ( 4 , 0 ) + ' (' + ( sleepPercent * 100 ). toFixed ( 1 ) + '%)' ); or you can set the  legend.position  option to "labeled", which changes the way the legend is drawn, but adds the percents to the labels: legend : { position : 'labeled' } see an example here:  http://jsfiddle.net/asgallant/Su6TX/

Sort a Google DataTable

https://stackoverflow.com/questions/23764280/sort-in-google-table-chart Sort your DataTable: // sort by column 0, descending data . sort ({ column : 0 , desc : true }); or use a sorted DataView: var view = new google . visualization . DataView ( data ); view . setRows ( data . getSortedRows ({ column : 0 , desc : true })); table . draw ( view , options );

Format a multi key-value MQTT message in Python

Here's the code to formulate a multi-attribute (multi key-value) MQTT message in Python mqtt_message = "{\"value\":\"" + str(light) + "\",\"serialNumber\":\"" + str(loopCount) + "\",\"sensorType\":\"light\"}"

Cloudera CDH

Hue https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.5/bk_command-line-installation/content/start_stop_restart_hue.html Install Docker Cloudera 5.13 https://gist.github.com/davideicardi/21aabb65faaa3c655770cf0ccbac6564