Showing posts with label Coding. Show all posts
Showing posts with label Coding. Show all posts

Sunday, November 10, 2019

How The ISE team at Stack Overflow does Python Linting


Some time back I wrote this short guide for our internal wiki at Stack.
I'm sharing it here for anyone with an interest in Python linting.
Our team generally subscribes to a modified version of pep8.
Reference: Google Standards for Python

Specifically:
  • We allow long lines up to 120 characters.
  • Classes should be CamelCase
  • Globals FULLY_CAPITALIZED
  • All other variables lower_snake_case
The following are recommended steps using Sublime Text linting with Anaconda.
  1. Install sublime text Package Control
    • From inside sublime text:
    • CTRL + SHIFT + P to open the package control menu 
  2. Install anaconda
    • if you already have it you may need to reinstall anaconda when done
  3. Install Sublime Text Package Resource Viewer 
  4. Update Anaconda Settings
    1. Go to preferences -> Package Settings -> Anaconda
    2. paste anaconda settings into the user settings file 
  5. Using Package resource viewer open your current color scheme 
    1. CTRL + Shift + P - then type color scheme 
    2. Select The Package Resource Viewer option for your color scheme.
    3. Add the color scheme JSON into the Rules section of your color scheme. 
    4. You'll need to do this any time you switch to another color scheme.
If everything worked out, your editor should now look something like this:
(Yellow dots indicate warnings, Red errors, blue spacing mistakes.)
An explanation of the error will appear in the bottom of the editor

Sunday, May 27, 2018

FizzBuzz in Go

I recently started poking around at Go again.
I like to prove I can write FizzBuzz in a new language (without looking up any language-specific syntax).

This is pretty straightforward - sometimes people go with a case statement, but I wasn't sure what kinds of comparisons were allowed in a Go switch.  It might be fun to see if I can perform an evaluation (i%5 ==0), or am limited to specific values (1,'a', false).

Friday, February 21, 2014

Better FizzBuzz

I was playing with PowerShell today - and writing another FizzBuzz.  I came across an example where the least common multiple of 3 and 5 (15) was used as a way to reduce the number of checks needed per pass.  Very cool!  Here's my powershell FizzBuzz using that.

Thursday, February 3, 2011

Google API

I've been looking for a method to programatically adjust users on our

Google Apps account here at school. This looks promising,

http://goo.gl/x5rRD

Theoretically, I can manage users, import mailboxes and perform other management tasks..

Tuesday, February 1, 2011

ML State

I came across this while reading another article today. It looks easy to follow, and pretty powerful.
https://www.mlstate.com/

JQuery - Decoded

For understanding Jquery, this site is extremely helpful..