Quickly Transform Text Values to Numbers in ArcGIS Pro with Python If statement

If you have a table with values of text that you want to change into numeric values to manipulate symbology, you can use the Python Code Block in the Calculate Field tool.

I want to add a column of numbers to correspond to these text descriptions

Non-detect -> 1
Low -> 1
Moderate -> 2
High -> 3
Very High -> 4

To do this, I’ll open the table in ArcGIS Pro, then click the Calculate button to open the Calculate Field Panel

In Calculate Field, chose the the table you want to edit, add a new field for your numbers “riskNumbers,” then make that a Long Integer field.

After the “=” add the code:

makeNumbers(!riskName!)

Then in the Code Block Section we’ll define our makeNumbers function:

def makeNumbers(risk):
    if risk == 'Non-detectable':
        return 0
    elif risk == 'Low':
        return 1
    elif risk == 'Moderate':
        return 2
    elif risk == 'High':
        return 3
    elif risk == 'Very High':
        return 4

Check your new RiskNumber column and spot check to make sure it worked.

Now you can go on to add gradient symbology to your data.

ArcGIS RemoteApp on mac from Windows Machine

Turns out you can use RemoteApp Tool to open a remote app on a windows machine on a mac. Here’s how I used it to run ArcGIS Pro to appear like it’s running on my mac.

Download RemoteApp Tool: http://www.kimknight.net/remoteapptool

Install it on your windows machine: (Even though it says it’s unsupported I installed it on a Windows 10 Pro machine)

  • Open RemoteApp Tool
  • Click +
  • Find whatever app you want (c:\program files\ArcGIS\bin\arcgispro.exe)
  • Create RDP File & Save to a shared drive on the mac.
  • In mac, open RDP file in Remote Desktop.

You may need to open the RDP file in a text editor to change the connection address.

Repair Corrupt RX100 Video Files

This method fixed my corrupt video from when my RX100Va’s battery died in the middle of recording an h264 mp4 video. 

I downloaded and tried repairing it with a variety of other free and paid software. This is the only one that worked for this particular file.

It requires a Windows machine with admin access.

https://tehnoblog.org/video-repair-guide-corrupted-mp4-avi-h264-file-fix/

2 Ways to Loop in After Effects

Big thanks to motionarray.com for explaining this:
https://motionarray.com/learn/after-effects/loop-video-animations-after-effects/

1. if your footage is the correct length, you can go to the projects panel right-click the element and select Interpret Footage > Main. in the dialogue box just select how many times you want to repeat it

2. Remapping Effect. Enable time remapping, option+click the stopwatch for time remap, Using the add Menu select Property > loopOutduration

If you need only a portion of your video looped… create a precomp of your footage, then use option 2 on your precomp. Just make sure the precomp is the right length to get the loop to match up correctly.

The loopOutduration command doesn’t seem to indicate where loops begin or end… But you want that on your first frame of the loop. ignore the other keyframes.

Google Sheets Tips

If you like me, really like using Google Sheets, you may find this list of tips on Fast Company helpful.

https://www.fastcompany.com/90334451/27-incredibly-useful-things-you-didnt-know-google-sheets-could-do

I especially liked the following:

13. Perform fast calculations in any number-oriented spreadsheet by highlighting a bunch of cells and then looking in the lower-right corner of the screen. By default, Sheets will show you the sum of the numbers you’ve selected. You can then click the box with that info and tell it to show the average, the minimum or maximum, or the total count of numbers involved–and once you make that change, your selection will stick and remain the new default for any future calculations you perform.

15. Tap into Google’s artificial intelligence and let Sheets perform different types of data analysis and create complex charts for you. Hover your mouse over the starburst-shaped icon in the lower-right corner of the screen, and you’ll see the word “Explore” appear. Click that button, and Sheets will pop up a panel of info related to your data. You can highlight specific rows in your spreadsheet to change its focus, and you can hover over any item it presents to find options for adjusting it or inserting it directly into your sheet.

24. Sheets has the capability to create QR codes that’ll pull up whatever URLs you want when they’re scanned. Type your URL into a cell (with “http://” or “https://” in front of it), then use the following function with your own cell number in place of “A2”:

=image(“https://chart.googleapis.com/chart?chs=150×150&cht=qr&chl=”&A2)

The QR code will instantly appear and be available to copy, share, or manipulate in any way your heart desires.

25. Here’s a handy little Sheets function for tracking trends across numerical data: Create a heat map to highlight highs and lows and make it easy to see things like sales or web-traffic success patterns. Select whatever range of data you want, then look for the “Conditional formatting” option within the Format menu. Click the “Color scale” tab at the top and assign a color to both “Min value” and “Max value.” The effect will work best if you use a light version of a color for the former and a dark version of the same color for the latter.

27. Ever find yourself scrolling through a list of responses in different languages? Sheets can identify any language used in a spreadsheet and even translate it into your own native tongue on the spot. To detect a language, use the following function (with the appropriate cell number in place of “A1”):

=DETECTLANGUAGE(A1)

You can also enter in a word in place of a cell number, if you want:

=DETECTLANGUAGE(“queso”)

Google will give you a two-letter code telling you the language that was used. To translate, meanwhile, use the following command–with your own word or cell number in place of “A1″ and the code for whatever language you want to translate into (if it’s anything other than English, as referenced below):

=GOOGLETRANSLATE(A1,”auto”,”en”)

Assez facile, non?

The full list:
https://www.fastcompany.com/90334451/27-incredibly-useful-things-you-didnt-know-google-sheets-could-do

Setting HTTPS and www in .htaccess

Find the .htaccess file in the folder where your index.html file is.

This will force anyone who visits your site to go to the HTTPS version of the site (Secure) and with the "www" subdomain. 

By default, many websites show duplicate content without a subdomain i.e. benbrenner.com and with the www subdomain (www.benbrenner.com)

In the last few years Google has begun penalizing sites that allow this because as they are crawling your site, they see duplicate pages.  For you to rank high in google, they want your information to be unique from the rest of the internet. 
# Canonical https/www
<IfModule mod_rewrite.c>
	RewriteCond %{HTTPS} off [OR]
	RewriteCond %{HTTP_HOST} !^www\. [NC]
	RewriteCond %{HTTP_HOST} ^(.*)$  [NC]
	RewriteRule (.*) https://www.%1/$1 [R=301,L]
</IfModule>

This tip comes from https://htaccessbook.com/htaccess-redirect-https-www/