<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Paul's Programming Notes</title>
 <link href="/atom.xml" rel="self"/>
 <link href="https://www.paulsprogrammingnotes.com/"/>
 <updated>2026-04-09T00:56:40+00:00</updated>
 <id>https://www.paulsprogrammingnotes.com</id>
 <author>
   <name>Paul Brown</name>
   <email></email>
 </author>

 
 <entry>
   <title>Macvlan private mode for container L2 isolation</title>
   <link href="https://www.paulsprogrammingnotes.com/2026/04/macvlan-private-mode.html"/>
   <updated>2026-04-08T23:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2026/04/macvlan-private-mode</id>
   <content type="html">&lt;p&gt;Macvlan is a Docker networking mode that gives each container its own MAC and IP on the network the host port is plugged into. The container shows up on the subnet as its own device, gets a DHCP lease from the router, and talks to the LAN directly instead of going through the Docker bridge.&lt;/p&gt;

&lt;p&gt;I have a box with multiple Ethernet ports, each port on a different VLAN. Some containers sit on the port assigned to a guest-style VLAN that can only reach the internet, not other hosts on the LAN. That worked fine in the default &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bridge&lt;/code&gt; macvlan mode while each port only had one service on it. Once I added more services to the same port, I hit a problem I hadn’t thought about: containers sharing a macvlan parent in bridge mode can freely ARP and talk to each other inside the kernel, which defeats the VLAN-level isolation.&lt;/p&gt;

&lt;p&gt;Macvlan has a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;private&lt;/code&gt; mode for exactly this. The kernel drops frames going between siblings on the same parent. Outbound traffic via the gateway still works. No switch cooperation, no extra VLANs.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker network create &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; macvlan &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--subnet&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;192.0.2.0/24 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--gateway&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;192.0.2.1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;eth0 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;macvlan_mode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;private &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  guest_private
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Attach a container to it with a static IP:&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;guest_private&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;ipv4_address&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;192.0.2.16&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;guest_private&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;external&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;One caveat: the host itself can’t reach its own containers over that interface. That’s true for any macvlan setup, not specific to private mode. For my case it’s fine since the containers just need internet access and to be reachable from other subnets through the router.&lt;/p&gt;

&lt;p&gt;More on the kernel feature underneath: &lt;a href=&quot;https://docs.kernel.org/networking/macvlan.html&quot;&gt;Linux kernel macvlan docs&lt;/a&gt;. Docker’s guide: &lt;a href=&quot;https://docs.docker.com/network/drivers/macvlan/&quot;&gt;Docker macvlan driver&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Python - Inline Script Dependencies With PEP 723</title>
   <link href="https://www.paulsprogrammingnotes.com/2026/03/pep-723-inline-script-metadata.html"/>
   <updated>2026-03-28T18:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2026/03/pep-723-inline-script-metadata</id>
   <content type="html">&lt;p&gt;Distributing one-off Python scripts has gotten a lot better recently. &lt;a href=&quot;https://peps.python.org/pep-0723/&quot;&gt;PEP 723&lt;/a&gt; added a standard way to declare dependencies and a minimum Python version inside a single &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.py&lt;/code&gt; file, and &lt;a href=&quot;https://docs.astral.sh/uv/&quot;&gt;uv&lt;/a&gt; makes running them painless. I used this to share a script with the team and it just worked across everyone’s machines.&lt;/p&gt;

&lt;p&gt;Before this, you’d end up writing some wrapper shell script that creates a virtualenv, makes sure the right Python version is being used, installs the dependencies, and tries to keep everything in sync. Brew-installed Python was especially bad for this because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;brew upgrade&lt;/code&gt; can &lt;a href=&quot;https://github.com/Homebrew/homebrew-core/issues/140227&quot;&gt;silently swap your Python version and break every virtualenv pointing at it&lt;/a&gt;. Even version managers like asdf or pyenv don’t really help because the recipient still needs the right version installed through their manager. A lot of ceremony for a single file.&lt;/p&gt;

&lt;p&gt;PEP 723 lets you declare all of that inline:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# /// script
# requires-python = &quot;&amp;gt;=3.12&quot;
# dependencies = [
#     &quot;requests&quot;,
# ]
# ///
&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;requests&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;resp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;requests&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;https://example.com/api/health&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;timeout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;resp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;# /// script&lt;/code&gt; block is TOML. You don’t have to write it by hand either, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;uv add --script example.py &apos;requests&apos;&lt;/code&gt; will add it for you.&lt;/p&gt;

&lt;p&gt;The recipient just needs uv installed:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;uv run check_status.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;uv reads the inline metadata and installs the dependencies in an isolated environment. If the required Python version isn’t on their machine, &lt;a href=&quot;https://docs.astral.sh/uv/guides/install-python/&quot;&gt;uv downloads it automatically&lt;/a&gt;. No virtualenv, no version manager, no wrapper script.&lt;/p&gt;

&lt;p&gt;You can also lock dependencies with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;uv lock --script example.py&lt;/code&gt; for reproducible runs. For bigger tools that span multiple files, &lt;a href=&quot;https://docs.astral.sh/uv/guides/tools/&quot;&gt;uv tool install&lt;/a&gt; is the next step up and can install from a private PyPI index.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Switching Open WebUI from Ollama to llama.cpp for Qwen 3.5</title>
   <link href="https://www.paulsprogrammingnotes.com/2026/03/llama-cpp-over-ollama-for-local-llm.html"/>
   <updated>2026-03-22T18:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2026/03/llama-cpp-over-ollama-for-local-llm</id>
   <content type="html">&lt;p&gt;I finally got to a local LLM setup that feels pretty usable within a 16 GB VRAM constraint (around 40 tok/s).&lt;/p&gt;

&lt;p&gt;As far as I can tell, Open WebUI is still the best open source chat interface for local models. I am running it on a Ryzen 5 5600 box with an RTX 5060 Ti 16 GB card, with Qwen3.5-9B GGUF at Q8_0 as the main local model. I started with Ollama because it is the popular default. For Qwen 3.5 though, I hit a few open issues at the time that made llama.cpp easier for my setup: &lt;a href=&quot;https://github.com/ollama/ollama/issues/14579&quot;&gt;much slower inference than llama.cpp with the same model&lt;/a&gt;, &lt;a href=&quot;https://github.com/ollama/ollama/issues/14662&quot;&gt;long stalls on later turns in a conversation&lt;/a&gt;, and &lt;a href=&quot;https://github.com/ollama/ollama/issues/14617&quot;&gt;broken &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/no_think&lt;/code&gt; handling for Qwen&lt;/a&gt;. It is a very new model, and I am sure the Ollama project will get those fixed.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;llama-server&lt;/code&gt; exposes an OpenAI-compatible API, so Open WebUI mostly treated it like a config swap.&lt;/p&gt;

&lt;p&gt;The more interesting part is that Qwen 3.5’s newer hybrid architecture seems to help a lot here. The 9B model feels much better than I would have expected for the size, and this is the first local setup I have had on this machine that felt worth keeping around.&lt;/p&gt;

&lt;p&gt;From what I had been reading, thinking mode also did not seem worth the wait for a setup like this, and that matched what I was seeing. Qwen 3.5 defaults to thinking, but for my use it was usually slower, often added 30-60 seconds, and sometimes got stuck in long thinking loops without noticeably improving the answer. What finally worked reliably here was a newer llama.cpp build with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LLAMA_ARG_JINJA=1&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LLAMA_ARG_THINK_BUDGET=0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Most of the other tuning was about using the remaining VRAM well once the 9B model itself had already taken roughly 9 GB. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LLAMA_ARG_N_PARALLEL=1&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LLAMA_ARG_FLASH_ATTN=1&lt;/code&gt;, q8_0 KV cache, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LLAMA_ARG_BATCH_SIZE=4096&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LLAMA_ARG_UBATCH_SIZE=1024&lt;/code&gt; were what got the whole setup to around 14 GB and let me spend the rest on context instead of spilling into system memory. The next size up looked much more likely to spill into RAM. I wanted to see what I could get done with this Nvidia card first, since it still seemed like the safest compatibility bet.&lt;/p&gt;

&lt;p&gt;For serious work I would still use frontier hosted models. The local setup is useful enough to keep around for narrower cases, especially redacting or cleaning text before sending it to a cloud model.&lt;/p&gt;

&lt;p&gt;Full example gist with the commented minimal two-container compose file:&lt;/p&gt;
&lt;noscript&gt;&lt;pre&gt;services:
  llama-server:
    image: ghcr.io/ggml-org/llama.cpp:server-cuda-b8369
    container_name: llama-server
    restart: unless-stopped
    environment:
      # Model - auto-downloads from Hugging Face on first run.
      - LLAMA_ARG_HF_REPO=unsloth/Qwen3.5-9B-GGUF:Q8_0
      - LLAMA_ARG_N_GPU_LAYERS=99

      # VRAM tuning for a 16 GB card.
      - LLAMA_ARG_CTX_SIZE=131072
      - LLAMA_ARG_N_PARALLEL=1
      - LLAMA_ARG_FLASH_ATTN=1
      - LLAMA_ARG_CACHE_TYPE_K=q8_0
      - LLAMA_ARG_CACHE_TYPE_V=q8_0
      - LLAMA_ARG_BATCH_SIZE=4096
      - LLAMA_ARG_UBATCH_SIZE=1024

      # Qwen 3.5 non-thinking mode.
      - LLAMA_ARG_JINJA=1
      - LLAMA_ARG_THINK_BUDGET=0

      # Qwen-recommended sampling defaults for non-thinking mode.
      - LLAMA_ARG_TEMP=0.6
      - LLAMA_ARG_TOP_K=20
      - LLAMA_ARG_TOP_P=0.95
      - LLAMA_ARG_MIN_P=0

      # Shared gaming PC - unload after 5 minutes idle.
      - LLAMA_ARG_SLEEP_IDLE_SECONDS=300
      - LLAMA_ARG_PORT=11434
      - LLAMA_ARG_HOST=0.0.0.0
    volumes:
      - ./models:/root/.cache/llama.cpp
    ports:
      - &amp;quot;11434:11434&amp;quot;
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

  open-webui:
    image: ghcr.io/open-webui/open-webui:v0.8.9
    container_name: open-webui
    restart: unless-stopped
    ports:
      - &amp;quot;3000:8080&amp;quot;
    volumes:
      - ./open-webui:/app/backend/data
    environment:
      - ENABLE_OLLAMA_API=false
      # llama-server exposes an OpenAI-compatible API.
      - OPENAI_API_BASE_URLS=http://llama-server:11434/v1
      - OPENAI_API_KEYS=no-key
      - WEBUI_AUTH=true
    depends_on:
      - llama-server&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/60694e3d32c8ec2ee9263afdbe097b87.js?file=docker-compose.yaml&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Kubernetes - Fixing GitOps Drift in Metrics Server</title>
   <link href="https://www.paulsprogrammingnotes.com/2025/10/metrics-server-gitops-drift.html"/>
   <updated>2025-10-15T18:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2025/10/metrics-server-gitops-drift</id>
   <content type="html">&lt;p&gt;I recently got a small fix merged into &lt;a href=&quot;https://github.com/kubernetes-sigs/metrics-server&quot;&gt;metrics-server&lt;/a&gt;, which powers &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kubectl top&lt;/code&gt; and is used for horizontal pod autoscaling in Kubernetes. It’s not exactly a core component, but most production clusters have it installed.&lt;/p&gt;

&lt;p&gt;I’ve been using ArgoCD at work lately for deploying Helm charts through a GitOps flow, and I noticed that the metrics-server APIService resource kept showing as “OutOfSync” even though nothing had actually changed.&lt;/p&gt;

&lt;p&gt;The issue was that the Helm template always rendered the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;insecureSkipTLSVerify&lt;/code&gt; field explicitly, but Kubernetes omits it from live resources when it’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;false&lt;/code&gt; (the API default). This caused ArgoCD to see a constant diff.&lt;/p&gt;

&lt;p&gt;The fix was to conditionally render the field using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;{{- with .Values.apiService.insecureSkipTLSVerify }}&lt;/code&gt; so it only appears when set to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;true&lt;/code&gt;. Same approach other projects like KEDA have used.&lt;/p&gt;

&lt;p&gt;It’s a tiny fix, but it’s satisfying to have a change merged into something as widely deployed as metrics-server.&lt;/p&gt;

&lt;p&gt;PR: &lt;a href=&quot;https://github.com/kubernetes-sigs/metrics-server/pull/1727&quot;&gt;kubernetes-sigs/metrics-server#1727&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Building a Lightweight Linux Torrent Seeder for Low-End VPS Hosting</title>
   <link href="https://www.paulsprogrammingnotes.com/2025/10/lightweight-linux-torrent-seeder.html"/>
   <updated>2025-10-15T18:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2025/10/lightweight-linux-torrent-seeder</id>
   <content type="html">&lt;p&gt;Earlier this year, I wanted to help seed Linux distribution torrents using cheap VPS servers that offer terabytes of monthly bandwidth for less than $20/year. To maximize cost efficiency, I needed something as memory-efficient as possible.&lt;/p&gt;

&lt;p&gt;After trying qBittorrent, rTorrent, and Transmission (via Docker) on a 1GB RAM VPS, I kept running into OOM issues and configuration headaches. Those clients are great, but running them in 1GB RAM doesn’t seem to be a design goal. It’s probably still possible with enough tweaking.&lt;/p&gt;

&lt;p&gt;I ended up building &lt;a href=&quot;https://github.com/pawl/distro-seed&quot;&gt;distro-seed&lt;/a&gt;, a lightweight Go-based BitTorrent seeder using &lt;a href=&quot;https://github.com/anacrolix/torrent&quot;&gt;anacrolix/torrent&lt;/a&gt;. It’s a Go library that handles all the BitTorrent protocol details while letting you build exactly what you need without the overhead of a full client.&lt;/p&gt;

&lt;p&gt;So far, it’s seeded &lt;strong&gt;1.25 TB&lt;/strong&gt; of Linux distributions.&lt;/p&gt;

&lt;p&gt;The project includes an Ansible playbook to set up a fresh Ubuntu VPS for automatic seeding. The whole setup is simple: configure your torrent sources in a YAML file, run the playbook, and let it seed.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href=&quot;https://github.com/pawl/distro-seed&quot;&gt;pawl/distro-seed&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Linux - Forgetting Exec</title>
   <link href="https://www.paulsprogrammingnotes.com/2022/08/forgetting-exec.html"/>
   <updated>2022-08-25T18:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2022/08/forgetting-exec</id>
   <content type="html">&lt;p&gt;Today, I came across a bug where a &lt;a href=&quot;https://github.com/celery/celery&quot;&gt;Celery&lt;/a&gt; worker wasn’t gracefully shutting down, and it was causing some &lt;a href=&quot;https://github.com/kubernetes/kubernetes/issues/105703&quot;&gt;odd “Connection Refused”&lt;/a&gt; errors from requests within the task being run by the worker. It was also shutting down before it could send errors to Rollbar/Sentry for the team to know they need to address it.&lt;/p&gt;

&lt;p&gt;This was happening because the entrypoint had a script that effectively did this:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;echo &quot;starting celery worker&quot;
celery -A tasks worker
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem with that entrypoint: it’s not using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exec&lt;/code&gt; to run the child process. Without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exec&lt;/code&gt;, it will &lt;a href=&quot;https://unix.stackexchange.com/a/196053&quot;&gt;not forward signals like SIGTERM to the process the entrypoint is waiting on&lt;/a&gt;. The Celery worker child process won’t know it needs to shut down gracefully if the SIGTERM is not forwarded to it.&lt;/p&gt;

&lt;p&gt;The fixed example would look like this:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;echo &quot;starting celery worker&quot;
exec celery -A tasks worker
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Linux - Dig&apos;s +short Option</title>
   <link href="https://www.paulsprogrammingnotes.com/2022/07/dig-short-option.html"/>
   <updated>2022-07-19T18:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2022/07/dig-short-option</id>
   <content type="html">&lt;p&gt;I learned Linux’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dig&lt;/code&gt; has a “+short” option that returns &lt;strong&gt;only&lt;/strong&gt; the IP address for a hostname:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ dig +short google.com
142.251.32.174
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Linux - Ping Not Showing Lost Packets</title>
   <link href="https://www.paulsprogrammingnotes.com/2022/06/ping-not-showing-loss.html"/>
   <updated>2022-06-02T18:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2022/06/ping-not-showing-loss</id>
   <content type="html">&lt;p&gt;I was recently troubleshooting some packet loss with ping on linux, and I noticed by default ping won’t explicitly show lost packets:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ping x.x.x.x
64 bytes from x.x.x.x: icmp_seq=8 ttl=52 time=18.1 ms
64 bytes from x.x.x.x: icmp_seq=11 ttl=52 time=21.2 ms
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;(notice the skipped 8-10, those were lost packets)&lt;/p&gt;

&lt;p&gt;To fix this, you can add run ping with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-O&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ping -O x.x.x.x
64 bytes from x.x.x.x: icmp_seq=11 ttl=52 time=19.0 ms
no answer yet for icmp_seq=12
no answer yet for icmp_seq=13
64 bytes from x.x.x.x: icmp_seq=14 ttl=52 time=18.9 ms
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://askubuntu.com/a/838793&quot;&gt;Related askubuntu.com Thread&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Linux - Improving Traceroute Output</title>
   <link href="https://www.paulsprogrammingnotes.com/2022/06/improving-traceroute.html"/>
   <updated>2022-06-02T18:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2022/06/improving-traceroute</id>
   <content type="html">&lt;p&gt;Usually when I use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;traceroute&lt;/code&gt; without any options, it gets stuck showing output like this:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; 14   *  *  * 
 15   *  *  * 
 16   *  *  * 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For more info about why this is happening: &lt;a href=&quot;https://webmasters.stackexchange.com/a/30957&quot;&gt;Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To improve this output, try adding &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-I&lt;/code&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;traceroute -I&lt;/code&gt;) to make it use ICMP ECHO instead of UDP for probes.&lt;/p&gt;

&lt;p&gt;If you want better statistics about packet loss, you can also use a tool called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mtr&lt;/code&gt; which combines traceroute and ping. If you’re on Ubuntu, you can install this with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get install mtr&lt;/code&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Docker - WORKDIR Creates Directories</title>
   <link href="https://www.paulsprogrammingnotes.com/2022/04/docker-workdir.html"/>
   <updated>2022-04-01T18:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2022/04/docker-workdir</id>
   <content type="html">&lt;p&gt;Which user do you think owns the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;src/&lt;/code&gt; directory in this Dockerfile example?:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;FROM alpine:3.13.2
RUN adduser -D wendy
USER wendy
WORKDIR src/
COPY --chown=wendy . src/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The answer?: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;root&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This happens because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;WORKDIR&lt;/code&gt; will create directories that don’t exist with the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;root&lt;/code&gt; user.&lt;/p&gt;

&lt;p&gt;What if you wanted &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;wendy&lt;/code&gt; to be the owner of that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;src/&lt;/code&gt; directory?&lt;/p&gt;

&lt;p&gt;You would need to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;COPY&lt;/code&gt; the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;src/&lt;/code&gt; directory into place before setting it as the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;WORKDIR&lt;/code&gt;. For example:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;FROM alpine:3.13.2
RUN adduser -D wendy
USER wendy
COPY --chown=wendy . src/
WORKDIR src/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;More info: &lt;a href=&quot;https://github.com/moby/moby/issues/20295&quot;&gt;Closed GitHub Issue&lt;/a&gt; &amp;amp; &lt;a href=&quot;https://github.com/moby/moby/blob/16009830c2e2f3840ee73459918289f4bf54bd1d/container/container.go#L277&quot;&gt;Docker Code&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>DIY NAS</title>
   <link href="https://www.paulsprogrammingnotes.com/2022/03/DIY-NAS.html"/>
   <updated>2022-03-13T18:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2022/03/DIY-NAS</id>
   <content type="html">&lt;p&gt;If you have an old computer with spare hard drives, it might be useful to use it to share files with computers on your network by turning it into a NAS (network attached storage). There are several popular DIY NAS options:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.unraid.net/&quot;&gt;Unraid&lt;/a&gt; - Paid, Slackware linux based&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.truenas.com/freenas/&quot;&gt;FreeNAS (now TrueNAS Core)&lt;/a&gt; - FreeBSD based&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/openmediavault/openmediavault&quot;&gt;OpenMediaVault&lt;/a&gt; - Debian linux based&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I ended up going with &lt;a href=&quot;https://github.com/openmediavault/openmediavault&quot;&gt;OpenMediaVault&lt;/a&gt; due to it being Debian based and super popular. To set it up, I followed this incredibly thorough guide: &lt;a href=&quot;https://michaelxander.com/diy-nas/&quot;&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I had a few issues that caused it to stop working after restarting.&lt;/p&gt;

&lt;p&gt;The first issue was related to the disk being encrypted. OpenMediaVault started in emergency mode due to being unable to access the encrypted disk. Emergency mode unfortunately doesn’t allow SSH access, which means you need to plug a monitor and keyboard into it. You have to make sure you have &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nofail&lt;/code&gt; in the options section of the lines of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/fstab&lt;/code&gt; starting with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/disk&lt;/code&gt;. You also need to add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nonempty&lt;/code&gt; and remove &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;x-systemd.requires=&amp;lt;disk&amp;gt;&lt;/code&gt; from the options section of the lines starting with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/srv/dev-disk-by-uuid&lt;/code&gt; (for mergerfs). I’ve had to redo the removing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;x-systemd.requires&lt;/code&gt; part every time I apply settings from the web UI. More information about this:  &lt;a href=&quot;https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-unionfilesystems/issues/36&quot;&gt;1&lt;/a&gt; &lt;a href=&quot;https://www.bananatronics.org/openmediavault-issues/&quot;&gt;2&lt;/a&gt; &lt;a href=&quot;https://forum.openmediavault.org/index.php?thread/6851-unionfilesystem-plugin/&amp;amp;postID=98406#post98406&quot;&gt;3&lt;/a&gt; &lt;a href=&quot;https://github.com/openmediavault/openmediavault/issues/850#issuecomment-752193645&quot;&gt;4&lt;/a&gt; &lt;a href=&quot;https://forum.openmediavault.org/index.php?thread/37268-omv5-not-surviving-first-reboot/&amp;amp;postID=277434#post277434&quot;&gt;5&lt;/a&gt; &lt;a href=&quot;https://forum.openmediavault.org/index.php?thread/32870-oops-can-t-boot-after-unionfs-changes/&amp;amp;postID=241306#post241306&quot;&gt;6&lt;/a&gt; &lt;a href=&quot;https://forum.openmediavault.org/index.php?thread/30129-problem-booting-up-with-luks-and-unionfilesystem/&amp;amp;pageNo=2&quot;&gt;7&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The second issue involved losing network adapter configuration after restarting. I had to run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;omv-firstaid&lt;/code&gt; and configure the network adapter with a static IP to resolve this. This may have something to do with an empty configuration from the web UI ovewriting the existing working configuration.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Docker - ufw rules ignored</title>
   <link href="https://www.paulsprogrammingnotes.com/2022/01/docker-ignores-ufw.html"/>
   <updated>2022-01-01T18:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2022/01/docker-ignores-ufw</id>
   <content type="html">&lt;p&gt;I recently learned that docker will ignore ufw (uncomplicated firewall) rules by default. This means that it will still expose ports that are blocked by ufw.&lt;/p&gt;

&lt;p&gt;The fix involved adding this to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/docker/daemon.json&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;{
    &quot;iptables&quot;: false,
    &quot;ip6tables&quot;: false
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then I restarted the docker daemon with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo systemctl restart docker&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/moby/moby/issues/9889#issuecomment-849165540&quot;&gt;More details&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Raspberry Pi Zero Not Connecting to Unifi AP</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/12/raspberry-pi-zero-not-connecting-unifi-wifi.html"/>
   <updated>2021-12-27T18:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/12/raspberry-pi-zero-not-connecting-unifi-wifi</id>
   <content type="html">&lt;p&gt;I recently had a lot of trouble getting my Raspberry Pi Zero W 2 to connect to WiFi on my Ubiquiti Unifi AP AC Lite after a firmware upgrade to 5.43.46. It’s a 2.4Ghz-only device, and actually all of my 2.4Ghz-only devices wouldn’t connect.&lt;/p&gt;

&lt;p&gt;Apparently something I did set a setting called PMF (Protected Management Frames) to “Required”, and the Pi Zero W 2 &lt;a href=&quot;https://forums.raspberrypi.com/viewtopic.php?t=293617&quot;&gt;doesn’t support that&lt;/a&gt;. In theory, this setting should help prevent clients from getting disconnected through de-auth packets from an attacker. However, not all devices support this.&lt;/p&gt;

&lt;p&gt;To fix the issue, you need to find the PMF setting under Settings -&amp;gt; Wifi -&amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;your network&amp;gt;&lt;/code&gt; -&amp;gt; Advanced -&amp;gt; Security and change it to “Optional”.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Fixing Memory Leaks In Popular Python Libraries</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/12/python-memory-leaks.html"/>
   <updated>2021-12-20T02:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/12/python-memory-leaks</id>
   <content type="html">&lt;p&gt;I was recently able to make a &lt;a href=&quot;https://github.com/celery/celery/issues/4843#issuecomment-988492732&quot;&gt;minimal example&lt;/a&gt; that reproduced a Celery memory leak. The memory leak would happen on the main Celery worker process that’s forked to make child processes, which makes the leak especially bad. Issue &lt;a href=&quot;https://github.com/celery/celery/issues/4843&quot;&gt;#4843&lt;/a&gt; has been around for 3+ years and has 140+ comments, so this one has been causing a lot of problems for Celery users for a while.&lt;/p&gt;

&lt;p&gt;The memory leak has been causing a lot of issues at my work too, and I was able to get some help resolving the issue during a work hackathon. My coworker Michael Lazar was able to find &lt;a href=&quot;https://github.com/celery/celery/issues/4843#issuecomment-991394349&quot;&gt;the root cause&lt;/a&gt; of the issue and make a &lt;a href=&quot;https://github.com/celery/py-amqp/pull/374&quot;&gt;pull request&lt;/a&gt; to fix it in py-amqp (a celery dependency when using RabbitMQ as a broker). The code with the issue was &lt;a href=&quot;https://github.com/celery/py-amqp/blame/v5.0.5/amqp/connection.py#L469&quot;&gt;10 years old&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Here’s what the bug looks like:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;try:
    sock.shutdown(socket.SHUT_RDWR)
    sock.close()
except OSError:
    pass
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem occurs when &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;socket.shutdown&lt;/code&gt; fails on an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;OSError&lt;/code&gt; and doesn’t proceed to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;socket.close&lt;/code&gt; to clean up the socket and allow garbage collection to release the memory used for it. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;OSError&lt;/code&gt; on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;shutdown&lt;/code&gt; can occur when the remote side of the connection closes the connection first.&lt;/p&gt;

&lt;p&gt;The fixed example (with separate &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;try&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;except&lt;/code&gt; blocks):&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;try:
    sock.shutdown(socket.SHUT_RDWR)
except OSError:
    pass

try:
    sock.close()
except OSError:
    pass
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I was able to make the same fix to a few other popular Python libraries too:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/redis/redis-py/pull/1797&quot;&gt;redis-py&lt;/a&gt; (&lt;a href=&quot;https://github.com/redis/redis-py/blame/v4.0.2/redis/connection.py#L682&quot;&gt;11 year old code!&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/Thriftpy/thriftpy2/pull/183&quot;&gt;thriftpy2&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/kovidgoyal/calibre/pull/1552&quot;&gt;calibre&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also found another way to reduce memory usage of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Connection&lt;/code&gt;s in &lt;a href=&quot;https://github.com/celery/py-amqp/pull/377&quot;&gt;py-amqp&lt;/a&gt; and &lt;a href=&quot;https://github.com/celery/librabbitmq/pull/160&quot;&gt;librabbitmq&lt;/a&gt; by changing how active channel IDs are stored.&lt;/p&gt;

&lt;p&gt;Update 12/20: Hacker News user &lt;a href=&quot;https://news.ycombinator.com/item?id=29626897&quot;&gt;js2 pointed out&lt;/a&gt; that Python will &lt;a href=&quot;https://docs.python.org/3/howto/sockets.html#disconnecting&quot;&gt;automatically&lt;/a&gt; close the socket when all the references to the socket are gone.&lt;/p&gt;

&lt;p&gt;Update 12/23: I got a &lt;a href=&quot;https://github.com/celery/kombu/pull/1470&quot;&gt;pull request&lt;/a&gt; merged into Kombu with the same memory usage reduction fix I made to &lt;a href=&quot;https://github.com/celery/py-amqp/pull/377&quot;&gt;py-amqp&lt;/a&gt; and &lt;a href=&quot;https://github.com/celery/librabbitmq/pull/160&quot;&gt;librabbitmq&lt;/a&gt;. I also opened another &lt;a href=&quot;https://github.com/celery/kombu/pull/1476&quot;&gt;pull request&lt;/a&gt; to Kombu that should fix a &lt;a href=&quot;https://github.com/celery/celery/issues/4843#issuecomment-999168967&quot;&gt;memory leak issue&lt;/a&gt; when using Celery with Redis.&lt;/p&gt;

&lt;p&gt;Update 12/25: I wrote a section for the Celery docs about &lt;a href=&quot;https://github.com/celery/celery/pull/7186&quot;&gt;optimizing memory usage&lt;/a&gt;. I also fixed &lt;a href=&quot;https://github.com/celery/celery/pull/7187&quot;&gt;another leak&lt;/a&gt; in Celery that happens when connection errors occur on a prefork worker.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Fn Key At The Software Level</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/12/fn-key.html"/>
   <updated>2021-12-04T02:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/12/fn-key</id>
   <content type="html">&lt;p&gt;I was trying to remap the “Fn” key on my keyboard and learned something interesting: The “Fn” key is not a real key at the software level.&lt;/p&gt;

&lt;p&gt;However, you can remap combinations of “Fn” + other keys.&lt;/p&gt;

&lt;p&gt;More details: &lt;a href=&quot;https://askubuntu.com/a/827953&quot;&gt;https://askubuntu.com/a/827953&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Firefox - arkenfox user.js</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/12/arkenfox.html"/>
   <updated>2021-12-04T02:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/12/arkenfox</id>
   <content type="html">&lt;p&gt;I recently learned about the &lt;a href=&quot;https://github.com/arkenfox/user.js&quot;&gt;arkenfox user.js project&lt;/a&gt;, which is an easy way to update Firefox’s settings to improve security and privacy.&lt;/p&gt;

&lt;p&gt;It suggests you add your own overrides to the bottom of the file. I added these:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/* re-enable location bar using search ***/
user_pref(&quot;keyword.enabled&quot;, true); 

/* override recipe: enable session restore ***/
user_pref(&quot;browser.startup.page&quot;, 3); // 0102
user_pref(&quot;browser.privatebrowsing.autostart&quot;, false); // 0110 required if you had it set as true
user_pref(&quot;places.history.enabled&quot;, true); // 0862 required if you had it set as false
user_pref(&quot;browser.sessionstore.privacy_level&quot;, 0); // 1003 optional [to restore cookies/formdata]
user_pref(&quot;network.cookie.lifetimePolicy&quot;, 0); // 2801  optional [so cookies persist]
user_pref(&quot;privacy.clearOnShutdown.history&quot;, false); // 2811
user_pref(&quot;privacy.cpd.history&quot;, false); // 2812 to match when you use Ctrl-Shift-Del
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Comparing Tags On Different Branches With GitHub</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/11/comparing-github-tags.html"/>
   <updated>2021-11-23T02:12:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/11/comparing-github-tags</id>
   <content type="html">&lt;p&gt;I recently compared two tags on github using the “compare” dropdown, and it displayed unexpectedly few changes between the tags. However, one of the tags was from a different branch and by default GitHub doesn’t show the other differences between the branches. To see other differences besides the tagged commit compared to the main/master branch, you need to change the “…” in the compare url to “..”.&lt;/p&gt;

&lt;p&gt;Now, I’m thinking it’s probably a good idea to avoid making tags from non-master/main branches.&lt;/p&gt;

&lt;p&gt;More info: &lt;a href=&quot;https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-comparing-branches-in-pull-requests#three-dot-and-two-dot-git-diff-comparisons&quot;&gt;GitHub Docs&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Air Quality Monitor</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/11/air-quality-monitor.html"/>
   <updated>2021-11-23T02:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/11/air-quality-monitor</id>
   <content type="html">&lt;p&gt;I build the air quality monitor from &lt;a href=&quot;https://www.jeffgeerling.com/blog/2021/airgradient-diy-air-quality-monitor-co2-pm25&quot;&gt;Jeff Geerling’s post&lt;/a&gt;:
&lt;img src=&quot;/generated/assets/images/air_quality_monitor_1-800-12084f20d.jpg&quot; srcset=&quot;/generated/assets/images/air_quality_monitor_1-400-12084f20d.jpg 400w, /generated/assets/images/air_quality_monitor_1-600-12084f20d.jpg 600w, /generated/assets/images/air_quality_monitor_1-800-12084f20d.jpg 800w, /generated/assets/images/air_quality_monitor_1-960-12084f20d.jpg 960w&quot; /&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Python - Singleton</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/09/singleton.html"/>
   <updated>2021-09-21T06:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/09/singleton</id>
   <content type="html">&lt;p&gt;I saw some interesting Python singleton code in the wild today. It was used for a Redis connection pool.&lt;/p&gt;

&lt;p&gt;It looked like &lt;a href=&quot;https://stackoverflow.com/q/53848389&quot;&gt;this&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Starting To Learn About GraphQL</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/08/graphql.html"/>
   <updated>2021-08-19T06:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/08/graphql</id>
   <content type="html">&lt;p&gt;I’ve started learning about GraphQL.&lt;/p&gt;

&lt;p&gt;The best summary I’ve seen so far is the &lt;a href=&quot;https://docs.graphene-python.org/en/latest/quickstart/&quot;&gt;graphene-python “Getting Started” guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This &lt;a href=&quot;https://medium.com/joor-engineering/graphql-on-django-at-joor-f31dc3251482&quot;&gt;post&lt;/a&gt; also talks about the &lt;a href=&quot;https://docs.graphene-python.org/en/latest/execution/dataloader/&quot;&gt;dataloader&lt;/a&gt; pattern to helps solve n+1 query issues.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.apollographql.com/blog/tooling/apollo-codegen/typescript-graphql-code-generator-generate-graphql-types/&quot;&gt;Apollo Codegen&lt;/a&gt; also looks like a good way to share GraphQL types with the front-end.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Celery - Tuning worker_prefetch_multiplier</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/08/celery-tasks.html"/>
   <updated>2021-08-19T06:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/08/celery-tasks</id>
   <content type="html">&lt;p&gt;I came across an interesting article that talks about speeding up the processing of fast running celery tasks by tuning worker_prefetch_multiplier: &lt;a href=&quot;https://www.lorenzogil.com/blog/2020/03/01/celery-tasks/&quot;&gt;https://www.lorenzogil.com/blog/2020/03/01/celery-tasks/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The default scheduling strategy in Celery is &lt;a href=&quot;https://docs.celeryproject.org/en/3.0/whatsnew-4.0.html#ofair-is-now-the-default-scheduling-strategy&quot;&gt;now “fair”&lt;/a&gt;, so part of the article doesn’t apply anymore.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Raspberry Pi Imager - Secret Menu</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/07/raspberry-pi-imager.html"/>
   <updated>2021-07-23T06:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/07/raspberry-pi-imager</id>
   <content type="html">&lt;p&gt;The v1.6 update for the Raspberry Pi Imager added a new shortcut (CTRL + Shift + X) that allows enabling SSH, configuring WiFi, setting hostname, and more.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.raspberrypi.org/blog/raspberry-pi-imager-update-to-v1-6/&quot;&gt;More Info&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>I&apos;m on Hackaday!</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/07/on-hackaday.html"/>
   <updated>2021-07-23T06:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/07/on-hackaday</id>
   <content type="html">&lt;p&gt;Hackaday posted an &lt;a href=&quot;https://hackaday.com/2021/07/21/raspberry-pi-server-cluster-in-1u-rack-mount-case/&quot;&gt;article&lt;/a&gt; about my &lt;a href=&quot;https://github.com/pawl/raspberry-pi-1u-server&quot;&gt;Raspberry Pi 1U Server&lt;/a&gt; project.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>ssh-keygen -R hostname</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/07/ssh-keygen-r.html"/>
   <updated>2021-07-12T00:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/07/ssh-keygen-r</id>
   <content type="html">&lt;p&gt;I’ve been manually removing the line from .known_hosts when I saw this message:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:&amp;lt;key&amp;gt;.
Please contact your system administrator.
Add correct host key in /Users/&amp;lt;user&amp;gt;/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/&amp;lt;user&amp;gt;/.ssh/known_hosts:85
ECDSA host key for &amp;lt;ip&amp;gt; has changed and you have requested strict checking.
Host key verification failed.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Today I found out about this command to remove entries from known_hosts: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ssh-keygen -R hostname&lt;/code&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Raspberry Pi 1U Server</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/06/raspberry-pi-1u-server.html"/>
   <updated>2021-06-24T02:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/06/raspberry-pi-1u-server</id>
   <content type="html">&lt;p&gt;I’ve been working on a power efficient 1U server made with Raspberry Pi’s to take advantage of cheap server colocation options:
&lt;img src=&quot;/generated/assets/images/pi_finished_1-800-882761c27.jpg&quot; srcset=&quot;/generated/assets/images/pi_finished_1-400-882761c27.jpg 400w, /generated/assets/images/pi_finished_1-600-882761c27.jpg 600w, /generated/assets/images/pi_finished_1-800-882761c27.jpg 800w, /generated/assets/images/pi_finished_1-1000-882761c27.jpg 1000w&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/generated/assets/images/pi_finished_2-800-82bcd0572.jpg&quot; srcset=&quot;/generated/assets/images/pi_finished_2-400-82bcd0572.jpg 400w, /generated/assets/images/pi_finished_2-600-82bcd0572.jpg 600w, /generated/assets/images/pi_finished_2-800-82bcd0572.jpg 800w, /generated/assets/images/pi_finished_2-1000-82bcd0572.jpg 1000w&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/generated/assets/images/pi_finished_3-800-a6bb194ad.jpg&quot; srcset=&quot;/generated/assets/images/pi_finished_3-400-a6bb194ad.jpg 400w, /generated/assets/images/pi_finished_3-600-a6bb194ad.jpg 600w, /generated/assets/images/pi_finished_3-800-a6bb194ad.jpg 800w, /generated/assets/images/pi_finished_3-1000-a6bb194ad.jpg 1000w&quot; /&gt;&lt;/p&gt;

&lt;p&gt;More details: &lt;a href=&quot;https://github.com/pawl/raspberry-pi-1u-server&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Python - Automatic Type Hinting With Monkeytype</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/05/python-monkeytype.html"/>
   <updated>2021-05-12T02:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/05/python-monkeytype</id>
   <content type="html">&lt;p&gt;I’ve been poking around with adding type hints to Python code automatically. Here’s my process so far:&lt;/p&gt;
&lt;noscript&gt;&lt;pre&gt;1. `pip install MonkeyType`
1. run tests with `monkeytype run` instead of `python`
  1. pytest: `monkeytype run -m pytest`
1. `mkdir stubs`
1. `monkeytype list-modules | xargs -n1 -I{} sh -c &amp;#39;monkeytype stub {} &amp;gt; stubs/{}.pyi&amp;#39;`
1. `pip install pytype`
1. `python move_files.py` (file in this gist)
1. `mypy &amp;lt;code folder name&amp;gt;`
1. remove duplicate imports added by merge-pyi, fix import sorting issues
1. clean up super long type hints by inlining with params&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/15ea14d194b48a4000dd6446b9b3f35d.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Python - setup.py project_urls</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/05/python-setup-py-project-urls.html"/>
   <updated>2021-05-08T02:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/05/python-setup-py-project-urls</id>
   <content type="html">&lt;p&gt;I saw the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;attrs&lt;/code&gt; project has a link to their changelog on pypi:
&lt;img src=&quot;/generated/assets/images/attrs_screenshot_2-549-3fb8b95d6.png&quot; srcset=&quot;/generated/assets/images/attrs_screenshot_2-400-3fb8b95d6.png 400w, /generated/assets/images/attrs_screenshot_2-549-3fb8b95d6.png 549w&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It turns out that’s controlled by the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;project_urls&lt;/code&gt; section of the setup.py.&lt;/p&gt;

&lt;p&gt;More details: &lt;a href=&quot;https://packaging.python.org/guides/distributing-packages-using-setuptools/#project-urls&quot;&gt;Python Docs&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Python - virtualenv &amp; Dockerfiles</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/04/python-virtualenv-dockerfile.html"/>
   <updated>2021-04-23T23:43:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/04/python-virtualenv-dockerfile</id>
   <content type="html">&lt;p&gt;I recently saw a Dockerfile based on the official docker Debian image that was installing dependencies into a virtualenv.&lt;/p&gt;

&lt;p&gt;I’m pretty sure using a virtualenv in an official Debian-based Dockerfile is unnecessary, because there’s no system Python to isolate from:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ docker run -it debian /bin/bash
root@21ca17310079:/# python
bash: python: command not found
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>git pickaxe</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/04/git-pickaxe.html"/>
   <updated>2021-04-23T23:43:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/04/git-pickaxe</id>
   <content type="html">&lt;p&gt;I learned about the “git pickaxe” this week, and I used it to find the first commit with a line of code that had been moved between a few different files.&lt;/p&gt;

&lt;p&gt;More details: &lt;a href=&quot;https://remireuvekamp.nl/blog/the-git-pickaxe.html&quot;&gt;https://remireuvekamp.nl/blog/the-git-pickaxe.html&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>apt-get install --no-install-recommends</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/04/no-install-recommends.html"/>
   <updated>2021-04-19T23:43:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/04/no-install-recommends</id>
   <content type="html">&lt;p&gt;I learned about apt-get install’s “–no-install-recommends” flag, and I used it to prevent unnecessary “recommended” packages from getting installed. This helped reduce some unnecesary bloat in a Docker image.&lt;/p&gt;

&lt;p&gt;More details: &lt;a href=&quot;https://ubuntu.com/blog/we-reduced-our-docker-images-by-60-with-no-install-recommends&quot;&gt;https://ubuntu.com/blog/we-reduced-our-docker-images-by-60-with-no-install-recommends&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>WLED</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/03/WLED.html"/>
   <updated>2021-03-14T01:43:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/03/WLED</id>
   <content type="html">&lt;p&gt;Today I learned about the amazing WLED project: &lt;a href=&quot;https://github.com/Aircoookie/WLED&quot;&gt;https://github.com/Aircoookie/WLED&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All you need to do is flash their binary to an ESP32 and it will bring up a WIFI access point that allows you to control the LEDs through an app or web page.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/generated/assets/images/2021-03-13-20.38.23-800-16757995f.jpg&quot; srcset=&quot;/generated/assets/images/2021-03-13-20.38.23-400-16757995f.jpg 400w, /generated/assets/images/2021-03-13-20.38.23-600-16757995f.jpg 600w, /generated/assets/images/2021-03-13-20.38.23-800-16757995f.jpg 800w, /generated/assets/images/2021-03-13-20.38.23-960-16757995f.jpg 960w&quot; /&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Event Driven Architecture Talk</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/01/event-driven-architecture.html"/>
   <updated>2021-01-22T05:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/01/event-driven-architecture</id>
   <content type="html">&lt;p&gt;I really liked this talk by Martin Fowler about Event Driven Architecture: &lt;a href=&quot;https://youtu.be/STKCRSUsyP0&quot;&gt;https://youtu.be/STKCRSUsyP0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s interesting to think about Git as an example of event sourcing.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Microservice Communication</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/01/microservice-communication.html"/>
   <updated>2021-01-20T18:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/01/microservice-communication</id>
   <content type="html">&lt;p&gt;I’ve been learning more about async communication between microservices and came across this article that talks about some of the trade-offs between sync and async communication: &lt;a href=&quot;https://dzone.com/articles/patterns-for-microservices-sync-vs-async&quot;&gt;https://dzone.com/articles/patterns-for-microservices-sync-vs-async&lt;/a&gt;&lt;/p&gt;

&lt;h1 id=&quot;summary&quot;&gt;Summary&lt;/h1&gt;

&lt;h2 id=&quot;sync&quot;&gt;Sync&lt;/h2&gt;

&lt;h3 id=&quot;pros&quot;&gt;Pros&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;“synchronous calls are simpler to grasp, debug and implement”&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;cons&quot;&gt;Cons&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;“A temporary burst at one component can flood other services with requests.”&lt;/li&gt;
  &lt;li&gt;Risk of Cascading Failures (domino effect of failures if one service experiences an otuage)&lt;/li&gt;
  &lt;li&gt;tighter coupling (requires endpoint versioning in the owning service)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;async&quot;&gt;Async&lt;/h2&gt;

&lt;h3 id=&quot;pros-1&quot;&gt;Pros&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;“removes the need to wait for a response thereby decoupling the execution of two or more services”&lt;/li&gt;
  &lt;li&gt;“deals better with sporadic bursts of traffic”&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;cons-1&quot;&gt;Cons&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;“Asynchronous systems tend to be significantly more complex than synchronous ones.”&lt;/li&gt;
  &lt;li&gt;“consumers need to adapt to work with an asynchronous system”&lt;/li&gt;
  &lt;li&gt;“the message bus the Achilles heel of the system as it remains a central point of failure”&lt;/li&gt;
  &lt;li&gt;Eventual Consistency (potentially out of date data)&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Python - Mypy</title>
   <link href="https://www.paulsprogrammingnotes.com/2021/01/learning-mypy.html"/>
   <updated>2021-01-08T18:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2021/01/learning-mypy</id>
   <content type="html">&lt;p&gt;My new job has me working on a larger codebase than previous jobs, and it’s also my first time using &lt;a href=&quot;https://mypy.readthedocs.io/en/stable/&quot;&gt;mypy&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I’m starting to understand why Guido’s work on mypy had a lot to do with Dropbox’s Python 3 migration. &lt;a href=&quot;https://dropbox.tech/application/our-journey-to-type-checking-4-million-lines-of-python&quot;&gt;Dropbox wrote an article&lt;/a&gt; with details on how they used mypy on their “4 million lines of Python”. With that much code, I can understand why they needed to treat code like “cattle, not pets”.&lt;/p&gt;

&lt;p&gt;Python 3 disallows some comparisons with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;None&lt;/code&gt; types, makes huge changes to strings/bytes, and has many other changes involving types. When your codebase is massive, you have to reach for automated tooling to consistently find and prevent those bugs. With the same tooling you can also prevent entire categories of other bugs from reaching production. The type hints can also be helpful documentation. For those reasons and more, I think implementing type hints on a large codebase like Dropbox’s will definitely be worth it in the long run.&lt;/p&gt;

&lt;p&gt;It has me wondering if I should have been taking the extra time to use type hints and checking (or a statically typed language) this whole time. Was going without type hints one less distraction? Or will be the price be paid in maintenance difficulties and bug fixes later?&lt;/p&gt;

&lt;p&gt;At this point, not much of the Python ecosystem has type hints (not even Python 2 compatible comment-style type hints). I’m starting to think it would be a good use of time to work on changing that.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Ruby - Jekyll</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/12/blog-updates.html"/>
   <updated>2020-12-25T08:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/12/blog-updates</id>
   <content type="html">&lt;p&gt;I migrated this blog from blogger/blogspot to a static site generated with Jekyll and hosted with Netlify.&lt;/p&gt;

&lt;p&gt;This blog post describes the process: &lt;a href=&quot;http://joshualande.com/jekyll-github-pages-poole&quot;&gt;http://joshualande.com/jekyll-github-pages-poole&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Initially, I started using Python’s Pelican, but pelican-import (pelican’s tool for migrating from blogger) doesn’t work as well as jekyll-import. It turned comments into posts and threw exceptions while processing draft posts without content. Also, the first docs that show up on google for Pelican aren’t the latest docs. This causing issues when I followed the old docs that said to use Python 2.7, but Pelican only supports Python 3.6+ now.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>&quot;A (multi-) monorepo setup with Git Submodules&quot;</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/12/a-multi-monorepo-setup-with-git.html"/>
   <updated>2020-12-25T00:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/12/a-multi-monorepo-setup-with-git</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://www.jannikbuschke.de/blog/git-submodules/&quot;&gt;https://www.jannikbuschke.de/blog/git-submodules/&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Arduino - Oven Thermometer</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/12/arduino-oven-thermometer.html"/>
   <updated>2020-12-20T20:38:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/12/arduino-oven-thermometer</id>
   <content type="html">&lt;p&gt;Parts:&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span class=&quot;pl-c&quot;&gt;HiLetgo DC 3-5V MAX6675 Module + K Type Thermocouple Temperature Sensor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;UCTRONICS 0.96 Inch OLED Module 12864 128x64 Yellow Blue SSD1306 Driver I2C&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;ESP32&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Code: &lt;a href=&quot;https://gist.github.com/pawl/73a1ccfbf2b2be6f934e651b39c51082&quot;&gt;https://gist.github.com/pawl/73a1ccfbf2b2be6f934e651b39c51082&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Linux - Sparse Files</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/12/linux-sparse-files.html"/>
   <updated>2020-12-12T23:54:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/12/linux-sparse-files</id>
   <content type="html">&lt;p&gt;Found a massive faillog/lastlog file recently and thought it was responsible for using up all my disk space. Turns out it&apos;s actually a sparse file and doesn&apos;t take up that much physical space: &lt;a href=&quot;https://unix.stackexchange.com/a/530157&quot;&gt;https://unix.stackexchange.com/a/530157&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Arduino - Coffee Roasting Monitor</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/12/arduino-coffee-roasting-monitor.html"/>
   <updated>2020-12-12T23:42:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/12/arduino-coffee-roasting-monitor</id>
   <content type="html">&lt;p&gt;Parts:&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Arduino Uno&lt;/li&gt;&lt;li&gt;2x MAX6675 w/ thermocouple&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Code: &lt;a href=&quot;https://gist.github.com/pawl/5ed1f61e0b0b27aa839fc2b4499a92c2&quot;&gt;https://gist.github.com/pawl/5ed1f61e0b0b27aa839fc2b4499a92c2&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Django - Duplicate Unformatted Logs</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/09/django-duplicate-unformatted-logs.html"/>
   <updated>2020-09-04T20:27:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/09/django-duplicate-unformatted-logs</id>
   <content type="html">&lt;p&gt;Recently I worked on a bug that was causing duplicate unformatted log messages to appear in a Django app&apos;s logs. I made a repository that demonstrates the issue: &lt;a href=&quot;https://github.com/pawl/django_duplicate_unformatted_logs_example&quot;&gt;https://github.com/pawl/django_duplicate_unformatted_logs_example&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The problem was caused by an accidental call to &lt;code&gt;logging.info&lt;/code&gt; (without using &lt;code&gt;logging.getLogger&lt;/code&gt; to get a specific logger) while the root logger isn&apos;t already configured.&lt;/p&gt;&lt;p&gt;The solution ended up being to get rid of the accidental calls to &lt;code&gt;logging.info&lt;/code&gt; and configuring the root logger to prevent it from accidentally happening again. I go into more details in that repo.&lt;br /&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Vue - vue-custom-element</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/05/vue-vue-custom-element.html"/>
   <updated>2020-05-12T01:46:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/05/vue-vue-custom-element</id>
   <content type="html">&lt;a href=&quot;https://github.com/karol-f/vue-custom-element&quot;&gt;Vue-custom-element&lt;/a&gt; seems like the best way to integrate vue into an existing application that uses server side templates.&lt;br /&gt;&lt;br /&gt;This approach allows you to use vue components (&lt;a href=&quot;https://medium.com/@rodrigosmaniotto/integrating-django-and-vuejs-with-vue-cli-3-and-webpack-loader-145c3b98501a&quot;&gt;built with the build pipeline&lt;/a&gt;) in your existing html without making your entire application a SPA.&lt;br /&gt;&lt;br /&gt;Initially I started following this guide: &lt;a href=&quot;https://robinverton.de/blog/2018/06/22/django-vue.js-integration-as-a-widget/&quot;&gt;https://robinverton.de/blog/2018/06/22/django-vue.js-integration-as-a-widget/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Vue-custom-element turned that code into 3 lines and allowed using components like normal (without the data attributes).&lt;br /&gt;&lt;br /&gt;This approach seems much better than: &lt;a href=&quot;https://vsupalov.com/vue-js-in-django-template/&quot;&gt;https://vsupalov.com/vue-js-in-django-template/&lt;/a&gt; Which doesn&apos;t allow for using a build pipeline for babel, linting, testing, single page components, live reload, modules with import/require, etc.&lt;br /&gt;&lt;br /&gt;Targeting your builds for web components might do the same thing: &lt;a href=&quot;https://cli.vuejs.org/guide/build-targets.html#web-component&quot;&gt;https://cli.vuejs.org/guide/build-targets.html#web-component&lt;/a&gt; It says it&apos;s not compatible with IE11, but that might not be a big deal in most situations.</content>
 </entry>
 
 <entry>
   <title>Django - Requiring Prefetching</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/05/django-requiring-prefetching.html"/>
   <updated>2020-05-06T03:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/05/django-requiring-prefetching</id>
   <content type="html">&lt;a href=&quot;https://github.com/pawl/django_require_prefetch_select_related_example&quot;&gt;https://github.com/pawl/django_require_prefetch_select_related_example&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;I made a repository to try to figure out the best way to require  prefech_related/select_related when fetching a model&apos;s related objects. I  also want to figure out a good pattern for avoiding duplicated  prefetch_related/select_related for multiple places in a codebase that  need the related objects eager loaded in the same way.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Nginx - WebDAV</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/04/nginx-webdav.html"/>
   <updated>2020-04-29T23:44:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/04/nginx-webdav</id>
   <content type="html">Just learned Nginx has WebDAV support: &lt;a href=&quot;https://nginx.org/en/docs/http/ngx_http_dav_module.html&quot;&gt;https://nginx.org/en/docs/http/ngx_http_dav_module.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It&apos;s a lot faster than the Python package I was using: &lt;a href=&quot;https://github.com/mar10/wsgidav&quot;&gt;https://github.com/mar10/wsgidav&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Wsgidav is great though. It&apos;s super customizable and the documentation is great too.</content>
 </entry>
 
 <entry>
   <title>Django - ModelChoiceField queryset caching</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/04/django-modelchoicefield-queryset-caching.html"/>
   <updated>2020-04-23T03:58:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/04/django-modelchoicefield-queryset-caching</id>
   <content type="html">&lt;p&gt;It would be nice to know a better way to cache the ModelChoiceField’s queryset when it’s used in a form that runs “is_valid()” in a loop (like Formsets do). The best way I know how at the moment is by not using a ModelChoiceField at all. The solution requires using a ChoiceField, running the query for choices outside of the loop, then passing the choices into the form to override the ChoiceField choices.&lt;/p&gt;

&lt;p&gt;Here’s an example:&lt;/p&gt;
&lt;noscript&gt;&lt;pre&gt;# See full example: https://github.com/pawl/django_modelchoicefield_caching/blob/master/myapp/views.py#L31-L51
    for song in playlist:
        form_data = {&amp;#39;title&amp;#39;: song[&amp;quot;title&amp;quot;], &amp;#39;artist&amp;#39;: song[&amp;quot;artist&amp;quot;]}
        song_form = forms.SongFormWithModelChoiceField(data=form_data)
        song_form.is_valid()  # runs a query to get the ModelChoiceField queryset each time

    print(&amp;#39;ModelChoiceField - query count AFTER validating all songs:&amp;#39;,
          len(connection.queries))  # 5 queries

    # query for choices outside of the loop to prevent unnecessary queries
    artist_choices = [(artist.pk, artist.name)
                      for artist in models.Artist.objects.all()]
    for song in playlist:
        form_data = {&amp;#39;title&amp;#39;: song[&amp;quot;title&amp;quot;], &amp;#39;artist&amp;#39;: song[&amp;quot;artist&amp;quot;]}
        # pass choices into the Form
        song_form = forms.SongFormWithChoiceField(
            artist_choices=artist_choices,
            data=form_data)
        song_form.is_valid()

    print(&amp;#39;ChoiceField w/ choices passed in - query count AFTER validating all songs:&amp;#39;,
          len(connection.queries))  # 6 queries (only 1 more query!)&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/fdaa8c916bf914cbe28ef60acd8ff78f.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Django API Forms</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/04/django-api-forms.html"/>
   <updated>2020-04-23T03:06:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/04/django-api-forms</id>
   <content type="html">Just found a really cool library for using Django&apos;s built-in forms to validate JSON: &lt;a href=&quot;https://github.com/Sibyx/django_api_forms&quot;&gt;https://github.com/Sibyx/django_api_forms&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I made a small example with it to show how it works with ModelChoiceFields: &lt;a href=&quot;https://github.com/pawl/django_api_forms_modelchoicefield_example&quot;&gt;https://github.com/pawl/django_api_forms_modelchoicefield_example&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Seems like a more lightweight version of DRF&apos;s serializers (but only for deserializing and validating) and with a similar API to Django&apos;s built-in forms.</content>
 </entry>
 
 <entry>
   <title>Learning Vue Through Terrible Pull Requests</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/04/learning-vue-through-terrible-pull.html"/>
   <updated>2020-04-18T18:58:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/04/learning-vue-through-terrible-pull</id>
   <content type="html">I made a pull request asking to &quot;remove the unused public/index.html&quot; file from django-vue-template: &lt;a href=&quot;https://github.com/gtalarico/django-vue-template/pull/53&quot;&gt;https://github.com/gtalarico/django-vue-template/pull/53&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Well, the author responded and it turns out it&apos;s definitely used (by vue magic): &lt;a href=&quot;https://cli.vuejs.org/guide/html-and-static-assets.html&quot;&gt;https://cli.vuejs.org/guide/html-and-static-assets.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Oops, definitely should have googled &quot;vue public/index.html&quot; before making that pull request. I made another pull request to add a link about it to the django-vue-template docs: &lt;a href=&quot;https://github.com/gtalarico/django-vue-template/pull/54&quot;&gt;https://github.com/gtalarico/django-vue-template/pull/54&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Server Side Templates Vs Front End Framework</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/04/server-side-templates-vs-front-end.html"/>
   <updated>2020-04-12T04:57:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/04/server-side-templates-vs-front-end</id>
   <content type="html">These Reddit comments have some of the best descriptions I&apos;ve seen for the type of scenario where you&apos;d use a front end framework over server side templates:&lt;br /&gt;&lt;br /&gt;&quot;Server side templating can work really well when the website is static. The problem is that as you add more and more dynamic elements, you either have to go to the server and re-render everything with every change (which can be slow), or you can make the changes on the client side with something like jQuery. But the latter option presents a challenge because you&apos;ll eventually find yourself duplicating functionality.&lt;br /&gt;&lt;br /&gt;For example, imagine a to-do list website that you render on the  server with a templating language. It fetches the user&apos;s to-do items  from the database and then renders the list. Now let&apos;s say you want to  let a user add a new item without re-rendering the entire page. You  could use AJAX to tell the server to add the new item, but now you need  to update your UI list accordingly. You could use jQuery to construct a  new DOM element and append it, but now that list element exists in two  different places: in your jQuery code and in your template on the  server. If your website becomes very dynamic, this situation can get  really unwieldy from a programming perspective.&lt;br /&gt;&lt;br /&gt;Both Angular (from what I&apos;ve read) and React (from personal  experience) are highly suitable for creating single page apps, with the  goal of creating a dynamic, fast, and maintainable website. There are  other benefits, as well as downsides, to using Angular and React, but I  hope this clears it up a little bit. Both of them make server side  templating unnecessary by moving UI logic/rendering from your server to  the client&apos;s browser. So a user who visits your React powered to-list  website would get the React code as a JS bundle, it would make an AJAX  call to your server to get just the data, and then it would render the  UI based on the data.&quot; -/u/VertiGuo (&lt;a href=&quot;https://www.reddit.com/r/node/comments/6t22cr/back_end_templating_engine_or_front_end_framework/dlhukkf/&quot;&gt;https://www.reddit.com/r/node/comments/6t22cr/back_end_templating_engine_or_front_end_framework/dlhukkf/)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&quot;for example putting together a form, and handle the response is easy,  but if you have to manage a list of items where the user can add/remove  items, or change the schema of items based on a selector (e.g. phone  type or address) you have to split the logic, and put some on client  side scripts, which can become very messy. not to mention live updates  like chat, comments etc.&lt;br /&gt;&lt;br /&gt;creating a separate backend and frontend solves this problem, as the  backend&apos;s responsibility will be only manipulating the database,  retrieve data and run jobs providing an api and the frontend&apos;s will be  the only the representation of these data, providing the user interface.  this separation lets developers use different technologies and  languages on the two side, as well as specializing in these. for the  beginning this approach is a bit hard to learn, but it will worth it on  the long run.&quot; -/u/bdvx (&lt;a href=&quot;https://www.reddit.com/r/webdev/comments/cbrdte/html_templating_vs_spa/etifiar/&quot;&gt;https://www.reddit.com/r/webdev/comments/cbrdte/html_templating_vs_spa/etifiar/&lt;/a&gt;)</content>
 </entry>
 
 <entry>
   <title>Integrating Django and Vue.js</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/04/integrating-django-and-vuejs.html"/>
   <updated>2020-04-08T01:03:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/04/integrating-django-and-vuejs</id>
   <content type="html">This is a great guide for including vue bundles in server side templates: &lt;a href=&quot;https://medium.com/@rodrigosmaniotto/integrating-django-and-vuejs-with-vue-cli-3-and-webpack-loader-145c3b98501a&quot;&gt;https://medium.com/@rodrigosmaniotto/integrating-django-and-vuejs-with-vue-cli-3-and-webpack-loader-145c3b98501a&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Otherwise, if you&apos;re starting a fresh project with a separate front-end, this is a good template: &lt;a href=&quot;https://github.com/gtalarico/django-vue-template/&quot;&gt;https://github.com/gtalarico/django-vue-template/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>The deepest reason why modern JavaScript frameworks exist</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/04/the-deepest-reason-why-modern.html"/>
   <updated>2020-04-04T02:16:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/04/the-deepest-reason-why-modern</id>
   <content type="html">Another really good article about why using a front-end framework is a good idea:&lt;br /&gt;&lt;a href=&quot;https://medium.com/dailyjs/the-deepest-reason-why-modern-javascript-frameworks-exist-933b86ebc445&quot;&gt;https://medium.com/dailyjs/the-deepest-reason-why-modern-javascript-frameworks-exist-933b86ebc445&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title> Make your life easier with Vue.js</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/04/make-your-life-easier-with-vuejs.html"/>
   <updated>2020-04-02T16:37:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/04/make-your-life-easier-with-vuejs</id>
   <content type="html">This is a really great article that shows how vue can make dynamic forms so much better: &lt;a href=&quot;https://dev.to/tsanak/make-your-life-easier-with-vuejs-4mj5&quot;&gt;https://dev.to/tsanak/make-your-life-easier-with-vuejs-4mj5&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Django - RelatedManager.set not removing models</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/02/django-relatedmanagerset-not-removing.html"/>
   <updated>2020-02-14T03:36:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/02/django-relatedmanagerset-not-removing</id>
   <content type="html">&lt;noscript&gt;&lt;pre&gt;In my opinion, one of django&amp;#39;s biggest gotchas is using `RelatedManager.set` with models that have non-nullable ForeignKey fields.

### Example
Models.py (with a one-to-many relationship and a non-nullable ForeignKey):
```
class Reporter(models.Model):
    name = models.CharField(max_length=255)


class Article(models.Model):
    title = models.CharField(max_length=255)

    reporter = models.ForeignKey(Reporter, on_delete=models.CASCADE)
```

Guess how many articles are on the reporter after you do this?:
```
reporter = Reporter.objects.create(name=&amp;quot;paul&amp;quot;)

# add 2 articles to the reporter
article_1 = reporter.article_set.create(title=&amp;quot;blah&amp;quot;)
reporter.article_set.create(title=&amp;quot;blah2&amp;quot;)

# set only 1 article on the reporter
reporter.article_set.set([article_1])
```

I expected just one article to be on the reporter. Nope:
```
reporter.article_set.count()
2
```

How do the docs say it should work?
&amp;gt;This method accepts a clear argument to control how to perform the operation. If False (the default), the elements missing from the new set are removed using remove() and only the new ones are added.

Well, crap, what&amp;#39;s going on?

It turns out you need to read the docs for `RelatedManager.remove` for a hint:
&amp;gt;For ForeignKey objects, this method only exists if null=True.

So, it turns out that `set()` is using `remove()` and `remove()` is only available on models with ForeignKeys that are `null=True`. What does `set()` do with things it needs to `remove()` when `remove()` isn&amp;#39;t available? Nothing...&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/74c734a1da1758b021b9f1c69b84397e.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Django - ChoiceField Display Text</title>
   <link href="https://www.paulsprogrammingnotes.com/2020/01/django-choicefield-display-text.html"/>
   <updated>2020-01-14T01:57:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2020/01/django-choicefield-display-text</id>
   <content type="html">I made a repo to demonstrate how to get a django ChoiceField&apos;s current selection&apos;s display text: &lt;a href=&quot;https://github.com/pawl/django_choicefield_display_example/&quot;&gt;https://github.com/pawl/django_choicefield_display_example/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I came across a few other examples, but they didn&apos;t do a good job of displaying the initial value or handling choices with integer values. </content>
 </entry>
 
 <entry>
   <title>Python - Pipenv to pip-tools</title>
   <link href="https://www.paulsprogrammingnotes.com/2019/12/python-pipenv-to-pip-tools.html"/>
   <updated>2019-12-20T17:31:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2019/12/python-pipenv-to-pip-tools</id>
   <content type="html">I&apos;ve been using Pipenv for the last few months and my biggest issue is that &quot;--keep-outdated&quot; has been broken in the latest release (2018.11.26) for a while. I&apos;ve needed to install Pipenv from the master branch to make it functional. However, the last time I used &quot;--keep-outdated&quot; from the master branch, it wouldn&apos;t automatically update the hash of the dependency being updated.&lt;br /&gt;&lt;br /&gt;Updating specific requirements is something I need to do pretty often, and it&apos;s not fun to explain all the Pipenv quirks to the team.&lt;br /&gt;&lt;br /&gt;Pip-tools looks like it does everything I need and has fewer quirks, so I ended up making the switch.&lt;br /&gt;&lt;br /&gt;Pipenv uses pip-tools under the hood, so the migration to pip-tools was very smooth. The migration process was:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Copy the dev-packages and packages sections of the Pipfile to their own requirements.in files.&lt;/li&gt;&lt;li&gt;Run pip-compile&lt;/li&gt;&lt;li&gt;Copy over the specific versions and hashes from the Pipfile.lock to the generated requirements.txt.&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;I did have a small issue where updating a specific package with pip-tools removed a bunch of dependencies from the requirements.txt unexpectedly, but running pip-compile with &quot;--rebuild&quot; fixed it.</content>
 </entry>
 
 <entry>
   <title>HTML5 - video playsinline</title>
   <link href="https://www.paulsprogrammingnotes.com/2019/07/html5-video-playsinline.html"/>
   <updated>2019-07-25T04:05:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2019/07/html5-video-playsinline</id>
   <content type="html">I added &quot;autoplay muted&quot; to my &amp;lt;video&amp;gt; tag to make a video autoplay in a carousel. It worked on desktop Chrome or Firefox, but didn&apos;t work on iOS Chrome or Safari. &lt;br /&gt;&lt;br /&gt;I learned about the &quot;playsinline&quot; fix from here: &lt;a href=&quot;https://webkit.org/blog/6784/new-video-policies-for-ios/&quot;&gt;https://webkit.org/blog/6784/new-video-policies-for-ios/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Adding &quot;playsinline&quot; to my video tag fixed it.&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>ESP32 Plant Sensor</title>
   <link href="https://www.paulsprogrammingnotes.com/2019/07/esp32-plant-sensor.html"/>
   <updated>2019-07-12T01:43:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2019/07/esp32-plant-sensor</id>
   <content type="html">&lt;p&gt;I set up a ESP32 houseplant soil water + temperature + humidity + light sensor that sends me a daily status update message.&lt;/p&gt;

&lt;p&gt;Here’s the code for it: &lt;a href=&quot;https://gist.github.com/pawl/6a408afde1411c6b1f58980e3d1dff83&quot;&gt;https://gist.github.com/pawl/6a408afde1411c6b1f58980e3d1dff83&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/06_2.png&quot; alt=&quot;esp32 plant sensor 1&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/36_2.png&quot; alt=&quot;esp32 plant sensor 2&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2019-07-11+20.38.41.png&quot; alt=&quot;esp32 plant sensor 3&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>AWS - redirecting domain to url using a 302 redirect (without running a server)</title>
   <link href="https://www.paulsprogrammingnotes.com/2019/07/aws-redirecting-domain-to-url-using-302.html"/>
   <updated>2019-07-11T00:26:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2019/07/aws-redirecting-domain-to-url-using-302</id>
   <content type="html">I wanted to make a domain name (heckingoodboys.com) redirect to a multisubreddit for dog pictures, but I didn&apos;t want to run a web server for it.&lt;br /&gt;&lt;br /&gt;Here&apos;s what I did:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Purchase the domain using Route53.&lt;/li&gt;&lt;li&gt;Create two public s3 buckets (www.heckingoodboys.com and heckingoodboys.com)&lt;/li&gt;&lt;li&gt;Enable &quot;Static website hosting&quot; on www.heckingoodboys.com and redirect to heckingoodboys.com.&lt;/li&gt;&lt;li&gt;Enable &quot;Static website hosting&quot; on heckingoodboys.com, select &quot;use this bucket to host this website&quot;, and use routing rules similar to this:&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&amp;lt;RoutingRules&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;RoutingRule&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Redirect&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Protocol&amp;gt;https&amp;lt;/Protocol&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;HostName&amp;gt;www.reddit.com&amp;lt;/HostName&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;HttpRedirectCode&amp;gt;302&amp;lt;/HttpRedirectCode&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ReplaceKeyPrefixWith&amp;gt;user/heckingoodboys/m/heckingoodboys/&amp;lt;/ReplaceKeyPrefixWith&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Redirect&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/RoutingRule&amp;gt;&lt;br /&gt;&amp;lt;/RoutingRules&amp;gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;Back to Route53 - Create an A record for both www.heckingoodboys.com and heckingoodboys.com using the alias to their respective buckets. (this will be the first option in autocomplete)&lt;/li&gt;&lt;/ol&gt;For more details: &lt;a href=&quot;https://medium.com/@P_Lessing/single-page-apps-on-aws-part-1-hosting-a-website-on-s3-3c9871f126&quot;&gt;https://medium.com/@P_Lessing/single-page-apps-on-aws-part-1-hosting-a-website-on-s3-3c9871f126&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Why not just use a CNAME from www.heckingoodboys.com to heckingoodboys.com? AWS says they don&apos;t charge for aliases, but they do charge for CNAMEs. So, I used an alias to a bucket instead. </content>
 </entry>
 
 <entry>
   <title>Django - When To Use Signals?</title>
   <link href="https://www.paulsprogrammingnotes.com/2018/02/django-when-to-use-signals.html"/>
   <updated>2018-02-08T04:18:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2018/02/django-when-to-use-signals</id>
   <content type="html">According to this blog post, almost never:&amp;nbsp;&lt;a href=&quot;https://lincolnloop.com/blog/django-anti-patterns-signals/&quot;&gt;https://lincolnloop.com/blog/django-anti-patterns-signals/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Django - Custom Storage Backends</title>
   <link href="https://www.paulsprogrammingnotes.com/2018/02/django-storage-backends.html"/>
   <updated>2018-02-08T04:17:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2018/02/django-storage-backends</id>
   <content type="html">I just learned about the custom storage systems in Django.&lt;br /&gt;&lt;br /&gt;What can you do with custom storage systems?:&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&quot;Django abstracts file storage using storage backends, from simple filesystem storage to things like S3. This can be used for processing file uploads, storing static assets, and more.&quot; -&lt;a href=&quot;https://tartarus.org/james/diary/2013/07/18/fun-with-django-storage-backends&quot;&gt;https://tartarus.org/james/diary/2013/07/18/fun-with-django-storage-backends&lt;/a&gt;&lt;/blockquote&gt;</content>
 </entry>
 
 <entry>
   <title>Sphinx Search - Lessons Learned</title>
   <link href="https://www.paulsprogrammingnotes.com/2018/01/sphinx-search-lessons-learned.html"/>
   <updated>2018-01-20T02:26:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2018/01/sphinx-search-lessons-learned</id>
   <content type="html">Here are a few things I&apos;ve learned while working on a project that uses Sphinx search:&lt;br /&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;It&apos;s important to know the difference between fields and attributes.&amp;nbsp;&lt;a href=&quot;https://www.percona.com/blog/2013/01/15/sphinx-search-performance-optimization-attribute-based-filtering/&quot;&gt;Attributes are basically unindexed columns&lt;/a&gt;&amp;nbsp;and you should try to avoid filtering only on these columns. Fields support full text search.&amp;nbsp;&lt;/li&gt;&lt;li&gt;It supports its own custom binary protocol and the MySQL protocol (recently they also added a HTTP API). When you see &quot;listen = localhost:9306:mysql41&quot; in the config, that means it&apos;s listening for MySQL protocol traffic on port 9306.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/a1tus/sphinxapi-py3&quot;&gt;https://github.com/a1tus/sphinxapi-py3&lt;/a&gt; appears to be the best Python client for the binary api at the moment. This doesn&apos;t support INSERTing things into the index (you&apos;ll need to use the MySQL protocol for that).&lt;/li&gt;&lt;li&gt;The version of &lt;a href=&quot;https://pypi.python.org/pypi/sphinxapi-py3/2.1.11&quot;&gt;sphinxapi-py3 on pypi&lt;/a&gt; is a &lt;a href=&quot;https://github.com/atuchak/sphinxapi-py3&quot;&gt;fork&lt;/a&gt; with just a few minor fixes and appears to be safe.&lt;/li&gt;&lt;li&gt;It does not match partial words by default. Turning on partial matching can also &lt;a href=&quot;http://sphinxsearch.com/docs/current/conf-max-substring-len.html&quot;&gt;increase the size of your index dramatically&lt;/a&gt;. You can also limit the fields that support partial matching with the &quot;infix_fields&quot; and &quot;prefix_fields&quot; setting.&lt;/li&gt;&lt;li&gt;Stemmers aren&apos;t turned on by default. So, searching for &quot;dog&quot; will not match &quot;dogs&quot;.&lt;/li&gt;&lt;li&gt;Most special characters ($, @, &amp;amp;, etc) are ignored by default. You will need to add them to &lt;a href=&quot;http://sphinxsearch.com/docs/current/conf-charset-table.html&quot;&gt;charset_table&lt;/a&gt; if you want them to be searchable.&lt;/li&gt;&lt;li&gt;Ruby&apos;s&amp;nbsp;thinking-sphinx looks much more battle tested than all of the Python binary api clients:&amp;nbsp;&lt;a href=&quot;https://github.com/pat/thinking-sphinx&quot;&gt;https://github.com/pat/thinking-sphinx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;You will need to use a real-time index if you want to INSERT/DELETE records immediately.&lt;/li&gt;&lt;li&gt;If you&apos;re using a real-time index, you will probably need to increase the &quot;rt_mem_limit&quot; from its default of 128mb. If this limit is too low, you&apos;ll see a high number of &quot;disk chunks&quot; when you run the &quot;SHOW INDEX rtindex STATUS&quot; query. More info:&amp;nbsp;&lt;a href=&quot;http://sphinxsearch.com/blog/2014/02/12/rt_performance_basics/&quot;&gt;http://sphinxsearch.com/blog/2014/02/12/rt_performance_basics/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;You have to use a special dialect if you want to use SQLAlchemy with sphinx:&amp;nbsp;&lt;a href=&quot;https://github.com/conversant/sqlalchemy-sphinx&quot;&gt;https://github.com/conversant/sqlalchemy-sphinx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;This appears to be the best Dockerfile for sphinx:&amp;nbsp;&lt;a href=&quot;https://github.com/leodido/dockerfiles&quot;&gt;https://github.com/leodido/dockerfiles&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;I probably won&apos;t be using Sphinx search for any new projects. Elasticsearch seems preferable these days.&lt;/div&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>MySQL - Duplicate Errors &amp; Trailing Whitespace</title>
   <link href="https://www.paulsprogrammingnotes.com/2017/12/mysql-duplicate-errors-trailing.html"/>
   <updated>2017-12-12T01:36:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/12/mysql-duplicate-errors-trailing</id>
   <content type="html">I had a unique constraint on a VARCHAR column and I inserted two rows with the following values:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&quot;name&quot; (without trailing whitespace)&lt;/li&gt;&lt;li&gt;&quot;name &quot; (with trailing whitespace)&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;To my surprise, I got a duplicate error on that 2nd insert. It turns out that MySQL ignores that trailing whitespace when it makes comparisons.&lt;br /&gt;&lt;br /&gt;The MySQL docs say this: &quot;All MySQL collations are of type PAD SPACE. This means that all CHAR, VARCHAR, and TEXT values are compared without regard to any trailing spaces. “Comparison” in this context does not include the LIKE pattern-matching operator, for which trailing spaces are significant.&quot; (&lt;a href=&quot;https://dev.mysql.com/doc/refman/5.7/en/char.html&quot;&gt;https://dev.mysql.com/doc/refman/5.7/en/char.html&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;The solution? You should probably be trimming trailing whitespace in your API endpoints and on your front-end.</content>
 </entry>
 
 <entry>
   <title>Gevent + Requests Performance With verify=True/False</title>
   <link href="https://www.paulsprogrammingnotes.com/2017/08/gevent-requests-performance-with.html"/>
   <updated>2017-08-11T00:48:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/08/gevent-requests-performance-with</id>
   <content type="html">If you use gevent with requests.get on a HTTPS URL with the default verify=True enabled, you&apos;ll see almost 2x longer execution times than with verify=False.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;I made a script to test:&amp;nbsp;&lt;a href=&quot;https://gist.github.com/pawl/56100a4ef958374a433840be8037b11b&quot;&gt;https://gist.github.com/pawl/56100a4ef958374a433840be8037b11b&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are the results:&lt;/div&gt;&lt;div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;verify=True took: 40.3454630375 secs&lt;br /&gt;verify=False took: 39.3803040981 secs&lt;br /&gt;gevent verify=True took: 2.23735189438 secs&lt;br /&gt;gevent verify=False took: 1.58263015747 secs&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;I suspect that gevent is having trouble using pyopenssl concurrently because it&apos;s a C library.&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Backing up or dumping a memcached server</title>
   <link href="https://www.paulsprogrammingnotes.com/2017/06/backing-up-or-dumping-memcached-server.html"/>
   <updated>2017-06-28T03:35:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/06/backing-up-or-dumping-memcached-server</id>
   <content type="html">I was needing to move from an old cache server to a larger one, but I wanted to do it without flushing cache.&lt;br /&gt;&lt;br /&gt;The first thing I came across was this &quot;memcached-tool&quot; which has a dump command:&amp;nbsp;&lt;a href=&quot;https://github.com/memcached/memcached/blob/master/scripts/memcached-tool&quot;&gt;https://github.com/memcached/memcached/blob/master/scripts/memcached-tool&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There&apos;s another article that mentions using memdump and memcat:&amp;nbsp;&lt;a href=&quot;http://www.dctrwatson.com/2010/12/how-to-dump-memcache-keyvalue-pairs-fast/&quot;&gt;http://www.dctrwatson.com/2010/12/how-to-dump-memcache-keyvalue-pairs-fast/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately, those methods only dumped a few mb of data. This post explains why: &lt;a href=&quot;https://stackoverflow.com/a/13941700&quot;&gt;https://stackoverflow.com/a/13941700&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;color: #242729; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span style=&quot;color: #242729; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit;&quot;&gt;You can only dump one page per slab class (1MB of data)&lt;/span&gt;&lt;/blockquote&gt;So, I ended up writing a script that loops through the expected cache keys, gets the data in cache, then sets the data in the new cache server. </content>
 </entry>
 
 <entry>
   <title>Microservice Best Practices</title>
   <link href="https://www.paulsprogrammingnotes.com/2017/06/microservice-best-practices.html"/>
   <updated>2017-06-27T05:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/06/microservice-best-practices</id>
   <content type="html">&lt;a href=&quot;http://www.vinaysahni.com/best-practices-for-building-a-microservice-architecture&quot;&gt;http://www.vinaysahni.com/best-practices-for-building-a-microservice-architecture&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Gunicorn - &quot;Resource temporarily unavailable&quot;</title>
   <link href="https://www.paulsprogrammingnotes.com/2017/06/gunicorn-resource-temporarily.html"/>
   <updated>2017-06-13T05:14:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/06/gunicorn-resource-temporarily</id>
   <content type="html">Are you seeing this error in your logs while your server is under high load?:&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;[error] 10#0: *14843 connect() to unix:/tmp/gunicorn.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 96.44.145.186, server: , request: &quot;GET / HTTP/1.0&quot;, upstream: &quot;http://unix:/tmp/gunicorn.sock:/&quot;, host: &quot;45.55.46.84&quot;&lt;/blockquote&gt;I ended up making an example dockerfile with nginx + gunicorn + flask to reproduce this problem: &lt;a href=&quot;https://github.com/pawl/somaxconn_test&quot;&gt;https://github.com/pawl/somaxconn_test&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Bumping the &quot;net.core.somaxconn&quot; setting ended up fixing it.</content>
 </entry>
 
 <entry>
   <title>SQLAlchemy - empty lists + in_() causing crazy queries (before 1.2.0)</title>
   <link href="https://www.paulsprogrammingnotes.com/2017/03/sqlalchemy-empty-lists-in-causing-crazy.html"/>
   <updated>2017-03-18T02:31:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/03/sqlalchemy-empty-lists-in-causing-crazy</id>
   <content type="html">&lt;p&gt;Before SQLAlchemy 1.2.0, if you use an empty list with in_(), it will emit some crazy SQL that will query your entire table. The best solution is probably to upgrade to SQLAlchemy 1.2.0.&lt;/p&gt;

&lt;noscript&gt;&lt;pre&gt;# demonstrates the issue fixed in: https://bitbucket.org/zzzeek/sqlalchemy/issues/3907

from sqlalchemy import create_engine, Column, Integer
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base

engine = create_engine(&amp;#39;mysql://root@localhost/test?charset=utf8mb4&amp;#39;,
                       convert_unicode=True,
                       echo=True)
session = scoped_session(sessionmaker(autocommit=False,
                                      autoflush=False,
                                      bind=engine))
Base = declarative_base()
Base.query = session.query_property()


class Post(Base):
    __tablename__ = &amp;#39;posts&amp;#39;
    id = Column(Integer, primary_key=True)


#Base.metadata.drop_all(engine)
Base.metadata.create_all(engine)

# create new rows if database is empty
for x in range(10):
    session.add(Post())
session.commit()

# empty lists trigger insane queries before 1.2.0
Post.query.filter(Post.id.in_([])).all()

&amp;quot;&amp;quot;&amp;quot;
SELECT posts.id AS posts_id
FROM posts
WHERE posts.id != posts.id
&amp;quot;&amp;quot;&amp;quot;&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/893c185519823b76150faa6a4bf74be5.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>The Robustness Principle</title>
   <link href="https://www.paulsprogrammingnotes.com/2017/03/the-robustness-principle.html"/>
   <updated>2017-03-14T06:05:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/03/the-robustness-principle</id>
   <content type="html">I learned about this at a talk called &quot;Implementing Evolvable APIs&quot; at SXSW:&amp;nbsp;&lt;a href=&quot;https://en.wikipedia.org/wiki/Robustness_principle&quot;&gt;https://en.wikipedia.org/wiki/Robustness_principle&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For example, making an API that throws errors when an unexpected parameter is provided is a bad idea. What if you need to make changes to the client to add the new parameter? You will need to make sure you deploy the code on the server side first, otherwise it will cause errors.</content>
 </entry>
 
 <entry>
   <title>SQLAlchemy - DISTINCT, LIMIT, or OFFSET Causing Subqueries</title>
   <link href="https://www.paulsprogrammingnotes.com/2017/02/sqlalchemy-distinct-limit-or-offset.html"/>
   <updated>2017-02-15T02:26:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/02/sqlalchemy-distinct-limit-or-offset</id>
   <content type="html">This section at the bottom of &lt;a href=&quot;http://docs.sqlalchemy.org/en/latest/orm/loading_relationships.html#the-zen-of-eager-loading&quot;&gt;The Zen of Eager loading&lt;/a&gt; is really important:&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;When using joined eager loading, &lt;b&gt;if the query contains a modifier that impacts the rows returned externally to the joins, such as when using DISTINCT, LIMIT, OFFSET or equivalent, the completed statement is first wrapped inside a subquery, and the joins used specifically for joined eager loading are applied to the subquery&lt;/b&gt;. SQLAlchemy’s joined eager loading goes the extra mile, and then ten miles further, to absolutely ensure that it does not affect the end result of the query, only the way collections and related objects are loaded, no matter what the format of the query is.&lt;/blockquote&gt;I made an example to illustrate this here:&amp;nbsp;&lt;a href=&quot;https://gist.github.com/pawl/cb57e0ddbdd0b2e64b75e94116873367&quot;&gt;https://gist.github.com/pawl/cb57e0ddbdd0b2e64b75e94116873367&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;On MySQL this can be responsible for some really poor query performance, because it can cause it to use temporary tables and filesort.&lt;br /&gt;&lt;br /&gt;The best way I&apos;ve found to prevent the subqueries is by first querying for the ids only, then running another query that includes all relations. For example:&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;ids = session.query(Product.id).limit(20)&lt;br /&gt;Product.query.filter(Product.id.in_(ids))&lt;/blockquote&gt;</content>
 </entry>
 
 <entry>
   <title>SQLAlchemy - &quot;Base.query = db_session.query_property()&quot;</title>
   <link href="https://www.paulsprogrammingnotes.com/2017/02/sqlalchemy-basequery.html"/>
   <updated>2017-02-13T00:23:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/02/sqlalchemy-basequery</id>
   <content type="html">I just saw this line in the &lt;a href=&quot;http://flask.pocoo.org/docs/0.12/patterns/sqlalchemy/&quot;&gt;SQLAlchemy flask patterns example&lt;/a&gt;:&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;Base.query = db_session.query_property()&lt;/blockquote&gt;&lt;div&gt;I went searching for what it does and found this:&amp;nbsp;&lt;a href=&quot;https://eoyilmaz.blogspot.com/2014/01/i-feel-so-much-hungry-about-posting.html&quot;&gt;https://eoyilmaz.blogspot.com/2014/01/i-feel-so-much-hungry-about-posting.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now I know how Flask-SQLAlchemy made queries work with Model.query instead of session.query(Model).&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>SQLAlchemy - Lost connection to MySQL server during query</title>
   <link href="https://www.paulsprogrammingnotes.com/2017/02/sqlalchemy-lost-connection-to-mysql.html"/>
   <updated>2017-02-11T18:55:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/02/sqlalchemy-lost-connection-to-mysql</id>
   <content type="html">&lt;div&gt;Here&apos;s was my situation:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;The database was set up behind behind an AWS ELB and HAProxy.&amp;nbsp;&lt;/li&gt;&lt;li&gt;The idle connection timeout on the ELB was set to 60 mins.&lt;/li&gt;&lt;li&gt;All the relevant timeouts on HAProxy seemed to be set to 60 mins too.&amp;nbsp;&lt;/li&gt;&lt;li&gt;The pool_recycle in SQLAlchemy was set to 30 mins.&lt;/li&gt;&lt;li&gt;I was still seeing the occasional &quot;Lost connection to MySQL server during query&quot; when small queries were running after the connection had some time to sit around.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The solution ended up being setting my pool_recycle down to 5 mins, but I&apos;m still not sure what was causing connections to time out after 5 mins.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;There are definitely other things that can cause this problem too. For example, it can happen if your data exceeds max_allowed_packet. See this page for more details:&amp;nbsp;&lt;a href=&quot;https://dev.mysql.com/doc/refman/5.7/en/error-lost-connection.html&quot;&gt;https://dev.mysql.com/doc/refman/5.7/en/error-lost-connection.html&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Most of this also applies for &quot;MySQL server has gone away&quot;.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;You should also make sure your pool_recycle is set lower than your &apos;interactive_timeout&apos; and &apos;wait_timeout&apos; properties in the mysql config file to the values you need.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>SQLAlchemy - Unexpected Lazy Loading </title>
   <link href="https://www.paulsprogrammingnotes.com/2017/01/sqlalchemy-unexpected-lazy-loading.html"/>
   <updated>2017-01-27T01:32:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/01/sqlalchemy-unexpected-lazy-loading</id>
   <content type="html">If you&apos;re seeing unexpected lazy loading on a lazy=&quot;joined&quot; relationship in SQLAlchemy, it might be because you&apos;re accessing those relationships after you&apos;ve already run session.commit(). By default, session.commit() will expire the data on your relationships, meaning it will try to fetch it again next time you try to access those attributes.&lt;br /&gt;&lt;br /&gt;The relevant section of the docs for &lt;a href=&quot;http://docs.sqlalchemy.org/en/latest/orm/session_api.html#sqlalchemy.orm.session.Session.commit&quot;&gt;session.commit()&lt;/a&gt;:&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;By default, the Session also expires all database loaded state on all ORM-managed attributes after transaction commit. This so that subsequent operations load the most recent data from the database. This behavior can be disabled using the expire_on_commit=False option to sessionmaker or the Session constructor.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Python - David Beazley&apos;s &quot;Understanding The Python GIL&quot;</title>
   <link href="https://www.paulsprogrammingnotes.com/2017/01/python-david-beazleys-understanding.html"/>
   <updated>2017-01-20T01:05:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/01/python-david-beazleys-understanding</id>
   <content type="html">This talk explains a lot about Python&apos;s multithreading:&amp;nbsp;&lt;a href=&quot;http://www.dabeaz.com/python/UnderstandingGIL.pdf&quot;&gt;http://www.dabeaz.com/python/UnderstandingGIL.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In Python 2.7, it knows to switch to different thread whenever it starts waiting on IO. And, it will check if it needs to switch threads every 100 bytecode instructions.</content>
 </entry>
 
 <entry>
   <title>SQLAlchemy - Is is necessary to commit after session.execute?</title>
   <link href="https://www.paulsprogrammingnotes.com/2017/01/sqlalchemy-is-is-necessary-to-commit.html"/>
   <updated>2017-01-17T04:50:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2017/01/sqlalchemy-is-is-necessary-to-commit</id>
   <content type="html">&lt;p&gt;The docs for &lt;a href=&quot;http://docs.sqlalchemy.org/en/latest/orm/session_api.html#sqlalchemy.orm.session.Session.execute&quot;&gt;session.execute&lt;/a&gt; say:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Execute a SQL expression construct or string statement &lt;strong&gt;within the current transaction&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, the answer is yes, you need to issue a commit after running session.execute().&lt;/p&gt;

&lt;p&gt;Here’s a code example along with the output from “echo=True” showing it begins the session but doesn’t end it unless you run session.commit():&lt;/p&gt;
&lt;noscript&gt;&lt;pre&gt;from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker

engine = create_engine(&amp;#39;mysql://root@localhost/test&amp;#39;)
db_session = scoped_session(sessionmaker(bind=engine))

db_session.execute(&amp;#39;&amp;#39;&amp;#39;
    INSERT INTO user (first_name, last_name, username, email)
    VALUES (&amp;quot;blah&amp;quot;, &amp;quot;blah&amp;quot;, &amp;quot;blah&amp;quot;, &amp;quot;blah@blah.com&amp;quot;);
&amp;#39;&amp;#39;&amp;#39;)&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/f3d66fb501065a589ce5ba2985de0ba2.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Global .gitignore</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/11/global-gitignore.html"/>
   <updated>2016-11-27T02:37:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/11/global-gitignore</id>
   <content type="html">&lt;a href=&quot;https://help.github.com/articles/ignoring-files/#create-a-global-gitignore&quot;&gt;https://help.github.com/articles/ignoring-files/#create-a-global-gitignore&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>SQLAlchemy 1.1.4&apos;s New &quot;server_side_cursors&quot; Option</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/11/sqlalchemy-114s-new-serversidecursors.html"/>
   <updated>2016-11-18T05:43:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/11/sqlalchemy-114s-new-serversidecursors</id>
   <content type="html">Before SQLAlchemy 1.1.4, if you wanted to stream your MySQL query using server side cursors, you would need to run your query using &quot;execution_options(stream_results=True)&quot; and pass SSCursor into create_engine&apos;s connect_args. Now, all you need to do is pass &quot;server_side_cursors=True&quot; into create_engine and it will automatically stream the results for your select queries.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#server-side-cursors&quot;&gt;http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#server-side-cursors&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Is it necessary to run SQLAlchemy&apos;s session.remove()?</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/10/is-it-necessary-to-run-sqlalchemys.html"/>
   <updated>2016-10-23T22:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/10/is-it-necessary-to-run-sqlalchemys</id>
   <content type="html">If you&apos;re using flask-sqlalchemy, then the answer is no - it&apos;s already doing it for you when the request finishes:&amp;nbsp;&lt;a href=&quot;https://github.com/mitsuhiko/flask-sqlalchemy/blob/7d65e2dc1f4e798f3234aaef01e615e3db319b05/flask_sqlalchemy/__init__.py#L836&quot;&gt;https://github.com/mitsuhiko/flask-sqlalchemy/blob/2.1/flask_sqlalchemy/__init__.py#L823&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you&apos;re using scoped_session and not explicitly running session.remove(), then your connections will only be returned to the pool after your thread finishes and garbage collection occurs. It&apos;s not a good idea to leave this to garbage collection, because you can&apos;t guarantee your connections will be returned to the pool when your application is busy. This will often lead to errors like this: &quot;TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30&quot;&lt;br /&gt;&lt;br /&gt;The solution is to make sure session.remove() runs when the work finishes (like flask-sqlalchemy does), as described here: &lt;a href=&quot;http://docs.sqlalchemy.org/en/latest/orm/contextual.html#using-thread-local-scope-with-web-applications&quot;&gt;http://docs.sqlalchemy.org/en/latest/orm/contextual.html#using-thread-local-scope-with-web-applications&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Another alternative is not making the session global and using a context manager, as described at the bottom of this section:&amp;nbsp;&lt;a href=&quot;http://docs.sqlalchemy.org/en/latest/orm/session_basics.html#when-do-i-construct-a-session-when-do-i-commit-it-and-when-do-i-close-it&quot;&gt;http://docs.sqlalchemy.org/en/latest/orm/session_basics.html#when-do-i-construct-a-session-when-do-i-commit-it-and-when-do-i-close-it&lt;/a&gt;&amp;nbsp;However, this can make things difficult when you need to access the query results outside of the context manager. If you access the query results outside of the context manager without running session.expunge_all(), you&apos;ll see all kinds of errors like this: &quot;DetachedInstanceError: Instance &amp;lt;ReportingJob at 0xa41cd8c&amp;gt; is not bound to a Session; attribute refresh operation cannot proceed&quot;&lt;br /&gt;&lt;br /&gt;Another option is setting &lt;a href=&quot;http://docs.sqlalchemy.org/en/latest/orm/session_transaction.html#autocommit-mode&quot;&gt;autocommit&lt;/a&gt; to True, but that has quite a few gotchas. Turning on autocommit will acquire connections from the engine on an as-needed basis and return them immediately after their use. You will have to explicitly start transactions with session.begin() if you enable it. It seems like this setting should be called &quot;autotransaction&quot; instead. It&apos;s also not very efficient, because it needs to get and return a connection each time you run a query.</content>
 </entry>
 
 <entry>
   <title>PHP - max_execution_time doesn&apos;t work for socket operations</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/09/php-maxexecutiontime-doesnt-work-for.html"/>
   <updated>2016-09-02T23:07:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/09/php-maxexecutiontime-doesnt-work-for</id>
   <content type="html">In new relic transaction logs, I was seeing some PHP requests last as long as an hour. It turns out that time spent waiting on sockets doesn&apos;t apply toward max_execution_time, and loops that involved waiting on sockets could end up taking a really long time without timing out.&lt;br /&gt;&lt;br /&gt;PHP docs have this to say about max_execution_time:&lt;br /&gt;&quot;The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running. This is not true on Windows where the measured time is real.&quot;&lt;br /&gt;&lt;br /&gt;The solution ended up being setting &lt;b&gt;request_terminate_timeout&lt;/b&gt; in php-fpm.</content>
 </entry>
 
 <entry>
   <title>Python - Cachetools LRUCache KeyError</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/08/python-cachetools-lrucache-keyerror.html"/>
   <updated>2016-08-27T22:34:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/08/python-cachetools-lrucache-keyerror</id>
   <content type="html">If your application is threaded and you&apos;re getting a &quot;KeyError&quot; while using the non-decorator version of cachetool&apos;s LRUCache, then you need to put whatever is manipulating the cache object inside of a lock. Also, since LRUCache is modified when values are gotten from it, you will also need to make sure you&apos;re locking when you get values from cache too. If you can use the decorator version of LRUCache, that&apos;s preferred since it has built-in locking.&lt;br /&gt;&lt;br /&gt;Here&apos;s an example of the error:&lt;br /&gt;&lt;br /&gt;&lt;script src=&quot;https://gist.github.com/pawl-rs/5d99ece9eaea723c901dfdb27bd4d9c1.js&quot;&gt;&lt;/script&gt; And an example of the fix: &lt;a href=&quot;https://bitbucket.org/zzzeek/dogpile.cache/pull-requests/32/add-a-cachetools-lru-lfu-in-memory-backend/diff#comment-22242704&quot;&gt;https://bitbucket.org/zzzeek/dogpile.cache/pull-requests/32/add-a-cachetools-lru-lfu-in-memory-backend/diff#comment-22242704&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Javascript&apos;s Round vs PHP&apos;s Round</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/06/javascripts-round-vs-phps-round.html"/>
   <updated>2016-06-22T06:33:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/06/javascripts-round-vs-phps-round</id>
   <content type="html">Today I learned that by default PHP rounds differently than javascript.&lt;br /&gt;&lt;h3&gt;PHP (using the default PHP_ROUND_HALF_UP)&lt;/h3&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;php &amp;gt; echo round(-1.5);&lt;br /&gt;-2&lt;/blockquote&gt;&quot;Round val up to precision decimal places away from zero, when it is half way there. Making 1.5 into 2 and -1.5 into -2.&quot;&lt;br /&gt;&lt;div&gt;&lt;a href=&quot;https://secure.php.net/manual/en/function.round.php&quot;&gt;https://secure.php.net/manual/en/function.round.php&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h3&gt;Javascript&lt;/h3&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;Math.round(-1.5);&lt;br /&gt;-1&lt;/blockquote&gt;&quot;For negative numbers, if the decimal portion is exactly -0.5, the return value is the smallest integer that is greater than the number.&quot;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/5cza0web(v=vs.94).aspx&quot;&gt;https://msdn.microsoft.com/en-us/library/5cza0web(v=vs.94).aspx&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Django-Moderation</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/05/django-moderation.html"/>
   <updated>2016-05-21T22:41:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/05/django-moderation</id>
   <content type="html">It would be nice if there were a sqlalchemy/flask equivalent to this: &lt;a href=&quot;https://github.com/dominno/django-moderation&quot;&gt;https://github.com/dominno/django-moderation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The equivalent might use sqlalchemy_utils for its generic relationships:&amp;nbsp;&lt;a href=&quot;https://sqlalchemy-utils.readthedocs.io/en/latest/generic_relationship.html&quot;&gt;https://sqlalchemy-utils.readthedocs.io/en/latest/generic_relationship.html&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Modified Preorder Tree Traversal</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/05/modified-preorder-tree-traversal.html"/>
   <updated>2016-05-20T03:25:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/05/modified-preorder-tree-traversal</id>
   <content type="html">This was a great explanation of Modified Preorder Tree Traversal (or MPTT):&amp;nbsp;&lt;a href=&quot;https://www.sitepoint.com/hierarchical-data-database-2/&quot;&gt;https://www.sitepoint.com/hierarchical-data-database-2/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A common use-case for MPTT is categorization data, like with the way django-oscar uses django-mptt:&amp;nbsp;&lt;a href=&quot;https://github.com/django-mptt/django-mptt&quot;&gt;https://github.com/django-mptt/django-mptt&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Datatables - Uncaught TypeError: Cannot read property &apos;style&apos; of undefined</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/05/datatables-uncaught-typeerror-cannot.html"/>
   <updated>2016-05-09T00:52:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/05/datatables-uncaught-typeerror-cannot</id>
   <content type="html">If you see this error in datatables: &quot;Uncaught TypeError: Cannot read property &apos;style&apos; of undefined&quot;&lt;br /&gt;&lt;br /&gt;It&apos;s likely that you&apos;re missing a header column in your table. Make sure you have the same number of&amp;nbsp;&amp;lt;th&amp;gt; elements as items in the &quot;columns&quot; section of your datatables initialization.</content>
 </entry>
 
 <entry>
   <title>Select2 Replacement</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/05/select2-replacement.html"/>
   <updated>2016-05-08T23:52:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/05/select2-replacement</id>
   <content type="html">This selectize.js library looks like a good replacement for Select2: &lt;a href=&quot;https://selectize.github.io/selectize.js/&quot;&gt;https://selectize.github.io/selectize.js/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Javascript Data Tables</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/05/javascript-data-tables.html"/>
   <updated>2016-05-05T04:04:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/05/javascript-data-tables</id>
   <content type="html">&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://fooplugins.github.io/FooTable/index.html&quot;&gt;https://fooplugins.github.io/FooTable/index.html&lt;/a&gt;&amp;nbsp;- good, no inline editing though&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://datatables.net/&quot;&gt;https://datatables.net/&lt;/a&gt; - editable plugin requires purchase&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/mleibman/SlickGrid&quot;&gt;https://github.com/mleibman/SlickGrid&lt;/a&gt; - unmaintained&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://handsontable.com/&quot;&gt;https://handsontable.com/&lt;/a&gt; - responsiveness doesn&apos;t work very well&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/mindmup/editable-table&quot;&gt;https://github.com/mindmup/editable-table&lt;/a&gt; - only supports editing&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/David-Mulder/paper-datatable&quot;&gt;https://github.com/David-Mulder/paper-datatable&lt;/a&gt; - pretty, but doesn&apos;t seem very battle-tested&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.ag-grid.com/&quot;&gt;https://www.ag-grid.com/&lt;/a&gt; - no tests&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/angular-ui/ui-grid&quot;&gt;https://github.com/angular-ui/ui-grid&lt;/a&gt; - requires angular&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://ng-table.com/&quot;&gt;http://ng-table.com/&lt;/a&gt; - requires angular&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://backgridjs.com/&quot;&gt;http://backgridjs.com/&lt;/a&gt; - requires backbone&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/daniel-nagy/md-data-table&quot;&gt;https://github.com/daniel-nagy/md-data-table&lt;/a&gt; - pretty, but requires angular&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.dynatable.com/&quot;&gt;https://www.dynatable.com/&lt;/a&gt; - not editable&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.jtable.org/&quot;&gt;http://www.jtable.org/&lt;/a&gt; - last updated in 2014, styling looks dated&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://datazenit.com/static/sensei-grid/examples/&quot;&gt;https://datazenit.com/static/sensei-grid/examples/&lt;/a&gt;&amp;nbsp;- simple, editable&lt;/li&gt;&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Falsehoods programmers believe about time and time zones</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/04/falsehoods-programmers-believe-about.html"/>
   <updated>2016-04-19T05:31:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/04/falsehoods-programmers-believe-about</id>
   <content type="html">This article has a lot of great lessons learned about timezones:&amp;nbsp;&lt;a href=&quot;http://www.creativedeletion.com/2015/01/28/falsehoods-programmers-date-time-zones.html&quot;&gt;http://www.creativedeletion.com/2015/01/28/falsehoods-programmers-date-time-zones.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>SQLAlchemy - JSON not changing on commit</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/04/sqlalchemy-json-not-changing-on-commit.html"/>
   <updated>2016-04-10T23:36:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/04/sqlalchemy-json-not-changing-on-commit</id>
   <content type="html">If your changes to a JSON, JSONB, or HSTORE field aren&apos;t saving after you commit, then you need to wrap your field in the MutableDict shown here: &lt;a href=&quot;http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#sqlalchemy.dialects.postgresql.HSTORE&quot;&gt;http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#sqlalchemy.dialects.postgresql.HSTORE&lt;/a&gt;
</content>
 </entry>
 
 <entry>
   <title>SQLAlchemy - AttributeError: type object &apos;JSONB&apos; has no attribute &apos;lower&apos;</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/04/sqlalchemy-attributeerror-type-object.html"/>
   <updated>2016-04-10T05:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/04/sqlalchemy-attributeerror-type-object</id>
   <content type="html">This error happened because I mistyped &quot;db.column&quot; instead of &quot;db.Column&quot; when I was creating my database model using SQLAlchemy.&lt;br /&gt;&lt;br /&gt;This might be your problem if db.create_all() isn&apos;t creating all the columns you expected.</content>
 </entry>
 
 <entry>
   <title>PHP - Problems With Long Running Processes</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/03/great-article-about-problems-with-using.html"/>
   <updated>2016-03-19T07:18:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/03/great-article-about-problems-with-using</id>
   <content type="html">Great article about the problems with using PHP for long running processes:&amp;nbsp;&lt;a href=&quot;https://software-gunslinger.tumblr.com/post/48215406921/php-is-meant-to-die-continued&quot;&gt;https://software-gunslinger.tumblr.com/post/48215406921/php-is-meant-to-die-continued&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Describes the main reason why I started using Python for long-running jobs.</content>
 </entry>
 
 <entry>
   <title>Ansible Vault - storing secrets in repos</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/03/ansible-vault-storing-secrets-in-repos.html"/>
   <updated>2016-03-04T03:52:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/03/ansible-vault-storing-secrets-in-repos</id>
   <content type="html">When others are deploying a project for you, it&apos;s easy for mistakes to be made when secrets must be updated in environmental variables. Ansible-vault takes a different approach and encrypts the secrets - allowing you to store the secrets in your repo.&lt;br /&gt;&lt;br /&gt;To encrypt a file: &lt;b&gt;ansible-vault encrypt secrets.py&lt;/b&gt;&lt;br /&gt;To decrypt a file: &lt;b&gt;ansible-vault decrypt secrets.py&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;More documentation is available here:&amp;nbsp;&lt;a href=&quot;http://docs.ansible.com/ansible/playbooks_vault.html&quot;&gt;http://docs.ansible.com/ansible/playbooks_vault.html&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Python - isort, useful tool for sorting python imports</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/03/python-isort-useful-tool-for-sorting.html"/>
   <updated>2016-03-04T03:44:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/03/python-isort-useful-tool-for-sorting</id>
   <content type="html">&lt;a href=&quot;http://timothycrosley.github.io/isort/&quot;&gt;http://timothycrosley.github.io/isort/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I saw it in the django coding style documentation:&amp;nbsp;&lt;a href=&quot;https://docs.djangoproject.com/en/1.9/internals/contributing/writing-code/coding-style/&quot;&gt;https://docs.djangoproject.com/en/1.9/internals/contributing/writing-code/coding-style/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To make an entire project&apos;s imports easier to read, all you need to do is:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;pip install isort&lt;/li&gt;&lt;li&gt;isort -rc .&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There&apos;s also a sublime plugin for it here:&amp;nbsp;&lt;a href=&quot;https://github.com/thijsdezoete/sublime-text-isort-plugin#install&quot;&gt;https://github.com/thijsdezoete/sublime-text-isort-plugin#install&lt;/a&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>git commit --amend -C HEAD</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/02/git-commit-amend-c-head.html"/>
   <updated>2016-02-19T04:29:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/02/git-commit-amend-c-head</id>
   <content type="html">Ever committed something and needed to make changes later? Just rebase and squash it, right? Or maybe &quot;git reset --soft HEAD~1&quot; and commit again?&lt;br /&gt;&lt;br /&gt;There&apos;s an even better solution: &quot;git commit --amend -C HEAD&quot;&lt;br /&gt;&lt;br /&gt;It will add the combine your commit with your last commit. If you already pushed, you will need to force push your change.</content>
 </entry>
 
 <entry>
   <title>pip install -e .</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/02/pip-install-e.html"/>
   <updated>2016-02-19T04:19:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/02/pip-install-e</id>
   <content type="html">I&apos;ve wasted a lot of time running &quot;python setup.py install&quot; before testing my changes to flask-admin. It turns out you can pip install a project as &quot;editable&quot;, which points the install toward your local directory instead of copying where the rest of your python modules are.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To install a project as editable, navigate to the repo and run &quot;&lt;b&gt;pip install -e .&lt;/b&gt;&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs&quot;&gt;https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs&lt;/a&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Python - Dropping Into pdb From Nose</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/02/dropping-into-pdb-from-nose.html"/>
   <updated>2016-02-14T01:09:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/02/dropping-into-pdb-from-nose</id>
   <content type="html">This document describes how to drop into pdb when your Python nose tests fail:&amp;nbsp;&lt;a href=&quot;http://nose.readthedocs.org/en/latest/plugins/debug.html&quot;&gt;http://nose.readthedocs.org/en/latest/plugins/debug.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It just requires running &quot;nosetests --pdb&quot;.&lt;br /&gt;&lt;br /&gt;Very helpful if you&apos;re debugging why a test failed.</content>
 </entry>
 
 <entry>
   <title>Great Hadoop + Spark Tutorial</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/02/great-hadoop-spark-tutorial.html"/>
   <updated>2016-02-14T01:07:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/02/great-hadoop-spark-tutorial</id>
   <content type="html">This great tutorial takes you through installing hadoop and spark to analyze Reddit comment data:&amp;nbsp;&lt;a href=&quot;http://blog.insightdatalabs.com/spark-cluster-step-by-step/&quot;&gt;http://blog.insightdatalabs.com/spark-cluster-step-by-step/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Hadoop Namenode Not Starting</title>
   <link href="https://www.paulsprogrammingnotes.com/2016/02/hadoop-namenode-not-starting.html"/>
   <updated>2016-02-14T01:05:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2016/02/hadoop-namenode-not-starting</id>
   <content type="html">My namenode was not starting because I had the wrong host configured in&amp;nbsp;yarn-site.xml,&amp;nbsp;mapred-site.xml, and&amp;nbsp;core-site.xml.&lt;br /&gt;&lt;br /&gt;When you&apos;re running start-dfs.sh on your namenode, ensure the line that says &quot;starting namenode&quot; shows &quot;/usr/local/hadoop/logs/hadoop-ubuntu-namenode-&lt;b&gt;&amp;lt;your namenode&apos;s hostname&amp;gt;&lt;/b&gt;.out&quot; in the output. This is how you know your configuration is correct.&lt;br /&gt;&lt;br /&gt;You can check your server&apos;s hostname on Ubuntu by running &quot;echo $(hostname)&quot;.</content>
 </entry>
 
 <entry>
   <title>Python - &quot;The Darker Side of type&quot;</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/12/python-darker-side-of-type.html"/>
   <updated>2015-12-26T08:31:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/12/python-darker-side-of-type</id>
   <content type="html">&lt;a href=&quot;https://www.jeffknupp.com/blog/2013/12/28/improve-your-python-metaclasses-and-dynamic-classes-with-type/&quot;&gt;https://www.jeffknupp.com/blog/2013/12/28/improve-your-python-metaclasses-and-dynamic-classes-with-type/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That blog post has a great description of how the type keyword can be used for another purpose, creating new types.&lt;br /&gt;&lt;br /&gt;Here&apos;s an example of the syntax:&lt;b&gt; Foo&amp;nbsp;= type(str(&apos;Foo&apos;), (object, ), {})&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This page has more details:&amp;nbsp;&lt;a href=&quot;http://python-3-patterns-idioms-test.readthedocs.org/en/latest/Metaprogramming.html&quot;&gt;http://python-3-patterns-idioms-test.readthedocs.org/en/latest/Metaprogramming.html&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>SQLAlchemy&apos;s &quot;scale&quot; Argument &amp; WTForms</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/12/sqlalchemys-scale-argument-wtforms.html"/>
   <updated>2015-12-23T01:24:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/12/sqlalchemys-scale-argument-wtforms</id>
   <content type="html">&lt;br /&gt;&lt;div&gt;Note: Unless otherwise stated, this applies to SQLAlchemy 1.0.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Here are a few things I learned while researching the fix for this&amp;nbsp;&lt;a href=&quot;https://github.com/flask-admin/flask-admin/issues/1141&quot;&gt;Flask-Admin Issue #1141&lt;/a&gt;:&lt;/div&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;With SQLAlchemy&apos;s Generic Float type, the &quot;scale&quot; argument is ignored. &quot;scale&quot; is not listed as an argument and the docs say &quot;Additional arguments here are ignored by the default Float type.&quot;. However, the object does have a &quot;scale&quot;, but it&apos;s always &quot;None&quot;.&lt;/li&gt;&lt;li&gt;WTForms&apos; &quot;places&quot; default for DecimalField&apos;s is 2.&lt;/li&gt;&lt;li&gt;The MySQL float does have a &quot;scale&quot; argument, it defaults to &quot;None&quot;. MySQL and Postgres have default limits on the length of the precision of floats, MySQL only shows 6 digits after the decimal and Postgres has a default column length of 17.&lt;/li&gt;&lt;li&gt;Numeric columns do have a &quot;scale&quot; argument, and the default is &quot;None&quot; in SQLAlchemy 0.7 and 1.0.&lt;/li&gt;&lt;li&gt;&quot;decimal_return_scale&quot; was added to both Float and Numeric in SQLAlchemy 0.9.&lt;/li&gt;&lt;li&gt;If you raise the number of &quot;places&quot; in WTForms&apos; DecimalField greater than &quot;decimal_return_scale&quot; in the SQLAlchemy field, the digits after the decimal place set in &quot;decimal_return_scale&quot; will show 0&apos;s.&lt;/li&gt;&lt;li&gt;In SQLAlchemy, &quot;_default_decimal_return_scale = 10&quot; is only used in a property/method called &quot;_effective_decimal_return_scale&quot;. The default for &quot;decimal_return_scale&quot; is &quot;None&quot; and not 10. Since &quot;_default_decimal_return_scale&quot; and &quot;_effective_decimal_return_scale&quot; start with an underscore, so it&apos;s only intended for internal use.&lt;/li&gt;&lt;li&gt;MySQL&apos;s &quot;FLOAT&quot; in SQLAlchemy doesn&apos;t have &quot;decimal_return_scale&quot;. It probably should? REAL and DOUBLE have this.&lt;/li&gt;&lt;li&gt;WTForms&apos; FloatField does not have &quot;places&quot;.&lt;/li&gt;&lt;li&gt;With SQLAlchemy 1.0, &quot;db.DECIMAL()&quot; will create a numeric(28, 6) in Postgres, but it creates a DECIMAL(10,0) in MySQL. This seemed pretty odd, since the default &quot;scale&quot; is &quot;None&quot;. Maybe it&apos;s just using whatever the default is in each backend.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Sources:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SQLAlchemy 0.7 docs for Float type: &lt;a href=&quot;http://docs.sqlalchemy.org/en/rel_0_7/core/types.html?highlight=float#sqlalchemy.types.Float&quot;&gt;http://docs.sqlalchemy.org/en/rel_0_7/core/types.html?highlight=float#sqlalchemy.types.Float&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Latest SQLAlchemy docs for Float type: &lt;a href=&quot;http://docs.sqlalchemy.org/en/latest/core/type_basics.html#sqlalchemy.types.Float&quot;&gt;http://docs.sqlalchemy.org/en/latest/core/type_basics.html#sqlalchemy.types.Float&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Latest docs for MySQL Float type: &lt;a href=&quot;http://docs.sqlalchemy.org/en/latest/dialects/mysql.html?highlight=float#sqlalchemy.dialects.mysql.FLOAT&quot;&gt;http://docs.sqlalchemy.org/en/latest/dialects/mysql.html?highlight=float#sqlalchemy.dialects.mysql.FLOAT&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Python Gotcha - Copying Nested Dicts</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/10/python-gotcha-preventing-argument-change.html"/>
   <updated>2015-10-27T03:18:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/10/python-gotcha-preventing-argument-change</id>
   <content type="html">Here&apos;s the best blog post I&apos;ve found that talks about the need for deep or shallow copy when using nested dicts in Python:&lt;br /&gt;&lt;span style=&quot;color: #0000ee;&quot;&gt;&lt;u&gt;&lt;a href=&quot;http://www.peterbe.com/plog/must__deepcopy__&quot;&gt;http://www.peterbe.com/plog/must__deepcopy__&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;</content>
 </entry>
 
 <entry>
   <title>Image Duplicate Detection In Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/10/image-duplicate-detection-in-python.html"/>
   <updated>2015-10-25T06:02:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/10/image-duplicate-detection-in-python</id>
   <content type="html">Great article on detecting duplicate images in Python:&amp;nbsp;&lt;a href=&quot;http://7webpages.com/blog/image-duplicates-detection-python/&quot;&gt;http://7webpages.com/blog/image-duplicates-detection-python/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>GoDaddy To Amazon Route 53 - Lessons Learned</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/10/godaddy-to-amazon-route-53-lessons.html"/>
   <updated>2015-10-11T05:52:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/10/godaddy-to-amazon-route-53-lessons</id>
   <content type="html">The first thing you&apos;ll want to do is created a &quot;Hosted Zone&quot; with the same A and CNAME records (and any other relevant records that aren&apos;t specific to GoDaddy).&lt;br /&gt;&lt;br /&gt;When you transfer the domain and it asks you if you want to use the old name servers - answer no. I messed this one up and kept using GoDaddy&apos;s &quot;domaincontrol.com&quot; name servers and DNS stopped resolving eventually. If you mess this up too, you&apos;ll need to go to the &quot;Hosted Zone&quot; for your site and copy the records in the &quot;NS&quot; list to domain&apos;s name servers on the registered domains page.</content>
 </entry>
 
 <entry>
   <title>Awesome-ETL List</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/10/awesome-etl-list.html"/>
   <updated>2015-10-07T08:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/10/awesome-etl-list</id>
   <content type="html">Finally decided to put all the interesting ETL software I find into a list:&amp;nbsp;&lt;a href=&quot;https://github.com/pawl/awesome-etl&quot;&gt;https://github.com/pawl/awesome-etl&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Python Idioms</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/09/python-idioms.html"/>
   <updated>2015-09-24T09:13:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/09/python-idioms</id>
   <content type="html">Here&apos;s a great page describing Python idioms:&amp;nbsp;&lt;a href=&quot;https://david.goodger.org/projects/pycon/2007/idiomatic/handout.html&quot;&gt;https://david.goodger.org/projects/pycon/2007/idiomatic/handout.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This gist of a Raymond Hettinger talk is also great:&amp;nbsp;&lt;a href=&quot;https://gist.github.com/JeffPaine/6213790&quot;&gt;https://gist.github.com/JeffPaine/6213790&lt;/a&gt;
</content>
 </entry>
 
 <entry>
   <title>Best &quot;Command Line&quot; Beginners Guide</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/09/best-command-line-beginners-guide.html"/>
   <updated>2015-09-19T21:06:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/09/best-command-line-beginners-guide</id>
   <content type="html">&lt;a href=&quot;http://www.learnenough.com/command-line&quot;&gt;http://www.learnenough.com/command-line&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It&apos;s a short guide, but I think it covers everything a beginner needs to know.</content>
 </entry>
 
 <entry>
   <title>Current State Of Workflow Engines / Frameworks</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/09/current-state-of-workflow-frameworks.html"/>
   <updated>2015-09-15T06:49:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/09/current-state-of-workflow-frameworks</id>
   <content type="html">This is a great article about the current state of workflow engines (and frameworks?):&amp;nbsp;&lt;a href=&quot;http://stackstorm.com/2015/04/10/the-return-of-workflows/&quot;&gt;http://stackstorm.com/2015/04/10/the-return-of-workflows/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Taskflow looks especially interesting. The article is unfortunately missing Airbnb&apos;s Airflow:&amp;nbsp;&lt;a href=&quot;https://github.com/airbnb/airflow&quot;&gt;https://github.com/airbnb/airflow&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Installing Postgres 9.5 On OSX</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/08/installing-postgres-95-on-osx.html"/>
   <updated>2015-08-02T04:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/08/installing-postgres-95-on-osx</id>
   <content type="html">&lt;p&gt;Edit 12/25/2020: I’d recommend using: &lt;a href=&quot;https://postgresapp.com/&quot;&gt;https://postgresapp.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ended up being surprisingly easy:&lt;/p&gt;
&lt;noscript&gt;&lt;pre&gt;brew uninstall postgresql
brew install postgresql-9.5
brew link -f postgresql-9.5
mv /usr/local/var/postgres /usr/local/var/postgres.old
initdb -D /usr/local/var/postgres

# restore old database?
# pg_upgrade -b /usr/local/Cellar/postgresql/9.0.4/bin -B /usr/local/Cellar/postgresql/9.1.2/bin -d /usr/local/var/postgres.old -D /usr/local/var/postgres

# start postgres
pg_ctl -D /usr/local/var/postgres -l logfile start&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/4d0213c5aef2bbba66f1.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>New Macbook Pro Setup</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/07/new-macbook-pro-setup.html"/>
   <updated>2015-07-26T22:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/07/new-macbook-pro-setup</id>
   <content type="html">&lt;p&gt;I’m finally switching to a Macbook Pro as my personal computer after a few months of using one at work. Local development on OSX is a lot easier and bug-free than on a Windows computer.&lt;/p&gt;

&lt;p&gt;I started a gist with what I did for setup:&lt;/p&gt;
&lt;noscript&gt;&lt;pre&gt;Important tips:
* to open applications quickly, command + space and type the application name
* mac doesn&amp;#39;t have an address bar in finder, you need to use command + shift + g to type a directory path
* mac doesn&amp;#39;t have &amp;quot;snap window to screen&amp;quot; like windows does, you need to install moom for this
* activity monitor = task manager
* brew install = apt get install (you&amp;#39;ll need to install brew) 
* use command + tilde to switch between windows for the same application

Setup:
* Upgrade MacOS to newest through the app store if you haven&amp;#39;t already
* Install chrome (https://www.google.com/chrome/browser/desktop/)
* Install chrome plugins (adblock, etc)
* Install brew
  * /usr/bin/ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;
* Install iterm2 (https://www.iterm2.com/)
* Fix alt + left/right arrow in iterm: http://apple.stackexchange.com/a/136931
* `brew install git`
  * [github ssh setup](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent)
* Install xcode and agree to terms of service (it&amp;#39;s required by some things)
* Install sublime text
* Install sublime package manager and plugins
  * command + shift + p then &amp;quot;install plugin manager&amp;quot;
  * install plugin sidebarenhancements
* restore sublime text settings from other computer
* Security hardening (especially turn off bluetooth): http://docs.hardentheworld.org/OS/OSX_10.11_El_Capitan/index.html
* Open dock settings and check &amp;quot;Automatically hide and show dock&amp;quot;
* Open trackpad settings and enable &amp;quot;Tap to Click&amp;quot;
* Open keyboard settings and set &amp;quot;key repeat&amp;quot; to &amp;quot;Fast&amp;quot; and &amp;quot;delay until repeat&amp;quot; to &amp;quot;Short&amp;quot;
* install docker
* install vlc&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/138d6c986a6bd674bdddfb9b730709b1.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>In Order to Configure TCP/IP, You Must Install and Enable a Network Adapter Card</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/07/in-order-to-configure-tcpip-you-must.html"/>
   <updated>2015-07-12T04:44:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/07/in-order-to-configure-tcpip-you-must</id>
   <content type="html">If you get this error message, you need to disable and uninstall your network adapter. Once you&apos;ve done that, you can reinstall the driver to fix it.</content>
 </entry>
 
 <entry>
   <title>Cygwin - Python Compiled Without SSL Support</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/07/importerror-cannot-import-name.html"/>
   <updated>2015-07-11T23:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/07/importerror-cannot-import-name</id>
   <content type="html">Download error on https://pypi.python.org/simple/pip/: unknown url type:&lt;br /&gt;https -- Some packages may not be found!&lt;br /&gt;&lt;br /&gt;ImportError: cannot import name HTTPSHandler&lt;br /&gt;&lt;br /&gt;I was trying to install pip in cygwin when this happened. Searches say openssl-devel needed to be installed, but it already was. Apparently python was compiled without ssl support.&lt;br /&gt;&lt;br /&gt;My solution was to install cygwin-x86 instead of the 64x one.</content>
 </entry>
 
 <entry>
   <title>md5sum: standard input: no properly formatted MD5 checksum lines found</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/07/md5sum-standard-input-no-properly.html"/>
   <updated>2015-07-11T06:22:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/07/md5sum-standard-input-no-properly</id>
   <content type="html">If you see this error when you&apos;re using apt-cyg, it means you need to update apt-cyg.&lt;br /&gt;&lt;br /&gt;You need to run the following commands:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;&quot;&gt;lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg &amp;gt; apt-cyg&lt;br /&gt;install apt-cyg /bin&lt;/code&gt;&lt;/pre&gt;</content>
 </entry>
 
 <entry>
   <title>Automatically Remove Long-Running Docker Containers</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/06/automatically-remove-long-running.html"/>
   <updated>2015-06-28T00:54:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/06/automatically-remove-long-running</id>
   <content type="html">&lt;p&gt;The following can be used in cron or run with &amp;amp; at the end of the command:&lt;/p&gt;

&lt;noscript&gt;&lt;pre&gt;PID=$(docker run -d &amp;quot;$@&amp;quot;)
docker wait $PID
docker rm $PID&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/722cb52669f1643f6a78.js&quot;&gt; &lt;/script&gt;

&lt;p&gt;I found this didn’t work: &lt;a href=&quot;http://www.ahtik.com/blog/removing-detached-docker-containers-automatically/&quot;&gt;http://www.ahtik.com/blog/removing-detached-docker-containers-automatically/&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Docker Run In Crontab</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/06/docker-run-in-crontab.html"/>
   <updated>2015-06-03T04:17:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/06/docker-run-in-crontab</id>
   <content type="html">&quot;0 5 * * 1 docker run --rm --name=mycontainer ubuntu:13.10 /opt/bin/job&quot;&lt;br /&gt;The above command is an example of how &quot;docker run&quot; would be used in crontab to run once every week at 5am.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;--rm will delete the container once the job is finished running&lt;/li&gt;&lt;li&gt;--name will name the container and prevent duplicate jobs from running&lt;/li&gt;&lt;li&gt;You don&apos;t need to use &quot;&amp;amp;&quot; at the end, because crons already run in the background.&lt;/li&gt;&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>MySQL Batch Updates Not Working</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/05/mysql-batch-updates-not-working.html"/>
   <updated>2015-05-08T07:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/05/mysql-batch-updates-not-working</id>
   <content type="html">Looking at &quot;SHOW PROCESSLIST&quot; and it looks like your queries are running individually instead of in batches like you sent?&lt;br /&gt;&lt;br /&gt;This happens because MySQL runs each update statement individually, but you should still be able to see the batches when the queries are in the &quot;init&quot; state.&lt;br /&gt;&lt;br /&gt;Use this query to see the batched queries:&lt;br /&gt;&lt;b&gt;SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST where state=&quot;init&quot;;&lt;/b&gt;</content>
 </entry>
 
 <entry>
   <title>New Flask Template</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/03/new-flask-template.html"/>
   <updated>2015-03-23T00:29:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/03/new-flask-template</id>
   <content type="html">&lt;a href=&quot;https://github.com/xen/flask-project-template/&quot;&gt;https://github.com/xen/flask-project-template/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It&apos;s also an interesting example of using docker for a flask project.</content>
 </entry>
 
 <entry>
   <title>&quot;Error response from daemon: 404 page not found&quot; - Docker</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/02/error-response-from-daemon-404-page-not.html"/>
   <updated>2015-02-13T05:16:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/02/error-response-from-daemon-404-page-not</id>
   <content type="html">This required setting the following in my /etc/environment:&lt;br /&gt;&lt;pre style=&quot;background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 11.8999996185303px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 11.8999996185303px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;&quot;&gt;no_proxy=/var/run/docker.sock&lt;/code&gt;&lt;/pre&gt;</content>
 </entry>
 
 <entry>
   <title>When Not to Use Generator Expressions</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/when-not-to-use-generator-expressions.html"/>
   <updated>2015-01-28T21:04:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/when-not-to-use-generator-expressions</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/a/26635939&quot;&gt;http://stackoverflow.com/a/26635939&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I found that post very helpful. I didn&apos;t know it&apos;s a better idea to use a list comprehension rather than a generator expression for &quot;&quot;.join().</content>
 </entry>
 
 <entry>
   <title>mod_wsgi + Flask</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/trailing-slashes-matter-if-you-set.html"/>
   <updated>2015-01-28T08:52:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/trailing-slashes-matter-if-you-set</id>
   <content type="html">&lt;p&gt;Here’s my mod_wsgi configuration for a flask app that uses Flask-Admin.&lt;/p&gt;

&lt;noscript&gt;&lt;pre&gt;WSGIDaemonProcess makermanager2 user=www-data group=www-data threads=5
WSGIScriptAlias /makermanager2 /var/www/makermanager2/runserver.wsgi

&amp;lt;Directory /var/www/makermanager2&amp;gt;
        WSGIProcessGroup makermanager2
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
&amp;lt;/Directory&amp;gt;

Alias /makermanager2/assets /var/www/makermanager2/application/static

&amp;lt;Directory /var/www/makermanager2/application/static&amp;gt;
        Order allow,deny
        Allow from all
&amp;lt;/Directory&amp;gt;

Alias /makermanager2/static/admin /opt/Envs/prod/src/flask-admin-master/flask_admin/static/

&amp;lt;Directory /opt/Envs/prod/src/flask-admin-master/flask_admin/static/&amp;gt;
        Order allow,deny
        Allow from all
&amp;lt;/Directory&amp;gt;
&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/99b6e114d0b792639400.js&quot;&gt; &lt;/script&gt;

&lt;p&gt;Trailing slashes matter! If you set a trailing slash, it will only set the alias for that directory and not all of the directories below it.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Request.Args Empty During Tests - Flask</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/requestargs-empty-during-tests-flask.html"/>
   <updated>2015-01-27T04:01:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/requestargs-empty-during-tests-flask</id>
   <content type="html">&lt;a href=&quot;https://github.com/mitsuhiko/flask/issues/801#issuecomment-21513278&quot;&gt;https://github.com/mitsuhiko/flask/issues/801#issuecomment-21513278&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you&apos;re using&amp;nbsp;app.test_client().get, it&apos;s very important to use a relative url or your parameters will be removed.&lt;br /&gt;&lt;br /&gt;# will not pass request.args&lt;br /&gt;rv = self.client.get(&apos;http://0.0.0.0:5000/view/?foo=bar&apos;)&lt;br /&gt;&lt;br /&gt;# works just fine&lt;br /&gt;rv = self.client.get(&apos;/view/?foo=bar&apos;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Self-Hosting Fonts</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/self-hosting-fonts.html"/>
   <updated>2015-01-23T05:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/self-hosting-fonts</id>
   <content type="html">&lt;a href=&quot;https://github.com/CSSLint/csslint/wiki/Bulletproof-font-face&quot;&gt;https://github.com/CSSLint/csslint/wiki/Bulletproof-font-face&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That&apos;s the most helpful guide I found for self-hosting your own fonts and preventing compatibility issues.</content>
 </entry>
 
 <entry>
   <title>Dokku Change Nginx Timeout</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/dokku-change-nginx-timeout.html"/>
   <updated>2015-01-21T20:36:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/dokku-change-nginx-timeout</id>
   <content type="html">None of the plug-ins for doing custom nginx configurations were working for me.&lt;br /&gt;&lt;br /&gt;So, I changed the following two files:&lt;br /&gt;/var/lib/dokku/plugins/nginx-vhosts/templates/nginx.ssl.conf&lt;br /&gt;/var/lib/dokku/plugins/nginx-vhosts/templates/nginx.conf&lt;br /&gt;&lt;br /&gt;I added the following under &quot;location &amp;nbsp; &amp;nbsp;/ {&quot;:&lt;br /&gt;proxy_connect_timeout 300s;&lt;br /&gt;proxy_read_timeout 300s;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Supervisord Tips and Gotchas</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/supervisord-tips-and-gotchas.html"/>
   <updated>2015-01-21T05:22:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/supervisord-tips-and-gotchas</id>
   <content type="html">If you make configuration changes, the changes will not take effect until you:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;supervisorctl reread&lt;/li&gt;&lt;li&gt;supervisorctl update&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&quot;redirect_stderr=true&quot; will cause both&amp;nbsp;stderr and stdout to appear in the &quot;stdout&quot; log.&lt;/div&gt;&lt;br /&gt;You get to select which user runs the command with the &quot;user&quot; parameter.&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;For example: &lt;b&gt;user=root&lt;/b&gt;&lt;/blockquote&gt;Supervisord keeps its own set of environmental variables with the &quot;environment&quot; parameter. It won&apos;t pick up env variables from /etc/environment.&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;For example:&amp;nbsp;&lt;b&gt;environment=A=&quot;1&quot;,B=&quot;2&quot;&lt;/b&gt;&lt;/blockquote&gt;For Gunicorn, use a configuration file rather than putting all your arguments into the &quot;command&quot; parameter.&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;For example, -t will be &lt;b&gt;ignored &lt;/b&gt;here:&lt;br /&gt;command=/path/to/gunicorn main:application &lt;b&gt;-t 300&lt;/b&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;Instead use:&lt;br /&gt;command=/path/to/gunicorn main:application &lt;b&gt;-c /path/to/gunicorn.conf.py&lt;/b&gt;&lt;/blockquote&gt;</content>
 </entry>
 
 <entry>
   <title>Installing python-ldap on Dokku</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/installing-python-ldap-on-dokku.html"/>
   <updated>2015-01-20T06:20:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/installing-python-ldap-on-dokku</id>
   <content type="html">Install this plugin:&amp;nbsp;&lt;a href=&quot;https://github.com/F4-Group/dokku-apt#installation&quot;&gt;https://github.com/F4-Group/dokku-apt#installation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Create an&amp;nbsp;apt-packages file in the root directory of your repository with the following lines:&lt;br /&gt;python-dev&lt;br /&gt;libldap2-dev&lt;br /&gt;libsasl2-dev&lt;br /&gt;libssl-dev&lt;br /&gt;&lt;br /&gt;Now, commit your new apt-packages file and python-ldap should install successfully.&lt;br /&gt;&lt;br /&gt;I also had trouble installing pymssql, and got an error saying &quot;_mssql.c:314:22: fatal error: sqlfront.h: No such file or directory&quot;. Similar fix, just add &quot;freetds-dev&quot; to your apt-packages file.</content>
 </entry>
 
 <entry>
   <title>Enabling SSL On Dokku</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/enabling-ssl-on-dokku.html"/>
   <updated>2015-01-20T05:13:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/enabling-ssl-on-dokku</id>
   <content type="html">&lt;ol&gt;&lt;li&gt;It&apos;s important that you have the newest version of Dokku:&amp;nbsp;&lt;a href=&quot;http://progrium.viewdocs.io/dokku/upgrading&quot;&gt;http://progrium.viewdocs.io/dokku/upgrading&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Zip your certificate and key:&amp;nbsp;&lt;b&gt;sudo tar cvf archive_name.tar.gz server.crt server.key&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Import using&amp;nbsp;&lt;b&gt;dokku nginx:import-ssl appname &amp;lt; ~/archive_name.tar.gz&lt;/b&gt;&lt;a href=&quot;https://github.com/progrium/dokku/blob/master/docs/nginx.md#importing-ssl-certificates&quot;&gt;https://github.com/progrium/dokku/blob/master/docs/nginx.md#importing-ssl-certificates&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;</content>
 </entry>
 
 <entry>
   <title>Expecting: TRUSTED CERTIFICATE</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/expecting-trusted-certificate.html"/>
   <updated>2015-01-20T04:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/expecting-trusted-certificate</id>
   <content type="html">I was trying to add my certificate to Dokku using &quot;dokku nginx:import-ssl&quot; when I got the error message &quot;Expecting: TRUSTED CERTIFICATE&quot;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This ended up being an issue with line endings and the dos2unix utility fixed it:&amp;nbsp;&lt;a href=&quot;http://serverfault.com/a/317038&quot;&gt;http://serverfault.com/a/317038&lt;/a&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Downloading Files With Python&apos;s Requests Module</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/downloading-files-with-pythons-requests.html"/>
   <updated>2015-01-19T00:28:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/downloading-files-with-pythons-requests</id>
   <content type="html">&lt;a href=&quot;http://docs.python-requests.org/en/latest/user/quickstart/#binary-response-content&quot;&gt;http://docs.python-requests.org/en/latest/user/quickstart/#binary-response-content&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;From the example:&lt;br /&gt;&lt;pre style=&quot;background: rgb(238, 238, 238); color: #3e4349; font-family: Consolas, Menlo, &apos;Deja Vu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, monospace; font-size: 0.9em; line-height: 1.3em; margin: 15px -30px; overflow-x: auto; overflow-y: hidden; padding: 7px 30px;&quot;&gt;&lt;span class=&quot;gp&quot; style=&quot;color: #745334;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot; style=&quot;color: #004461; font-weight: bold;&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot; style=&quot;color: black;&quot;&gt;PIL&lt;/span&gt; &lt;span class=&quot;kn&quot; style=&quot;color: #004461; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: black;&quot;&gt;Image&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;gp&quot; style=&quot;color: #745334;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot; style=&quot;color: #004461; font-weight: bold;&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot; style=&quot;color: black;&quot;&gt;StringIO&lt;/span&gt; &lt;span class=&quot;kn&quot; style=&quot;color: #004461; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: black;&quot;&gt;StringIO&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;gp&quot; style=&quot;color: #745334;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: black;&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: #582800;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: black;&quot;&gt;Image&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: #582800;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: black;&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: black;&quot;&gt;StringIO&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: black;&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: #582800;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: black;&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;))&lt;/span&gt;&lt;/pre&gt;</content>
 </entry>
 
 <entry>
   <title>Nmap Not Finding Hostnames</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/nmap-not-finding-hostnames.html"/>
   <updated>2015-01-16T06:22:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/nmap-not-finding-hostnames</id>
   <content type="html">&lt;a href=&quot;http://serverfault.com/a/153779&quot;&gt;http://serverfault.com/a/153779&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The secret ended up being running the command as sudo. It&apos;s odd how &quot;socket.gethostbyaddr()&quot; worked just fine without sudo, but was slower than nmap.</content>
 </entry>
 
 <entry>
   <title>Slow Disk Performance On Dell r620</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/slow-disk-performance-on-ubuntu-1304-vs.html"/>
   <updated>2015-01-07T16:47:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/slow-disk-performance-on-ubuntu-1304-vs</id>
   <content type="html">&lt;h3&gt;Update:&lt;/h3&gt;I installed openmanage with the instructions on this page and used it to check/update bios settings:&amp;nbsp;&lt;a href=&quot;http://linux.dell.com/repo/community/deb/OMSA_7.1/&quot;&gt;http://linux.dell.com/repo/community/deb/OMSA_7.1/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The fix ended up being BIOS power profile settings. It was set to&amp;nbsp;Performance Per Watt (DAPC) and needed to be set to &quot;Performance&quot;.&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/assets/images/performance_setting.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;/assets/images/performance_setting.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;It&apos;s very interesting that the BIOS power profile settings didn&apos;t seem to affect Ubuntu 14.10&apos;s disk read speed.&lt;br /&gt;&lt;h3&gt;Troubleshooting:&lt;/h3&gt;I have three of the same server. All the servers are Dell r620&apos;s with a PERC H710 Mini RAID controller (21.2.0-0007_A04 firmware) and have the exact same hard drives (Seagate ST300MM0006) in RAID 1 configurations. I&apos;m seeing about 50% worse disk read performance on some versions of Ubuntu.&lt;br /&gt;&lt;br /&gt;They only differences I can find in the hardware:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The BIOS version on the poorly performing machines is&amp;nbsp;1.4.8, the machine that&apos;s performing well is on 1.6.0. The BIOS change log doesn&apos;t appear to have any changes between the two versions that would affect anything.&lt;/li&gt;&lt;li&gt;The chipset version on the RAID controller of the poorly performing machines is rev 01 (ChipRevision: B0). The machine that&apos;s performing well has the rev 05 chipset (ChipRevision: D1). The motherboard chipset revision is also different.&lt;/li&gt;&lt;/ul&gt;Here are the benchmark results for the different Ubuntu versions and RAID controller chipsets:&lt;br /&gt;&lt;br /&gt;(mysql read speed test - using the same version of mysql across all 3 machines)&lt;br /&gt;sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --max-time=60 --oltp-read-only=on --max-requests=0 --num-threads=8 run:&lt;br /&gt;&lt;div class=&quot;Mu SP&quot; id=&quot;:ie.ma&quot; style=&quot;-webkit-transition: opacity 0.218s ease; color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 6px; opacity: 1; transition: opacity 0.218s ease; word-break: break-word; word-wrap: break-word;&quot;&gt;&lt;div id=&quot;:ie.co&quot;&gt;(&lt;b&gt;13.04&lt;/b&gt;&lt;b style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&amp;nbsp;- rev 05&lt;/b&gt;): read/write requests: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4996362 (&lt;b&gt;83271.11&lt;/b&gt;&amp;nbsp;per sec.)&lt;br /&gt;(&lt;b&gt;14.04&lt;/b&gt;&lt;b style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&amp;nbsp;- rev 01&lt;/b&gt;):&amp;nbsp;read/write requests: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1906520 (&lt;b&gt;31773.58&lt;/b&gt;&amp;nbsp;per sec.)&lt;br /&gt;(&lt;b&gt;14.10&lt;/b&gt;&lt;b style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&amp;nbsp;- rev 01&lt;/b&gt;):&amp;nbsp;read/write requests: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5166798 (&lt;b&gt;86111.50&lt;/b&gt;&amp;nbsp;per sec.)&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;Mu SP&quot; id=&quot;:if.ma&quot; style=&quot;-webkit-transition: opacity 0.218s ease; margin-bottom: 6px; opacity: 1; transition: opacity 0.218s ease; word-break: break-word; word-wrap: break-word;&quot;&gt;&lt;div class=&quot;xH&quot; id=&quot;:if.at&quot; style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div id=&quot;:if.co&quot;&gt;dd if=/dev/zero of=/tmp/output bs=8k count=10k; rm -f /tmp/output:&lt;br /&gt;&lt;div style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;(&lt;b&gt;13.04 - rev 05&lt;/b&gt;):&amp;nbsp;83886080 bytes (84 MB) copied, 0.0437543 s,&amp;nbsp;&lt;b&gt;1.9 GB/s&lt;/b&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white;&quot;&gt;(&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;13.04&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b&gt;&amp;nbsp;- rev 01&lt;/b&gt;) 83886080 bytes (84 MB) copied, 0.116811 s,&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&amp;nbsp;718 MB/s&lt;/b&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white;&quot;&gt;(&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;13.10&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b&gt;&amp;nbsp;- rev 01&lt;/b&gt;):&amp;nbsp;83886080 bytes (84 MB) copied, 0.129371 s, &lt;b&gt;648 MB/s&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;(&lt;b&gt;14.04&lt;/b&gt;&lt;b&gt;&amp;nbsp;- rev 01&lt;/b&gt;):&amp;nbsp;83886080 bytes (84 MB) copied, 0.157808 s,&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;532 MB/s&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;(&lt;b&gt;14.10&lt;/b&gt;&lt;b&gt;&amp;nbsp;- rev 01&lt;/b&gt;):&amp;nbsp;83886080 bytes (84 MB) copied, 0.102355 s,&amp;nbsp;&lt;b&gt;820 MB/s&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id=&quot;:if.co&quot; style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div id=&quot;:if.co&quot;&gt;hdparm -tT /dev/sda1:&lt;br /&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 16px;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;13.04&lt;/b&gt;&lt;b style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&amp;nbsp;- rev 05&lt;/b&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;):&amp;nbsp;Timing cached reads:23154 MB in &amp;nbsp;2.00 seconds = &lt;/span&gt;&lt;b style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;11589.16&lt;/b&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt; MB/sec&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 18.4799995422363px;&quot;&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white; color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;13.04&lt;/b&gt;&lt;b style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&amp;nbsp;- rev 01&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 18.4799995422363px;&quot;&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;):&amp;nbsp;Timing cached reads:17934 MB in &amp;nbsp;2.00 seconds =&amp;nbsp;&lt;b&gt;8973.68&lt;/b&gt;&amp;nbsp;MB/sec&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 18.4799995422363px;&quot;&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;(&lt;b&gt;13.10 - rev 01&lt;/b&gt;):&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 16px;&quot;&gt;Timing cached reads:18102 MB in &amp;nbsp;2.00 seconds = &lt;b&gt;9058.08&lt;/b&gt; MB/sec&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 16px;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;14.04 - rev 01&lt;/b&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 16px;&quot;&gt;):&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;Timing cached reads:17846 MB in &amp;nbsp;1.99 seconds =&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;8956.28&lt;/b&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&amp;nbsp;MB/sec&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 16px;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;14.10 - rev 01&lt;/b&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 16px;&quot;&gt;):&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;Timing cached reads:21538 MB in &amp;nbsp;2.00 seconds =&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;10777.93&lt;/b&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&amp;nbsp;MB/sec&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;At one point, 2 of the rev 01 servers were using Ubuntu 14.04 and were getting similar bad benchmark results. After the upgrading them to 14.10, I immediately saw the disk read speed increase. &lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;:if.co&quot;&gt;The performance on rev 01 machine with 13.04 was bad, but somehow the rev 05 machine with the same OS version was performing well. This told me it&apos;s not a problem with the megaraid_sas driver, because the rev 01 and rev 05 machines with 13.04 had the same version.&lt;br /&gt;&lt;br /&gt;Here&apos;s the closest I can find to a similar issue (it&apos;s different hardware though):&amp;nbsp;&lt;a href=&quot;http://en.community.dell.com/support-forums/servers/f/906/t/19596533&quot;&gt;http://en.community.dell.com/support-forums/servers/f/906/t/19596533&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Update 3/1/2015:&lt;/b&gt;&lt;br /&gt;Saw an interesting checklist on Hacker News today that also mentioned disabling BIOS power saving settings:&amp;nbsp;&lt;a href=&quot;http://odetodata.com/2015/02/installation-and-configuration-checklist-for-microsoft-sql-server/&quot;&gt;http://odetodata.com/2015/02/installation-and-configuration-checklist-for-microsoft-sql-server/&lt;/a&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>MegaCli64 / MegaCli Only showing &quot;Exit Code: 0x00&quot;</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/megacli64-megacli-only-showing-exit.html"/>
   <updated>2015-01-06T18:23:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/megacli64-megacli-only-showing-exit</id>
   <content type="html">Problem: You see MegaCli64 or MegaCli only showing &quot;Exit Code: 0x00&quot; when you try to run commands.&lt;br /&gt;&lt;br /&gt;Solution: &lt;b&gt;Try running as sudo.&lt;/b&gt;</content>
 </entry>
 
 <entry>
   <title>Changing Putty Default Settings</title>
   <link href="https://www.paulsprogrammingnotes.com/2015/01/changing-putty-default-settings.html"/>
   <updated>2015-01-02T06:10:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2015/01/changing-putty-default-settings</id>
   <content type="html">&lt;p&gt;If you need to change Putty’s defaults, press “Load” on the saved session for “Default Settings”, make your changes, and “Save”.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/default_Settings.png&quot; alt=&quot;putty default settings&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Best Django Boilerplate/Skeleton</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/12/best-django-boilerplatetemplateskeleton.html"/>
   <updated>2014-12-27T07:29:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/12/best-django-boilerplatetemplateskeleton</id>
   <content type="html">This is my favorite boilerplate for new projects so far:&amp;nbsp;&lt;a href=&quot;https://github.com/kirpit/django-sample-app&quot;&gt;https://github.com/kirpit/django-sample-app&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Because:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;It&apos;s up-to-date (as of 12/27/2014). &lt;a href=&quot;https://github.com/rdegges/django-skel&quot;&gt;Django-skel&lt;/a&gt; is currently at only up to 1.5.9.&lt;/li&gt;&lt;li&gt;It&apos;s minimal. It doesn&apos;t make many design decisions for you or include a bunch of junk. &lt;a href=&quot;https://github.com/xenith/django-base-template&quot;&gt;Django-base-template&lt;/a&gt;&amp;nbsp;isn&apos;t as minimal.&lt;/li&gt;&lt;li&gt;Great structure, it follows this fairly closely:&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/a/23469321/1364191&quot;&gt;http://stackoverflow.com/a/23469321/1364191&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;If you&apos;re not a fan of bootstrap, &lt;a href=&quot;https://github.com/mike360/django-html5-boilerplate&quot;&gt;django-html5-boilerplate&lt;/a&gt; also looks good.</content>
 </entry>
 
 <entry>
   <title>Setting A WTForm Default Date To Today/Now</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/12/setting-wtform-default-date-to-today.html"/>
   <updated>2014-12-11T17:14:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/12/setting-wtform-default-date-to-today</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/a/27424739/1364191&quot;&gt;http://stackoverflow.com/a/27424739/1364191&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It&apos;s definitely a common mistake for people using WTForms. When you create a form and use something like datetime.date.today() as a default value, that value will always stay the same. &lt;b&gt;The fix is to use &quot;datetime.date.today&quot;&lt;/b&gt; instead of &quot;datetime.date.today()&quot;.</content>
 </entry>
 
 <entry>
   <title>Dokku Flask Port and Host</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/12/dokku-flask-port-and-host.html"/>
   <updated>2014-12-05T20:07:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/12/dokku-flask-port-and-host</id>
   <content type="html">In your flask application, you need to:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Set&amp;nbsp;default&amp;nbsp;&lt;b&gt;port=5000&lt;/b&gt; (this seems to be Dokku&apos;s default too)&lt;/li&gt;&lt;li&gt;Set default &lt;b&gt;host=0.0.0.0&lt;/b&gt; (this allows your host server to connect to the container)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;In your Procfile:&lt;br /&gt;&lt;div&gt;&lt;b&gt;web: python &amp;lt;your-app&amp;gt;.py&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If you&apos;re using gunicorn, it shouldn&apos;t matter because it&apos;s not using app.run().&lt;br /&gt;&lt;br /&gt;If you still can&apos;t connect to your application after it deploys, see this:&amp;nbsp;&lt;a href=&quot;http://www.paulsprogrammingnotes.com/2014/12/troubleshooting-dokku-not-accessible.html&quot;&gt;http://www.paulsprogrammingnotes.com/2014/12/troubleshooting-dokku-not-accessible.html&lt;/a&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Troubleshooting Dokku Not Accessible</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/12/troubleshooting-dokku-not-accessible.html"/>
   <updated>2014-12-05T20:02:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/12/troubleshooting-dokku-not-accessible</id>
   <content type="html">First, make sure your application isn&apos;t giving any errors when it attempts to run:&lt;br /&gt;&lt;b&gt;dokku run &amp;lt;your-app&amp;gt; &quot;&amp;lt;whatever is in your proc file&amp;gt;&quot;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Get the :port number from the line with &quot;upstream&quot; in the following file: &lt;b&gt;/home/dokku/&amp;lt;your-app&amp;gt;/nginx.conf&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Try to &quot;&lt;b&gt;wget&amp;nbsp;127.0.0.1:&amp;lt;your-port&amp;gt;&lt;/b&gt;&quot; from the host. Will it connect?</content>
 </entry>
 
 <entry>
   <title>&quot;Requested runtime not available for this stack&quot; - Dokku</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/12/requested-runtime-not-available-for.html"/>
   <updated>2014-12-04T15:32:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/12/requested-runtime-not-available-for</id>
   <content type="html">While using Dokku, I was getting the following error message: &lt;b&gt;Requested runtime (python-2.7.8) is not available for this stack (cedar-14).&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;This was due to a connection error between my docker container and the internet. To determine this, I ran &quot;docker images&quot; and got the image id of &quot;programium/buildstep&quot;, then got into a container with the following command:&amp;nbsp;&lt;b&gt;sudo docker run -t -i &amp;lt;your image id&amp;gt; /bin/bash&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Once in the container, I ran:&lt;br /&gt;&lt;b&gt;curl http://lang-python.s3.amazonaws.com/cedar/runtimes/python-2.7.8.tar.gz -s&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;If that is unsuccessful, that should confirm it&apos;s a connection issue.&lt;br /&gt;&lt;br /&gt;This was the solution to the problem:&amp;nbsp;&lt;a href=&quot;http://www.paulsprogrammingnotes.com/2014/12/rebuilding-buildstep-image-for-dokku.html&quot;&gt;http://www.paulsprogrammingnotes.com/2014/12/rebuilding-buildstep-image-for-dokku.html&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Rebuilding Buildstep Image For Dokku From Behind Proxy</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/12/rebuilding-buildstep-image-for-dokku.html"/>
   <updated>2014-12-02T20:52:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/12/rebuilding-buildstep-image-for-dokku</id>
   <content type="html">&lt;p&gt;I had to change the buildstep image’s docker file to add my proxy. This is because the buildstep image required a proxy before the build to download the python buildpack.&lt;/p&gt;

&lt;p&gt;I was rebuilding the buildstep image for dokku with these instructions: &lt;a href=&quot;https://github.com/progrium/dokku/commit/9ebf453b72cab3a16ea261284236bb7c20ca3a1a#diff-04c6e90faac2675aa89e2176d2eec7d8R101&quot;&gt;https://github.com/progrium/dokku/commit/9ebf453b72cab3a16ea261284236bb7c20ca3a1a#diff-04c6e90faac2675aa89e2176d2eec7d8R101&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m behind a proxy, so I was getting this error when I ran “&lt;strong&gt;sudo make build&lt;/strong&gt;”:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Cloning into ‘heroku-buildpack-multi’…
fatal: unable to access ‘https://github.com/ddollar/heroku-buildpack-multi.git/’: Failed to connect to github.com port 443: Connection timed out&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The solution? Replace the Dockerfile in the root of the folder you git cloned with this:&lt;/p&gt;
&lt;noscript&gt;&lt;pre&gt;FROM progrium/cedarish:cedar14
MAINTAINER Jeff Lindsay &amp;lt;progrium@gmail.com&amp;gt;

ENV http_proxy http://proxy.myproxy.com:8080/
ENV https_proxy http://proxy.myproxy.com:8080/

ADD ./stack/configs/etc-profile /etc/profile

ADD ./builder/ /build
RUN xargs -L 1 /build/install-buildpack /tmp/buildpacks &amp;lt; /build/config/buildpacks.txt
&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/190b948b42f9a637b327.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Troubleshooting Pip Timeout - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/12/troubleshooting-pip-timeout-python.html"/>
   <updated>2014-12-01T16:39:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/12/troubleshooting-pip-timeout-python</id>
   <content type="html">Timeout: (&amp;lt;pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x27330d0&amp;gt;, &apos;Connection to pypi.python.org timed out. (connect timeout=15)&apos;)&lt;br /&gt;&lt;br /&gt;If you&apos;re installing several requirements from a requirements.txt file, it helps to use &quot;-v&quot; after your pip install command to figure out which module has the timeout. Most likely, it&apos;s trying to download a module from a URL that doesn&apos;t exist.</content>
 </entry>
 
 <entry>
   <title>django-admin2</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/django-admin2.html"/>
   <updated>2014-11-29T03:09:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/django-admin2</id>
   <content type="html">This project looks similar more similar to Flask-Admin than regular Django Admin:&amp;nbsp;&lt;a href=&quot;https://github.com/pydanny/django-admin2&quot;&gt;https://github.com/pydanny/django-admin2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There&apos;s an example admin app here:&amp;nbsp;&lt;a href=&quot;https://github.com/pydanny/django-admin2/tree/develop/example&quot;&gt;https://github.com/pydanny/django-admin2/tree/develop/example&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>NULL values excluded from NOT IN - SQLAlchemy+SQLite</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/null-values-excluded-from-not-in.html"/>
   <updated>2014-11-26T01:47:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/null-values-excluded-from-not-in</id>
   <content type="html">Solution: AND column IS NOT NULL&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Example: &lt;b&gt;query.filter(or_(~self.column.in_(value), self.column == None))&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This thread explains &quot;SQL Server in treating NULL as a value&quot;: http://stackoverflow.com/questions/11491831/null-values-are-excluded-why</content>
 </entry>
 
 <entry>
   <title>Github Asking For Password After Adding SSH Key</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/github-asking-for-password-after-adding.html"/>
   <updated>2014-11-25T23:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/github-asking-for-password-after-adding</id>
   <content type="html">&lt;div&gt;Run:&amp;nbsp;&lt;b&gt;git remote -v&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If the output has a URL that starts with&amp;nbsp;https://github.com and not git@github.com, you need to change that by running a command similar to this:&amp;nbsp;&lt;b&gt;git remote set-url origin git@github.com:&lt;/b&gt;pawl/flask-admin.git&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://help.github.com/articles/changing-a-remote-s-url/#switching-remote-urls-from-ssh-to-https&quot;&gt;https://help.github.com/articles/changing-a-remote-s-url/#switching-remote-urls-from-ssh-to-https&lt;/a&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Guide To Syncing Fork With Original Project</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/guide-to-sync-fork-with-original-project.html"/>
   <updated>2014-11-21T08:14:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/guide-to-sync-fork-with-original-project</id>
   <content type="html">&lt;a href=&quot;https://help.github.com/articles/syncing-a-fork/&quot;&gt;https://help.github.com/articles/syncing-a-fork/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;From my fork, I ran these commands:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;git remote add upstream https://github.com/mrjoes/flask-admin.git&lt;/li&gt;&lt;li&gt;git fetch upstream&lt;/li&gt;&lt;li&gt;git merge upstream/master&lt;/li&gt;&lt;li&gt;git push&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Create new branch and sync with upstream (change the &lt;b&gt;bolded &lt;/b&gt;text):&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;git remote add upstream &lt;b&gt;https://github.com/mrjoes/flask-admin.git&lt;/b&gt;&lt;/li&gt;&lt;li&gt;git fetch upstream&lt;/li&gt;&lt;li&gt;git checkout -b &lt;b&gt;issue_xxxx &lt;/b&gt;upstream/master&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://docs.djangoproject.com/en/1.6/internals/contributing/writing-code/working-with-git/#working-on-a-ticket&quot;&gt;https://docs.djangoproject.com/en/1.6/internals/contributing/writing-code/working-with-git/#working-on-a-ticket&lt;/a&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Auto-Fixing Syntax Guideline Problems With Autopep8 - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/auto-fixing-syntax-guideline-problems.html"/>
   <updated>2014-11-18T19:50:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/auto-fixing-syntax-guideline-problems</id>
   <content type="html">&lt;b&gt;find . -name &apos;*.py&apos; -exec autopep8 --in-place &apos;{}&apos; \;&lt;/b&gt;&lt;br /&gt;&lt;a href=&quot;https://github.com/hhatto/autopep8/issues/30#issuecomment-22458121&quot;&gt;https://github.com/hhatto/autopep8/issues/30#issuecomment-22458121&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Configuring Notepad++ For Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/configuring-notepad-for-python.html"/>
   <updated>2014-11-16T08:53:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/configuring-notepad-for-python</id>
   <content type="html">&lt;blockquote class=&quot;tr_bq&quot;&gt;On the Settings-&amp;gt;&quot;Preferences&quot;, &quot;Tab Settings&quot; tab, I set &quot;[Default]&quot; at Tab size: 8, uncheck Replace by space; and set &quot;Python&quot; to uncheck Use default value, Tab size: 4, check Replace by space. This causes inserts into a python source to use 4 spaces for indents, and indent with spaces instead of tabs.&amp;nbsp;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;If I end up with any tabs in the source, I use Edit-&amp;gt;Blank Operations-&amp;gt;TAB to Space to convert them. I also clean up trailing blanks with Edit-&amp;gt;Blank Operations-&amp;gt;Trim Trailing Space.&amp;nbsp;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;I install and use the pep8 package to verify standard formatting.&lt;/blockquote&gt;&lt;a href=&quot;http://www.reddit.com/r/Python/comments/2mfrn6/python_in_notepad/cm3tdj5&quot;&gt;http://www.reddit.com/r/Python/comments/2mfrn6/python_in_notepad/cm3tdj5&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Redirecting From Within Helper Functions - Flask</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/redirecting-from-within-helper.html"/>
   <updated>2014-11-15T23:33:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/redirecting-from-within-helper</id>
   <content type="html">&lt;noscript&gt;&lt;pre&gt;from flask import Flask, redirect
from werkzeug.routing import RoutingException, HTTPException

app = Flask(__name__)

@app.route(&amp;#39;/&amp;#39;)
def hello_world():
	def helper_function():
		# Attempt #1
		# this obviously won&amp;#39;t work: return redirect(&amp;#39;www.google.com&amp;#39;)
		# the program would just return &amp;#39;Hello World!&amp;#39;
		
		# Attempt #2
		# THIS IS PERMANENT!: raise RequestRedirect(&amp;#39;example2&amp;#39;)
		# your browser will cache the status 301 and ALWAYS redirect
		# explanation: http://stackoverflow.com/a/16371787/1364191
		
		# Attempt #3
		class RequestRedirect(HTTPException, RoutingException):
			&amp;quot;&amp;quot;&amp;quot;Raise if the map requests a redirect. This is for example the case if
			`strict_slashes` are activated and an url that requires a trailing slash.
			The attribute `new_url` contains the absolute destination url.
			The attribute `code` is returned status code.
			&amp;quot;&amp;quot;&amp;quot;
			def __init__(self, new_url, code=301):
				RoutingException.__init__(self, new_url)
				self.new_url = new_url
				self.code = code
			def get_response(self, environ):
				return redirect(self.new_url, self.code)
				
		raise RequestRedirect(&amp;#39;example3&amp;#39;, code=302)
	helper_function()
	return &amp;#39;Hello World!&amp;#39;
	
@app.route(&amp;#39;/example2&amp;#39;)
def example2():
	return &amp;#39;Example 2&amp;#39;
	
@app.route(&amp;#39;/example3&amp;#39;)
def example3():
	return &amp;#39;Example 3&amp;#39;

if __name__ == &amp;#39;__main__&amp;#39;:
    app.run(host=&amp;quot;0.0.0.0&amp;quot;, port=9999, debug=True)&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/762876a1770e0d2593b6.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Reload Enviromental Variables Without Logging Out - Ubuntu</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/reload-enviromental-variables-without.html"/>
   <updated>2014-11-15T21:54:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/reload-enviromental-variables-without</id>
   <content type="html">This doesn&apos;t actually work: &quot;source /etc/environment&quot;&lt;br /&gt;This did the trick though:&lt;pre style=&quot;background: rgb(238, 238, 238); border-left-color: rgb(204, 204, 204); border-left-style: solid; border-width: 0px 0px 0px 5px; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; font-size: 14px; line-height: 17.8048000335693px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px 5px 5px 10px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;for line in $( cat /etc/environment ) ; do export $line ; done&lt;/code&gt;&lt;/pre&gt;&lt;a href=&quot;http://superuser.com/questions/339617/how-to-reload-etc-environment-without-rebooting#comment371112_339617&quot;&gt;http://superuser.com/questions/339617/how-to-reload-etc-environment-without-rebooting#comment371112_339617&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Open Source Charting Library With Vertical Markers/Annotations</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/open-source-charting-library-with.html"/>
   <updated>2014-11-15T18:42:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/open-source-charting-library-with</id>
   <content type="html">Saw this charting library from the Mozilla Metrics Team on hacker news recently: &lt;a href=&quot;http://metricsgraphicsjs.org/interactive-demo.htm&quot;&gt;http://metricsgraphicsjs.org/interactive-demo.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Their interactive example is here:&amp;nbsp;&lt;a href=&quot;http://metricsgraphicsjs.org/interactive-demo.htm&quot;&gt;http://metricsgraphicsjs.org/interactive-demo.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I&apos;m not aware of any other charting libraries besides highcharts that do vertical marker lines this easily.</content>
 </entry>
 
 <entry>
   <title>Python datetime.strftime Cheat Sheet</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/python-datetimestrftime-cheat-sheet.html"/>
   <updated>2014-11-14T17:52:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/python-datetimestrftime-cheat-sheet</id>
   <content type="html">&lt;a href=&quot;http://strftime.org/&quot;&gt;http://strftime.org/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Using Bootstrap-DateRangePicker As A Timepicker</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/using-bootstrap-daterangepicker-as.html"/>
   <updated>2014-11-11T07:32:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/using-bootstrap-daterangepicker-as</id>
   <content type="html">Here&apos;s the jsfiddle:&amp;nbsp;&lt;a href=&quot;http://jsfiddle.net/d8uomdjv/&quot;&gt;http://jsfiddle.net/d8uomdjv/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It seems like the author is opposed to adding this sort of functionality:&amp;nbsp;&lt;a href=&quot;https://github.com/dangrossman/bootstrap-daterangepicker/issues/295&quot;&gt;https://github.com/dangrossman/bootstrap-daterangepicker/issues/295&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>re.match vs re.search - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/rematch-vs-research-python.html"/>
   <updated>2014-11-11T01:13:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/rematch-vs-research-python</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/a/180993/1364191&quot;&gt;http://stackoverflow.com/a/180993/1364191&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;re.match&lt;/b&gt; -&amp;nbsp;If zero or more characters at the beginning of string match the regular expression pattern.&lt;/li&gt;&lt;li&gt;&lt;b&gt;re.search&lt;/b&gt; -&amp;nbsp;Scan through string looking for a location where the regular expression pattern produces a match&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>New Machine Setup For Flask Development On Ubuntu</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/11/new-machine-setup-for-flask-development.html"/>
   <updated>2014-11-09T01:34:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/11/new-machine-setup-for-flask-development</id>
   <content type="html">&lt;p&gt;Here are the commands I use when I bring up a new Ubuntu server for flask development:&lt;/p&gt;
&lt;noscript&gt;&lt;pre&gt;sudo apt-get update &amp;amp;&amp;amp; time sudo apt-get dist-upgrade
sudo timedatectl set-timezone America/Chicago
apt-get install git fail2ban htop nano
mkdir -p .ssh
nano .ssh/authorized_keys
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa
apt-get install python-setuptools
easy_install pip
pip install virtualenvwrapper
sudo mkdir ~/virtualenvs
sudo sh -c &amp;quot;echo &amp;#39;WORKON_HOME=~/virtualenvs&amp;#39; &amp;gt;&amp;gt; /etc/environment&amp;quot;
for line in $( cat /etc/environment ) ; do export $line ; done
mkdir -p $WORKON_HOME
sudo sh -c &amp;quot;echo &amp;#39;source /usr/local/bin/virtualenvwrapper.sh&amp;#39; &amp;gt;&amp;gt; ~/.bashrc&amp;quot;
bash
mkvirtualenv default
apt-get install python-dev&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/f7d58208cbeddb8c3b69.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>MySQL Performance LXC Container vs Host</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/10/mysql-performance-lxc-container-vs-host.html"/>
   <updated>2014-10-23T05:25:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/10/mysql-performance-lxc-container-vs-host</id>
   <content type="html">I have a linux virtual container (LXC) and the server hosting the container running the same version of MySQL with the same database.&lt;br /&gt;&lt;br /&gt;I tried running some select queries on both of the both the virtual container and host for benchmark purposes. My conclusion? MySQL read performance inside and outside the LXC container is the exactly the same.</content>
 </entry>
 
 <entry>
   <title>WHMCS Cronjob Error</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/10/whmcs-cronjob-error.html"/>
   <updated>2014-10-22T00:54:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/10/whmcs-cronjob-error</id>
   <content type="html">If you get the following error while you try to run the WHMCS cronjob from the command line:&lt;br /&gt;Site error: the file &amp;lt;b&amp;gt;/var/www/accounts/admin/cron.php&amp;lt;/b&amp;gt; requires the ionCube PHP Loader ioncube_loader_lin_5.3.so to be installed by the website operator. If you are the website operator please use the &amp;lt;a href=&quot;http://www.ioncube.com/lw/&quot;&amp;gt;ionCube Loader Wizard&amp;lt;/a&amp;gt; to assist with installation.&lt;br /&gt;&lt;br /&gt;You need to add your the ioncube zend extension to the CLI php.ini too:&amp;nbsp;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;/etc/php5/cli/php.ini&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Sendmail/STARTTLS verify=FAIL</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/10/sendmailstarttls-verifyfail.html"/>
   <updated>2014-10-19T19:33:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/10/sendmailstarttls-verifyfail</id>
   <content type="html">&lt;br /&gt;&lt;div class=&quot;Mu SP&quot; id=&quot;:ew.ma&quot; style=&quot;-webkit-transition: opacity 0.218s ease; font-family: arial, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 6px; opacity: 1; transition: opacity 0.218s ease; word-break: break-word; word-wrap: break-word;&quot;&gt;&lt;div class=&quot;xH&quot; id=&quot;:ew.at&quot; style=&quot;-webkit-text-stroke-width: 0px; color: #262626; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;Mu SP&quot; id=&quot;:ev.ma&quot; style=&quot;-webkit-transition: opacity 0.218s ease; font-family: arial, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 6px; opacity: 1; transition: opacity 0.218s ease; word-break: break-word; word-wrap: break-word;&quot;&gt;&lt;div id=&quot;:ev.co&quot; style=&quot;font-family: arial, sans-serif;&quot;&gt;Oct 19 14:04:34 Billing sm-mta[17583]: STARTTLS=client, relay=aspmx.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-RC4-SHA, bits=128/128&lt;/div&gt;&lt;div id=&quot;:ev.co&quot; style=&quot;font-family: arial, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;:ev.co&quot; style=&quot;font-family: arial, sans-serif;&quot;&gt;If you see those errors in your mail.log and your emails are failing to send, you need to add your ssl cert from apache to the sendmail config in /etc/mail/sendmail.cf:&lt;/div&gt;&lt;div id=&quot;:ev.co&quot; style=&quot;font-family: arial, sans-serif;&quot;&gt;&lt;div id=&quot;:ev.co&quot;&gt;# CA directory&lt;/div&gt;&lt;div id=&quot;:ev.co&quot;&gt;O CACertPath=/etc/apache2/ssl&lt;/div&gt;&lt;div id=&quot;:ev.co&quot;&gt;# CA file&lt;/div&gt;&lt;div id=&quot;:ev.co&quot;&gt;O CACertFile=/etc/apache2/ssl/example.ca-bundle&lt;/div&gt;&lt;div id=&quot;:ev.co&quot;&gt;# Server Cert&lt;/div&gt;&lt;div id=&quot;:ev.co&quot;&gt;O ServerCertFile=/etc/apache2/ssl/example.cert&lt;/div&gt;&lt;div id=&quot;:ev.co&quot;&gt;# Server private key&lt;/div&gt;&lt;div id=&quot;:ev.co&quot;&gt;O ServerKeyFile=/etc/apache2/ssl/example.key&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Securing External LDAP Connections</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/10/securing-external-ldap-connections.html"/>
   <updated>2014-10-19T03:58:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/10/securing-external-ldap-connections</id>
   <content type="html">&lt;a href=&quot;https://help.ubuntu.com/community/SecuringOpenLDAPConnections&quot;&gt;https://help.ubuntu.com/community/SecuringOpenLDAPConnections&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I was getting the following error when I tried testing with openssl:&lt;br /&gt;&lt;b&gt;error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:177&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;The solution? It turns out that&amp;nbsp;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;/etc/default/slapd needs to be configured to use /etc/ldap/ldap.conf using the following:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #262626; font-family: arial, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;&lt;b&gt;SLAPD_OPTIONS=&quot;-f /etc/ldap/slapd.conf&quot;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Adding Virtualhost In Apache For Port</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/10/adding-virtualhost-in-apache-for-port.html"/>
   <updated>2014-10-17T16:26:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/10/adding-virtualhost-in-apache-for-port</id>
   <content type="html">Say we wanted to route the &amp;lt;your-domain&amp;gt;.com:8072/misc to /var/www/misc...&lt;br /&gt;&lt;br /&gt;Add the following to /etc/apache2/ports.conf:&lt;br /&gt;&lt;b&gt;NameVirtualHost *:8072&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Listen 8072&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Add a file that describes your site to&amp;nbsp;/etc/apache2/sites-available with this:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&amp;lt;VirtualHost *:8072&amp;gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;ServerName &amp;lt;your-domain&amp;gt;.com&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;DocumentRoot /var/www/misc/&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&amp;lt;/VirtualHost&amp;gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Run this command: &lt;b&gt;sudo a2ensite misc&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And restart apache:&amp;nbsp;&lt;b&gt;sudo service apache2 restart&lt;/b&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Deploying Nginx + Gunicorn + Flask</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/10/deploying-nginx-gunicorn-flask.html"/>
   <updated>2014-10-16T19:33:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/10/deploying-nginx-gunicorn-flask</id>
   <content type="html">Why use both Nginx and Gunicorn?:&amp;nbsp;&lt;a href=&quot;http://serverfault.com/a/220047&quot; style=&quot;font-family: &apos;Segoe UI&apos;; font-size: 10pt;&quot; title=&quot;http://serverfault.com/a/220047&quot;&gt;http://serverfault.com/a/220047&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Simple explanation:&amp;nbsp;&lt;a href=&quot;http://prakhar.me/articles/flask-on-nginx-and-gunicorn/&quot; style=&quot;font-family: &apos;Segoe UI&apos;; font-size: 10pt;&quot; title=&quot;http://prakhar.me/articles/flask-on-nginx-and-gunicorn/&quot;&gt;http://prakhar.me/articles/flask-on-nginx-and-gunicorn/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Nginx SSL configuration:&amp;nbsp;&lt;a href=&quot;https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-with-ssl-as-a-reverse-proxy-for-jenkins&quot; style=&quot;font-family: &apos;Segoe UI&apos;; font-size: 10pt;&quot; title=&quot;https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-with-ssl-as-a-reverse-proxy-for-jenkins&quot;&gt;https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-with-ssl-as-a-reverse-proxy-for-jenkins&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The thing I spent the longest on was getting supervisor to work. Gunicorn kept giving me &quot;gunicorn.errors.HaltServer: &amp;lt;HaltServer &apos;Worker failed to boot.&apos; 3&amp;gt;&quot;, because I was missing the &quot;directory&quot; parameter. I needed to tell supervisor which directory to start from.&lt;br /&gt;&lt;br /&gt;[program:my_app]&lt;br /&gt;command=/&amp;lt;path&amp;gt;/venv/prod/bin/gunicorn -w 8 main:app -b 127.0.0.1:8080&lt;br /&gt;user=me&lt;br /&gt;autostart=true&lt;br /&gt;&lt;b&gt;directory=/home/me/my_dir/&lt;/b&gt;&lt;br /&gt;stdout_logfile=/home/me/my_dir/gunicorn_supervisor.log&lt;br /&gt;stdout_logfile_maxbytes=20MB&lt;br /&gt;redirect_stderr=true&lt;br /&gt;&lt;div&gt;&lt;br /&gt;You will need to create an upstart script to get supervisor to run when the system starts: http://serverfault.com/a/96500&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Python Excel Library Benchmark Comparison</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/10/python-excel-library-benchmark.html"/>
   <updated>2014-10-15T05:01:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/10/python-excel-library-benchmark</id>
   <content type="html">&lt;a href=&quot;https://github.com/swistakm/python-excel-benchmarks&quot;&gt;https://github.com/swistakm/python-excel-benchmarks&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;benchmark_csv &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.026495&lt;br /&gt;benchmark_excellent &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.784107&lt;br /&gt;benchmark_openpyxl &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.897072&lt;br /&gt;benchmark_openpyxl_rows &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7.025895&lt;br /&gt;benchmark_pyexcelerate &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.550225&lt;br /&gt;benchmark_xlsxcessive &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.430242&lt;br /&gt;benchmark_xlsxwriter &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.611668&lt;br /&gt;benchmark_xlwt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.275144&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://xlsxwriter.readthedocs.org/en/latest/working_with_memory.html&quot;&gt;http://xlsxwriter.readthedocs.org/en/latest/working_with_memory.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;pyexcelerate &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: &amp;nbsp;10.11&lt;br /&gt;xlwt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: &amp;nbsp;15.67&lt;br /&gt;xlsxwriter (optimised): &amp;nbsp;19.70&lt;br /&gt;xlsxwriter &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: &amp;nbsp;23.50&lt;br /&gt;openpyxl &amp;nbsp; (optimised): &amp;nbsp;95.82&lt;br /&gt;openpyxl &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: &amp;nbsp;95.90</content>
 </entry>
 
 <entry>
   <title>Large Dictionaries Not Released From Memory - Python + Ubuntu</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/10/large-dictionaries-not-released-from.html"/>
   <updated>2014-10-13T18:27:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/10/large-dictionaries-not-released-from</id>
   <content type="html">I have a flask application running on Ubuntu which reads from a file and creates several large dictionaries. After the dictionaries are created and flask returns the request, the memory used for the dictionaries is not released back to the OS. This example shows the problem:&amp;nbsp;&lt;a href=&quot;https://gist.github.com/pawl/c3ed7663b94abec01d75&quot;&gt;https://gist.github.com/pawl/c3ed7663b94abec01d75&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It&apos;s not really a Flask issue, but the Flask guys were super helpful when I asked why my large dictionary wasn&apos;t released from memory:&amp;nbsp;&lt;a href=&quot;https://github.com/mitsuhiko/flask/issues/1202&quot;&gt;https://github.com/mitsuhiko/flask/issues/1202&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I dug even deeper and learned this is a Linux thing:&lt;br /&gt;&quot;Python returns memory to the OS on the heap (that allocates other objects than small objects) &lt;b&gt;only on Windows&lt;/b&gt;, if you run on Linux, you can only see the total memory used by your program increase.&quot;&lt;br /&gt;&lt;a href=&quot;http://deeplearning.net/software/theano/tutorial/python-memory-management.html&quot;&gt;http://deeplearning.net/software/theano/tutorial/python-memory-management.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My solution:&lt;br /&gt;Turning it into a function and &lt;b&gt;running it as a separate process&lt;/b&gt;:&amp;nbsp;&lt;a href=&quot;https://gist.github.com/pawl/95769724848269cff890&quot;&gt;https://gist.github.com/pawl/95769724848269cff890&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you want to go even deeper down the rabbit hole, read these:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&quot;most malloc implementations will not release memory to the operating system, and the few that do, do not do it very easily&quot; -&lt;a href=&quot;http://stackoverflow.com/questions/2215259/will-malloc-implementations-return-free-ed-memory-back-to-the-system&quot;&gt;http://stackoverflow.com/questions/2215259/will-malloc-implementations-return-free-ed-memory-back-to-the-system&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&quot;We compiled a version of Python with TCMalloc that only uses mmap. When testing the new Python in one of our largest projects, we found that not only did Python give back memory to the OS correctly, it also had a reduced memory usage and no apparent CPU penalty for using mmap instead of brk.&quot; -&amp;nbsp;&lt;a href=&quot;http://pushingtheweb.com/2010/06/python-and-tcmalloc/&quot;&gt;http://pushingtheweb.com/2010/06/python-and-tcmalloc/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Renaming Screen - Ubuntu</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/10/renaming-screen-ubuntu.html"/>
   <updated>2014-10-08T18:23:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/10/renaming-screen-ubuntu</id>
   <content type="html">&lt;a href=&quot;http://superuser.com/a/521112&quot;&gt;http://superuser.com/a/521112&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;screen -S 8890.foo -X sessionname bar</content>
 </entry>
 
 <entry>
   <title>Initializing Dictionary Elements Inside A Loop - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/10/initializing-dictionary-elements-inside.html"/>
   <updated>2014-10-04T08:29:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/10/initializing-dictionary-elements-inside</id>
   <content type="html">There&apos;s a really interesting tip in the &quot;Initializing Dictionary Elements&quot; section of this page: &lt;a href=&quot;https://wiki.python.org/moin/PythonSpeed/PerformanceTips&quot;&gt;https://wiki.python.org/moin/PythonSpeed/PerformanceTips&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&quot;&lt;span style=&quot;background-color: white; font-family: Arial, Verdana, Geneva, &apos;Bitstream Vera Sans&apos;, Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;&quot;&gt;it is cheaper to use a&amp;nbsp;&lt;/span&gt;&lt;tt style=&quot;background-color: white;&quot;&gt;try&lt;/tt&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Verdana, Geneva, &apos;Bitstream Vera Sans&apos;, Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;&quot;&gt;&amp;nbsp;statement&quot; when checking to see if a key exists in a dictionary (inside of a loop).&lt;/span&gt;</content>
 </entry>
 
 <entry>
   <title>maximum recursion depth exceeded - PyIntervalTree</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/10/maximum-recursion-depth-exceeded.html"/>
   <updated>2014-10-02T17:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/10/maximum-recursion-depth-exceeded</id>
   <content type="html">I was getting the &quot;maximum recursion depth exceeded&quot; when I tried to run large datasets through&amp;nbsp;PyIntervalTree.&lt;br /&gt;&lt;br /&gt;I never fixed the issue or found anyone else with the issue. I ended up switching to bx-python instead:&amp;nbsp;&lt;a href=&quot;https://www.biostars.org/p/99/#100&quot;&gt;https://www.biostars.org/p/99/#100&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Group By Apply Occurring Twice On First Item - Pandas</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/10/group-by-apply-occurring-twice-on-first.html"/>
   <updated>2014-10-02T17:10:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/10/group-by-apply-occurring-twice-on-first</id>
   <content type="html">&lt;a href=&quot;https://github.com/pydata/pandas/issues/7739#issuecomment-48823964&quot;&gt;https://github.com/pydata/pandas/issues/7739#issuecomment-48823964&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If Pandas&apos;s Group By is applying the function in Apply twice to the first item, it&apos;s actually expected behavior according to the warning in the documentation:&amp;nbsp;&lt;a href=&quot;http://pandas.pydata.org/pandas-docs/stable/groupby.html#flexible-apply&quot;&gt;http://pandas.pydata.org/pandas-docs/stable/groupby.html#flexible-apply&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Virtualenvwrapper Basics</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/09/virtualenvwrapper-basics.html"/>
   <updated>2014-09-28T08:25:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/09/virtualenvwrapper-basics</id>
   <content type="html">This video does a good job of describing the basics of Virtualenvwrapper:&amp;nbsp;&lt;a href=&quot;https://www.youtube.com/watch?v=thHNYVrY0lU&quot;&gt;https://www.youtube.com/watch?v=thHNYVrY0lU&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You&apos;ll need to have used virtualenv to appreciate this.&lt;br /&gt;&lt;br /&gt;Basically, you create virtual environments with &lt;b&gt;&quot;mkvirtualenv&quot;&lt;/b&gt; and they&apos;re stored in a central location. When you want to switch to your virtual environment, you use the &lt;b&gt;&quot;workon&quot;&lt;/b&gt; command.&lt;br /&gt;&lt;br /&gt;You can also create a postactivate script that loads environmental variables when you switch to your virtual environment.&lt;br /&gt;&lt;br /&gt;Note: There is also a module called Pew that seems to have a simpler installation process:&amp;nbsp;&lt;a href=&quot;https://github.com/berdario/pew&quot;&gt;https://github.com/berdario/pew&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Meetup API address_1_error</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/09/meetup-api-address1error.html"/>
   <updated>2014-09-25T03:10:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/09/meetup-api-address1error</id>
   <content type="html">I was getting this error while using the POST /venues method of the meetup API.&lt;br /&gt;&lt;br /&gt;The error seems to happen when you duplicate the address of another venue. I was able to add the venue, but when I tried to add it a second time - I would get this error.&lt;br /&gt;&lt;br /&gt;I ended up getting the list of venues and trying to find a match first.</content>
 </entry>
 
 <entry>
   <title>Profiling Python Scripts</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/09/profiling-python-scripts.html"/>
   <updated>2014-09-20T20:24:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/09/profiling-python-scripts</id>
   <content type="html">&lt;a href=&quot;https://github.com/what-studio/profiling&quot;&gt;https://github.com/what-studio/profiling&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Easiest Way To Install Python Libraries In Windows (that require compiling)</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/09/easiest-way-to-install-python-libraries.html"/>
   <updated>2014-09-18T19:03:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/09/easiest-way-to-install-python-libraries</id>
   <content type="html">&lt;a href=&quot;http://www.lfd.uci.edu/~gohlke/pythonlibs/&quot;&gt;http://www.lfd.uci.edu/~gohlke/pythonlibs/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Eventbrite &quot;Application Key Error&quot;</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/09/eventbrite-application-key-error.html"/>
   <updated>2014-09-16T07:29:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/09/eventbrite-application-key-error</id>
   <content type="html">The error message looks like this:&lt;br /&gt;{u&apos;status&apos;: {u&apos;http_code&apos;: 200}, u&apos;contents&apos;: {u&apos;error&apos;: {u&apos;error_type&apos;: u&apos;&lt;b&gt;Application Key Error&lt;/b&gt;&apos;, u&apos;error_message&apos;: u&apos;&lt;b&gt;Please provide your Application Key in the URL &lt;/b&gt;as &quot;?app_key=&amp;lt;APP_KEY&amp;gt;&quot;.&apos;}}}&lt;br /&gt;&lt;br /&gt;After a few hours of trying to get past the Eventbrite API&apos;s &quot;Application Key Error&quot;. I finally figured out that I needed to switch my request URL from:&lt;br /&gt;&lt;b&gt;&quot;https://developer.eventbrite.com/json/event_new&quot;&lt;/b&gt;&lt;br /&gt;to:&lt;br /&gt;&lt;b&gt;&quot;https://www.eventbrite.com/json/event_new&quot;&lt;/b&gt;</content>
 </entry>
 
 <entry>
   <title>dc.js + Crosstab: Chart With Linked Table</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/09/dcjs-crosstab-chart-with-linked-table.html"/>
   <updated>2014-09-14T23:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/09/dcjs-crosstab-chart-with-linked-table</id>
   <content type="html">&lt;a href=&quot;http://dc-js.github.io/dc.js/&quot;&gt;http://dc-js.github.io/dc.js/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Flask OAuthLib Examples</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/09/flask-oauthlib-examples.html"/>
   <updated>2014-09-13T06:40:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/09/flask-oauthlib-examples</id>
   <content type="html">&lt;a href=&quot;https://github.com/lepture/flask-oauthlib/blob/master/example/github.py&quot;&gt;https://github.com/lepture/flask-oauthlib/blob/master/example/github.py&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://github.com/bjourne/vvm/blob/master/app/users/views.py&quot;&gt;https://github.com/bjourne/vvm/blob/master/app/users/views.py&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Override get_query based on GET parameter - Flask-Admin</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/09/override-getquery-based-on-get.html"/>
   <updated>2014-09-10T18:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/09/override-getquery-based-on-get</id>
   <content type="html">&lt;p&gt;This will change the results in a flask-admin index view based on GET parameters. In most cases, using filters to do this is probably a better idea.&lt;/p&gt;

&lt;noscript&gt;&lt;pre&gt;from application import db
from application.views.modelview import ModelView
from application.models import Things # has an attribute called thing_type

class MyModelView(ModelView):
	def get_query(self):
		thing_type = request.args.get(&amp;#39;type&amp;#39;, None) # pretending we have a GET parameter called &amp;quot;type&amp;quot;
		if thing_type == &amp;quot;type1&amp;quot;:
			return super(ModelView, self).get_query().filter(Things.thing_type.like(&amp;#39;type1 %&amp;#39;))
		elif thing_type == &amp;quot;type2&amp;quot;:
			return super(ModelView, self).get_query().filter(Things.thing_type.like(&amp;#39;type2 %&amp;#39;))
		else:
			return super(ModelView, self).get_query()
			
# note, you can&amp;#39;t define get_query inside of def index_view(self)&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/5fcd1d206c874d091302.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Changing A Single GET Parameter In Request - Flask</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/09/changing-single-get-parameter-in.html"/>
   <updated>2014-09-10T16:42:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/09/changing-single-get-parameter-in</id>
   <content type="html">&lt;noscript&gt;&lt;pre&gt;from application import app
from flask import request, url_for, redirect

@app.route(&amp;#39;/&amp;#39;)
def index():
	modified_args = dict(request.args)
	modified_args[&amp;#39;key&amp;#39;] = &amp;#39;modified_value&amp;#39;
	return redirect(url_for(&amp;#39;my_view&amp;#39;, **modified_args))&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/10edd7bd2305379ef108.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>SQLAlchemy Performance Tip</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/09/sqlalchemy-performance-tip.html"/>
   <updated>2014-09-03T18:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/09/sqlalchemy-performance-tip</id>
   <content type="html">&lt;a href=&quot;http://www.mobify.com/blog/sqlalchemy-memory-magic/&quot;&gt;http://www.mobify.com/blog/sqlalchemy-memory-magic/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&quot;If you can process the results of database queries iteratively (and very often you can), stream the results&quot;&lt;br /&gt;&lt;br /&gt;&quot;Since the data needs to travel over the network from the database whether it&apos;s streamed or not, this doesn&apos;t add a huge overhead, but we&apos;ll see that it reduces memory requirements.&quot;&lt;br /&gt;&lt;br /&gt;Example (using Flask-SQLAlchemy):&lt;br /&gt;&lt;b&gt;db.engine.execution_options(stream_results=True).execute(query)&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;However, that&apos;s not the full story when it comes to MySQLdb (MySQL-python). &lt;a href=&quot;http://stackoverflow.com/a/3699677&quot;&gt;http://stackoverflow.com/a/3699677&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you&apos;re going to do this with mysql, I recommend using oursql:&amp;nbsp;&lt;a href=&quot;https://pypi.python.org/pypi/oursql&quot;&gt;https://pypi.python.org/pypi/oursql&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Enable Threading - Flask</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/09/enable-threading-flask.html"/>
   <updated>2014-09-03T18:47:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/09/enable-threading-flask</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/a/14823968/1364191&quot;&gt;http://stackoverflow.com/a/14823968/1364191&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you&apos;re going to be expecting more than one user on your flask server, you need to enable threading like this:&amp;nbsp;app.run(host=&apos;0.0.0.0&apos;, port=5000, &lt;b&gt;threaded=True&lt;/b&gt;)&lt;br /&gt;&lt;br /&gt;Unfortunately, the threading makes Ctrl+C not work sometimes and I&apos;ll have to kill the thread manually.&lt;br /&gt;&lt;br /&gt;For better solutions for production, check out these WSGI solutions:&amp;nbsp;&lt;a href=&quot;http://flask.pocoo.org/docs/0.10/deploying/wsgi-standalone/&quot;&gt;http://flask.pocoo.org/docs/0.10/deploying/wsgi-standalone/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Mosh - SSH Without Dropped Connections</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/09/mosh-ssh-without-dropped-connections.html"/>
   <updated>2014-09-01T21:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/09/mosh-ssh-without-dropped-connections</id>
   <content type="html">&lt;a href=&quot;https://mosh.mit.edu/&quot;&gt;https://mosh.mit.edu/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Warning: As of 10/17/2014, it&apos;s still in development and they haven&apos;t implemented scrollback yet. However, you can use screen and view the scrollback with Ctrl+A then Esc.</content>
 </entry>
 
 <entry>
   <title>Things I Learned From DEFCON</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/08/things-i-learned-from-defcon.html"/>
   <updated>2014-08-31T20:52:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/08/things-i-learned-from-defcon</id>
   <content type="html">&lt;div dir=&quot;ltr&quot;&gt;Pentoo - Linux distro for pen testing.&lt;br /&gt;VMware fusion - Most of the presenters were using a Macbook with VMware fusion managing their VMs.&lt;br /&gt;Chinavasion - One of the presentations mentioned this in the context of dealextreme, I&apos;m assuming this site is similar.&lt;br /&gt;Kali linux - Another distro for pen testing.&lt;br /&gt;Open bts &lt;br /&gt;Sqlmap (SQLi injection) - Python tool used to tell if php pages were vulnerable to SQLi injection.&lt;br /&gt;C99 shell - PHP interface for shell level system functions.&lt;br /&gt;b374k shell - Another shell which allows an user to run file system, database, and shell commands from a web interface.&lt;br /&gt;Accunetix (xss)&lt;br /&gt;Business logic flaws in mobile operators&lt;br /&gt;Doskey /history - Will show you all the previous commands typed into command prompt.&lt;br /&gt;Maria DB - When oracle took over MySQL, it forked and maria db is still run by the previous developers.&lt;br /&gt;Firefox imacro - A presenter said he uses this for all of his bots.&lt;br /&gt;Burp repeater - Looks similar to fiddler, allows repeating http packets. Maybe only for Mac.&lt;br /&gt;Fritzing&lt;br /&gt;Groupie and Geocouch (couch dB) - This was used in combination with the unity engine to display clusters of map points in a video game.&lt;br /&gt;Steganography - The word for hiding data inside of other files. A presenter showed how histograms could be used.&lt;br /&gt;Femtocells - A personal cell tower. One of the presentations talked about how to use a femtocell to intercept text messages to a Verizon (CDMA) phone.&lt;br /&gt;Shark - Has something to do with a hadoop, good for storing large amounts of data.&lt;br /&gt;SuperTimeline&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Alembic Cheat Sheet - Python/SQLAlchemy</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/08/alembic-cheat-sheet-pythonsqlalchemy.html"/>
   <updated>2014-08-27T07:34:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/08/alembic-cheat-sheet-pythonsqlalchemy</id>
   <content type="html">alembic revision --autogenerate -m &quot;&amp;lt;your message&amp;gt;&quot;&lt;br /&gt;alembic upgrade head&lt;br /&gt;&lt;br /&gt;Problem:&amp;nbsp;&lt;b&gt;FAILED: Target database is not up to date.&lt;/b&gt;&lt;br /&gt;Solution:&amp;nbsp;&lt;b&gt;alembic upgrade head&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Problem: &lt;b&gt;No such revision &apos;5000106def16&apos;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;Solution:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;sqlite3 db.sqlite3&lt;/li&gt;&lt;li&gt;drop table alembic_version; (and exit, ctrl+d)&lt;/li&gt;&lt;li&gt;alembic upgrade head&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Failed to fetch http://security.ubuntu.com</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/08/failed-to-fetch-httpsecurityubuntucom.html"/>
   <updated>2014-08-27T07:23:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/08/failed-to-fetch-httpsecurityubuntucom</id>
   <content type="html">W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/quantal-security/main/binary-amd64/Packages &amp;nbsp;404 &amp;nbsp;Not Found [IP: 91.189.91.14 80]&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is happening because you&apos;re on an unsupported/old version of Ubuntu.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One way to fix it:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;nano /etc/apt/sources.list&lt;/li&gt;&lt;li&gt;Change all entries referring to&amp;nbsp;http://&lt;b&gt;archive&lt;/b&gt;.ubuntu.com/ubuntu to&amp;nbsp;http://&lt;b&gt;old-releases&lt;/b&gt;.ubuntu.com/ubuntu&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Best Python Tricks</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/08/best-python-tricks.html"/>
   <updated>2014-08-22T04:17:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/08/best-python-tricks</id>
   <content type="html">&lt;a href=&quot;https://gist.github.com/JeffPaine/6213790&quot;&gt;https://gist.github.com/JeffPaine/6213790&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Most of the examples involve making your code much faster by using iterators instead of creating copies of the data. Example: xrange&lt;br /&gt;&lt;br /&gt;Here&apos;s the video:&amp;nbsp;&lt;a href=&quot;https://www.youtube.com/watch?v=OSGv2VnC0go&quot;&gt;https://www.youtube.com/watch?v=OSGv2VnC0go&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>CSS Selectors - ~ + &gt;</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/08/css-selectors.html"/>
   <updated>2014-08-21T21:38:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/08/css-selectors</id>
   <content type="html">&lt;a href=&quot;http://css-tricks.com/child-and-sibling-selectors/&quot;&gt;http://css-tricks.com/child-and-sibling-selectors/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That&apos;s an excellent article describing what angle brackets, plus signs, and tildes do in CSS selectors. The illustrations make it especially clear.</content>
 </entry>
 
 <entry>
   <title>Change Percent To Numbers and Keep Color - Flot Pie Chart</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/08/change-percent-to-numbers-and-keep.html"/>
   <updated>2014-08-06T18:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/08/change-percent-to-numbers-and-keep</id>
   <content type="html">&lt;p&gt;You can access the color of the section of the pie chart by using “series.color”:&lt;/p&gt;

&lt;noscript&gt;&lt;pre&gt;options = {
 series: {
  pie: {
  	innerRadius: 0.5,
  	show: true,
  	label: {
  		show: true,
  		formatter: function (label, series) {
  			console.log(series);
  			return &amp;#39;&amp;lt;div style=&amp;quot;font-size:8pt;text-align:center;padding:2px; color: &amp;#39; + series.color +&amp;#39;;&amp;quot;&amp;gt;&amp;#39; + label + &amp;#39;&amp;lt;br/&amp;gt;&amp;#39; + series.data[0][1] + &amp;#39;&amp;lt;/div&amp;gt;&amp;#39;;
		},
	}
  }
 },
};&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/e8e2b246365c60755403.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Use List In Bind Parameters - SQLAlchemy</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/08/use-list-in-bind-parameters-sqlalchemy.html"/>
   <updated>2014-08-01T00:34:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/08/use-list-in-bind-parameters-sqlalchemy</id>
   <content type="html">&lt;noscript&gt;&lt;pre&gt;my_list = [&amp;#39;peach&amp;#39;, &amp;#39;grape&amp;#39;, &amp;#39;apple&amp;#39;]
query_parameters = {}
counter = 1
for list_item in my_list:
  query_parameters[&amp;quot;list_item&amp;quot; + str(counter)] = list_item
  counter += 1
  
where_clause = &amp;#39;fruits IN(:&amp;#39; + &amp;quot;,:&amp;quot;.join(query_parameters.keys()) + &amp;#39;)&amp;#39; # create clause to be inserted into query
query_text = db.text(&amp;quot;&amp;quot;&amp;quot;
 SELECT 
  fruits
 FROM table
 WHERE &amp;quot;&amp;quot;&amp;quot; + where_clause + &amp;quot;&amp;quot;&amp;quot;
&amp;quot;&amp;quot;&amp;quot;)

result = db.engine.execute(query_text, **query_parameters)&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/555e5eecce77d4de0ada.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Overwriting module with same version in Heroku - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/07/overwriting-python-module-in-heroku.html"/>
   <updated>2014-07-30T09:01:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/07/overwriting-python-module-in-heroku</id>
   <content type="html">I needed to install a newer version of a module from a github commit, but it had the same version number. Heroku just used the cached version of the module and didn&apos;t overwrite it with the newer version.&lt;br /&gt;&lt;br /&gt;The easiest fix for this:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a file in your application&apos;s root directory called &quot;runtime.txt&quot; with only &quot;python-3.4.1&quot; written inside.&lt;/li&gt;&lt;li&gt;Add, commit, and push the new runtime.txt&lt;/li&gt;&lt;li&gt;Change runtime.txt back to &quot;python-2.7.6&quot;&lt;/li&gt;&lt;li&gt;Add, commit, and push to clear your virtualenv and reinstall all modules&lt;/li&gt;&lt;/ol&gt;</content>
 </entry>
 
 <entry>
   <title>The server quit without updating PID file (/var/run/mysqld/mysqld.pid). - MySQL</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/06/the-server-quit-without-updating-pid.html"/>
   <updated>2014-06-27T23:25:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/06/the-server-quit-without-updating-pid</id>
   <content type="html">. * The server quit without updating PID file (/var/run/mysqld/mysqld.pid).&lt;br /&gt;&lt;br /&gt;If you&apos;re getting this error message, &lt;b&gt;try using sudo&lt;/b&gt; to start mysql.</content>
 </entry>
 
 <entry>
   <title>Submit Form When User Clicks Option (autosubmit) - Typeahead.js </title>
   <link href="https://www.paulsprogrammingnotes.com/2014/06/submit-form-when-user-clicks-option.html"/>
   <updated>2014-06-19T20:56:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/06/submit-form-when-user-clicks-option</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/a/18483816/1364191&quot;&gt;http://stackoverflow.com/a/18483816/1364191&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The bolded section below will automatically submit your form when you select an option from the Typeahead.js dropdown:&lt;br /&gt;$(&apos;#remote .typeahead&apos;).typeahead(null, {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;displayKey: &apos;value&apos;,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;source: site_search.ttAdapter()&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;})&lt;b&gt;.on(&apos;typeahead:selected&apos;, function(e){&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; e.target.form.submit();&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; });&lt;/b&gt;</content>
 </entry>
 
 <entry>
   <title>Using Enter Key With Typeahead.js - Javascript</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/06/using-enter-key-with-typeaheadjs.html"/>
   <updated>2014-06-19T20:29:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/06/using-enter-key-with-typeaheadjs</id>
   <content type="html">&lt;a href=&quot;https://github.com/twitter/typeahead.js/issues/255&quot;&gt;https://github.com/twitter/typeahead.js/issues/255&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If your text input with typeahead.js is not letting you use the enter key, you need to add a submit button (if you don&apos;t already have one).&lt;br /&gt;&lt;br /&gt;You can hide it if you want:&lt;br /&gt;&lt;b&gt;&amp;lt;input type=&quot;submit&quot; value=&quot;Submit&quot; style=&quot;display: none&quot;&amp;gt;&lt;/b&gt;</content>
 </entry>
 
 <entry>
   <title>WinSCP vs Samba For Windows &lt;---&gt; Ubuntu Development</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/06/winscp-vs-samba-for-windows-ubuntu.html"/>
   <updated>2014-06-12T15:36:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/06/winscp-vs-samba-for-windows-ubuntu</id>
   <content type="html">&lt;p&gt;I’ve always used WinSCP to transfer files between my Windows development environment and Ubuntu. It worked pretty well. All you had to do was open the file with your editor by clicking the file in WinSCP, and when you saved the file it would save to the server in the background.&lt;/p&gt;

&lt;p&gt;The main negative was the lack of feedback when a file fails to save to the server. WinSCP could be logged out and asking for a password in the background, but you were expecting that save to fix the bug you were working on. It ended up being another thing to debug.&lt;/p&gt;

&lt;p&gt;A coworker suggested using Samba instead. I installed it with this simple guide: &lt;a href=&quot;https://help.ubuntu.com/community/How%20to%20Create%20a%20Network%20Share%20Via%20Samba%20Via%20CLI%20(Command-line%20interface/Linux%20Terminal)%20-%20Uncomplicated,%20Simple%20and%20Brief%20Way!&quot;&gt;How to Create a Network Share Via Samba Via CLI&lt;/a&gt; Then I mapped the network drive in Windows by going to the “Map Network Drive” option in the tools menu of the file explorer:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/map_network_drive.png&quot; alt=&quot;map network drive&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The only negative I’ve found with Samba so far is that it makes Notepad++ a little less responsive. But it helps a small amount if you turn off “File Status Auto-Detection”:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/notepad.png&quot; alt=&quot;File Status Auto-Detection&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Relative Paths In Scripts Run By Crontab - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/06/relative-paths-in-scripts-run-by.html"/>
   <updated>2014-06-10T15:52:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/06/relative-paths-in-scripts-run-by</id>
   <content type="html">I learned that a script run by crontab can&apos;t have a relative path.&lt;br /&gt;&lt;br /&gt;This fix was here: &lt;a href=&quot;http://stackoverflow.com/a/10422444&quot;&gt;http://stackoverflow.com/a/10422444&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The following example opens my_file.txt in a path relative to your script:&lt;br /&gt;&lt;b&gt;import os &lt;/b&gt;&lt;br /&gt;&lt;b&gt;dir_path = os.path.dirname(os.path.abspath(__file__))&lt;/b&gt;&lt;br /&gt;&lt;b&gt;with open (os.path.join(dir_path, &apos;my_file.txt&apos;), &quot;r&quot;) as myfile:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; mytext = myfile.read()&lt;/b&gt;</content>
 </entry>
 
 <entry>
   <title>ELSE in FOR loops - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/06/else-in-for-loops-python.html"/>
   <updated>2014-06-09T16:19:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/06/else-in-for-loops-python</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/a/9980160&quot;&gt;http://stackoverflow.com/a/9980160&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Turns out that you can use ELSE after a FOR loop to make it give an output if it didn&apos;t have anything to iterate.</content>
 </entry>
 
 <entry>
   <title>Undoing git rm -r --cached </title>
   <link href="https://www.paulsprogrammingnotes.com/2014/06/undoing-git-rm-r-cached-git.html"/>
   <updated>2014-06-09T13:37:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/06/undoing-git-rm-r-cached-git</id>
   <content type="html">I followed these instructions to gitignore an already committed file:&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/6535362/gitignore-after-commit&quot;&gt;http://stackoverflow.com/questions/6535362/gitignore-after-commit&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;When I wanted to start tracking it again, I needed to following these instructions: &lt;a href=&quot;https://gist.github.com/laszlomiklosik/3833968&quot;&gt;https://gist.github.com/laszlomiklosik/3833968&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Make sure you save a backup of your current version before you check out the file again.</content>
 </entry>
 
 <entry>
   <title>Multiple DSNs All Connecting To The Same IP - Sybase ODBC</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/06/multiple-dsns-all-connecting-to-same-ip.html"/>
   <updated>2014-06-05T19:10:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/06/multiple-dsns-all-connecting-to-same-ip</id>
   <content type="html">The problem: You have multiple DSNs defined in your unixODBC&apos;s odbc.ini file, and it always connects to the same IP when you try testing with iSQL.&lt;br /&gt;&lt;br /&gt;The solution: &lt;br /&gt;&lt;b&gt;DO NOT&lt;/b&gt;&amp;nbsp;use the following line in your odbc.ini file to define your DSN&apos;s port:&lt;br /&gt;CommLinks &amp;nbsp; &amp;nbsp; &amp;nbsp; = tcpip(host=localhost;port=9502)&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;DO&lt;/b&gt; use the following format:&lt;/div&gt;&lt;div&gt;&lt;div&gt;CommLinks &amp;nbsp; &amp;nbsp; &amp;nbsp; = tcpip(HOST=localhost:9502)&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Compress - Sybase ODBC</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/06/compress-sybase-odbc.html"/>
   <updated>2014-06-05T18:20:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/06/compress-sybase-odbc</id>
   <content type="html">Sybase has a odbc parameter called &quot;Compress&quot; that is disabled by default. It&apos;s very useful if you&apos;re running queries on something with slow network transfer speeds and large datasets.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;Compress = yes&lt;br /&gt;&lt;br /&gt;This improve the performance of my query by about 40%.</content>
 </entry>
 
 <entry>
   <title>[IM004] [unixODBC][Driver Manager]Driver&apos;s SQLAllocHandle on SQL_HANDLE_HENV failed (0) (SQLDriverConnect) - Ubuntu</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/06/im004-unixodbcdriver-managerdrivers.html"/>
   <updated>2014-06-02T22:45:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/06/im004-unixodbcdriver-managerdrivers</id>
   <content type="html">The link to download SQLanywhere is here:&amp;nbsp;&lt;a href=&quot;http://www.sybase.com/detail?id=1087327&quot;&gt;http://www.sybase.com/detail?id=1087327&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To install it, you need to unzip the file and run &quot;./setup&quot; in the top level directory in the unzipped folder.&lt;br /&gt;&lt;br /&gt;I also installed:&lt;br /&gt;&lt;a href=&quot;https://code.google.com/p/pyodbc/&quot;&gt;https://code.google.com/p/pyodbc/&lt;/a&gt;&amp;nbsp;(use the .zip file on the left)&lt;br /&gt;&lt;a href=&quot;http://onefinepub.com/2014/03/05/installing-unixodbc-2-3-2-higher-ubuntu-12-04-lts/&quot;&gt;http://onefinepub.com/2014/03/05/installing-unixodbc-2-3-2-higher-ubuntu-12-04-lts/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The first error message I received was:&lt;br /&gt;sqlanydb.InterfaceError: Could not load dbcapi. &amp;nbsp;Tried: dbcapi.dll,libdbcapi_r.so,libdbcapi_r.dylib&lt;br /&gt;Exception AttributeError: &quot;&apos;Root&apos; object has no attribute &apos;api&apos;&quot; in &amp;lt;bound method Root.__del__ of &amp;lt;sqlanydb.Root object at 0x3061150&amp;gt;&amp;gt; ignored&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This error is resolved by creating a file called &quot;/etc/ld.so.conf.d/sqlanywhere.conf&quot; and adding a line with &quot;/opt/sqlanywhere12/lib64&quot;. Then you will need to run&amp;nbsp;ldconfig -v.&lt;/div&gt;&lt;br /&gt;The error message in the title occurred on Ubuntu because unixODBC was unable to find all of the libraries it needed to run.&lt;br /&gt;&lt;br /&gt;This helped to find the issue: &lt;a href=&quot;http://blogs.msdn.com/b/dataaccesstechnologies/archive/2014/01/22/sqlallochandle-on-sql-handle-henv-from-linux-sqlncli-driver.aspx&quot;&gt;http://blogs.msdn.com/b/dataaccesstechnologies/archive/2014/01/22/sqlallochandle-on-sql-handle-henv-from-linux-sqlncli-driver.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;strace -t -f -o trace_out.txt isql -v &amp;lt;DSN&amp;gt;&amp;lt; USERNAME&amp;gt; &amp;lt;PASSWORD&amp;gt;&lt;br /&gt;&lt;br /&gt;It will show there are a bunch of missing files. The issue was resolved when isql was run from the&amp;nbsp;/opt/sqlanywhere12/bin64 directory. This indicated that it&apos;s not looking in the right place for the library files. Run the following:&amp;nbsp;&lt;b&gt;export LD_LIBRARY_PATH=&apos;/opt/sqlanywhere12/lib64&apos;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Not having the environmental variable above will also cause &quot;sqlanydb.InterfaceError: dbcapi version 1 required.&quot; if you&apos;re using python&apos;s sqlanydb library.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It will give a &quot;file not found&quot; error if you try using bin32/lib32 files on a 64 bit system. Make sure you use the bin64/lib64 files in the &quot;Driver=&quot; fild in your /etc/odbc.ini file (if you&apos;re using a 64 bit system)!&lt;br /&gt;&lt;br /&gt;Now you will receive an error saying &quot;Parse error: DSN does not exist&quot;. You need to add an ODBC_INI environmental variable to where your DSNs are defined. I ran the following: &lt;b&gt;export ODBC_INI=&apos;/etc/odbc.ini&apos;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To make those variables we exported work system-wide and continue to work even after we log out:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;sudo nano /etc/environment&lt;/li&gt;&lt;li&gt;Add:&lt;br /&gt;&lt;b&gt;ODBC_INI=&apos;/etc/odbc.ini&apos;&lt;br /&gt;&lt;b&gt;LD_LIBRARY_PATH=&apos;/opt/sqlanywhere12/lib64&apos;&lt;/b&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;These articles were helpful:&lt;br /&gt;&lt;a href=&quot;https://hynek.me/articles/twisted-sybase/&quot;&gt;https://hynek.me/articles/twisted-sybase/&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://hynek.me/articles/a-short-summary-on-sybase-sql-anywhere-python/&quot;&gt;https://hynek.me/articles/a-short-summary-on-sybase-sql-anywhere-python/&lt;/a&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Escape Newlines In Description For Google Calendar Api - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/06/escape-newlines-in-description-for.html"/>
   <updated>2014-06-02T06:41:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/06/escape-newlines-in-description-for</id>
   <content type="html">&lt;noscript&gt;&lt;pre&gt;# how you need to format the body of the request
requestbody = &amp;quot;&amp;quot;&amp;quot;{
    &amp;quot;description&amp;quot;: %s,
    &amp;quot;summary&amp;quot;: %s
  }
&amp;quot;&amp;quot;&amp;quot; % (json.dumps(description), json.dumps(summary)) # use json.dumps to escape string for the request body
&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/7017f7ef477bde8e9bdc.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Get ID of edited item within WTforms validator - Flask-Admin</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/06/get-id-of-edited-item-within-wtforms.html"/>
   <updated>2014-06-02T03:04:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/06/get-id-of-edited-item-within-wtforms</id>
   <content type="html">&lt;noscript&gt;&lt;pre&gt;def start_must_not_conflict(form, field):
		print request.args.get(&amp;#39;id&amp;#39;) # get ID
		if Event.query.filter(db.and_(Event.location == form.location.data, Event.start.between(form.start.data, form.end.data), Event.id != request.args.get(&amp;#39;id&amp;#39;))).first(): # exclude ID from query
			raise wtforms.validators.ValidationError(&amp;#39;Start time conflicts with another request for the same time.&amp;#39;)
			
form_args = dict(
		start=dict(validators=[start_must_not_conflict])
	)&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/b95ca0f5dc50c4f1995a.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Heroku&apos;s Advantages Over Google App Engine</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/05/heroku-advantages-over-google-app-engine.html"/>
   <updated>2014-05-26T20:43:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/05/heroku-advantages-over-google-app-engine</id>
   <content type="html">Pros:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Postgres (you can even use pgAdmin to view your database)&lt;/li&gt;&lt;li&gt;Uses Git to push your application into production&lt;/li&gt;&lt;li&gt;More monitoring features and 3rd party apps&lt;/li&gt;&lt;li&gt;As long as your project uses one dyno, it runs for free (similar to google, but with a less confusing billing structure)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Cons:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;10k row limit for your database before they start charging you $9 per month&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>AttributeError: &apos;QuerySelectField&apos; object has no attribute &apos;_sa_instance_state&apos;</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/05/attributeerror-queryselectfield-object.html"/>
   <updated>2014-05-25T02:56:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/05/attributeerror-queryselectfield-object</id>
   <content type="html">I came across this error when I was trying to make a custom validator in Flask-Admin with wtforms form objects.&lt;br /&gt;&lt;br /&gt;This code didn&apos;t work:&lt;br /&gt;def location_must_not_conflict(form, field):&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if Event.query.filter(Event.location == &lt;b&gt;form.location&lt;/b&gt;).first():&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;raise wtforms.validators.ValidationError(&apos;Location conflicts with another request for the same venue.&apos;)&lt;br /&gt;&lt;br /&gt;Because I was using form.location and not form.location.data.&lt;br /&gt;&lt;br /&gt;This will work:&lt;br /&gt;def location_must_not_conflict(form, field):&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if Event.query.filter(Event.location ==&amp;nbsp;&lt;b&gt;form.location.data&lt;/b&gt;).first():&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;raise wtforms.validators.ValidationError(&apos;Location conflicts with another request for the same venue.&apos;)</content>
 </entry>
 
 <entry>
   <title>Individual Form Fields In Jinja2 - Flask-Admin</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/05/individual-form-fields-in-jinja2-flask.html"/>
   <updated>2014-05-21T04:20:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/05/individual-form-fields-in-jinja2-flask</id>
   <content type="html">On your edit and create templates in Flask-Admin, you can print individual form fields like this (the field&apos;s name is location):&lt;div&gt;&lt;b&gt;{{ form.location }}&lt;/b&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Google Calendar Api bad request 400 - Python Authomatic Library</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/05/google-calendar-api-bad-request-400.html"/>
   <updated>2014-05-18T19:34:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/05/google-calendar-api-bad-request-400</id>
   <content type="html">I was finally able to get the request to go through by adding a header saying it&apos;s json format. Here&apos;s an example:&lt;br /&gt;&lt;br /&gt;requestbody = &quot;&quot;&quot;&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;end&quot;: {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;dateTime&quot;: &quot;2014-05-18T01:35:00Z&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;start&quot;: {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;dateTime&quot;: &quot;2014-05-18T01:35:00Z&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;description&quot;: &quot;test2&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;location&quot;: &quot;test venue&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;summary&quot;: &quot;test2&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&lt;div&gt;&quot;&quot;&quot;&lt;/div&gt;response = authomatic.access(credentials, url, method=&apos;POST&apos;, headers={&apos;Content-Type&apos;: &apos;application/json&apos;}, body=requestbody)&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Add user_id for modified_by field before save - Flask-Admin</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/05/add-userid-for-modifiedby-field-before.html"/>
   <updated>2014-05-18T01:58:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/05/add-userid-for-modifiedby-field-before</id>
   <content type="html">&lt;br /&gt;In Flask-Admin, you can override the &quot;on_model_change&quot; function to to automatically populate a &quot;modified_by&quot; field in your model.&lt;br /&gt;&lt;br /&gt;class LocationView(ModelView):&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;def on_model_change(self, form, model):&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;model.user_id = g.user.id&lt;br /&gt;&lt;br /&gt;admin = Admin(app)&lt;br /&gt;admin.add_view(LocationView(Location, db.session, name=&quot;Locations&quot;))</content>
 </entry>
 
 <entry>
   <title>Favorite Flask Boilerplate/Skeleton/Templates</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/05/favorite-flask-boilerplateskeletontempl.html"/>
   <updated>2014-05-17T07:31:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/05/favorite-flask-boilerplateskeletontempl</id>
   <content type="html">&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/sloria/cookiecutter-flask&quot;&gt;https://github.com/sloria/cookiecutter-flask&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/mattupstate/overholt&quot;&gt;https://github.com/mattupstate/overholt&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Because it&apos;s easy:&amp;nbsp;&lt;a href=&quot;https://github.com/fogleman/HelloFlask&quot;&gt;https://github.com/fogleman/HelloFlask&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Those do a lot of the work of starting a new Flask project for you.&lt;br /&gt;&lt;br /&gt;With cookiecutter flask, all you need to do to build a new project is: cookiecutter https://github.com/sloria/cookiecutter-flask.git&lt;br /&gt;&lt;br /&gt;As a warning, cookiecutter flask and overholt include a lot of stuff. I ended up not using it because it was too much work to change everything to work with oAuth.</content>
 </entry>
 
 <entry>
   <title>Remove Index Column From Pandas CSV Export</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/05/remove-index-column-from-pandas-csv.html"/>
   <updated>2014-05-12T15:27:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/05/remove-index-column-from-pandas-csv</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/a/19782137/1364191&quot;&gt;http://stackoverflow.com/a/19782137/1364191&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Reverse PDF Page Order</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/05/reverse-pdf-page-order.html"/>
   <updated>2014-05-11T02:13:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/05/reverse-pdf-page-order</id>
   <content type="html">&lt;p&gt;I created an app that allows you to upload a pdf and it returns a copy of your PDF with the page order reversed. The code is here: &lt;a href=&quot;https://github.com/pawl/pdfreverse&quot;&gt;https://github.com/pawl/pdfreverse&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Initially when I googled how to do this in Adobe Acrobat, the first few results had fairly complicated solutions. After I made the app, I ended up finding an easier way to do it in Adobe (in the 6th from the top Google result on “reverse pdf order acrobat”…):&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/generated/assets/images/2014-05-10+20_59_21-Print-629-e9de053b9.png&quot; srcset=&quot;/generated/assets/images/2014-05-10+20_59_21-Print-400-e9de053b9.png 400w, /generated/assets/images/2014-05-10+20_59_21-Print-600-e9de053b9.png 600w, /generated/assets/images/2014-05-10+20_59_21-Print-629-e9de053b9.png 629w&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Oh well, it was a fun project.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Discourse As Potential Mailing List Replacement</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/discourse-as-potential-mailing-list.html"/>
   <updated>2014-04-29T05:09:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/discourse-as-potential-mailing-list</id>
   <content type="html">&lt;p&gt;While tested out Discourse, I only found a few negative things:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;To make it act like a mailing list, it currently requires each user to change settings on their account: &lt;a href=&quot;https://github.com/discourse/discourse/blob/master/docs/MAILING-LIST-SETUP.md#suggested-user-preferences&quot;&gt;https://github.com/discourse/discourse/blob/master/docs/MAILING-LIST-SETUP.md#suggested-user-preferences&lt;/a&gt;&lt;br /&gt;I commented on a thread about a new feature that allows setting defaults for this: &lt;a href=&quot;https://meta.discourse.org/t/default-email-settings-for-a-new-user/14980&quot;&gt;https://meta.discourse.org/t/default-email-settings-for-a-new-user/14980&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;It doesn’t allow setting defaults for which categories the user has “Watched”. For example, I would want to default the “General” list to “Watched”, but more obscure lists would only be watched if the user chooses to.&lt;/li&gt;
  &lt;li&gt;It uses a different e-mail address for each e-mail it sends you (this is to keep track of which thread it belongs to), here’s an example of a “From” address: testdiscourse+43854630fb3a3d9492505fa5a23db196@gmail.com&lt;br /&gt;Google Groups always has the same to/from e-mail address and magically figures this out. This might be weird in some peoples’ email clients.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As a forum, this beats the crap out of PhpBB, but as a mailing list it’s not a clear winner over Google Groups yet. It’s open source, has a better web interface, and the “Categories” are a cool feature for keeping all the lists in the same place. But, the “email in” functionality was too recently implemented, and it might take a few months before it’s as polished as Google Groups.&lt;/p&gt;

&lt;p&gt;It’s going to be a very tempting replacement if they add default settings for user preferences.&lt;/p&gt;

&lt;p&gt;Screenshots:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/discourse1.png&quot; alt=&quot;discourse 1&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/discourse2.png&quot; alt=&quot;discourse 2&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/discourse3.png&quot; alt=&quot;discourse 3&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/discourse4.png&quot; alt=&quot;discourse 4&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/discourse5.png&quot; alt=&quot;discourse 5&quot; /&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Data source name not found and no default driver specified - SQLalchemy/Sybase</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/data-source-name-not-found-and-no.html"/>
   <updated>2014-04-28T19:05:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/data-source-name-not-found-and-no</id>
   <content type="html">I was getting this error when trying to connect to a sybase database using Microsoft&apos;s odbc driver by using the connection string shown in the SqlAlchemy examples:&lt;br /&gt;&lt;b&gt;DBAPIError: (Error) (&apos;IM002&apos;, &apos;[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)&apos;) None None&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;The following code worked to connect:&lt;br /&gt;&lt;b&gt;import pyodbc, sqlalchemy&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;def connect():&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; return pyodbc.connect(&apos;DSN=&amp;lt;dsn name&amp;gt;;UID=&amp;lt;username&amp;gt;;PWD=&amp;lt;password&amp;gt;&apos;)&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;srcEngine = sqlalchemy.create_engine(&apos;sybase+pyodbc://&apos;, creator=connect, echo=True)&lt;/b&gt;</content>
 </entry>
 
 <entry>
   <title>Docker Not Starting - Ubuntu</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/docker-not-starting-ubuntu.html"/>
   <updated>2014-04-27T00:12:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/docker-not-starting-ubuntu</id>
   <content type="html">I was getting this error message because docker was refusing to start: Cannot connect to the Docker daemon. Is &apos;docker -d&apos; running on this host?&lt;br /&gt;&lt;br /&gt;This issue was occurring because my kernel was refusing to upgrade, because I was on a VPS. (you need to get your VPS provider to upgrade it for you)&lt;br /&gt;&lt;br /&gt;Run uname -r, if it returns something like this: &quot;&lt;b&gt;2.6.32-042stab084.20&lt;/b&gt;&quot; That&apos;s probably the reason why docker isn&apos;t starting. Your kernel isn&apos;t compatible.&lt;br /&gt;&lt;br /&gt;If you&apos;re not on a VPS and can upgrade your kernel, try instructions on this page:&amp;nbsp;&lt;a href=&quot;http://docs.docker.io.s3-website-us-west-2.amazonaws.com/installation/ubuntulinux/&quot;&gt;http://docs.docker.io.s3-website-us-west-2.amazonaws.com/installation/ubuntulinux/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>E: Sub-process /usr/bin/dpkg returned an error code (1)</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/e-sub-process-usrbindpkg-returned-error.html"/>
   <updated>2014-04-27T00:02:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/e-sub-process-usrbindpkg-returned-error</id>
   <content type="html">I was getting this error message while I was trying to upgrade the kernel on my VPS:&lt;br /&gt;&lt;b&gt;/usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).&lt;/b&gt;&lt;br /&gt;&lt;b&gt;run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.8.0-34-generic.postrm line 328.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;dpkg: error processing linux-image-3.8.0-34-generic (--remove):&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;subprocess installed post-removal script returned error exit status 1&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Errors were encountered while processing:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;linux-image-3.8.0-34-generic&lt;/b&gt;&lt;br /&gt;&lt;b&gt;E: Sub-process /usr/bin/dpkg returned an error code (1)&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You might not be able to upgrade the kernel on your VPS. Contact your VPS provider and get them to upgrade the kernel for you.&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>WHMCS Cronjob Not Running On Ubuntu</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/whmcs-cronjob-not-running-on-ubuntu.html"/>
   <updated>2014-04-26T18:48:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/whmcs-cronjob-not-running-on-ubuntu</id>
   <content type="html">My issue was the user with the cronjob did not have access to run the cronjob php file. So, I needed to make the new cronjob for the correct user.&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Find out the owner of your apache process (usually www-data).&lt;/li&gt;&lt;li&gt;Look at the top of the &quot;Automation Settings&quot; page in your WHMCS admin area. It should say something like:&amp;nbsp;php -q /var/www/whmcs/admin/cron.php (&lt;b&gt;keep this handy for step 4&lt;/b&gt;)&lt;/li&gt;&lt;li&gt;In terminal run: &lt;b&gt;crontab -e -u www-data&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Ensure you have a line that says: &lt;br /&gt;0 &amp;nbsp; 6 &amp;nbsp; * &amp;nbsp; * &amp;nbsp; * &amp;nbsp; &amp;nbsp;php -q&amp;nbsp;/var/www/whmcs/admin/cron.php (&lt;b&gt;note: this should be the same file path you got for your own install in step 2&lt;/b&gt;)&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Http Port 443 Working But Https Port 443 Not Working In CherryPy - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/http-port-443-working-but-https-port.html"/>
   <updated>2014-04-26T15:35:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/http-port-443-working-but-https-port</id>
   <content type="html">I was able to visit my site using HTTP and port 443, but nothing would even show in the log when I tried to visit with HTTPS and port 443.&lt;br /&gt;&lt;br /&gt;This seems to only be an issue with CherryPy 3.3.0, I switched back to CherryPy 3.2.3 and it worked again.&lt;br /&gt;&lt;br /&gt;I noted it on their bitbucket issue here:&amp;nbsp;&lt;a href=&quot;https://bitbucket.org/cherrypy/cherrypy/issue/1298/ssl-not-working&quot;&gt;https://bitbucket.org/cherrypy/cherrypy/issue/1298/ssl-not-working&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>OpenSSL DLL load failed On Windows - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/openssl-dll-load-failed-on-windows.html"/>
   <updated>2014-04-26T14:07:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/openssl-dll-load-failed-on-windows</id>
   <content type="html">The DLL load failed error happened when cherrypy tried the following import: &quot;from OpenSSL import SSL&quot;&lt;br /&gt;&lt;br /&gt;ChannelFailures: VerificationError(&quot;importing &apos;C:\\\\Python27\\\\lib\\\\site-packages\\\\cryptography\\\\_Cryptography_c&lt;br /&gt;ffi_48bbf0ebx93c91939.pyd&apos;: DLL load failed: %1 is not a valid Win32 application.&quot;,)&lt;br /&gt;&lt;br /&gt;These error messages are solved with this install:&amp;nbsp;&lt;a href=&quot;http://slproweb.com/download/Win32OpenSSL-1_0_1g.exe&quot;&gt;http://slproweb.com/download/Win32OpenSSL-1_0_1g.exe&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you have a 32-bit version of python, that install will move the correct DLLs to your system32 folder.</content>
 </entry>
 
 <entry>
   <title>My First Python Library</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/my-first-python-library.html"/>
   <updated>2014-04-24T16:27:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/my-first-python-library</id>
   <content type="html">&lt;a href=&quot;https://github.com/pawl/Chinese-RFID-Access-Control-Library&quot;&gt;https://github.com/pawl/Chinese-RFID-Access-Control-Library&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;I purchased a chinese access controller and reverse engineered some functionality of the windows software that came with it. I made a python library that does some of the same functions as the desktop software:&amp;nbsp;&lt;/span&gt;&lt;u style=&quot;background-color: white; color: #1155cc; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;a href=&quot;https://github.com/pawl/Chinese-RFID-Access-Control-Library/&quot; style=&quot;color: #1155cc;&quot; target=&quot;_blank&quot;&gt;https://github.com/pawl/&lt;wbr&gt;&lt;/wbr&gt;Chinese-RFID-Access-Control-&lt;wbr&gt;&lt;/wbr&gt;Library/&lt;/a&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I use this library to tie our access controller into with our billing system (called WHMCS) and another web application (which is meant to be a self-documenting way to activate/deactivate RFID badges):&amp;nbsp;&lt;a href=&quot;https://github.com/pawl/MakerManager&quot; style=&quot;color: #1155cc;&quot; target=&quot;_blank&quot;&gt;https://github.com/&lt;wbr&gt;&lt;/wbr&gt;pawl/MakerManager&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, whenever someone stops paying for 5+ days, their RFID badge is deactivated because a &quot;hook&quot; in WHMCS sends a request to a&amp;nbsp;&lt;a href=&quot;https://github.com/pawl/Chinese-RFID-Access-Control-Library/blob/master/examples/webserver.py&quot; style=&quot;color: #1155cc;&quot; target=&quot;_blank&quot;&gt;webservice&lt;/a&gt;&amp;nbsp;that uses the access control library.&lt;/div&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Android Bitcoin OutOfMemoryError Or Crashing On Startup</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/android-bitcoin-outofmemoryerror-or.html"/>
   <updated>2014-04-21T05:47:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/android-bitcoin-outofmemoryerror-or</id>
   <content type="html">This page explains the problem:&amp;nbsp;&lt;a href=&quot;https://code.google.com/p/bitcoin-wallet/wiki/OutOfMemory&quot;&gt;https://code.google.com/p/bitcoin-wallet/wiki/OutOfMemory&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;At one point, it got so bad that the application would not even start anymore.&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Get &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.speedsoftware.rootexplorer&quot;&gt;Root Explorer&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Navigate to your system folder and open &quot;build.prop&quot; in the text editor&lt;/li&gt;&lt;li&gt;Edit &quot;dalvik.vm.heapsize&quot; and &quot;dalvik.vm.heapgrowthlimit&quot; to the following:&lt;br /&gt;dalvik.vm.heapsize=&lt;b&gt;256m&lt;/b&gt;&lt;br /&gt;dalvik.vm.heapgrowthlimit=&lt;b&gt;128m&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Restart your phone, open the bitcoin application, and backup your keys before it crashes again.&lt;/li&gt;&lt;/ol&gt;</content>
 </entry>
 
 <entry>
   <title>Network Visualization Library</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/network-visualization-library.html"/>
   <updated>2014-04-16T02:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/network-visualization-library</id>
   <content type="html">&lt;a href=&quot;http://visjs.org/&quot;&gt;http://visjs.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This example looks particularly awesome:&amp;nbsp;&lt;a href=&quot;http://visjs.org/examples/graph/17_network_info.html&quot;&gt;http://visjs.org/examples/graph/17_network_info.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Lock wait timeout exceeded - MySQL</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/lock-wait-timeout-exceeded.html"/>
   <updated>2014-04-14T15:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/lock-wait-timeout-exceeded</id>
   <content type="html">OperationalError: (OperationalError) (1205, &apos;Lock wait timeout exceeded; try restarting transaction&apos;)&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;After trying a bunch of different solutions in the code, I ended up having to&lt;b&gt; restart MySQL&lt;/b&gt; to get this error message to go away.</content>
 </entry>
 
 <entry>
   <title>Solution To Apache Triggering OOM-Killer</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/solution-to-apache-triggering-oom-killer.html"/>
   <updated>2014-04-14T15:49:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/solution-to-apache-triggering-oom-killer</id>
   <content type="html">&lt;b&gt;Update: &lt;/b&gt;We switched to Prefork apache and have been experiencing significantly fewer problems.&lt;br /&gt;&lt;br /&gt;In this instance, we were getting hit with web crawlers according to the access log and the syslog was saying this: &lt;b&gt;/usr/sbin/apach invoked oom-killer&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This issue occurs when apache opens up too many child processes, uses up too much memory, then OOM killer starts shutting down random processes like mysql.&lt;br /&gt;&lt;br /&gt;The problem ended up being that our apache2.conf did not have any configuration limiting the number of processes that Apache could open. It might have had a default, but the default was too high. We were using Apache ITK MPM and the apache2.conf only mentioned prefork, worker, and event MPMs. You can check which MPM you are running with &quot;apache2 -V&quot;.&lt;br /&gt;&lt;br /&gt;Adding this to the configuration solved the problem:&lt;br /&gt;&amp;lt;IfModule mpm_itk_module&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; StartServers 5&lt;br /&gt;&amp;nbsp; &amp;nbsp; MinSpareServers 5&lt;br /&gt;&amp;nbsp; &amp;nbsp; MaxSpareServers 10&lt;br /&gt;&amp;nbsp; &amp;nbsp; ServerLimit 75&lt;br /&gt;&amp;nbsp; &amp;nbsp; MaxClients 75&lt;br /&gt;&amp;nbsp; &amp;nbsp; MaxRequestsPerChild 5000&lt;br /&gt;&amp;lt;/IfModule&amp;gt;&lt;br /&gt;&lt;br /&gt;At first I had the ServerLimit and MaxClients set to 150 and it seemed like apache was ignoring ServerLimit and Maxclients. However, ITK MPM creates an extra fork for each request (&lt;a href=&quot;http://mpm-itk.sesse.net/&quot;&gt;according to their site&lt;/a&gt;), that&apos;s why there was 200+ processes running for my limit of 150. So,&amp;nbsp;the process count is going to be 2x the limit you set.</content>
 </entry>
 
 <entry>
   <title>My Favorite Guide For Installing Python On Windows</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/my-favorite-guide-for-installing-python.html"/>
   <updated>2014-04-05T01:47:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/my-favorite-guide-for-installing-python</id>
   <content type="html">&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href=&quot;http://docs.python-guide.org/en/latest/starting/install/win/&quot;&gt;http://docs.python-guide.org/en/latest/starting/install/win/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you&apos;re behind a proxy, start with this guide:&amp;nbsp;&lt;a href=&quot;https://github.com/chocolatey/chocolatey/wiki/Proxy-Settings-for-Chocolatey#using-chocolatey-behind-a-proxy-server&quot;&gt;https://github.com/chocolatey/chocolatey/wiki/Proxy-Settings-for-Chocolatey#using-chocolatey-behind-a-proxy-server&lt;/a&gt;&amp;nbsp;(only the part starting with &quot;Using Chocolatey behind a proxy server&quot;)</content>
 </entry>
 
 <entry>
   <title>Edit A Sharepoint List Page</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/edit-sharepoint-list-page.html"/>
   <updated>2014-04-03T18:55:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/edit-sharepoint-list-page</id>
   <content type="html">Add the following to the end of the List page&apos;s URL:&amp;nbsp;&amp;nbsp;?ToolPaneView=2</content>
 </entry>
 
 <entry>
   <title>Bootstrap Wizard</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/bootstrap-wizard.html"/>
   <updated>2014-04-02T18:37:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/bootstrap-wizard</id>
   <content type="html">&lt;a href=&quot;https://github.com/amoffat/bootstrap-application-wizard&quot;&gt;https://github.com/amoffat/bootstrap-application-wizard&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That looks like it will be useful someday.</content>
 </entry>
 
 <entry>
   <title>Override ModelView Class - Flask-Admin</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/override-class-modelview-flask-admin.html"/>
   <updated>2014-04-01T22:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/override-class-modelview-flask-admin</id>
   <content type="html">This has an awesome example of how to override your base ModelView:&amp;nbsp;&lt;a href=&quot;http://code.vokor.org/vokorbb/src/04de9dcb666d2fb35513ca29c97654b6eef80648/vokorbb/admin.py?at=tip&quot;&gt;http://code.vokor.org/vokorbb/src/04de9dcb666d2fb35513ca29c97654b6eef80648/vokorbb/admin.py?at=tip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You would want to do this if you wanted to add something to all of your admin classes. Use cases:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If you wanted to require login by overriding&amp;nbsp;is_accessible for all of your ModelViews.&lt;/li&gt;&lt;li&gt;If you wanted to add an export method to all of your ModelViews.&lt;/li&gt;&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Flask-Admin Export CSV</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/flask-admin-export-csv.html"/>
   <updated>2014-04-01T19:16:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/flask-admin-export-csv</id>
   <content type="html">&lt;p&gt;Edited: This was recently added to Flask-Admin as a feature.&lt;/p&gt;

&lt;p&gt;You can add “can_export = True” to your ModelView to enable it.&lt;/p&gt;

&lt;p&gt;More info here: &lt;a href=&quot;http://flask-admin.readthedocs.org/en/latest/api/mod_model/#flask_admin.model.BaseModelView.can_export&quot;&gt;http://flask-admin.readthedocs.org/en/latest/api/mod_model/#flask_admin.model.BaseModelView.can_export&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Print URL With Request Parameters/Arguments - Python Flask / Jinja2</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/04/print-url-with-request.html"/>
   <updated>2014-04-01T19:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/04/print-url-with-request</id>
   <content type="html">You need to add the following to your jinja2 template:&lt;br /&gt;&lt;b&gt;{{ request.path ~ &apos;?&apos; ~ request.query_string }}&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You can also print only the&amp;nbsp;Get Variables / URL Parameters / Argument String with the following:&lt;br /&gt;&lt;b&gt;print request.query_string&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The example is available here:&lt;a href=&quot;http://stackoverflow.com/a/11781872/1364191&quot;&gt;&amp;nbsp;http://stackoverflow.com/a/11781872/1364191&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>SQLalchemy Cheat Sheet</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/03/sqlalchemy-cheat-sheet.html"/>
   <updated>2014-03-28T16:33:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/03/sqlalchemy-cheat-sheet</id>
   <content type="html">Common Filter Operators:&amp;nbsp;&lt;a href=&quot;http://manuelmax.tumblr.com/post/289720781/common-filter-operators-sqlalchemy&quot;&gt;http://manuelmax.tumblr.com/post/289720781/common-filter-operators-sqlalchemy&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Common relationships:&amp;nbsp;&lt;a href=&quot;http://docs.sqlalchemy.org/en/latest/orm/relationships.html#basic-relational-patterns&quot;&gt;http://docs.sqlalchemy.org/en/latest/orm/relationships.html#basic-relational-patterns&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you&apos;re using Flask-SQLalchemy, their documentation serves as an awesome quick summary of how to use SQLalchemy:&amp;nbsp;&lt;a href=&quot;http://pythonhosted.org/Flask-SQLAlchemy/&quot;&gt;http://pythonhosted.org/Flask-SQLAlchemy/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Use A Temporary File (StringIO) for Pandas&apos;s to_csv - Python Flask</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/03/use-temporary-file-stringio-for-tocsv.html"/>
   <updated>2014-03-27T22:06:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/03/use-temporary-file-stringio-for-tocsv</id>
   <content type="html">This link helped me use a temporary file for an excel export in flask (using pandas): &lt;a href=&quot;https://coderwall.com/p/nwbuhq&quot;&gt;https://coderwall.com/p/nwbuhq&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Get Column and Row Labels In selectHandler - Google Charts / Visualization API</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/03/get-column-and-row-labels-in.html"/>
   <updated>2014-03-27T15:54:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/03/get-column-and-row-labels-in</id>
   <content type="html">For a more complete example of using selectHandler, see this page:&amp;nbsp;&lt;a href=&quot;https://developers.google.com/chart/interactive/docs/basic_interactivity&quot;&gt;https://developers.google.com/chart/interactive/docs/basic_interactivity&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My example below get the labels from the row and the columns. I used this to send the user to another link and drill-down.&lt;br /&gt;&lt;br /&gt;// this is an example of a bar chart&apos;s selectHandler function&lt;br /&gt;function selectHandler() {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var selection = chart.getSelection();&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var item = selection[0];&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (item.row != null &amp;amp;&amp;amp; item.column != null) {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;var rowLabel = parseInt(data.getValue(item.row, 0));&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;var columnLabel = data.getColumnLabel(item.column);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;google.visualization.events.addListener(chart, &apos;select&apos;, selectHandler);</content>
 </entry>
 
 <entry>
   <title>Ordered Post Data - Python Requests</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/03/ordered-post-data-python-requests.html"/>
   <updated>2014-03-23T06:42:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/03/ordered-post-data-python-requests</id>
   <content type="html">Here&apos;s an example of how to send ordered data with python&apos;s Requests library, for when the order of your post request data matters:&lt;br /&gt;&lt;br /&gt;import requests&lt;br /&gt;from collections import OrderedDict&lt;br /&gt;&lt;br /&gt;&lt;b&gt;payload = OrderedDict([(&quot;username&quot;, &quot;admin&quot;), (&quot;pwd&quot;, &quot;password&quot;)]) # the order matters!&lt;/b&gt;&lt;br /&gt;r = requests.post(&apos;http://1.1.1.1/example&apos;, data=payload)&lt;br /&gt;print r.text&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Example of custom filters - Flask-Admin</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/03/example-of-custom-filters-flask-admin.html"/>
   <updated>2014-03-18T18:14:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/03/example-of-custom-filters-flask-admin</id>
   <content type="html">Update: I got this example added to the project:&amp;nbsp;&lt;a href=&quot;https://github.com/mrjoes/flask-admin/tree/master/examples/custom-sqla-filter&quot;&gt;https://github.com/mrjoes/flask-admin/tree/master/examples/custom-sqla-filter&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This Github issue has an example of how to use custom filters in Flask-Admin:&amp;nbsp;&lt;a href=&quot;https://github.com/mrjoes/flask-admin/issues/400&quot;&gt;https://github.com/mrjoes/flask-admin/issues/400&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Multiple Views Based On Same Model - Flask-Admin</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/03/multiple-views-based-on-same-model.html"/>
   <updated>2014-03-17T21:24:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/03/multiple-views-based-on-same-model</id>
   <content type="html">You need to manually change the endpoint like MrJoes says in issue 480:&amp;nbsp;&lt;a href=&quot;https://github.com/mrjoes/flask-admin/issues/480&quot;&gt;https://github.com/mrjoes/flask-admin/issues/480&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here&apos;s an example:&lt;br /&gt;admin.add_view(MyModelView(model.CsvTable, db.session, endpoint=&quot;duplicate_view&quot;))&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can now visit your view by going to 0.0.0.0/admin/duplicate_view&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Checkmark &quot;column_formatters&quot; - Flask-Admin</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/03/checkmark-columnformatters-flask-admin.html"/>
   <updated>2014-03-04T21:54:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/03/checkmark-columnformatters-flask-admin</id>
   <content type="html">In your custom ModelView, you need to add the following lines:&lt;br /&gt;from flask.ext.admin.model.template import macro&lt;br /&gt;column_formatters = dict(your_column=macro(&apos;render_your_column&apos;))&lt;br /&gt;list_template = &apos;list.html&apos;&lt;br /&gt;&lt;br /&gt;In your custom list.html template, you need to add the following jinja2 code:&lt;br /&gt;{% macro render_your_column(model, column) %}&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{% if model.your_column%}&amp;lt;i class=&quot;icon-ok&quot;&amp;gt;&amp;lt;/i&amp;gt;{% endif %}&lt;br /&gt;{% endmacro %}&lt;br /&gt;&lt;br /&gt;If your row has a value in &quot;your_column&quot;, then it will show as a checkmark. You need to make a new macro for each column.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Flask-Migrate</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/03/create-new.html"/>
   <updated>2014-03-04T19:44:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/03/create-new</id>
   <content type="html">&lt;a href=&quot;https://github.com/miguelgrinberg/Flask-Migrate&quot;&gt;https://github.com/miguelgrinberg/Flask-Migrate&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Flask-Migrate is exactly what I&apos;ve been looking for when it comes to database migrations. When I create PHP applications with MVC frameworks, the changes in the database need to be done manually when the model is changed. Flask-Migrate handles changes to the database (like adding/removing columns) so your models reflect your database.&lt;br /&gt;&lt;br /&gt;This is a big advantage Flask has over PHP frameworks.</content>
 </entry>
 
 <entry>
   <title>Pip Not Working From Powershell</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/02/pip-not-working-from-powershell.html"/>
   <updated>2014-02-26T01:13:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/02/pip-not-working-from-powershell</id>
   <content type="html">If you have strawberry perl installed, you may get one of these errors when you try to use pip from powershell:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Did not provide a command&lt;/li&gt;&lt;li&gt;Unknown or unsupported command &apos;install&apos;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;This is the result of a conflict between strawberry perl&apos;s pip and python&apos;s pip. You need to remove anything related to strawberry perl from your path environmental variable and ensure you have C:\Python27\Scripts and C:\Python27\Scripts in your environmental variables.&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Tableau&apos;s Frustrating Licensing Program</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/02/tableaus-frustrating-licensing-program.html"/>
   <updated>2014-02-25T22:58:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/02/tableaus-frustrating-licensing-program</id>
   <content type="html">Tableau&apos;s licensing program is crazy.&lt;br /&gt;&lt;br /&gt;I was planning to use &quot;Trusted Authentication&quot; to share an embedded chart with lots of users (not all of whom have licenses). Some of those users will only look at the chart maybe once a year, and we can&apos;t justify buying them an entire license to look at a chart once.&lt;br /&gt;&lt;br /&gt;This page says &quot;everyone who visits the page must be a licensed user on Tableau Server&quot;: &lt;a href=&quot;http://onlinehelp.tableausoftware.com/v7.0/server/en-us/trusted_auth.htm&quot;&gt;http://onlinehelp.tableausoftware.com/v7.0/server/en-us/trusted_auth.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you want more details on how to implement Trusted Authentication using PHP, first visit the following folder on your server:&amp;nbsp;C:\Program Files\Tableau\Tableau Server\8.1\extras\embedding\php&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It has some sample code, but you need to install version 1.x of pecl_http to make it work. The guides for that are:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.php.net/manual/en/http.install.php#113853&quot;&gt;http://www.php.net/manual/en/http.install.php#113853&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.mkfoster.com/2009/01/04/how-to-use-the-pecl-http-pecl_http-extension-to-make-http-requests-from-php/&quot;&gt;http://www.mkfoster.com/2009/01/04/how-to-use-the-pecl-http-pecl_http-extension-to-make-http-requests-from-php/&lt;/a&gt; (careful, this guide will install pecl_http 2.x which is too different to work)&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Possible Solution To Slow SQLalchemy + Flask Application</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/02/possible-solution-to-slow-sqlalchemy.html"/>
   <updated>2014-02-25T20:30:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/02/possible-solution-to-slow-sqlalchemy</id>
   <content type="html">This stackoverflow thread talks about why you want to use scoped_session:&lt;br /&gt;&lt;a href=&quot;http://stackoverflow.com/questions/6519546/scoped-sessionsession-maker-or-plain-session-maker-in-sqlalchemy&quot;&gt;http://stackoverflow.com/questions/6519546/scoped-sessionsession-maker-or-plain-session-maker-in-sqlalchemy&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Basically, your web application isn&apos;t thread-safe if you&apos;re not using scoped_session. It&apos;s much better than having you application use a new thread for every instance.&lt;br /&gt;&lt;br /&gt;An example of scoped_session in use is available here:&amp;nbsp;&lt;a href=&quot;https://github.com/mjhea0/flask-boilerplate/blob/master/models.py&quot;&gt;https://github.com/mjhea0/flask-boilerplate/blob/master/models.py&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Hide Zero Value Points On Google Chart</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/02/hide-zero-value-points-on-google-chart.html"/>
   <updated>2014-02-18T19:28:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/02/hide-zero-value-points-on-google-chart</id>
   <content type="html">I have a line chart which needed a series of points. I don&apos;t want points to show if the value is zero.&lt;br /&gt;&lt;br /&gt;Here&apos;s my solution:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Set the series&apos;s lineWidth to zero and make the point larger than 0:&lt;br /&gt;series: {0: {lineWidth: 0, pointSize: 5}}&lt;/li&gt;&lt;li&gt;Make the viewWindow setting&apos;s min higher than 0 (to hide the 0 points):&lt;br /&gt;vAxis: { viewWindowMode:&apos;explicit&apos;, viewWindow:{ min: 0.5 } },&lt;/li&gt;&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Change Home Flask-Admin</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/02/change-home-flask-admin.html"/>
   <updated>2014-02-17T18:52:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/02/change-home-flask-admin</id>
   <content type="html">This was the only thing I was able to get working:&amp;nbsp;&lt;a href=&quot;http://www.marteinn.se/blog/?p=637&quot;&gt;http://www.marteinn.se/blog/?p=637&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Just putting index.html into an admin/ directory wouldn&apos;t work.&lt;br /&gt;&lt;br /&gt;There&apos;s also an even shorter way to do it, for example:&lt;br /&gt;&lt;b&gt;admin = Admin(app, &quot;G-Cal Manager&quot;, index_view=AdminIndexView(name=&apos;Home&apos;, template=&apos;admin/home.html&apos;, url=&apos;/&apos;))&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The example above will change the root url to / instead of /admin and it will use home.html from your templates/admin folder.&lt;br /&gt;&lt;br /&gt;To fix the 404 errors on your stylesheets after the change, you will also need to change the static_folder in your flask object:&lt;br /&gt;&lt;b&gt;app = Flask(__name__, static_folder=&apos;admin&apos;)&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>invalid byte sequence for encoding &quot;UTF8&quot; - sqlalchemy</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/invalid-byte-sequence-for-encoding-utf8.html"/>
   <updated>2014-01-30T09:38:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/invalid-byte-sequence-for-encoding-utf8</id>
   <content type="html">Try putting ?charset=utf8 at the end of your connection string, like:&lt;br /&gt;&apos;mysql+mysqldb://user:pass@111.111.111.111/rf?charset=utf8&apos;</content>
 </entry>
 
 <entry>
   <title>Adminer - Unable to connect to PostgreSQL server: FATAL: Peer authentication failed for user</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/adminer-unable-to-connect-to-postgresql.html"/>
   <updated>2014-01-30T07:01:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/adminer-unable-to-connect-to-postgresql</id>
   <content type="html">You need to make sure you have the following line in your&amp;nbsp;pg_hba.conf file:&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;local &amp;nbsp; all &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; postgres &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;trust&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Clone/Copy Table Schema From One Database To Another - SQLalchemy</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/clonecopy-table-schema-from-one.html"/>
   <updated>2014-01-30T00:22:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/clonecopy-table-schema-from-one</id>
   <content type="html">&lt;p&gt;I got the following code from slide 36 of this slideshow: &lt;a href=&quot;http://www.slideshare.net/Stiivi/python-business-intelligence-pydata-2012-talk&quot;&gt;http://www.slideshare.net/Stiivi/python-business-intelligence-pydata-2012-talk&lt;/a&gt;&lt;/p&gt;

&lt;noscript&gt;&lt;pre&gt;from sqlalchemy import create_engine, Table, Column, Integer, Unicode, MetaData, String, Text, update, and_, select, func, types

# create engine, reflect existing columns, and create table object for oldTable
srcEngine = create_engine(&amp;#39;mysql+mysqldb://username:password@111.111.111.111/database&amp;#39;) # change this for your source database
srcEngine._metadata = MetaData(bind=srcEngine)
srcEngine._metadata.reflect(srcEngine) # get columns from existing table
srcTable = Table(&amp;#39;oldTable&amp;#39;, srcEngine._metadata)

# create engine and table object for newTable
destEngine = create_engine(&amp;#39;mysql+mysqldb://username:password@localhost/database&amp;#39;) # change this for your destination database
destEngine._metadata = MetaData(bind=destEngine)
destTable = Table(&amp;#39;newTable&amp;#39;, destEngine._metadata)

# copy schema and create newTable from oldTable
for column in srcTable.columns:
    destTable.append_column(column.copy())
destTable.create()&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/9935333.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>SQLalchemy - Print Tables In Database (Show Tables)</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/sqlalchemy-print-tables-in-database.html"/>
   <updated>2014-01-28T22:57:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/sqlalchemy-print-tables-in-database</id>
   <content type="html">from sqlalchemy import create_engine, Table, MetaData&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;engine = create_engine(&apos;mysql+mysqldb://username:password@111.111.111.111/databaseName&apos;)&lt;br /&gt;metadata = MetaData(bind=engine)&lt;br /&gt;metadata.reflect(engine)&lt;br /&gt;print metadata.tables.keys()&lt;br /&gt;&lt;br /&gt;You could also use that for looping through a list of the tables in the database.</content>
 </entry>
 
 <entry>
   <title>Print Flask-Restless Routes</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/print-flask-restless-routes.html"/>
   <updated>2014-01-28T16:43:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/print-flask-restless-routes</id>
   <content type="html"># show api routes&lt;br /&gt;for route in app.url_map.iter_rules():&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print route.rule</content>
 </entry>
 
 <entry>
   <title>pip install MySQLdb</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/pip-install-mysqldb.html"/>
   <updated>2014-01-27T18:04:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/pip-install-mysqldb</id>
   <content type="html">In case you haven&apos;t already noticed, the command in the title won&apos;t work.&lt;br /&gt;&lt;br /&gt;You need to use:&amp;nbsp;&lt;b&gt;pip install MySQL-python&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This article explains the correct approach:&amp;nbsp;&lt;a href=&quot;http://mysql-python.blogspot.com/2012/11/is-mysqldb-hard-to-install.html&quot;&gt;http://mysql-python.blogspot.com/2012/11/is-mysqldb-hard-to-install.html&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Generate Class From Existing Table Sql-Alchemy - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/generate-class-from-existing-table-sql.html"/>
   <updated>2014-01-21T15:55:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/generate-class-from-existing-table-sql</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/questions/6290162/how-to-automatically-reflect-database-to-sqlalchemy-declarative&quot;&gt;http://stackoverflow.com/questions/6290162/how-to-automatically-reflect-database-to-sqlalchemy-declarative&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That is the key to the kingdom when it comes to using extensions like Flask-Admin and Flask-Restless on existing tables which do not have a class already.</content>
 </entry>
 
 <entry>
   <title>Best VNC Installation Guide</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/httpswiki.html"/>
   <updated>2014-01-18T06:49:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/httpswiki</id>
   <content type="html">https://wiki.amahi.org/index.php/Install_VNC_server_on_Ubuntu_Server_12.04&lt;br /&gt;&lt;br /&gt;That guide gave me the least amount of hassle when I installed VNC on a server. I started by trying to get it working with 13.10, but had issues with a grey screen when tightvnc connected.</content>
 </entry>
 
 <entry>
   <title>&quot;Could not connect to database: Database connection &quot;Mysql&quot; is missing, or could not be created.&quot; - CakePHP</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/could-not-connect-to-database-database.html"/>
   <updated>2014-01-15T20:03:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/could-not-connect-to-database-database</id>
   <content type="html">I got rid of this error just by creating the database manually. Shouldn&apos;t Cake do this?</content>
 </entry>
 
 <entry>
   <title>&quot;Not Found  The requested URL /app/install was not found on this server.&quot; - CakePHP</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/not-found-requested-url-appinstall-was.html"/>
   <updated>2014-01-15T19:44:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/not-found-requested-url-appinstall-was</id>
   <content type="html">Rather than dealing with my .htaccess problems to fix the error, I thought this would be a better approach:&amp;nbsp;&lt;a href=&quot;http://wwdj.wijndaele.com/getting-started-with-cakephp-without-mod_rewrite/&quot;&gt;http://wwdj.wijndaele.com/getting-started-with-cakephp-without-mod_rewrite/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately, it messed up quite a few links on my site.&lt;br /&gt;&lt;br /&gt;I ended up solving the problem by &lt;b&gt;changing &quot;AllowOverride&quot; None to &quot;AllowOverride All&quot;&lt;/b&gt; in my&amp;nbsp;/etc/apache2/sites-available/default file.&lt;br /&gt;&lt;br /&gt;Why the heck is CakePHP using .htaccess files by default anyway? Yii has this more streamlined.</content>
 </entry>
 
 <entry>
   <title>CakePHP Boilerplate</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/cakephp-boilerplate.html"/>
   <updated>2014-01-15T17:27:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/cakephp-boilerplate</id>
   <content type="html">While I was searching for a some good boilerplate to start my first CakePHP project with, I found this:&amp;nbsp;&lt;a href=&quot;https://github.com/hugodias/cakeStrap&quot;&gt;https://github.com/hugodias/cakeStrap&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There&apos;s also this one, but it has much fewer commits:&amp;nbsp;&lt;a href=&quot;https://github.com/zynesis/cakephp-boilerplate&quot;&gt;https://github.com/zynesis/cakephp-boilerplate&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError - Java</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/exception-in-thread-main.html"/>
   <updated>2014-01-07T18:05:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/exception-in-thread-main</id>
   <content type="html">Got this error when I was missing a library that came with the build.&lt;br /&gt;&lt;br /&gt;If you&apos;re getting this error, you may need to move the lib folder from your build directory into the folder of your JAR file.</content>
 </entry>
 
 <entry>
   <title>How To Use Endpoint Parameter - Flask-Admin</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/how-to-use-endpoint-parameter-flask.html"/>
   <updated>2014-01-03T19:01:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/how-to-use-endpoint-parameter-flask</id>
   <content type="html">You can access the endpoint parameter by using self.endpoint.&lt;br /&gt;&lt;br /&gt;class displayResults(BaseView):&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@expose(&apos;/&apos;,methods=(&apos;GET&apos;,&apos;POST&apos;))&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;def index(self):&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;print self.endpoint&lt;br /&gt;&lt;br /&gt;admin.add_view(displayResults(name=&apos;test&apos;, endpoint=&apos;test2&apos;))&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That will print &quot;test2&quot;.&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>UndefinedError: &apos;admin_base_template&apos; is undefined - Flask Admin</title>
   <link href="https://www.paulsprogrammingnotes.com/2014/01/undefinederror-adminbasetemplate-is.html"/>
   <updated>2014-01-02T17:47:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2014/01/undefinederror-adminbasetemplate-is</id>
   <content type="html">This happens when you try to render a template like this:&lt;br /&gt;return render_template(&apos;admin/upload.html&apos;)&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You need to use self.render instead:&lt;/div&gt;&lt;div&gt;return self.render(&apos;admin/upload.html&apos;)&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Enable UART2 On BeagleBone Black for RS232 Cape</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/12/enable-uart2-on-beaglebone-black-for.html"/>
   <updated>2013-12-30T12:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/12/enable-uart2-on-beaglebone-black-for</id>
   <content type="html">&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Use this script to ensure UART2 is enabled in the device tree:&amp;nbsp;&lt;a href=&quot;https://github.com/victorporof/BeagleBone-SPI-UART&quot;&gt;https://github.com/victorporof/BeagleBone-SPI-UART&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Enable ttyO1 it in the firmware using this guide (makes the device appear):&amp;nbsp;&lt;a href=&quot;http://www.element14.com/community/blogs/mirandasoft/2013/07/30/beaglebone-black-rapid-activation-of-ttyo1-ttyo2-ttyo4-and-ttyo5&quot;&gt;http://www.element14.com/community/blogs/mirandasoft/2013/07/30/beaglebone-black-rapid-activation-of-ttyo1-ttyo2-ttyo4-and-ttyo5&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Put a paperclip into the RS232 port like in the picture on this page:&amp;nbsp;&lt;a href=&quot;http://sensorsblog.com/serial-communications/rs232loopbacktest/&quot;&gt;http://sensorsblog.com/serial-communications/rs232loopbacktest/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;echo hello &amp;gt; /dev/ttyO1&lt;/li&gt;&lt;li&gt;cat /dev/ttyO1&lt;/li&gt;&lt;/ol&gt;</content>
 </entry>
 
 <entry>
   <title>Clustering With Leaflet</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/12/clustering-with-leaflet.html"/>
   <updated>2013-12-30T03:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/12/clustering-with-leaflet</id>
   <content type="html">&lt;a href=&quot;http://jmduke.com/blog/2013/12/28/seattle-911&quot;&gt;http://jmduke.com/blog/2013/12/28/seattle-911&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>The Z Layout</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/12/the-z-layout.html"/>
   <updated>2013-12-29T23:56:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/12/the-z-layout</id>
   <content type="html">I&apos;m definitely going to use this technique on my next business site:&amp;nbsp;&lt;a href=&quot;http://design.tutsplus.com/articles/understanding-the-z-layout-in-web-design--webdesign-28&quot;&gt;http://design.tutsplus.com/articles/understanding-the-z-layout-in-web-design--webdesign-28&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Two Column Match - Flask + HandsOnTable</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/12/two-column-match-flask-handsontable.html"/>
   <updated>2013-12-29T23:37:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/12/two-column-match-flask-handsontable</id>
   <content type="html">I&apos;m getting more comfortable with Flask, so I decided to experiment with Google App Engine + Flask + HandsOnTable.&lt;br /&gt;&lt;br /&gt;Here&apos;s the application I made:&amp;nbsp;&lt;a href=&quot;http://twocolumnmatch.appspot.com/match&quot;&gt;http://twocolumnmatch.appspot.com/match&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It takes the contents of the 2nd column and matches it to the rows of the first column. Just press the &quot;Match&quot; button to see what it does.&lt;br /&gt;&lt;br /&gt;I&apos;ve found myself doing what this application does a few times, but I manually create two python lists and compare them in IDLE. This application streamlines that process quite a bit.&lt;br /&gt;&lt;br /&gt;Here&apos;s the code:&amp;nbsp;&lt;a href=&quot;https://github.com/pawl/2ColumnMatch&quot;&gt;https://github.com/pawl/2ColumnMatch&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>SQLalchemy - Simple Select Query</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/12/sqlalchemy-simple-select-query.html"/>
   <updated>2013-12-26T19:10:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/12/sqlalchemy-simple-select-query</id>
   <content type="html">from sqlalchemy import create_engine,&amp;nbsp;MetaData, Table&lt;br /&gt;&lt;br /&gt;engine = create_engine(&apos;sqlite:///cars.db&apos;, echo=False)&lt;br /&gt;metadata = MetaData(bind=engine)&lt;br /&gt;&lt;br /&gt;table = Table(&apos;cars&apos;, metadata)&lt;br /&gt;stmt = table.select()&lt;br /&gt;for row in stmt.execute():&lt;br /&gt;&amp;nbsp; &amp;nbsp; print row</content>
 </entry>
 
 <entry>
   <title>Entity-Attribute-Value - Dynamic Database Columns</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/12/entity-attribute-value-dynamic-database.html"/>
   <updated>2013-12-26T16:35:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/12/entity-attribute-value-dynamic-database</id>
   <content type="html">This page has a great example of when to use the Entity-Attribute-Value data model:&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/7933596/django-dynamic-model-fields&quot;&gt;http://stackoverflow.com/questions/7933596/django-dynamic-model-fields&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I&apos;m planning to use it for an application I&apos;m making which has user defined fields.</content>
 </entry>
 
 <entry>
   <title>SHOW COLUMNS or Get Column Names From SQLalchemy SELECT Query</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/12/show-columns-or-get-column-names-from.html"/>
   <updated>2013-12-18T23:19:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/12/show-columns-or-get-column-names-from</id>
   <content type="html">&lt;div class=&quot;tr_bq&quot;&gt;&lt;a href=&quot;http://stackoverflow.com/questions/8947616/python-sqlalchemy-get-column-names-dynamically&quot;&gt;http://stackoverflow.com/questions/8947616/python-sqlalchemy-get-column-names-dynamically&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Rob Wouter&apos;s answer really helped me out:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;You can either find the columns by calling result.keys() or you can access them through calling v.keys() inside the for loop.&lt;br /&gt;Here&apos;s an example using items():&lt;br /&gt;for v in result:&lt;br /&gt;&amp;nbsp; &amp;nbsp; for column, value in v.items():&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&apos;{0}: {1}&apos;.format(column, value))&lt;/blockquote&gt;</content>
 </entry>
 
 <entry>
   <title>AttributeError: &apos;dict&apos; object has no attribute &apos;_set_parent_with_dispatch&apos; - SQLalchemy</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/12/attributeerror-dict-object-has-no.html"/>
   <updated>2013-12-11T17:56:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/12/attributeerror-dict-object-has-no</id>
   <content type="html">&lt;br /&gt;&lt;div class=&quot;highlight-python&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20.390625px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;highlight&quot; style=&quot;background-image: none; background-position: initial initial; background-repeat: initial initial;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20.390625px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;The documentation says: &quot;Keyword arguments can be specified by specifying the last argument as a dictionary&quot;&lt;/div&gt;&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20.390625px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20.390625px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;So you will need to change this:&lt;/div&gt;&lt;div style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.390625px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;__table_args__ = (&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.390625px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;            &lt;/span&gt;{&apos;sqlite_autoincrement&apos;: True},&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.390625px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UniqueConstraint(&apos;filename&apos;, &apos;path&apos;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.390625px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.390625px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.390625px;&quot;&gt;to this:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.390625px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;__table_args__ = (&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.390625px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UniqueConstraint(&apos;filename&apos;, &apos;path&apos;),&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.390625px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&apos;sqlite_autoincrement&apos;: True}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.390625px;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.390625px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Flask-Admin Foreign Key Columns Allowing Editing</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/12/flask-admin-foreign-key-columns.html"/>
   <updated>2013-12-11T17:36:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/12/flask-admin-foreign-key-columns</id>
   <content type="html">Make sure you have a row id number as your primary key for your child table. Having a composite primary key didn&apos;t seem to save when I was editing the form.</content>
 </entry>
 
 <entry>
   <title>PC Building Site</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/12/pc-building-site.html"/>
   <updated>2013-12-06T06:57:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/12/pc-building-site</id>
   <content type="html">Awesome site for finding the best prices on PC parts:&amp;nbsp;&lt;a href=&quot;http://pcpartpicker.com/&quot;&gt;http://pcpartpicker.com&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>jPanelMenu Causing Document.Ready() To Run Twice</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/11/jpanelmenu-causing-documentready-to-run.html"/>
   <updated>2013-11-27T22:57:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/11/jpanelmenu-causing-documentready-to-run</id>
   <content type="html">This line in jquery.jpanelmenu.js is the cause:&lt;br /&gt;$(&apos;body &amp;gt; *&apos;).not(jP.menu + &apos;, &apos; + jP.options.excludedPanelContent).wrapAll(&apos;&amp;lt;div class=&quot;&apos; + &apos;jPanelMenu-panel&apos; + &apos;&quot;/&amp;gt;&apos;);&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You will need to comment it out and wrap everything in your body tag manually with:&lt;/div&gt;&lt;div&gt;&amp;lt;div class=&quot;jPanelMenu-panel&quot; style=&quot;position: relative; left: 0px;&quot;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The end result will look like:&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div class=&quot;jPanelMenu-panel&quot; style=&quot;position: relative; left: 0px;&quot;&amp;gt;&lt;/div&gt;&lt;div&gt;all your code....&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This page helped me figure it out:&amp;nbsp;&lt;a href=&quot;http://doctype.com/trying-jquery-wrapall-seems-wrap-content-twice&quot;&gt;http://doctype.com/trying-jquery-wrapall-seems-wrap-content-twice&lt;/a&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Best cArrayDataProvider Example - Yii</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/11/best-carraydataprovider-example-yii.html"/>
   <updated>2013-11-18T16:40:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/11/best-carraydataprovider-example-yii</id>
   <content type="html">&lt;a href=&quot;http://queirozf.com/reminders/using-carraydataprovider-to-populate-a-cgridview-in-yii&quot;&gt;http://queirozf.com/reminders/using-carraydataprovider-to-populate-a-cgridview-in-yii&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Spreadsheet Parsing With Javascript</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/11/spreadsheet-parsing-with-javascript.html"/>
   <updated>2013-11-13T07:04:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/11/spreadsheet-parsing-with-javascript</id>
   <content type="html">&lt;a href=&quot;http://oss.sheetjs.com/&quot;&gt;http://oss.sheetjs.com/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Responsive Email Template</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/11/responsive-email-template.html"/>
   <updated>2013-11-08T09:18:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/11/responsive-email-template</id>
   <content type="html">Zurb Ink -&amp;nbsp;&lt;a href=&quot;http://zurb.com/ink/templates.php&quot;&gt;http://zurb.com/ink/templates.php&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Catch ldap_bind(): Unable to bind to server: Invalid credentials</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/11/catch-ldapbind-unable-to-bind-to-server.html"/>
   <updated>2013-11-06T04:33:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/11/catch-ldapbind-unable-to-bind-to-server</id>
   <content type="html">I used the tip from this page:&amp;nbsp;&lt;a href=&quot;http://bytes.com/topic/php/answers/600903-ldap_bind-warning-instead-false&quot;&gt;http://bytes.com/topic/php/answers/600903-ldap_bind-warning-instead-false&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&quot;&lt;span style=&quot;background-color: white; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px;&quot;&gt;You can get around this if you supress warning and error messages by&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px;&quot;&gt;putting a @ in front of the function name:&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: white; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px;&quot;&gt;$ldapbind = @ldap_bind($ldapconn, $ldaprdn, $ldappass);&quot;&lt;/span&gt;</content>
 </entry>
 
 <entry>
   <title>Yii Google Chart Extension</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/11/yii-google-chart-extension.html"/>
   <updated>2013-11-05T23:08:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/11/yii-google-chart-extension</id>
   <content type="html">Here&apos;s YiiWheel&apos;s google chart wrapper extension:&amp;nbsp;&lt;a href=&quot;https://github.com/2amigos/yiiwheels/blob/master/widgets/google/WhVisualizationChart.php&quot;&gt;https://github.com/2amigos/yiiwheels/blob/master/widgets/google/WhVisualizationChart.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I downloaded just the WhVisualizationChart file and put this in my view:&lt;br /&gt;&lt;br /&gt;$this-&amp;gt;widget(&apos;ext.WhVisualizationChart&apos;, array(&lt;br /&gt;&amp;nbsp; &amp;nbsp; &apos;visualization&apos; =&amp;gt; &apos;PieChart&apos;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &apos;data&apos; =&amp;gt; $chartDataProvider,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &apos;options&apos; =&amp;gt; array(&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &apos;pieHole&apos;=&amp;gt; &apos;0.5&apos;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &apos;backgroundColor&apos;=&amp;gt;array(&apos;fill&apos;=&amp;gt;&apos;transparent&apos;),&lt;br /&gt;&amp;nbsp; &amp;nbsp; ),&lt;br /&gt;&amp;nbsp; &amp;nbsp; &apos;htmlOptions&apos;=&amp;gt;array(&apos;style&apos;=&amp;gt;&apos;width:100%; height:375px&apos;),&lt;br /&gt;));&lt;br /&gt;&lt;br /&gt;and this in my controller:&lt;br /&gt;&lt;br /&gt;public function actionIndex()&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $chartDataProvider = array(&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; array(&apos;Task&apos;, &apos;Hours per Day&apos;),&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; array(&apos;Work&apos;, 11),&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; array(&apos;Eat&apos;, 2),&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; array(&apos;Commute&apos;, 2),&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; array(&apos;Watch TV&apos;, 2),&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; array(&apos;Sleep&apos;, 7)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;$this-&amp;gt;render(&apos;index&apos;, array(&apos;chartDataProvider&apos;=&amp;gt;$chartDataProvider));&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;Examples on how to use it are at the bottom of this page:&amp;nbsp;&lt;a href=&quot;http://yiiwheels.2amigos.us/site/charts#visualizationchart&quot;&gt;http://yiiwheels.2amigos.us/site/charts#visualizationchart&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Render View From Another Controller In Yii</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/render-view-from-another-controller-in.html"/>
   <updated>2013-10-31T02:39:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/render-view-from-another-controller-in</id>
   <content type="html">&lt;a href=&quot;http://developwithguru.com/how-to-renderpartial-a-file-in-another-controllers-view-folder-for-yii/&quot;&gt;http://developwithguru.com/how-to-renderpartial-a-file-in-another-controllers-view-folder-for-yii/&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://developwithguru.com/how-to-renderpartial-a-file-in-another-controllers-view-folder-for-yii/&quot;&gt;&lt;br /&gt;&lt;/a&gt;&amp;lt;?php $this-&amp;gt;renderPartial(&apos;//library/_book&apos;, array(&apos;books&apos;=&amp;gt;$books))?&amp;gt;&lt;br /&gt;&lt;br /&gt;Use double slashes before the controller.</content>
 </entry>
 
 <entry>
   <title>Easier Monitoring Than Nagios</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/easier-monitoring-than-nagios.html"/>
   <updated>2013-10-28T16:57:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/easier-monitoring-than-nagios</id>
   <content type="html">&lt;a href=&quot;http://mmonit.com/monit/&quot;&gt;http://mmonit.com/monit/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It was not easy at all to get Nagios to monitor mysql. This only took a minute.</content>
 </entry>
 
 <entry>
   <title>CSqlDataProvider Using Special Data Attribute - Yii</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/csqldataprovider-using-special-data.html"/>
   <updated>2013-10-23T18:55:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/csqldataprovider-using-special-data</id>
   <content type="html">Just posted this on the Yii forum after I found out that using the special data attribute in a column requires a syntax like &apos;value&apos;=&amp;gt;&apos;$data[&quot;issueCount&quot;]&apos; when you&apos;re using&amp;nbsp;CSqlDataProvider:&lt;br /&gt;&lt;a href=&quot;http://www.yiiframework.com/forum/index.php/topic/48219-special-data-attribute-syntax-in-cactivedataprovider-vs-csqldataprovider/&quot;&gt;http://www.yiiframework.com/forum/index.php/topic/48219-special-data-attribute-syntax-in-cactivedataprovider-vs-csqldataprovider/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Trick For Running Python Scripts On Reboot - Ubuntu</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/trick-for-running-python-scripts-on.html"/>
   <updated>2013-10-18T08:15:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/trick-for-running-python-scripts-on</id>
   <content type="html">&lt;a href=&quot;http://www.raspberrypi-spy.co.uk/2013/07/running-a-python-script-at-boot-using-cron/&quot;&gt;http://www.raspberrypi-spy.co.uk/2013/07/running-a-python-script-at-boot-using-cron/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here&apos;s what it looks like in crontab:&lt;br /&gt;&lt;span style=&quot;background-color: #f7f7f7; color: #222222; font-family: &apos;Courier 10 Pitch&apos;, Courier, monospace; font-size: 15px; line-height: 21px;&quot;&gt;@reboot python /home/pi/MyScript.py &amp;amp;&lt;/span&gt;</content>
 </entry>
 
 <entry>
   <title>Enabling SSL On Apache</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/enabling-ssl-on-apache.html"/>
   <updated>2013-10-17T17:40:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/enabling-ssl-on-apache</id>
   <content type="html">&lt;br /&gt;&lt;div&gt;This is a quick overview of the process of adding an SSL certificate to apache (for next time...):&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Generate your private key and CSR with: &lt;br /&gt;openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out&amp;nbsp;yourdomain.csr&lt;/li&gt;&lt;li&gt;Request your certificate&lt;/li&gt;&lt;li&gt;Save requested certificate onto server in a .crt file&lt;/li&gt;&lt;li&gt;Download the intermediary/root cert from&amp;nbsp;&lt;a href=&quot;http://www.symantec.com/page.jsp?id=roots&quot;&gt;http://www.symantec.com/page.jsp?id=roots&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Make your site file in /etc/apache2/sites-enabled/ look like this:&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;div&gt;&amp;lt;VirtualHost *:443&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SSLEngine On&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SSLCertificateFile /home/youruser/yourdomain.crt&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SSLCertificateKeyFile /home/youruser/yourdomain.key&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SSLCACertificateFile /var/www/verisign.crt&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ServerName www.yourdomain.com&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DocumentRoot /var/www/yourdomain&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;An explanation of each of those certificates:&lt;/div&gt;&lt;div&gt;SSLCertificateFile - This is the certificate you received after your request.&lt;/div&gt;&lt;div&gt;SSLCertificateKeyFile - This is the private key you generated in step 1.&lt;/div&gt;&lt;div&gt;SSLCACertificateFile - This is the intermediary cert you downloaded from verisign.&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>TbEditableColumn Inside of A TbRelationalColumn&apos;s GridView - Yii&apos;s YiiBooster Extension</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/tbeditablecolumn-inside-of.html"/>
   <updated>2013-10-16T17:23:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/tbeditablecolumn-inside-of</id>
   <content type="html">&lt;a href=&quot;https://github.com/clevertech/YiiBooster/issues/703&quot;&gt;https://github.com/clevertech/YiiBooster/issues/703&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Just posted an issue on github with instructions for how to get&amp;nbsp;TbEditableColumn working inside of one of YiiBooster&apos;s subgrids.</content>
 </entry>
 
 <entry>
   <title>Yii quickdlgs Without UrlManager Enabled</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/yii-quickdlgs-without-urlmanager-enabled.html"/>
   <updated>2013-10-11T19:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/yii-quickdlgs-without-urlmanager-enabled</id>
   <content type="html">EQuickDlgs::iframeButton(&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;array(&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&apos;controllerRoute&apos; =&amp;gt; &apos;controller/create&apos;,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&apos;dialogTitle&apos; =&amp;gt; &apos;Create New Record&apos;,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&apos;dialogWidth&apos; =&amp;gt; 800,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&apos;dialogHeight&apos; =&amp;gt; 600,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&apos;openButtonText&apos; =&amp;gt; &apos;Add Record&apos;,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&apos;closeButtonText&apos; =&amp;gt; &apos;Close&apos;,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;//&apos;openButtonHtmlOptions&apos; =&amp;gt; array(...),&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;With the code above, I was getting the following error:&lt;br /&gt;The system is unable to find the requested action &quot;create?qdsClass=EFrameJuiDlg&quot;.&lt;br /&gt;&lt;br /&gt;I had to change line 79 in EFrameJuiDlg.php inside the quickdlgs extension from:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $url .= &apos;?&apos; . http_build_query($this-&amp;gt;urlParams);&lt;br /&gt;&lt;div&gt;to:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $url .= &apos;&amp;amp;&apos; . http_build_query($this-&amp;gt;urlParams);&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>htmlspecialchars() expects parameter 1 - Yii (echmultiselect)</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/htmlspecialchars-expects-parameter-1.html"/>
   <updated>2013-10-09T05:38:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/htmlspecialchars-expects-parameter-1</id>
   <content type="html">&lt;blockquote class=&quot;tr_bq&quot;&gt;htmlspecialchars() expects parameter 1 to be string, array given C:\xampp\htdocs\yii\framework\web\helpers\CHtml.php(98)&amp;nbsp;&lt;/blockquote&gt;The error only occurred when trying to apply the&amp;nbsp;echmultiselect filter to the filter above the gridview.&lt;br /&gt;&lt;br /&gt;Here&apos;s what I did to fix:&lt;br /&gt;1. Went to the Yii framework folder and found the following file: yii\framework\web\helpers\CHtml.php&lt;br /&gt;&lt;br /&gt;2. Modifed line 98 from &quot;return htmlspecialchars($text,ENT_QUOTES,Yii::app()-&amp;gt;charset);&quot; to:&lt;br /&gt;&quot;return htmlspecialchars(print_r($text, true),ENT_QUOTES,Yii::app()-&amp;gt;charset);&quot;&lt;br /&gt;&lt;br /&gt;Then you need to implement the echmultiselect extension in the view (my example shows adding it for site_status):&lt;br /&gt;&lt;br /&gt;3. Added this php code to the view: $data= CHtml::listData(Nvdaily::model()-&amp;gt;findAll(), &apos;blahblahblah&apos;, &apos;blahblahblah&apos;);&lt;br /&gt;(but it should probably be in the model)&lt;br /&gt;&lt;br /&gt;4. Made my &apos;columns&apos; array look like this:&lt;br /&gt;&apos;columns&apos;=&amp;gt;array(&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&apos;id&apos;,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&apos;blah&apos;,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&apos;blahblah&apos;,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;array (&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &apos;name&apos;=&amp;gt;&apos;blahblahblah&apos;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &apos;filter&apos;=&amp;gt; $this-&amp;gt;widget(&apos;ext.EchMultiselect.EchMultiselect&apos;,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;array(&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &apos;model&apos; =&amp;gt; $model,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &apos;dropDownAttribute&apos; =&amp;gt; &apos;blahblahblah&apos;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &apos;data&apos; =&amp;gt; $data,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &apos;options&apos; =&amp;gt; array(&apos;buttonWidth&apos; =&amp;gt; 80, &apos;ajaxRefresh&apos; =&amp;gt; true),&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; true // capture output; needed so the widget displays inside the grid&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;),&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;),&lt;br /&gt;array(&lt;br /&gt;&apos;class&apos;=&amp;gt;&apos;bootstrap.widgets.TbButtonColumn&apos;,&lt;br /&gt;),&lt;br /&gt;),</content>
 </entry>
 
 <entry>
   <title>SQL Formatter</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/sql-formatter.html"/>
   <updated>2013-10-07T06:26:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/sql-formatter</id>
   <content type="html">I had no idea this existed until now:&amp;nbsp;&lt;a href=&quot;http://www.dpriver.com/pp/sqlformat.htm&quot;&gt;http://www.dpriver.com/pp/sqlformat.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It makes your SQL queries more readable.&lt;br /&gt;&lt;br /&gt;I learned about it from this thread:&amp;nbsp;&lt;a href=&quot;http://www.reddit.com/r/PHP/comments/1n8kgz/how_do_you_write_readable_sql_queries/&quot;&gt;http://www.reddit.com/r/PHP/comments/1n8kgz/how_do_you_write_readable_sql_queries/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Error Handling In mysqldb - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/error-handling-in-mysqldb-python.html"/>
   <updated>2013-10-06T22:56:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/error-handling-in-mysqldb-python</id>
   <content type="html">I&apos;ve had issues with queries failing and leaving connections open (enough to stall a server...). I know python&apos;s oursql library supports using the WITH keyword, and I think it will close the connection when there is an unexpected error. However, I&apos;m not sure if I&apos;m ready to move to a different library for MySQL (it&apos;s working well).&lt;br /&gt;&lt;br /&gt;Here&apos;s what I&apos;m currently doing to close the cursor and connection, then re-raise the error:&lt;br /&gt;&lt;br /&gt;import MySQLdb&lt;br /&gt;&lt;br /&gt;conn = MySQLdb.connect(user=&quot;username&quot;, passwd=&quot;secret&quot;, db=&quot;database&quot;, charset=&apos;utf8&apos;)&lt;br /&gt;cur = conn.cursor()&lt;br /&gt;&lt;br /&gt;try:&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;cur.execute(&quot;INSERT INTO testTable (userid) VALUES(%s);&quot; % id)&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;conn.commit()&lt;br /&gt;except:&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;cur.close()&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;conn.close()&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;raise&lt;br /&gt;finally:&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print &quot;Insert Successful&quot;</content>
 </entry>
 
 <entry>
   <title>haufe.sharepoint Python Library - URLs With %20</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/haufesharepoint-python-library-urls.html"/>
   <updated>2013-10-04T19:06:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/haufesharepoint-python-library-urls</id>
   <content type="html">I changed line 25 of the haufe.sharepoint library to fix an issue I was having with URLs which had %20 (the url encoded space character):&lt;br /&gt;&lt;br /&gt;New Code:&lt;br /&gt;location = urllib.quote(self.location(), safe=&quot;:/&quot;)&lt;br /&gt;&lt;br /&gt;Old Code:&lt;br /&gt;location = self.location()&lt;br /&gt;&lt;br /&gt;Just try using a URL with %20 with haufe.sharepoint to see what I&apos;m talking about.</content>
 </entry>
 
 <entry>
   <title>urllib2.URLError Python SUDS library</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/urllib2urlerror-python-suds-library.html"/>
   <updated>2013-10-03T21:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/urllib2urlerror-python-suds-library</id>
   <content type="html">&lt;div&gt;To figure this out, you&apos;re going to need logging. Turn on logging with the following:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://stackoverflow.com/questions/2388046/can-you-help-me-solve-this-suds-soap-issue&quot;&gt;http://stackoverflow.com/questions/2388046/can-you-help-me-solve-this-suds-soap-issue&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;import logging logging.basicConfig(level=logging.INFO) logging.getLogger(&apos;suds.client&apos;).setLevel(logging.DEBUG) logging.getLogger(&apos;suds.transport&apos;).setLevel(logging.DEBUG) logging.getLogger(&apos;suds.xsd.schema&apos;).setLevel(logging.DEBUG) logging.getLogger(&apos;suds.wsdl&apos;).setLevel(logging.DEBUG)&lt;/span&gt;</content>
 </entry>
 
 <entry>
   <title>pip 1.3 Not Working Behind Proxy</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/pip-13-not-working-behind-proxy.html"/>
   <updated>2013-10-03T19:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/pip-13-not-working-behind-proxy</id>
   <content type="html">&lt;a href=&quot;http://pythontesting.net/python/pip/&quot;&gt;http://pythontesting.net/python/pip/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Like this article says, it&apos;s fixed in the dev version of pip.</content>
 </entry>
 
 <entry>
   <title>Bootstrap Starter Templates</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/bootstrap-starter-templates.html"/>
   <updated>2013-10-03T07:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/bootstrap-starter-templates</id>
   <content type="html">&lt;a href=&quot;http://startbootstrap.com/all-templates&quot;&gt;http://startbootstrap.com/all-templates&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Installing Nagios</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/installing-nagios.html"/>
   <updated>2013-10-02T21:16:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/installing-nagios</id>
   <content type="html">I had a heck of a time finding the config file for nagios. It&apos;s under:&amp;nbsp;/etc/nagios3/conf.d/localhost_nagios2.cfg&lt;br /&gt;&lt;br /&gt;These guides were helpful:&lt;br /&gt;&lt;a href=&quot;http://ostatic.com/blog/monitoring-web-services-with-nagios&quot;&gt;http://ostatic.com/blog/monitoring-web-services-with-nagios&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://library.linode.com/server-monitoring/nagios/ubuntu-12.04-precise-pangolin&quot;&gt;https://library.linode.com/server-monitoring/nagios/ubuntu-12.04-precise-pangolin&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>MySQL Not Starting On Reboot</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/10/mysql-not-starting-on-reboot.html"/>
   <updated>2013-10-01T21:07:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/10/mysql-not-starting-on-reboot</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/questions/9859381/how-make-mysql-start-automatically-linux-cli-only&quot;&gt;http://stackoverflow.com/questions/9859381/how-make-mysql-start-automatically-linux-cli-only&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I was able to to the following, based on the post above:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-family: &apos;Lucida Console&apos;; font-size: 10pt;&quot;&gt;sudo apt-get install sysv-rc-conf&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: &apos;Lucida Console&apos;; font-size: 10pt;&quot;&gt;sudo sysv-rc-conf&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: &apos;Lucida Console&apos;; font-size: 10pt;&quot;&gt;mark the 6 column for mysqld or mysql.server (6 = reboot)&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: x-small;&quot;&gt;Note: I tried&amp;nbsp;sudo update-rc.d mysql.server defaults and it didn&apos;t work. It gave me the following error: System start/stop links for /etc/init.d/mysql.server already exist.&lt;/span&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Fira Font</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/09/fira-font.html"/>
   <updated>2013-09-25T06:28:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/09/fira-font</id>
   <content type="html">&lt;a href=&quot;https://github.com/mozilla/Fira&quot;&gt;https://github.com/mozilla/Fira&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Mozilla&apos;s new Fira font looks great. Looking forward to use it on some future projects.</content>
 </entry>
 
 <entry>
   <title>MySQL IF Statement Affect On Speed</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/09/mysql-if-statement-affect-on-speed.html"/>
   <updated>2013-09-19T17:28:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/09/mysql-if-statement-affect-on-speed</id>
   <content type="html">&lt;span style=&quot;background-color: white; color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;if(`table`.`start`=&apos;0000-00-00&apos;,&apos;&apos;,`table`.`start`)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;That&apos;s the part of my query that was increasing the execution time by 10x.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;I changed it to just&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #262626; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;`table`.`start` (without the IF statement) and the query was 10x faster.&lt;/span&gt;</content>
 </entry>
 
 <entry>
   <title>Phonegap Start (for Phonegap Build)</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/09/phonegap-start.html"/>
   <updated>2013-09-18T04:24:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/09/phonegap-start</id>
   <content type="html">&lt;div&gt;&quot;&lt;span style=&quot;color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;&quot;&gt;A Hello World application to get started with PhoneGap Build.&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://github.com/phonegap/phonegap-start&quot;&gt;https://github.com/phonegap/phonegap-start&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Twilio PHP Library Using A Proxy</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/09/twilio-php-library-using-proxy.html"/>
   <updated>2013-09-17T20:48:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/09/twilio-php-library-using-proxy</id>
   <content type="html">&lt;a href=&quot;https://github.com/twilio/twilio-php/issues/144&quot;&gt;https://github.com/twilio/twilio-php/issues/144&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I found a spot where I can add a proxy to the twilio PHP library.&lt;br /&gt;&lt;br /&gt;Go to&amp;nbsp;&lt;span style=&quot;background-color: #fbfbfb; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 13px; line-height: 22px;&quot;&gt;TinyHttp.php and add the highlighted part (using your own URL of course):&lt;/span&gt;&lt;br /&gt;&lt;pre style=&quot;border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(221, 221, 221); color: #333333; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 13px; line-height: 19px; margin-bottom: 15px; margin-top: 15px; overflow: auto; padding: 6px 10px;&quot;&gt;&lt;code style=&quot;background-color: yellow; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;&quot;&gt;$opts[CURLOPT_PROXY] = &apos;http://xxx.xxx.xxx.xxx:8080/&apos;;&lt;/code&gt;&lt;code style=&quot;background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;try {&lt;br /&gt;      if ($curl = curl_init()) {&lt;/code&gt;&lt;/pre&gt;</content>
 </entry>
 
 <entry>
   <title>Failed to connect to socket /var/run/dbus/system_bus_socket</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/09/failed-to-connect-to-socket.html"/>
   <updated>2013-09-17T15:36:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/09/failed-to-connect-to-socket</id>
   <content type="html">Error: Can&apos;t find out if NetworkManager is running: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory.&lt;br /&gt;The following fixed the problem:&lt;br /&gt;apt-get install dbus&lt;br /&gt;(if you already have dbus installed:&amp;nbsp;sudo service dbus start)&lt;br /&gt;/etc/init.d/network-manager start&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What caused the error?:&lt;br /&gt;/etc/init.d/network restart</content>
 </entry>
 
 <entry>
   <title>Could not initialize NMClient </title>
   <link href="https://www.paulsprogrammingnotes.com/2013/09/could-not-initialize-nmclient.html"/>
   <updated>2013-09-16T23:52:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/09/could-not-initialize-nmclient</id>
   <content type="html">** (process:17986): WARNING **: error: could not connect to NetworkManager&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Fix: Try running with sudo.&lt;br /&gt;&lt;br /&gt;For example:&amp;nbsp;sudo nm-tool | grep DNS</content>
 </entry>
 
 <entry>
   <title>Check If Script Is already Running - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/09/check-if-script-is-already-running.html"/>
   <updated>2013-09-08T18:36:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/09/check-if-script-is-already-running</id>
   <content type="html">&lt;a href=&quot;http://pythonhosted.org/tendo/&quot;&gt;http://pythonhosted.org/tendo/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;import tendo&lt;br /&gt;&lt;br /&gt;# If is there another instance already running:&lt;br /&gt;# display the message “Another instance is already running, quitting.”, and return -1 error code.&lt;br /&gt;me = SingleInstance()&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Fighting WinSCP Time-Outs</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/09/fighting-winscp-time-outs.html"/>
   <updated>2013-09-03T17:14:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/09/fighting-winscp-time-outs</id>
   <content type="html">&lt;a href=&quot;http://www.lampdocs.com/blog/2008/10/winscp-how-to-prevent-timeouts/&quot;&gt;http://www.lampdocs.com/blog/2008/10/winscp-how-to-prevent-timeouts/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That&apos;s a guide to making WinSCP send a dummy command every 30 seconds to keep your connection alive. It&apos;s way better than constantly having to type in your password.</content>
 </entry>
 
 <entry>
   <title>Crontab Mistake</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/09/crontab-mistake.html"/>
   <updated>2013-09-03T16:20:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/09/crontab-mistake</id>
   <content type="html">I wanted to run a script every 20 minutes, so I put this into my crontab:&lt;br /&gt;20 * * * * sh script.sh&lt;br /&gt;&lt;br /&gt;That&apos;s wrong. That only runs it once every hour 20 minutes into the hour. For example, &quot;20,40 * * * * sh bash.sh&quot; would run it twice - 20 and 40 minutes into the hour.&lt;br /&gt;&lt;br /&gt;To run the script every 20 minutes like I was expecting:&lt;br /&gt;*/20 * * * * sh script.sh</content>
 </entry>
 
 <entry>
   <title>Include yiiGridView Javascript </title>
   <link href="https://www.paulsprogrammingnotes.com/2013/09/include-yiigridview-javascript.html"/>
   <updated>2013-09-02T20:04:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/09/include-yiigridview-javascript</id>
   <content type="html">&lt;a href=&quot;http://chevronscode.com/yii-include-preload-yiigridview-javascript/&quot;&gt;http://chevronscode.com/yii-include-preload-yiigridview-javascript/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I ended up with the following code at the top of the page (since I&apos;m not using a layout):&lt;br /&gt;&lt;br /&gt;Yii::app()-&amp;gt;clientScript-&amp;gt;registerCoreScript(&apos;jquery&apos;);&lt;br /&gt;$assetsScriptUrl = Yii::app()-&amp;gt;getAssetManager()-&amp;gt;publish(Yii::getPathOfAlias(&apos;zii.widgets.assets&apos;));&lt;br /&gt;Yii::app()-&amp;gt;getClientScript()-&amp;gt;registerScriptFile($assetsScriptUrl .&apos;/gridview/jquery.yiigridview.js&apos;);</content>
 </entry>
 
 <entry>
   <title>PHP Best Practices</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/08/php-best-practices.html"/>
   <updated>2013-08-20T06:52:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/08/php-best-practices</id>
   <content type="html">&lt;a href=&quot;https://phpbestpractices.org/&quot;&gt;https://phpbestpractices.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Things I learned:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;It&apos;s easy to install PHP-APC for quick opcode caching, and it apparently serves the same purpose as memcached for a single server.&lt;/li&gt;&lt;li&gt;Memcache and Memcached are two different libraries.&lt;/li&gt;&lt;li&gt;There&apos;s a different (a small one) in speed between single and double quotes.&lt;/li&gt;&lt;li&gt;Use phpass to store passwords.&lt;/li&gt;&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Set Up Wordpress For FTP</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/08/set-up-wordpress-for-ftp.html"/>
   <updated>2013-08-16T22:19:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/08/set-up-wordpress-for-ftp</id>
   <content type="html">If it&apos;s asking you for FTP login information when you try to update wordpress or a plugin, you don&apos;t need to do that! Chances are you don&apos;t have permissions correctly configured on that directory. Make sure apache owns the directory. On ubuntu, this will probably work (depending on which user owns apache):&lt;br /&gt;&lt;br /&gt;sudo chown -R www-data:www-data /var/www&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Add Multiple Unique Indexes - MySQL</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/08/add-multiple-unique-indexes-mysql.html"/>
   <updated>2013-08-15T01:35:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/08/add-multiple-unique-indexes-mysql</id>
   <content type="html">alter table users add unique index(id, name, phone);</content>
 </entry>
 
 <entry>
   <title>Bootstrap Span Is Overlapping</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/08/bootstrap-span-is-overlapping.html"/>
   <updated>2013-08-15T01:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/08/bootstrap-span-is-overlapping</id>
   <content type="html">Try setting a static width on the span. This ensures responsive knows when to put it on another line. It solved my issues with the spans overlapping.&lt;br /&gt;&lt;br /&gt;example: add style=&quot;width: 520px&quot; to your div with class=&quot;span6&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>mysql-client 5.6 or phpmyadmin for mysql 5.6</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/08/mysql-client-56-or-phpmyadmin-for-mysql.html"/>
   <updated>2013-08-15T00:02:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/08/mysql-client-56-or-phpmyadmin-for-mysql</id>
   <content type="html">Mysql-client 5.6 doesn&apos;t seem to exist, and you don&apos;t need it. Phpmyadmin installs mysql-client 5.5 automatically, and that works with mysql server 5.6. If you&apos;re having issues, you probably need to run &quot;sudo dpkg-reconfigure phpmyadmin&quot;.</content>
 </entry>
 
 <entry>
   <title>Turn Off MySQL Strict Mode</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/08/turn-off-mysql-strict-mode.html"/>
   <updated>2013-08-14T23:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/08/turn-off-mysql-strict-mode</id>
   <content type="html">&lt;a href=&quot;http://nickbartlett.com/wordpress/how-to-turn-off-mysql-strict-mode/&quot;&gt;http://nickbartlett.com/wordpress/how-to-turn-off-mysql-strict-mode/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;SET @@global.sql_mode= ”; will set it temporarily. (to see if it will fix your problem)&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To turn it off permanently, add this setting to your my.cnf (probably in /etc/mysql/my.cnf if you&apos;re using ubuntu):&amp;nbsp;&lt;/div&gt;&lt;div&gt;[mysqld]&lt;div&gt;sql-mode =&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you&apos;re having issues getting this setting to work in your my.cnf, look for another my.cnf in&amp;nbsp;/opt/mysql/server-5.6/my.cnf or elsewhere on your system using the &quot;find / -name &apos;my.cnf&apos;&quot; command.&lt;/div&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Using Dictionaries In Python&apos;s cursor.execute</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/08/using-dictionaries-in-pythons.html"/>
   <updated>2013-08-09T17:05:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/08/using-dictionaries-in-pythons</id>
   <content type="html">http://stackoverflow.com/questions/10983616/parameterized-queries-in-oursql</content>
 </entry>
 
 <entry>
   <title>pymssql SELECT Always Returns None - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/08/pymssql-select-always-returns-none.html"/>
   <updated>2013-08-07T18:54:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/08/pymssql-select-always-returns-none</id>
   <content type="html">apt-get remove python-pymssql&lt;br /&gt;&lt;br /&gt;The version from apt-get has this error. Just use easy_install to install pymssql and select statements will work.</content>
 </entry>
 
 <entry>
   <title>error: Setup script exited with error: command &apos;x86_64-linux-gnu-gcc&apos; failed with exit status 1</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/08/error-setup-script-exited-with-error.html"/>
   <updated>2013-08-07T18:49:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/08/error-setup-script-exited-with-error</id>
   <content type="html">sudo apt-get install python-dev&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Running that command on ubuntu will fix the issue.&lt;br /&gt;&lt;br /&gt;If you&apos;re installing lxml:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/16149613/installing-lxml-with-pip-in-virtualenv-ubuntu-12-10-error-command-gcc-failed&quot;&gt;http://stackoverflow.com/questions/16149613/installing-lxml-with-pip-in-virtualenv-ubuntu-12-10-error-command-gcc-failed&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.isnull.com.ar/2011/10/ubuntu-11-fatal-error-libxmlxmlversionh.html&quot;&gt;http://www.isnull.com.ar/2011/10/ubuntu-11-fatal-error-libxmlxmlversionh.html&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Also try this:&lt;/div&gt;&lt;div&gt;sudo apt-get install libxslt1-dev libxslt1.1 libxml2-dev libxml2 libssl-dev&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Defcon Ace Badge</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/08/defcon-ace-badge.html"/>
   <updated>2013-08-02T17:10:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/08/defcon-ace-badge</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/generated/assets/images/IMG_20130802_100539_934-800-26caba9be.jpg&quot; srcset=&quot;/generated/assets/images/IMG_20130802_100539_934-400-26caba9be.jpg 400w, /generated/assets/images/IMG_20130802_100539_934-600-26caba9be.jpg 600w, /generated/assets/images/IMG_20130802_100539_934-800-26caba9be.jpg 800w, /generated/assets/images/IMG_20130802_100539_934-1000-26caba9be.jpg 1000w&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/generated/assets/images/IMG_20130802_100554_625-800-d22ea8474.jpg&quot; srcset=&quot;/generated/assets/images/IMG_20130802_100554_625-400-d22ea8474.jpg 400w, /generated/assets/images/IMG_20130802_100554_625-600-d22ea8474.jpg 600w, /generated/assets/images/IMG_20130802_100554_625-800-d22ea8474.jpg 800w, /generated/assets/images/IMG_20130802_100554_625-1000-d22ea8474.jpg 1000w&quot; /&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>WHMCS Hook - Trigger E-mail On New User Sign-Up</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/whmcs-hook-trigger-e-mail-on-new-user.html"/>
   <updated>2013-07-28T19:48:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/whmcs-hook-trigger-e-mail-on-new-user</id>
   <content type="html">This script needs to go into your WHMCS hooks folder (root/includes/hooks/):&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;&amp;nbsp;function send_invitiation_email($vars) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;$command = &quot;sendemail&quot;;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; $adminuser = &quot;admin&quot;; // Your admin username&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; $values[&quot;messagename&quot;] = &quot;Google Groups Invitation&quot;; // exact name of e-mail template&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; $values[&quot;id&quot;] = &amp;nbsp;$vars[&apos;userid&apos;];&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; $results = localAPI($command,$values,$adminuser);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;add_hook(&quot;ClientAdd&quot;,1,&quot;send_invitiation_email&quot;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;?&amp;gt;</content>
 </entry>
 
 <entry>
   <title>Bootstrap Form Builder</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/bootstrap-form-builder.html"/>
   <updated>2013-07-24T21:53:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/bootstrap-form-builder</id>
   <content type="html">&lt;a href=&quot;http://minikomi.github.io/Bootstrap-Form-Builder/&quot;&gt;http://minikomi.github.io/Bootstrap-Form-Builder/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This looks great for non-technical users who want a form built. It&apos;s a great response to &quot;Hey, make me a checklist!&quot;...&lt;br /&gt;&lt;br /&gt;&quot;You make the checklist the way you want it using this site, then I&apos;ll put it on the web.&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>PHPmyAdmin Loading Slowly (or not at all)</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/phpmyadmin-loading-slowly-or-not-at-all.html"/>
   <updated>2013-07-23T19:04:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/phpmyadmin-loading-slowly-or-not-at-all</id>
   <content type="html">&lt;a href=&quot;http://future500.nl/phpmyadmin-slow-on-startup/&quot;&gt;http://future500.nl/phpmyadmin-slow-on-startup/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>UnicodeEncodeError: &apos;ascii&apos; codec can&apos;t encode character u&apos;\ufffd&apos; in position 12: ordinal not in range(128)</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/unicodeencodeerror-ascii-codec-cant.html"/>
   <updated>2013-07-19T19:49:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/unicodeencodeerror-ascii-codec-cant</id>
   <content type="html">&lt;p&gt;The error in the title will occur on pre-0.12.0 versions of python’s Requests library. It seems to be fixed on later versions and maybe even earlier.&lt;/p&gt;

&lt;p&gt;Here’s an example of how you save a zip file from behind a corporate proxy with python’s Requests library:&lt;/p&gt;
&lt;noscript&gt;&lt;pre&gt;sess = requests.session()

# you may have other get/post requests before you can get to the download page for the file
url = &amp;#39;https://example.com/report.zip&amp;#39;

# this may be different for you, i just copied this from an existing request (using fiddler)
file_headers = {
    &amp;#39;Accept&amp;#39;: &amp;#39;text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&amp;#39;,
    &amp;#39;Accept-Language&amp;#39;: &amp;#39;en-US,en;q=0.8&amp;#39;,
    &amp;#39;User-Agent&amp;#39;: &amp;#39;Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)&amp;#39;,
    &amp;#39;Host&amp;#39;: &amp;#39;example.com&amp;#39;,
    &amp;#39;Accept-Encoding&amp;#39;: &amp;#39;gzip,deflate,sdch&amp;#39;,
    &amp;#39;Connection&amp;#39;: &amp;#39;Keep-Alive&amp;#39;,
    &amp;#39;Content-Type&amp;#39;: &amp;#39;application/octet-stream;charset=text/html;charset=UTF-8&amp;#39;,
}

with open(&amp;#39;report.zip&amp;#39;, mode=&amp;#39;wb&amp;#39;) as handle:
    report_file = sess.get(url, headers=file_headers, prefetch=False, verify=False)
    handle.write(report_file.content)&lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/65d525f3d9defcb34870ad8a815a0b09.js&quot;&gt; &lt;/script&gt;

&lt;p&gt;&lt;strong&gt;That’s it!&lt;/strong&gt; Just use the write function with the content of the returned request.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/requestsexceptionssslerror-errno-1.html"/>
   <updated>2013-07-19T18:55:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/requestsexceptionssslerror-errno-1</id>
   <content type="html">This happens with the Requests library in python. All you need to do is set verify=false.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;cookieRequest = s.post(url, data=json.dumps(payload).strip(&apos;&quot;&apos;), allow_redirects=False, headers=headers, verify=False)&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>src/pycurl.c:42:20: fatal error: Python.h: No such file or directory</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/srcpycurlc4220-fatal-error-pythonh-no.html"/>
   <updated>2013-07-19T17:14:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/srcpycurlc4220-fatal-error-pythonh-no</id>
   <content type="html">The following helped to resolve this issue:&amp;nbsp;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; font-size: 14px; line-height: 18px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;sudo apt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; font-size: 14px; line-height: 18px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; font-size: 14px; line-height: 18px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; font-size: 14px; line-height: 18px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; install python&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; font-size: 14px; line-height: 18px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; font-size: 14px; line-height: 18px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;dev&lt;/span&gt;</content>
 </entry>
 
 <entry>
   <title>Writing To File - UnicodeEncodeError: &apos;ascii&apos; codec can&apos;t encode characters</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/i-was-getting-lot-of-errors-when-i-was.html"/>
   <updated>2013-07-17T18:10:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/i-was-getting-lot-of-errors-when-i-was</id>
   <content type="html">&lt;p&gt;I was getting a lot of errors when I was trying to download a file with the python requests library. The errors looked like the following:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 2-6: ordinal not in range(128)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This code ended up fixing it:&lt;/p&gt;
&lt;noscript&gt;&lt;pre&gt;import codecs
import requests
import time

# this could be different, but it works for my application, but the content-type definitely matters
fileHeaders = {
    &amp;#39;Content-Type&amp;#39;: &amp;#39;application/octet-stream;charset=text/html;charset=UTF-8&amp;#39;
}

url = &amp;#39;www.yourfile.com/your.zip&amp;#39;
with codecs.open(&amp;#39;your.zip&amp;#39;, mode=&amp;#39;wb&amp;#39;, encoding=&amp;#39;utf-8&amp;#39;) as handle:
    zip_file = requests.get(url, headers=fileHeaders, prefetch=False)
    for block in zip_file.iter_content(1024):
        if block:
            handle.write(block)
    &lt;/pre&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/9cac6e18fd888063141d15aac15fc253.js&quot;&gt; &lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>Prevent URL Encoding - Python Requests Library</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/prevent-url-encoding-python-requests.html"/>
   <updated>2013-07-15T23:48:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/prevent-url-encoding-python-requests</id>
   <content type="html">&lt;br /&gt;Use json.dumps in the data parameter.&lt;br /&gt;&lt;br /&gt;for example:&lt;br /&gt;r = s.post(url, data=json.dumps(payload), allow_redirects=False, cookies=cookieRequest.cookies)&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Google Maps Event Firing Order</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/google-maps-event-firing-order.html"/>
   <updated>2013-07-11T19:49:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/google-maps-event-firing-order</id>
   <content type="html">&lt;a href=&quot;http://gmaps-samples-v3.googlecode.com/svn/trunk/map_events/map_events.html&quot;&gt;http://gmaps-samples-v3.googlecode.com/svn/trunk/map_events/map_events.html&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Tunnel Traffic Through Webserver Using Your Browser</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/tunnel-traffic-through-webserver-using.html"/>
   <updated>2013-07-10T05:56:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/tunnel-traffic-through-webserver-using</id>
   <content type="html">&lt;p&gt;Use the following command in Cygwin (using your IP and Username, of course):&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ssh yourUsername@198.168.xxx.xxx -D 2280 -i your/certificate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Set the following settings in Firefox (connect settings, under the advanced tab):&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/proxySettings.png&quot; alt=&quot;proxy settings&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Dream Factory</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/dream-factory.html"/>
   <updated>2013-07-10T05:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/dream-factory</id>
   <content type="html">&lt;a href=&quot;https://www.dreamfactory.com/&quot;&gt;https://www.dreamfactory.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It&apos;s suspiciously free. It&apos;s a ready to go back-end that can be accessed with APIs.</content>
 </entry>
 
 <entry>
   <title>Secure MySQL Command</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/secure-mysql-command.html"/>
   <updated>2013-07-03T16:02:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/secure-mysql-command</id>
   <content type="html">&lt;span style=&quot;background-color: #eeeeff; color: #666666; font-family: &apos;Lucida Grande&apos;, &apos;Lucida Sans Unicode&apos;, Verdana, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;/usr/bin/mysql_secure_installation&lt;/span&gt;</content>
 </entry>
 
 <entry>
   <title>Easyphp Change Directory To Github</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/easyphp-change-directory-to-github.html"/>
   <updated>2013-07-02T21:01:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/easyphp-change-directory-to-github</id>
   <content type="html">1. Right click on the easyphp icon --&amp;gt; configuration --&amp;gt; apache (this should open the&amp;nbsp;httpd.conf in your easyphp apache directory)&lt;br /&gt;&lt;br /&gt;2. Find the section labelled DocumentRootDirectory and overwrite with this:&lt;br /&gt;&lt;br /&gt;# DocumentRootDirectory&lt;br /&gt;&amp;lt;Directory &quot;C:/Users/&lt;span style=&quot;background-color: yellow;&quot;&gt;your_username&lt;/span&gt;/Documents/GitHub/&lt;span style=&quot;background-color: yellow;&quot;&gt;your_project&lt;/span&gt;/&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; #&lt;br /&gt;&amp;nbsp; &amp;nbsp; # Possible values for the Options directive are &quot;None&quot;, &quot;All&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; # or any combination of:&lt;br /&gt;&amp;nbsp; &amp;nbsp; # &amp;nbsp; Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews&lt;br /&gt;&amp;nbsp; &amp;nbsp; #&lt;br /&gt;&amp;nbsp; &amp;nbsp; # Note that &quot;MultiViews&quot; must be named *explicitly* --- &quot;Options All&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; # doesn&apos;t give it to you.&lt;br /&gt;&amp;nbsp; &amp;nbsp; #&lt;br /&gt;&amp;nbsp; &amp;nbsp; # The Options directive is both complicated and important. &amp;nbsp;Please see&lt;br /&gt;&amp;nbsp; &amp;nbsp; # http://httpd.apache.org/docs/2.4/mod/core.html#options&lt;br /&gt;&amp;nbsp; &amp;nbsp; # for more information.&lt;br /&gt;&amp;nbsp; &amp;nbsp; #&lt;br /&gt;&amp;nbsp; &amp;nbsp; Options Indexes FollowSymLinks Includes ExecCGI&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; #&lt;br /&gt;&amp;nbsp; &amp;nbsp; # AllowOverride controls what directives may be placed in .htaccess files.&lt;br /&gt;&amp;nbsp; &amp;nbsp; # It can be &quot;All&quot;, &quot;None&quot;, or any combination of the keywords:&lt;br /&gt;&amp;nbsp; &amp;nbsp; # &amp;nbsp; Options FileInfo AuthConfig Limit&lt;br /&gt;&amp;nbsp; &amp;nbsp; #&lt;br /&gt;&amp;nbsp; &amp;nbsp; AllowOverride All&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; #&lt;br /&gt;&amp;nbsp; &amp;nbsp; # Controls who can get stuff from this server.&lt;br /&gt;&amp;nbsp; &amp;nbsp; #&lt;br /&gt;&amp;nbsp; &amp;nbsp; Require all granted&lt;br /&gt;&lt;br /&gt;&amp;lt;/Directory&amp;gt;</content>
 </entry>
 
 <entry>
   <title>Setting Up Github Windows Client Behind a Proxy</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/07/setting-up-github-windows-client-behind.html"/>
   <updated>2013-07-02T20:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/07/setting-up-github-windows-client-behind</id>
   <content type="html">&lt;div&gt;1. Navigate to your git.exe directory (C:\Users\your_username\AppData\Local\GitHub\PortableGit~\bin)&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;Normalcontent&quot; style=&quot;clear: both; position: relative; width: 100%;&quot; xmlns:convitem=&quot;http://schemas.microsoft.com/2008/10/sip/convItems&quot; xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot; xmlns:rtc=&quot;urn:microsoft-rtc-xslt-functions&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns=&quot;http://schemas.microsoft.com/2008/10/sip/convItems&quot;&gt;2. git config --global http.proxy http://username:password@host:port/&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;Normalcontent&quot; style=&quot;clear: both; position: relative; width: 100%;&quot; xmlns:convitem=&quot;http://schemas.microsoft.com/2008/10/sip/convItems&quot; xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot; xmlns:rtc=&quot;urn:microsoft-rtc-xslt-functions&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns=&quot;http://schemas.microsoft.com/2008/10/sip/convItems&quot;&gt;3. git config --system http.sslcainfo /bin/curl-ca-bundle.crt&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id=&quot;Normalcontent&quot; style=&quot;clear: both; position: relative; width: 100%;&quot; xmlns:convitem=&quot;http://schemas.microsoft.com/2008/10/sip/convItems&quot; xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot; xmlns:rtc=&quot;urn:microsoft-rtc-xslt-functions&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns=&quot;http://schemas.microsoft.com/2008/10/sip/convItems&quot;&gt;4. Open the github client (it should work now)&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>move_uploaded_file To Current Path - PHP</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/06/moveuploadedfile-to-current-path-php.html"/>
   <updated>2013-06-29T23:23:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/06/moveuploadedfile-to-current-path-php</id>
   <content type="html">$uploadfile = &apos;./&apos; . basename($_FILES[&apos;file&apos;][&apos;name&apos;]);&lt;br /&gt;&lt;br /&gt;if (move_uploaded_file($_FILES[&apos;file&apos;][&apos;tmp_name&apos;], $uploadfile)) {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;echo &quot;File was successfully uploaded.\n&quot;;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} else {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;echo &quot;There was an issue uploading the file.\n&quot;;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}</content>
 </entry>
 
 <entry>
   <title>View In Use and Will Not DROP - MySQL</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/06/view-in-use-and-will-not-drop-mysql.html"/>
   <updated>2013-06-29T03:16:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/06/view-in-use-and-will-not-drop-mysql</id>
   <content type="html">I had several views in my MySQL database that were showing &quot;In Use&quot; and phpmyadmin would not let me drop them through the interface.&lt;br /&gt;&lt;br /&gt;The solution:&lt;br /&gt;Open the MySQL in terminal and &quot;DROP VIEW yourView;&quot;</content>
 </entry>
 
 <entry>
   <title>Include Array From File - PHP</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/06/include-array-from-file-php.html"/>
   <updated>2013-06-29T03:04:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/06/include-array-from-file-php</id>
   <content type="html">file.php&lt;br /&gt;&amp;lt;?php&lt;br /&gt;return array(&apos;item1&apos;,&apos;item2&apos;);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;Your php code:&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;$thisVariable = include(&apos;file.php&apos;);&lt;br /&gt;print_r($thisVariable); //prints the array&lt;br /&gt;?&amp;gt;</content>
 </entry>
 
 <entry>
   <title>Fixing &quot;Copying To Temp Table&quot; - MySQL</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/06/fixing-copying-to-temp-table-mysql.html"/>
   <updated>2013-06-17T07:54:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/06/fixing-copying-to-temp-table-mysql</id>
   <content type="html">&lt;a href=&quot;http://themanbehindthecode.com/2011/08/12/avoid-mysql-copying-to-tmp-table/&quot;&gt;http://themanbehindthecode.com/2011/08/12/avoid-mysql-copying-to-tmp-table/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Don&apos;t Use Nested IFNULL, Use COALESCE - MySQL</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/06/dont-use-nested-ifnull-use-coalesce.html"/>
   <updated>2013-06-16T22:53:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/06/dont-use-nested-ifnull-use-coalesce</id>
   <content type="html">If you&apos;re looking for how to do a nested IFNULL, you probably need to be looking at how to use COALESCE instead. It returns the first non-null item in a list.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;SELECT COALESCE(NULL,1);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Returns 1&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>IFNULL - MySQL</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/06/ifnull-mysql.html"/>
   <updated>2013-06-16T22:41:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/06/ifnull-mysql</id>
   <content type="html">IFNULL(`field1`, `field2`)&lt;br /&gt;&lt;br /&gt;That returns field1 if it&apos;s not null. However, it will return field2 if it is null.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Notes On JOIN - MySQL</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/06/join-returning-duplicate-values.html"/>
   <updated>2013-06-16T21:43:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/06/join-returning-duplicate-values</id>
   <content type="html">&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If your INNER join is returning too few values and duplicates, you&apos;re probably using the wrong kind of join. Try a LEFT join.&lt;/li&gt;&lt;li&gt;INNER JOIN is the same as JOIN&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://i.stack.imgur.com/GbJ7N.png&quot;&gt;http://i.stack.imgur.com/GbJ7N.png&lt;/a&gt;&amp;nbsp;(diagram explaining joins)&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &apos;Liberation Sans&apos;, &apos;DejaVu Sans&apos;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;LEFT JOIN is used - this will return ALL rows from Table1, regardless of whether or not there is a matching row in Table2.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Indexes Help... A Lot</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/06/indexs-help-lot.html"/>
   <updated>2013-06-16T15:54:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/06/indexs-help-lot</id>
   <content type="html">I just brought 4 queries from 15 seconds to less than 1 second by adding indexes to the columns in the ON() portion on the join.&lt;br /&gt;&lt;br /&gt;Indexes help... A lot.</content>
 </entry>
 
 <entry>
   <title>Yii-Booster Incorrect Width</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/06/yii-booster-incorrect-width.html"/>
   <updated>2013-06-15T20:38:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/06/yii-booster-incorrect-width</id>
   <content type="html">Set&amp;nbsp;public $responsiveCss = false; to&amp;nbsp;public $responsiveCss = true;</content>
 </entry>
 
 <entry>
   <title>group_concat - MySQL</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/06/groupconcat-mysql.html"/>
   <updated>2013-06-13T19:38:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/06/groupconcat-mysql</id>
   <content type="html">&lt;a href=&quot;http://mahmudahsan.wordpress.com/2008/08/27/mysql-the-group_concat-function/&quot;&gt;http://mahmudahsan.wordpress.com/2008/08/27/mysql-the-group_concat-function/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This seems like it will be super useful.&lt;br /&gt;&lt;br /&gt;If you&apos;re using &quot;group by&quot; and you still want to get data out of the grouped rows, then you can use this to combine multiple rows into a single row.</content>
 </entry>
 
 <entry>
   <title>Looping Through Associative Array - PHP</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/06/looping-through-associative-array-php.html"/>
   <updated>2013-06-13T01:32:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/06/looping-through-associative-array-php</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/questions/1951690/php-how-to-loop-through-a-associative-array-and-get-the-key-name&quot;&gt;http://stackoverflow.com/questions/1951690/php-how-to-loop-through-a-associative-array-and-get-the-key-name&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This was totally not very intuitive. I was expecting something like this:&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;foreach($array as $sub) {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;echo(key($sub));&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;Instead, it&apos;s this:&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;foreach ($decodedOutput as $key =&amp;gt; $value) {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;echo $key;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}</content>
 </entry>
 
 <entry>
   <title>Search Directory For String - Linux</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/06/search-directory-for-string-linux.html"/>
   <updated>2013-06-03T19:36:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/06/search-directory-for-string-linux</id>
   <content type="html">grep -rl &quot;search_for_this_string&quot; /var/www</content>
 </entry>
 
 <entry>
   <title>PHPExcel Convert Excel Serial Date To MM/DD/YY</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/05/phpexcel-convert-excel-serial-date-to.html"/>
   <updated>2013-05-31T08:31:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/05/phpexcel-convert-excel-serial-date-to</id>
   <content type="html">PHPExcel_Shared_Date::ExcelToPHPObject($value)-&amp;gt;format(&quot;m/d/y&quot;)</content>
 </entry>
 
 <entry>
   <title>Easiest Way To Consume .Net Web Services - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/05/easiest-way-to-consume-net-web-services.html"/>
   <updated>2013-05-19T21:48:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/05/easiest-way-to-consume-net-web-services</id>
   <content type="html">&lt;a href=&quot;http://www.jansipke.nl/python-soap-client-with-suds/&quot;&gt;http://www.jansipke.nl/python-soap-client-with-suds/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That article was very helpful for learning to use Python&apos;s SUDS library for consuming soap web services.&lt;br /&gt;&lt;br /&gt;Here&apos;s an example of my simple client:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;from suds.client import Client&lt;br /&gt;client = Client(&quot;http://xxx.xxx.xxx.xxx/API/Info.asmx?WSDL&quot;)&lt;br /&gt;client.service.getInfo(&quot;05/12/2013&quot;,&quot;05/12/2013&quot;)&lt;br /&gt;&lt;br /&gt;&quot;05/12/2013&quot; and &quot;05/12/2013&quot; are both parameters&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>New Vocabulary Word</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/05/new-vocabulary-word.html"/>
   <updated>2013-05-11T09:34:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/05/new-vocabulary-word</id>
   <content type="html">CRUD&lt;br /&gt;-Create&lt;br /&gt;-Read&lt;br /&gt;-Update&lt;br /&gt;-Delete&lt;br /&gt;&lt;br /&gt;An example of a CRUD application would be something that tracks orders in a database. All 4 actions are going to be necessary to track those orders. CRUD: The basic database operations.</content>
 </entry>
 
 <entry>
   <title>Dynamically Import Data From Other Workbooks - Google Spreadsheet</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/05/dynamically-import-data-from-other.html"/>
   <updated>2013-05-08T05:26:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/05/dynamically-import-data-from-other</id>
   <content type="html">I made a google spreadsheet which pulls data from two other workbooks using &quot;importRange&quot; and QUERY function. You can use either one if you just want to pull a few columns from another spreadsheet. QUERY provides more flexibility by allowing you to use a SQL statement. Here is an example of a query which pulls 2 columns from another workbook and filters out the blank rows in column 41:&lt;br /&gt;&lt;br /&gt;=QUERY(importRange(&quot;yourSpreadsheetKeyHere&quot;, &quot;Donations!A3:BB200000&quot;), &quot;select Col41, Col2 WHERE Col41!=&apos;&apos; &quot;, 1)&lt;br /&gt;&lt;br /&gt;One of the biggest pains during the entire process was google spreadsheet&apos;s vlookup. I learned the vlookup function only searches for a value in the first column in the Array. It&apos;s also helpful if you format the results of your vlookup as &quot;Plain Text&quot; under the numbers format drop-down. Of course, something formatted as a number won&apos;t match something formatted as plain text.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You could use this technique if you have a list of customer id&apos;s with names, and a separate spreadsheet with more customer information. With this, you could combine that information.&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Javascript Excel Parser</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/05/javascript-excel-parser.html"/>
   <updated>2013-05-07T08:20:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/05/javascript-excel-parser</id>
   <content type="html">&lt;a href=&quot;http://niggler.github.io/js-xlsx/&quot;&gt;http://niggler.github.io/js-xlsx/&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That&apos;s an impressive project that allows parsing excel files in the browser.&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Green Mountain Energy&apos;s B2B Site</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/04/green-mountain-energys-b2b-site.html"/>
   <updated>2013-04-28T03:29:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/04/green-mountain-energys-b2b-site</id>
   <content type="html">&lt;p&gt;Green Mountain Energy has the worst B2B portal I’ve seen in my life. The worst parts:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;It only works in IE (barely, and switching between browser versions in the F12 menu doesn’t help)&lt;/li&gt;
  &lt;li&gt;The page only takes up ~30% of the browser window (see the picture)&lt;/li&gt;
  &lt;li&gt;Nothing is functional, I can’t change my automated billing agreement because there’s no submit button.&lt;/li&gt;
  &lt;li&gt;If you have more than one address on your account, just give up.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Picture: &lt;a href=&quot;http://i.imgur.com/cP4CLTl.png&quot;&gt;http://i.imgur.com/cP4CLTl.png&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Update: They sent a letter saying they made a new business portal site. &lt;a href=&quot;https://www.businessportal.greenmountain.com/&quot;&gt;www.businessportal.greenmountain.com&lt;/a&gt; My first visit gives me an “Our site is currently down as we upgrade our systems.” error message.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/generated/assets/images/green+mountain+error-800-093ee2ff4.png&quot; srcset=&quot;/generated/assets/images/green+mountain+error-400-093ee2ff4.png 400w, /generated/assets/images/green+mountain+error-600-093ee2ff4.png 600w, /generated/assets/images/green+mountain+error-800-093ee2ff4.png 800w, /generated/assets/images/green+mountain+error-917-093ee2ff4.png 917w&quot; /&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Don&apos;t Use == null - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/04/dont-use-null-python.html"/>
   <updated>2013-04-26T18:04:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/04/dont-use-null-python</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/questions/3289601/null-object-in-python&quot;&gt;http://stackoverflow.com/questions/3289601/null-object-in-python&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It says not to use == to check for &quot;none-ness&quot;. It&apos;s better to use:&lt;br /&gt;&lt;br /&gt;if variable is none:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;your code&amp;gt;&lt;br /&gt;&lt;br /&gt;Why? &lt;span style=&quot;background-color: white; color: #444444; font-family: Arial, &apos;Liberation Sans&apos;, &apos;DejaVu Sans&apos;, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&quot;And the reason for choosing&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: #eeeeee; border: 0px; color: #444444; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; font-size: 13px; line-height: 17px; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;egg is None&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: Arial, &apos;Liberation Sans&apos;, &apos;DejaVu Sans&apos;, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&amp;nbsp;over&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: #eeeeee; border: 0px; color: #444444; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; font-size: 13px; line-height: 17px; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;egg == None&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: Arial, &apos;Liberation Sans&apos;, &apos;DejaVu Sans&apos;, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;: The latter can be overloaded, and is likely to break when comparing valid object with None (depends on how it&apos;s implemented, but you don&apos;t expect everyone to take comparisions with None into account, do you?), while&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: #eeeeee; border: 0px; color: #444444; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; font-size: 13px; line-height: 17px; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;is&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: Arial, &apos;Liberation Sans&apos;, &apos;DejaVu Sans&apos;, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&amp;nbsp;always works the same.&quot;&lt;/span&gt;</content>
 </entry>
 
 <entry>
   <title>King Of Button Generators</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/04/king-of-button-generators.html"/>
   <updated>2013-04-26T05:07:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/04/king-of-button-generators</id>
   <content type="html">&lt;a href=&quot;http://buttonoptimizer.com/&quot;&gt;http://buttonoptimizer.com/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Something I Need To Drill Into My Brain - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/04/something-i-need-to-drill-into-my-brain.html"/>
   <updated>2013-04-24T03:36:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/04/something-i-need-to-drill-into-my-brain</id>
   <content type="html">The operation of the slicing operator:&lt;div&gt;&lt;pre style=&quot;background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;&quot;&gt;&lt;span class=&quot;gp&quot; style=&quot;color: #c65d09; font-weight: bold;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;word&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[:&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;color: #208050;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;    &lt;span class=&quot;c&quot; style=&quot;color: #408090; font-style: italic;&quot;&gt;# The first two characters&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;go&quot; style=&quot;color: #303030;&quot;&gt;&apos;He&apos;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;gp&quot; style=&quot;color: #c65d09; font-weight: bold;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;word&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;color: #208050;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:]&lt;/span&gt;    &lt;span class=&quot;c&quot; style=&quot;color: #408090; font-style: italic;&quot;&gt;# Everything except the first two characters&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;go&quot; style=&quot;color: #303030;&quot;&gt;&apos;lpA&apos;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Prezi Video With No Audio</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/04/prezi-video-with-no-audio.html"/>
   <updated>2013-04-22T22:06:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/04/prezi-video-with-no-audio</id>
   <content type="html">&lt;p&gt;I converted a wmv video to a few different formats (mp4 and flv) and still couldn’t get the audio to play in Prezi. However, videos with the following codec settings will work:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/codec.png&quot; alt=&quot;codec info&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Solution: Open your video with Handbrake and convert it to H264 with AAC as the selected audio codec and it will play just fine.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Start Ser2Sock.c On Boot</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/04/start-ser2sock-on-boot.html"/>
   <updated>2013-04-16T21:54:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/04/start-ser2sock-on-boot</id>
   <content type="html">&lt;br /&gt;Make a shell script saying the following:&lt;br /&gt;./ser2sock -b 115200 -c -w 5000 -p 10000 -s /dev/ttyUSB0 -d -g 3&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Follow these instructions:&amp;nbsp;&lt;a href=&quot;http://jonathonhill.net/2009-04-23/auto-start-a-shell-script-on-ubuntu-server/&quot;&gt;http://jonathonhill.net/2009-04-23/auto-start-a-shell-script-on-ubuntu-server/&lt;/a&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Easiest To Set Up FTP Server</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/04/easiest-to-set-up-ftp-server.html"/>
   <updated>2013-04-09T07:23:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/04/easiest-to-set-up-ftp-server</id>
   <content type="html">&lt;a href=&quot;http://askubuntu.com/questions/1722/basic-ubuntu-ftp-server&quot;&gt;http://askubuntu.com/questions/1722/basic-ubuntu-ftp-server&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&quot;&lt;span style=&quot;background-color: #f7f7f7; color: #333333; font-family: &apos;Ubuntu Beta&apos;, UbuntuBeta, Ubuntu, &apos;Bitstream Vera Sans&apos;, &apos;DejaVu Sans&apos;, Tahoma, sans-serif; font-size: 14px; line-height: 17px;&quot;&gt;I&apos;m going to recommend PureFTPD because it&apos;s been the simplest and easiest to use in my opinion. You&apos;ll need to install it first:&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: #e0e0e0; border: 0px; color: #222222; font-family: &apos;Ubuntu Mono&apos;, &apos;Ubuntu Beta Mono A&apos;, Consolas, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;sudo apt-get install pure-ftpd&lt;/code&gt;&lt;span style=&quot;background-color: #f7f7f7; color: #333333; font-family: &apos;Ubuntu Beta&apos;, UbuntuBeta, Ubuntu, &apos;Bitstream Vera Sans&apos;, &apos;DejaVu Sans&apos;, Tahoma, sans-serif; font-size: 14px; line-height: 17px;&quot;&gt;&amp;nbsp;once it&apos;s installed it&apos;ll start itself up.&quot;&lt;/span&gt;</content>
 </entry>
 
 <entry>
   <title>Useful Bootstrap Links</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/04/useful-bootstrap-links.html"/>
   <updated>2013-04-08T22:00:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/04/useful-bootstrap-links</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://bootstraphero.com/the-big-badass-list-of-twitter-bootstrap-resources&quot;&gt;http://bootstraphero.com/the-big-badass-list-of-twitter-bootstrap-resources&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, an user named Billy Cravens on Meetup.com left a ton of good bootstrap links (bootsnip looks especially awesome) in this post: &lt;a href=&quot;http://www.meetup.com/HoustonCFUG/events/79862792/&quot;&gt;http://www.meetup.com/HoustonCFUG/events/79862792/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Twitter Bootstrap:&lt;br /&gt;
&lt;a href=&quot;http://twitter.github.com/bootstrap/&quot;&gt;http://twitter.github.com/bootstrap/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bootswatch: (free Bootstrap themes)&lt;br /&gt;
&lt;a href=&quot;http://www.bootswatch.com&quot;&gt;http://www.bootswatch.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wrap Bootstrap (premium Bootstrap themes)&lt;br /&gt;
&lt;a href=&quot;http://www.wrapbootstrap.com&quot;&gt;http://www.wrapbootstrap.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Common Bootstrap Snippets&lt;br /&gt;
&lt;a href=&quot;http://www.bootsnipp.com&quot;&gt;http://www.bootsnipp.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some nice date plugins for Bootstrap&lt;br /&gt;
&lt;a href=&quot;http://www.eyecon.ro/bootstrap-datepicker/&quot;&gt;http://www.eyecon.ro/bootstrap-datepicker/&lt;/a&gt;
&lt;a href=&quot;https://github.com/dangrossman/bootstrap-daterangepicker&quot;&gt;https://github.com/dangrossman/bootstrap-daterangepicker&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bootstrap WYSIWYG editor plugin&lt;br /&gt;
&lt;a href=&quot;http://jhollingworth.github.com/bootstrap-wysihtml5/&quot;&gt;http://jhollingworth.github.com/bootstrap-wysihtml5/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Integrating Bootstrap with jQueryValidate&lt;br /&gt;
&lt;a href=&quot;http://alittlecode.com/jquery-form-validation-with-styles-from-twitter-bootstrap/&quot;&gt;http://alittlecode.com/jquery-form-validation-with-styles-from-twitter-bootstrap/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nice data grids:&lt;br /&gt;
&lt;a href=&quot;http://www.datatables.net&quot;&gt;http://www.datatables.net&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Integrate Bootstrap with Data Tables:&lt;br /&gt;
&lt;a href=&quot;http://datatables.net/blog/Twitter_Bootstrap_2&quot;&gt;http://datatables.net/blog/Twitter_Bootstrap_2&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>HTML5 In &lt; IE9</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/04/html5-in-ie9.html"/>
   <updated>2013-04-08T16:43:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/04/html5-in-ie9</id>
   <content type="html">&lt;a href=&quot;https://code.google.com/p/html5shiv/&quot;&gt;https://code.google.com/p/html5shiv/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I saw this javascript library in the code for the &lt;a href=&quot;http://support.mozilla.org/en-US/home&quot;&gt;Mozilla Support page&lt;/a&gt;&amp;nbsp;(really well done). It looks like it adds HTML5 functionality to older versions of IE. Looks like it should be really useful in the future.</content>
 </entry>
 
 <entry>
   <title>PHP - Verify File Is Uploaded And Zip</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/04/php-verify-file-is-uploaded-and-zip.html"/>
   <updated>2013-04-02T16:33:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/04/php-verify-file-is-uploaded-and-zip</id>
   <content type="html">&lt;br /&gt;if($_FILES[&quot;zip_file&quot;][&quot;name&quot;]) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;$filename = $_FILES[&quot;zip_file&quot;][&quot;name&quot;];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;$name = explode(&quot;.&quot;, $filename);&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;$continue = strtolower(end($name)) == &apos;zip&apos; ? true : false;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if(!$continue) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;$message = &quot;The file you are trying to upload is not a .zip file. Please try again.&quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;} else {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;$message = &quot;File Is .zip&quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>PHP - Loop Through Excel Document and Print Cells</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/03/php-loop-through-excel-document-and.html"/>
   <updated>2013-03-29T15:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/03/php-loop-through-excel-document-and</id>
   <content type="html">&lt;br /&gt;require_once &apos;excel_reader2.php&apos;;&lt;br /&gt;&lt;br /&gt;foreach($reader-&amp;gt;sheets as $k=&amp;gt;$data)&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; echo &quot;\n\n &quot;.$reader-&amp;gt;boundsheets[$k].&quot;\n\n&quot;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; foreach($data[&apos;cells&apos;] as $row)&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach($row as $cell)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &quot;$cell\t&quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &quot;\n&quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Head Tracking In The Browser</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/03/head-tracking-in-browser.html"/>
   <updated>2013-03-17T01:55:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/03/head-tracking-in-browser</id>
   <content type="html">&lt;a href=&quot;http://learningthreejs.com/blog/2013/03/12/move-a-cube-with-your-head/&quot;&gt;http://learningthreejs.com/blog/2013/03/12/move-a-cube-with-your-head/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Had no idea this was even possible, but that&apos;s an example of head tracking in the browser done with WEBRTC.&lt;br /&gt;&lt;br /&gt;Demo:&amp;nbsp;&lt;a href=&quot;http://jeromeetienne.github.com/tquery/plugins/headtrackr/examples/demo.html&quot;&gt;http://jeromeetienne.github.com/tquery/plugins/headtrackr/examples/demo.html&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Check If Time Is Between - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/03/check-if-time-is-between-python.html"/>
   <updated>2013-03-16T23:28:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/03/check-if-time-is-between-python</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/questions/1907196/how-do-i-check-if-its-monday-to-friday-and-the-time-is-between-10-am-to-3-pm&quot;&gt;http://stackoverflow.com/questions/1907196/how-do-i-check-if-its-monday-to-friday-and-the-time-is-between-10-am-to-3-pm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;From an user named miku:&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &apos;Lucida Console&apos;, &apos;Liberation Mono&apos;, &apos;DejaVu Sans Mono&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; datetime&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; d &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; datetime&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; border: 0px; color: grey; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;# =&amp;gt; datetime.datetime(2009, 12, 15, 13, 50, 35, 833175)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; border: 0px; color: grey; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;# check if weekday is 1..5&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; d&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;isoweekday &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; range&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; border: 0px; color: grey; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;# check if hour is 10..15&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; d&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;hour &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; range&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; border: 0px; color: grey; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;# check if minute is 30&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; d&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;minute&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;False&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content>
 </entry>
 
 <entry>
   <title>Prevent Character Escaping - Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/03/prevent-character-escaping.html"/>
   <updated>2013-03-15T21:57:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/03/prevent-character-escaping</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/questions/2042342/network-path-and-variables-in-python&quot;&gt;http://stackoverflow.com/questions/2042342/network-path-and-variables-in-python&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you want to use network paths without adding extra slashes, you can use python&apos;s raw string function.&lt;br /&gt;&lt;br /&gt;Here&apos;s an example of something you want to make a raw string:&lt;br /&gt;&lt;br /&gt;source_path = r&quot;\\mynetworkshare&quot;&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Canvas JS Charts - Google Charts Killer?</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/03/canvas-js-charts-google-charts-killer.html"/>
   <updated>2013-03-07T06:13:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/03/canvas-js-charts-google-charts-killer</id>
   <content type="html">&lt;a href=&quot;http://canvasjs.com/docs/charts/intro/high-performance-javascript-charts/&quot;&gt;http://canvasjs.com/docs/charts/intro/high-performance-javascript-charts/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The most impressive part is how fast it renders all that data.</content>
 </entry>
 
 <entry>
   <title>Check If Workbook Is Open By Name - VBA</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/03/check-if-workbook-is-open-by-name-vba.html"/>
   <updated>2013-03-05T23:13:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/03/check-if-workbook-is-open-by-name-vba</id>
   <content type="html">This code from StackOverflow helped me find whether a workbook was open with its name. Here&apos;s the link to the thread: &lt;a href=&quot;http://stackoverflow.com/questions/9373082/detect-whether-excel-workbook-is-already-open-using-vba&quot;&gt;Link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;Function BookOpen(strBookName As String) As Boolean&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; Dim oBk As Workbook&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; On Error Resume Next&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; Set oBk = Workbooks(strBookName)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; On Error GoTo 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; If oBk Is Nothing Then&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BookOpen = False&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; Else&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BookOpen = True&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; End If&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;End Function&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;Sub testbook()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; Dim strBookName As String&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; strBookName = &quot;myWork.xls&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; If BookOpen(strBookName) Then&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox strBookName &amp;amp; &quot; is open&quot;, vbOKOnly + vbInformation&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; Else&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox strBookName &amp;amp; &quot; is NOT open&quot;, vbOKOnly + vbExclamation&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&amp;nbsp; &amp;nbsp; End If&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;End Sub&lt;/span&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>&quot;The link you have used to enter the PayPal system is invalid. Please review the link and try again.&quot;</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/03/the-link-you-have-used-to-enter-paypal.html"/>
   <updated>2013-03-04T03:08:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/03/the-link-you-have-used-to-enter-paypal</id>
   <content type="html">Using an incorrect e-mail address in the hidden &quot;business&quot; field in your HTML form can cause this issue.&lt;br /&gt;&lt;br /&gt;Example of the hidden field with the problem:&lt;br /&gt;&amp;lt;input type=&quot;hidden&quot; name=&quot;business&quot; value=&quot;dave@davesgarage.com&quot;&amp;gt;</content>
 </entry>
 
 <entry>
   <title>Overdue Member Calculator</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/03/overdue-member-calculator.html"/>
   <updated>2013-03-01T12:07:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/03/overdue-member-calculator</id>
   <content type="html">&lt;a href=&quot;https://github.com/pawl/OverdueMemberCalculator&quot;&gt;https://github.com/pawl/OverdueMemberCalculator&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This should help ease the pain of dealing with suspended paypal recurring payment agreements.&lt;br /&gt;&lt;br /&gt;The page accepts variables from the URL, then generates a paypal payment button based on the person&apos;s last payment date.</content>
 </entry>
 
 <entry>
   <title>HTML Skeleton / Boilerplate</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/03/html-skeleton-boilerplate.html"/>
   <updated>2013-03-01T09:09:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/03/html-skeleton-boilerplate</id>
   <content type="html">Here&apos;s a good HTML skeleton/boilerplate tool: http://www.htmlshell.com/</content>
 </entry>
 
 <entry>
   <title>WebForms.js or WebUIValidation.js CDN</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/03/webformsjs-or-webuivalidationjs-cdn.html"/>
   <updated>2013-03-01T07:23:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/03/webformsjs-or-webuivalidationjs-cdn</id>
   <content type="html">&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;In the console, it was giving me two errors saying it could not GET these two files from the CDN:&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: Consolas, &apos;Lucida Console&apos;, monospace; font-size: 12px; white-space: pre-wrap;&quot;&gt;&lt;a href=&quot;http://www.blogger.com/goog_445237617&quot;&gt;&lt;span style=&quot;color: #1155cc;&quot;&gt;http://ajax.microsoft.com/&lt;/span&gt;&lt;wbr&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1155cc;&quot;&gt;ajax/4.0/2/WebForms.js&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;a href=&quot;http://ajax.microsoft.com/ajax/4.0/2/WebUIValidation.js&quot;&gt;&lt;span style=&quot;font-family: Consolas, &apos;Lucida Console&apos;, monospace; font-size: 12px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;color: #1155cc;&quot;&gt;http://ajax.microsoft.com/&lt;/span&gt;&lt;wbr&gt;&lt;/wbr&gt;ajax/4.0/2/&lt;/span&gt;&lt;span style=&quot;font-family: Consolas, &apos;Lucida Console&apos;, monospace; font-size: 12px; white-space: pre-wrap;&quot;&gt;WebUIValidation.js&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: Consolas, &apos;Lucida Console&apos;, monospace; font-size: 12px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;To fix it, you need to delete the &amp;lt;script&amp;gt;&amp;lt;/script&amp;gt; references for both of the files above and make a single reference to:&lt;/span&gt;&lt;div style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-size: 12px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Lucida Console, monospace;&quot;&gt;&amp;lt;script src=&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas, &apos;Lucida Console&apos;, monospace; font-size: 12px; white-space: pre-wrap;&quot;&gt;&lt;a href=&quot;http://ajax.aspnetcdn.com/ajax/4.5/6/WebFormsBundle.js&quot; style=&quot;color: #1155cc;&quot; target=&quot;_blank&quot;&gt;http://ajax.aspnetcdn.&lt;wbr&gt;&lt;/wbr&gt;com/ajax/4.5/6/WebFormsBundle.&lt;wbr&gt;&lt;/wbr&gt;js&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 12px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Lucida Console, monospace;&quot;&gt;&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/&lt;wbr&gt;&lt;/wbr&gt;script&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Raspberry Pi Text To Speech IRC Service</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/02/raspberry-pi-text-to-speech-irc-service.html"/>
   <updated>2013-02-27T20:17:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/02/raspberry-pi-text-to-speech-irc-service</id>
   <content type="html">These are my notes for installing Eastein&apos;s announce. It&apos;s a IRC bot that will receive a message and do text to speech on the message:&amp;nbsp;&lt;a href=&quot;https://github.com/eastein/announce&quot;&gt;https://github.com/eastein/announce&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Installation:&lt;/span&gt;&lt;/h2&gt;&lt;ol&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/eastein/announce&quot;&gt;Download announce&lt;/a&gt; and extract it to it&apos;s own folder.&lt;/li&gt;&lt;li&gt;apt-get install python-irclib&lt;/li&gt;&lt;li&gt;apt-get install python-pip&lt;/li&gt;&lt;li&gt;sudo apt-get install python-dev&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;apt-get install festival festlex-cmu festlex-poslex festlex-oald libestools1.2 unzip&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;apt-get install speech-tools&lt;/span&gt;&lt;/li&gt;&lt;li&gt;pip install pyzmq --install-option=&quot;--zmq=bundled&quot;&lt;br /&gt;&lt;b&gt;or (if you have easy_install installed):&lt;/b&gt;&lt;br /&gt;easy_install pyzmq&lt;/li&gt;&lt;li&gt;download &lt;a href=&quot;https://github.com/eastein/mediorc&quot;&gt;mediorc&lt;/a&gt; and move mediorc into directory&lt;/li&gt;&lt;li&gt;easy_install dnspython&lt;/li&gt;&lt;li&gt;apt-get install mplayer&lt;/li&gt;&lt;li&gt;apt-get install sox&lt;/li&gt;&lt;li&gt;&lt;b&gt;Fix permissions:&lt;/b&gt;&lt;br /&gt;chmod 777 saypitchprase&lt;br /&gt;chmod 777&amp;nbsp;pitchphrase2wav&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;h2&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Running The Program:&lt;/span&gt;&lt;/h2&gt;&lt;/div&gt;&lt;b&gt;Run process in background by starting a screen (first navigate to the Announce folder):&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;(start a new screen)&lt;/li&gt;&lt;li&gt;python announced &quot;tcp://*:4900&quot;&lt;/li&gt;&lt;li&gt;(detach from screen)&lt;/li&gt;&lt;li&gt;(start a new screen)&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;python announcebot &quot;chat.freenode.net&quot; &quot;voicebot&quot; &quot;#yourircchannel&quot; &quot;tcp://0:4901&quot;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;(detack from screen)&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;b&gt;Starting the program using mp3 files in the JSON file (as always, start in the folder which has Announce):&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;white-space: normal;&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;wget http://fake.com/fake/eye_tiger.mp3 &lt;/span&gt;&lt;b style=&quot;white-space: pre-wrap;&quot;&gt;(use a real URL with an mp3 file)&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;nano default.json&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;enter into the json file: [ [&quot;eye of the tiger&quot;, &quot;eye_tiger.mp3&quot;] ]&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;ctrl+x and save&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;(start a new screen)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;python announced &quot;tcp://0:4900&quot; default.json&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;(detach from screen)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;(start a new screen)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;python announcebot &quot;chat.freenode.net&quot; &quot;voicebot&quot; &quot;#yourircchannel&quot; &quot;tcp://0:4900&quot;&lt;/li&gt;&lt;li&gt;(detach from screen)&lt;/li&gt;&lt;li&gt;now &quot;!say eye of the tiger&quot; in the IRC channel will trigger the mp3&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Troubleshooting:&lt;/span&gt;&lt;/h2&gt;&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;b&gt;Ensure your Raspberry Pi audio is working:&lt;/b&gt; &lt;a href=&quot;http://jeffskinnerbox.wordpress.com/2012/11/15/getting-audio-out-working-on-the-raspberry-pi/&quot;&gt;http://jeffskinnerbox.wordpress.com/2012/11/15/getting-audio-out-working-on-the-raspberry-pi/&lt;/a&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Testing Festival (create a text file named mytext.txt with some words first):&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;echo &quot;This is a test.&quot; | festival --tts&lt;/div&gt;&lt;/div&gt;&lt;div&gt;echo &quot;this is a test&quot; &amp;gt; mytext.txt&lt;/div&gt;&lt;div&gt;text2wave -o myaudio.wav mytext.txt&lt;/div&gt;&lt;div&gt;&lt;div&gt;aplay myaudio.wav&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;better voices:&lt;/b&gt;&lt;br /&gt;&lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=677277&quot;&gt;http://ubuntuforums.org/showthread.php?t=677277&lt;/a&gt;&lt;br /&gt;&lt;pre style=&quot;word-wrap: break-word;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=751169&quot;&gt;http://ubuntuforums.org/showthread.php?t=751169&lt;/a&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;word-wrap: break-word;&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;word-wrap: break-word;&quot;&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;adjust the volume:&lt;/b&gt;&lt;br /&gt;http://blog.scphillips.com/2013/01/sound-configuration-on-raspberry-pi-with-alsa/&lt;br /&gt;or use amixer?&lt;/div&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Find An Image Font</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/02/font-finder.html"/>
   <updated>2013-02-27T20:01:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/02/font-finder</id>
   <content type="html">This page will tell you what font an image is using:&amp;nbsp;&lt;a href=&quot;http://www.myfonts.com/WhatTheFont/&quot;&gt;http://www.myfonts.com/WhatTheFont/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I wish this feature was included in GIMP or Photoshop.</content>
 </entry>
 
 <entry>
   <title>Regex Debugger</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/02/regex-debugger.html"/>
   <updated>2013-02-23T00:38:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/02/regex-debugger</id>
   <content type="html">&lt;a href=&quot;http://www.debuggex.com/?re=&amp;amp;str=&quot;&gt;http://www.debuggex.com/?re=&amp;amp;str= &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Don&apos;t want to lose this link, it&apos;s going to make regex related programming a lot easier.</content>
 </entry>
 
 <entry>
   <title>Tableizer</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/02/tableizer.html"/>
   <updated>2013-02-19T22:48:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/02/tableizer</id>
   <content type="html">Freaking brilliant tool that converts spreadsheet format things to HTML: http://tableizer.journalistopia.com/tableizer.php&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>PhoneGap Build - cordova-2.4.0.js</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/02/phonegap-build-cordova-240js.html"/>
   <updated>2013-02-19T20:39:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/02/phonegap-build-cordova-240js</id>
   <content type="html">If you&apos;re using Phonegap Build, you don&apos;t need to include cordova-2.4.0.js or any other specific version of cordova/phonegap. Just use phonegap.js, but you don&apos;t actually need to include phonegap.js in the file you upload to Phonegap Build.&lt;br /&gt;&lt;br /&gt;Quote from the Phonegap Build site:&lt;br /&gt;&lt;span style=&quot;-webkit-text-size-adjust: none; background-color: whitesmoke; color: #222222; font-family: adobe-clean, &apos;Helvetica Neue&apos;, Helvetica, Arial, sans-serif; font-size: 18px;&quot;&gt;&quot;Once you&apos;ve included the necessary assets, remove the&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;-webkit-text-size-adjust: none; background-color: whitesmoke; box-sizing: border-box; color: #222222; font-family: monospace, serif; font-size: 14px;&quot;&gt;phonegap.js&lt;/code&gt;&lt;span style=&quot;-webkit-text-size-adjust: none; background-color: whitesmoke; color: #222222; font-family: adobe-clean, &apos;Helvetica Neue&apos;, Helvetica, Arial, sans-serif; font-size: 18px;&quot;&gt;&amp;nbsp;(cordova.js) as Build will automatically inject it during compile time.&quot;&lt;/span&gt;</content>
 </entry>
 
 <entry>
   <title>Sharepoint Lists Crashing</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/02/sharepoint-lists-crashing.html"/>
   <updated>2013-02-05T23:03:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/02/sharepoint-lists-crashing</id>
   <content type="html">If your sharepoint lists crash IE as soon as they open, try disabling the following IE addons:&lt;div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &apos;Segoe UI&apos;, sans-serif; font-size: 10pt;&quot;&gt;Sharepoint spreadsheet Launcher&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &apos;Segoe UI&apos;, sans-serif; font-size: 10pt;&quot;&gt;Sharepoint export database~&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Open File With Excel Macro</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/02/open-file-with-excel-macro.html"/>
   <updated>2013-02-05T15:31:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/02/open-file-with-excel-macro</id>
   <content type="html">&lt;br /&gt;This macro will ask the user to input an excel file, then open that excel file:&lt;br /&gt;&lt;br /&gt;Sub RunMacro()&lt;br /&gt;&amp;nbsp; &amp;nbsp;&lt;br /&gt;Dim vaFiles As Variant&lt;br /&gt;Dim i As Long&lt;br /&gt;&lt;br /&gt;vaFiles = Application.GetOpenFilename _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(FileFilter:=&quot;Excel Filer (*.xls),*.xls&quot;, _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Title:=&quot;Open File(s)&quot;, MultiSelect:=False)&lt;br /&gt;&lt;br /&gt;If Not IsArray(vaFiles) Then Exit Sub&lt;br /&gt;&lt;br /&gt;With Application&lt;br /&gt;&amp;nbsp; &amp;nbsp; .ScreenUpdating = False&lt;br /&gt;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; For i = 1 To UBound(vaFiles)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Workbooks.Open vaFiles(i)&lt;br /&gt;&amp;nbsp; &amp;nbsp; Next i&lt;br /&gt;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; .ScreenUpdating = True&lt;br /&gt;End With&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Java - Swing&apos;s Nimbus Look &amp; Feel</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/02/java-swings-nimbus-look-feel.html"/>
   <updated>2013-02-01T16:32:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/02/java-swings-nimbus-look-feel</id>
   <content type="html">&lt;p&gt;Since Java SE 6 Update 10, Java has had an updated interface called Nimbus. Comparison pictures are below.&lt;/p&gt;

&lt;p&gt;All I needed to do to use it was add this import to the top of the .java file with my main() method:
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;import javax.swing.UIManager.*;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And this code to the top of the main() method (&lt;a href=&quot;http://stackoverflow.com/questions/4617615/how-to-set-nimbus-look-and-feel-in-main&quot;&gt;http://stackoverflow.com/questions/4617615/how-to-set-nimbus-look-and-feel-in-main&lt;/a&gt;):&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;public static void main(String[] args) {
try {
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        if (&quot;Nimbus&quot;.equals(info.getName())) {
            UIManager.setLookAndFeel(info.getClassName());
            break;
        }
    }
} catch (Exception e) {
    // If Nimbus is not available, fall back to cross-platform
    try {
        UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    } catch (Exception ex) {
        // not worth my time
    }
}
new Controller();
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Default:
&lt;img src=&quot;/generated/assets/images/default-484-e1b065ae0.png&quot; srcset=&quot;/generated/assets/images/default-400-e1b065ae0.png 400w, /generated/assets/images/default-484-e1b065ae0.png 484w&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Nimbus:
&lt;img src=&quot;/generated/assets/images/nimbus-313-6b0b3189e.png&quot; srcset=&quot;/generated/assets/images/nimbus-313-6b0b3189e.png 313w&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Note: This blog post says it is slightly slower than the default: &lt;a href=&quot;http://www.pushing-pixels.org/2008/06/17/lightbeam-measuring-performance-of-swing-look-and-feels.html&quot;&gt;http://www.pushing-pixels.org/2008/06/17/lightbeam-measuring-performance-of-swing-look-and-feels.html&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>&quot;Protected mode is currently turned off for the Internet zone&quot;</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/protected-mode-is-currently-turned-off.html"/>
   <updated>2013-01-23T17:58:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/protected-mode-is-currently-turned-off</id>
   <content type="html">&lt;p&gt;Want to disable the IE7 pop-up saying “Protected mode is currently turned off”?&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/protected+mode.png&quot; alt=&quot;protected mode&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Just right-click the message and click “Don’t show this again”.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Ljava.lang.String; Error</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/ljavalangstring-error.html"/>
   <updated>2013-01-22T18:49:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/ljavalangstring-error</id>
   <content type="html">This is a simple one. You&apos;re asking java to return an Array as a string.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt; Put&amp;nbsp;Arrays.toString( ) around your Array.</content>
 </entry>
 
 <entry>
   <title>Java Exceptions - Catching All Errors</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/java-exceptions.html"/>
   <updated>2013-01-22T18:42:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/java-exceptions</id>
   <content type="html">&quot;Exception is the base class for all exceptions&quot;&lt;br /&gt;&lt;br /&gt;&quot;Thus any exception that may get thrown is an Exception (Uppercase &apos;E&apos;).&quot;&lt;br /&gt;&lt;br /&gt;Meaning, catch(Exception e) will catch any type of exception that is thrown, as opposed to specific Exceptions.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;try { &lt;br /&gt;&amp;nbsp; &amp;nbsp; // code&lt;br /&gt;}catch(Exception e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; //catch all exceptions&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://stackoverflow.com/questions/1075895/how-can-i-catch-all-the-exceptions-that-will-be-thrown-through-reading-and-writi&quot;&gt;http://stackoverflow.com/questions/1075895/how-can-i-catch-all-the-exceptions-that-will-be-thrown-through-reading-and-writi&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Meaning Of &quot;l&quot; In LDAP</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/meaning-of-l-in-ldap.html"/>
   <updated>2013-01-16T20:53:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/meaning-of-l-in-ldap</id>
   <content type="html">&quot;The lower case &apos;l&apos; refers to the locality (city).&quot;
</content>
 </entry>
 
 <entry>
   <title>Jquery Slideup Jerking Effect In IE9</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/jquery-slideup-jerking-effect-in-ie9.html"/>
   <updated>2013-01-15T20:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/jquery-slideup-jerking-effect-in-ie9</id>
   <content type="html">This website has code to help get rid of the jerking effect on Jquery SlideUp in IE9: &lt;a href=&quot;https://siderite.dev/blog/jquery-slideup-flickers-in-internet.html&quot;&gt;https://siderite.dev/blog/jquery-slideup-flickers-in-internet.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You just add this code after you include your Jquery library:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: #09004d; font-size: 13px; line-height: 18px;&quot;&gt;(function(){&lt;br /&gt;// Define overriding method.&lt;br /&gt;jQuery.fx.prototype.hide = function(){&lt;br /&gt;&lt;br /&gt;// Remember where we started, so that we can go back to it later&lt;br /&gt;this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );&lt;br /&gt;this.options.hide = true;&lt;br /&gt;&lt;br /&gt;// Begin the animation&lt;br /&gt;this.custom(this.cur(), 1);&lt;br /&gt;}&lt;br /&gt;})();&lt;/pre&gt;</content>
 </entry>
 
 <entry>
   <title>Raspberry Pi - No Ethernet Caused By Charger</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/raspberry-pi-no-ethernet-caused-by.html"/>
   <updated>2013-01-15T04:34:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/raspberry-pi-no-ethernet-caused-by</id>
   <content type="html">I was using the following charger, but I couldn&apos;t get my Raspberry Pi to connect over&amp;nbsp;Ethernet (ethernet lights showed no link):&amp;nbsp;&lt;a href=&quot;http://www.amazon.com/gp/product/B0038HYPZS&quot;&gt;http://www.amazon.com/gp/product/B0038HYPZS&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The charger was definitely the problem. I swapped it with a Motorola OEM charger and the&amp;nbsp;Ethernet&amp;nbsp;started working again. I did some quick googling, and haven&apos;t seen many reports of this issue yet.&amp;nbsp;I have the Model B, Rev 2.0 board with 512MB RAM.</content>
 </entry>
 
 <entry>
   <title>WHMCS LDAP User Creation Action Hook</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/whmcs-ldap-user-creation-action-hook.html"/>
   <updated>2013-01-14T07:44:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/whmcs-ldap-user-creation-action-hook</id>
   <content type="html">I created an Action Hook for WHMCS which will create an user when they are added as a client. With this script, we no longer need to add our users to LDAP manually. I&apos;m thinking about turning it into a module, and making it easier to other users to use.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://github.com/pawl/WHMCS_LDAP&quot;&gt;https://github.com/pawl/WHMCS_LDAP&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>LDAP_ADD PHP - Object Class Violation</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/ldapadd-php-object-class-violation.html"/>
   <updated>2013-01-14T07:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/ldapadd-php-object-class-violation</id>
   <content type="html">If you are trying to use php&apos;s ldap_add to add an user and are getting an object class violation, try to copy all the fields of a working user exactly. Most likely you are missing some of the required fields of the objectclass you are trying to add.</content>
 </entry>
 
 <entry>
   <title>Reading RFID With Raspberry Pi (or any linux device) + Reader</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/reading-rfid-with-raspberry-pi-or-any.html"/>
   <updated>2013-01-14T06:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/reading-rfid-with-raspberry-pi-or-any</id>
   <content type="html">I&apos;m using the following Parallax USB RFID reader: &lt;a href=&quot;http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/28140-28340-RFIDreader-v2.2.pdf&quot;&gt;http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/28140-28340-RFIDreader-v2.2.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;First you will need to ensure you have PySerial installed by trying to &quot;import PySerial&quot; while running Python&apos;s IDLE. If you receive an error:&lt;br /&gt;&lt;div&gt;&lt;ol&gt;&lt;ol&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0 0 0 40px; padding: 0px;&quot;&gt;&lt;div&gt;Install PySerial:&lt;/div&gt;&lt;/blockquote&gt;&lt;ol&gt;&lt;ol&gt;&lt;li&gt;Install python&apos;s setuptools:&amp;nbsp;apt-get install python-setuptools&lt;/li&gt;&lt;li&gt;Install PySerial:&amp;nbsp;pip install pyserial&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Once you have PySerial installed, open IDLE again and use the following code to see output from the reader:&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;script src=&quot;https://gist.github.com/pawl/9935400.js&quot;&gt;&lt;/script&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Why didn&apos;t&amp;nbsp;ser.read(12)&amp;nbsp;return the same unique identifier as what is written on the fob?:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If the key on the card says 30788590 and the reader returns 3501D5CBEE. The &quot;1D5CBEE&quot; part is the card number. Try going from the card number in DEC to HEX it in the windows calculator while it&apos;s in scientific mode if you don&apos;t believe me.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>&quot;margin-left: auto;&quot; and &quot;margin-right: auto;&quot;  Not Working In IE8</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/margin-left-auto-and-margin-right-auto.html"/>
   <updated>2013-01-07T22:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/margin-left-auto-and-margin-right-auto</id>
   <content type="html">&lt;div&gt;To get something centered within a div in IE8, it requires doing something unusual. I wasn&apos;t able to get the &quot;display: block;&quot; trick working. But this worked:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;#super-wrap { position: absolute; width: 100%;&amp;nbsp;text-align: center;&amp;nbsp;}&amp;nbsp;&lt;/div&gt;&lt;div&gt;#page-wrap { position: relative; width: 970px; margin: auto auto; &amp;nbsp;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I had to do this to get the InfoGrid (&lt;a href=&quot;http://css-tricks.com/examples/InfoGrid/&quot;&gt;http://css-tricks.com/examples/InfoGrid/&lt;/a&gt;) to center in IE8. The div with the ID of #page-wrap already exists, but the super-wrap div needs to be created outside of the page-wrap div.&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Using &quot;nth-of-type&quot; with IE8</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/using-nth-of-type-with-ie8.html"/>
   <updated>2013-01-07T16:44:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/using-nth-of-type-with-ie8</id>
   <content type="html">IE8 apparently doesn&apos;t support the CSS selector &quot;nth-of-type&quot;.&lt;br /&gt;&lt;br /&gt;You can fix it by adding this script to your page:&amp;nbsp;&lt;a href=&quot;https://github.com/keithclark/JQuery-Extended-Selectors/blob/master/jquery-extra-selectors.js&quot;&gt;https://github.com/keithclark/JQuery-Extended-Selectors/blob/master/jquery-extra-selectors.js&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You will also need to add the following script to the bottom of your page (of course you will need to swap the numbers with your own):&lt;br /&gt;&lt;br /&gt;$(&quot;div:nth-of-type(1)&quot;).css(&quot;background&quot;, &quot;#b44835&quot;);&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;I used this to fix an IE8 compatibility issue with something called InfoGrid:&amp;nbsp;&lt;a href=&quot;http://css-tricks.com/examples/InfoGrid/&quot;&gt;http://css-tricks.com/examples/InfoGrid/&lt;/a&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>PHP - Generate SSHA (sha1) Password For LDAP User</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/php-generate-ssha-sha1-password-for.html"/>
   <updated>2013-01-07T02:48:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/php-generate-ssha-sha1-password-for</id>
   <content type="html">$info[&apos;userpassword&apos;][0] = &quot;{SHA}&quot; . base64_encode(sha1(&quot;pass&quot;, TRUE));</content>
 </entry>
 
 <entry>
   <title>Function To Find Largest UID Number In LDAP</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/function-to-find-largest-uid-number-in.html"/>
   <updated>2013-01-07T02:43:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/function-to-find-largest-uid-number-in</id>
   <content type="html">&lt;br /&gt;&amp;nbsp;I got most of this function from &lt;a href=&quot;http://bakery.cakephp.org/articles/UncleBill/2006/10/15/using-ldap-as-a-database&quot;&gt;http://bakery.cakephp.org/articles/UncleBill/2006/10/15/using-ldap-as-a-database&lt;/a&gt;. It will find all the uidNumbers, sorting them largest to smallest, then return the largest number.&lt;br /&gt;&lt;br /&gt;$ds = ldap_connect(&quot;localhost&quot;); &amp;nbsp;// assuming the LDAP server is on this host&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; function findLargestUidNumber($ds)&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; $s = ldap_search($ds, &quot;ou=people,dc=yourdomain,dc=com&quot;, &apos;uidnumber=*&apos;);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if ($s)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// there must be a better way to get the largest uidnumber, but I can&apos;t find a way to reverse sort.&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ldap_sort($ds, $s, &quot;uidnumber&quot;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$result = ldap_get_entries($ds, $s);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$count = $result[&apos;count&apos;];&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$biguid = $result[$count-1][&apos;uidnumber&apos;][0];&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return $biguid;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&lt;div&gt;&lt;br /&gt;$largestUID = findLargestUidNumber($ds);&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>LDAP shadowlastchange - Weird Date Format</title>
   <link href="https://www.paulsprogrammingnotes.com/2013/01/ldap-shadowlastchange-uses-weird-date.html"/>
   <updated>2013-01-07T02:09:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2013/01/ldap-shadowlastchange-uses-weird-date</id>
   <content type="html">&lt;br /&gt;I&apos;m working on a PHP script that adds an user to a directory using LDAP.&lt;br /&gt;&lt;br /&gt;Here&apos;s the formula required to get the date format that shadowlastchange uses:&lt;br /&gt;$unixTimeDays = floor(time()/86400);&lt;br /&gt;&lt;div&gt;&lt;br /&gt;It&apos;s the days since the last epoch.&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>First Android App</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/12/first-android-app.html"/>
   <updated>2012-12-31T13:04:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/12/first-android-app</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://play.google.com/store/apps/details?id=com.DallasTollCalculator&quot;&gt;https://play.google.com/store/apps/details?id=com.DallasTollCalculator&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Py2exe Issues</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/12/py2exe-issues.html"/>
   <updated>2012-12-28T17:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/12/py2exe-issues</id>
   <content type="html">When getting the directory of the file you&apos;re executing in python use the correct example:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: lime;&quot;&gt;CORRECT&lt;/span&gt;: os.path.abspath(os.path.dirname(sys.argv[0]))&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;INCORRECT&lt;/span&gt;: os.path.dirname(inspect.getsourcefile( lambda:None ))&lt;br /&gt;&lt;br /&gt;If you&apos;re using py2exe, the incorrect example will just give error messages.</content>
 </entry>
 
 <entry>
   <title>Outlook 2010 - Run a Script (Blank)</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/12/outlook-2010-run-script-blank.html"/>
   <updated>2012-12-27T15:47:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/12/outlook-2010-run-script-blank</id>
   <content type="html">&lt;br /&gt;Apparently a script does not equal a macro in outlook. When you&apos;re setting up a rule, you have the option to run a script. However, your macro will not show up in the script menu unless it has&amp;nbsp;(MyMail As MailItem) as an argument. Example:&lt;br /&gt;&lt;br /&gt;Sub Save(MyMail As MailItem)&lt;br /&gt;&lt;br /&gt;SaveEmailAttachmentsToFolder &quot;AgentReports&quot;, &quot;html&quot;, &quot;C:\Users\EBRNPAL\Documents\Agent Reports\Saved&quot;&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Save Outlook Attachments Automatically With A Macro</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/12/save-outlook-attachments-automatically.html"/>
   <updated>2012-12-21T22:26:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/12/save-outlook-attachments-automatically</id>
   <content type="html">Source: &lt;a href=&quot;http://www.rondebruin.nl/mail/folder2/saveatt.htm&quot;&gt;http://www.rondebruin.nl/mail/folder2/saveatt.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sub Test()&lt;br /&gt;&apos;Arg 1 = Folder name in your Inbox&lt;br /&gt;&apos;Arg 2 = File extension, &quot;&quot; is every file&lt;br /&gt;&apos;Arg 3 = Save folder, &quot;C:\Users\Ron\test&quot; or &quot;&quot;&lt;br /&gt;&apos;If you use &quot;&quot; it will create a date/time stamped&lt;br /&gt;&apos;folder for you in the &quot;My Documents&quot; folder.&lt;br /&gt;&apos;Note: If you use this &quot;C:\Users\Ron\test&quot; the folder must exist&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; SaveEmailAttachmentsToFolder &quot;AgentReports&quot;, &quot;html&quot;, &quot;C:\Users\Paul\Documents\Agent Reports\Saved&quot;&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Sub SaveEmailAttachmentsToFolder(OutlookFolderInInbox As String, _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ExtString As String, DestFolder As String)&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim ns As NameSpace&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim Inbox As MAPIFolder&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim SubFolder As MAPIFolder&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim Item As Object&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim Atmt As Attachment&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim FileName As String&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim MyDocPath As String&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim I As Integer&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim wsh As Object&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim fs As Object&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; On Error GoTo ThisMacro_err&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Set ns = GetNamespace(&quot;MAPI&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; Set Inbox = ns.GetDefaultFolder(olFolderInbox)&lt;br /&gt;&amp;nbsp; &amp;nbsp; Set SubFolder = Inbox.Folders(OutlookFolderInInbox)&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; I = 0&lt;br /&gt;&amp;nbsp; &amp;nbsp; &apos; Check subfolder for messages and exit of none found&lt;br /&gt;&amp;nbsp; &amp;nbsp; If SubFolder.Items.Count = 0 Then&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox &quot;There are no messages in this folder : &quot; &amp;amp; OutlookFolderInInbox, _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vbInformation, &quot;Nothing Found&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Set SubFolder = Nothing&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Set Inbox = Nothing&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Set ns = Nothing&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Exit Sub&lt;br /&gt;&amp;nbsp; &amp;nbsp; End If&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &apos;Create DestFolder if DestFolder = &quot;&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; If DestFolder = &quot;&quot; Then&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Set wsh = CreateObject(&quot;WScript.Shell&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MyDocPath = wsh.SpecialFolders.Item(&quot;mydocuments&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DestFolder = MyDocPath &amp;amp; &quot;\&quot; &amp;amp; Format(Now, &quot;dd-mmm-yyyy hh-mm-ss&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If Not fs.FolderExists(DestFolder) Then&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fs.CreateFolder DestFolder&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;&amp;nbsp; &amp;nbsp; End If&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; If Right(DestFolder, 1) &amp;lt;&amp;gt; &quot;\&quot; Then&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DestFolder = DestFolder &amp;amp; &quot;\&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; End If&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &apos; Check each message for attachments and extensions&lt;br /&gt;&amp;nbsp; &amp;nbsp; For Each Item In SubFolder.Items&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For Each Atmt In Item.Attachments&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If LCase(Right(Atmt.FileName, Len(ExtString))) = LCase(ExtString) Then&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FileName = DestFolder &amp;amp; Item.SenderName &amp;amp; &quot; &quot; &amp;amp; Atmt.FileName&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Atmt.SaveAsFile FileName&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I = I + 1&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next Atmt&lt;br /&gt;&amp;nbsp; &amp;nbsp; Next Item&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &apos; Show this message when Finished&lt;br /&gt;&amp;nbsp; &amp;nbsp; If I &amp;gt; 0 Then&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox &quot;You can find the files here : &quot; _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;amp; DestFolder, vbInformation, &quot;Finished!&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Else&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox &quot;No attached files in your mail.&quot;, vbInformation, &quot;Finished!&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; End If&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &apos; Clear memory&lt;br /&gt;ThisMacro_exit:&lt;br /&gt;&amp;nbsp; &amp;nbsp; Set SubFolder = Nothing&lt;br /&gt;&amp;nbsp; &amp;nbsp; Set Inbox = Nothing&lt;br /&gt;&amp;nbsp; &amp;nbsp; Set ns = Nothing&lt;br /&gt;&amp;nbsp; &amp;nbsp; Set fs = Nothing&lt;br /&gt;&amp;nbsp; &amp;nbsp; Set wsh = Nothing&lt;br /&gt;&amp;nbsp; &amp;nbsp; Exit Sub&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &apos; Error information&lt;br /&gt;ThisMacro_err:&lt;br /&gt;&amp;nbsp; &amp;nbsp; MsgBox &quot;An unexpected error has occurred.&quot; _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;amp; vbCrLf &amp;amp; &quot;Please note and report the following information.&quot; _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;amp; vbCrLf &amp;amp; &quot;Macro Name: SaveEmailAttachmentsToFolder&quot; _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;amp; vbCrLf &amp;amp; &quot;Error Number: &quot; &amp;amp; Err.Number _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;amp; vbCrLf &amp;amp; &quot;Error Description: &quot; &amp;amp; Err.Description _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;, vbCritical, &quot;Error!&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Resume ThisMacro_exit&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Declaring 2 Variables At The Same Time In Python</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/12/declaring-2-variables-at-same-time-in.html"/>
   <updated>2012-12-21T16:57:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/12/declaring-2-variables-at-same-time-in</id>
   <content type="html">I thought this was interesting:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;import os&lt;/div&gt;&lt;div&gt;fileName, fileExtension = os.path.splitext(&apos;/path/to/somefile.ext&apos;)&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Since os.path.splitext returns a list of 2 items, you can assign those 2 list items to variables at the same time with the code above.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Path To Sharepoint</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/12/path-to-sharepoint.html"/>
   <updated>2012-12-18T23:23:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/12/path-to-sharepoint</id>
   <content type="html">&lt;a href=&quot;http://www.pathtosharepoint.com/&quot;&gt;http://www.pathtosharepoint.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A lot of that stuff looks useful for adding functionality to Sharepoint. Also, this is one of the first public sites I&apos;ve seen which use sharepoint (and it&apos;s not too bad). I saw it mentioned on this site:&amp;nbsp;&lt;a href=&quot;http://sharepointjavascript.wordpress.com/&quot;&gt;http://sharepointjavascript.wordpress.com/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>UTDesign - Xbee Claims vs Reality</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/12/utdesign-xbee-claims-vs-reality.html"/>
   <updated>2012-12-15T08:55:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/12/utdesign-xbee-claims-vs-reality</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/generated/assets/images/2012-12-14_13-22-11_839-800-8068c12e6.jpg&quot; srcset=&quot;/generated/assets/images/2012-12-14_13-22-11_839-400-8068c12e6.jpg 400w, /generated/assets/images/2012-12-14_13-22-11_839-600-8068c12e6.jpg 600w, /generated/assets/images/2012-12-14_13-22-11_839-800-8068c12e6.jpg 800w, /generated/assets/images/2012-12-14_13-22-11_839-1000-8068c12e6.jpg 1000w&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The picture above shows some research done by some UTD students for their UT Design program.&lt;/p&gt;

&lt;p&gt;Their results showed the specs claimed by Xbee modules were far superior to reality. They said they experienced an overwhelming amount of noise at about half of the rated distance and both the peak and idle current ratings were inaccurate.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Unheap - Uncluttering Plugins</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/12/unheap-uncluttering-plugins.html"/>
   <updated>2012-12-13T16:48:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/12/unheap-uncluttering-plugins</id>
   <content type="html">&lt;a href=&quot;http://www.unheap.com/&quot;&gt;http://www.unheap.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That website is an excellent list of a lot of good jquery plugins out there.</content>
 </entry>
 
 <entry>
   <title>Raspberry Pi - Mining Bitcoins </title>
   <link href="https://www.paulsprogrammingnotes.com/2012/12/raspberry-pi-mining-bitcoins.html"/>
   <updated>2012-12-13T07:58:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/12/raspberry-pi-mining-bitcoins</id>
   <content type="html">Rather than letting my Raspberry Pi lay dormant in its cabinet at a data center, I&apos;ve decided to use it for mining bitcoins.&lt;br /&gt;&lt;br /&gt;I followed these instructions: http://www.youtube.com/watch?v=rrdzam7voOg&lt;br /&gt;&lt;br /&gt;I&apos;m using Deepbit as the pool, but I&apos;m not 100% sure what a pool is or if there are better pools out there.&lt;br /&gt;&lt;br /&gt;Update: In about 5 days, I have only mined&amp;nbsp;0.00003898 BTC.</content>
 </entry>
 
 <entry>
   <title>Stop IE Alert Messages </title>
   <link href="https://www.paulsprogrammingnotes.com/2012/12/stop-ie-alert-messages.html"/>
   <updated>2012-12-04T23:30:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/12/stop-ie-alert-messages</id>
   <content type="html">The following snippet of Jquery will prevent alerts from showing in internet explorer:&lt;br /&gt;&lt;br /&gt;if ($.browser.msie) { window.alert = function() { }; };&lt;br /&gt;&lt;br /&gt;It detects if the browser is IE, then disables the alert function with a blank if it is IE. The alert happens only in IE, that&apos;s why it checks to see if the browser is IE.&lt;br /&gt;&lt;br /&gt;I did this because there is some code I can&apos;t change on a sharepoint page which is causing an alert (which doesn&apos;t actually cause any real issues). Adding this code to the part of the page I can change will stop the error.&lt;br /&gt;&lt;br /&gt;About the alert:&lt;br /&gt;It says &quot;Hit error fn!&quot; and it happens in the following span after an ajax call fails:&amp;nbsp;&lt;span style=&quot;color: #881280; font-family: monospace; white-space: pre-wrap;&quot;&gt;&amp;lt;span &lt;/span&gt;&lt;span class=&quot;webkit-html-attribute-name&quot; style=&quot;font-family: monospace; white-space: pre-wrap;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #881280; font-family: monospace; white-space: pre-wrap;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;webkit-html-attribute-value&quot; style=&quot;font-family: monospace; white-space: pre-wrap;&quot;&gt;ctl00_LogUserActivity1&lt;/span&gt;&lt;span style=&quot;color: #881280; font-family: monospace; white-space: pre-wrap;&quot;&gt;&quot;&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It&apos;s definitely a hack, but it works so far.</content>
 </entry>
 
 <entry>
   <title>Raspberry Pi Webserver w/ Wordpress Slow</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/11/raspberry-pi-webserver-w-wordpress.html"/>
   <updated>2012-11-28T08:22:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/11/raspberry-pi-webserver-w-wordpress</id>
   <content type="html">I installed the LAMP stack on a Raspberry Pi, then moved a small Wordpress site to it. It then got plugged into a fast connection at a data center.&lt;br /&gt;&lt;br /&gt;Before the move (shared hosting webserver at Siteground):&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;1 second load times on the main page&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;After the move (Raspberry Pi):&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;8-9 second load times on the main page&lt;/li&gt;&lt;li&gt;5 second load times on single pages&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The Pi does a good job at displaying static pages, but it does not run more intensive things like a CMS quickly enough.&lt;/div&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>LAMP Stack Ubuntu</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/11/lamp-stack-ubuntu.html"/>
   <updated>2012-11-28T03:54:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/11/lamp-stack-ubuntu</id>
   <content type="html">It&apos;s crazy easy to install the LAMP stack on ubuntu with this command:&lt;br /&gt;&lt;br /&gt;sudo apt-get install lamp-server^</content>
 </entry>
 
 <entry>
   <title>SPJS Charts - Dynamically Select Filter Item</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/11/spjs-charts.html"/>
   <updated>2012-11-26T20:53:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/11/spjs-charts</id>
   <content type="html">I&apos;ve been using &lt;a href=&quot;http://sharepointjavascript.wordpress.com/2012/02/03/spjs-charts-for-sharepoint-v3-x/&quot;&gt;SPJS charts&lt;/a&gt;&amp;nbsp;to make google charts with data from sharepoint lists. If you use a custom drop-down filter, you may want to dynamically select items in the drop-down like I did.&lt;br /&gt;&lt;br /&gt;An example: You&apos;re using a drop-filter which filters the results by week, but you always want it to select last week.&lt;br /&gt;&lt;br /&gt;Snippet:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function manualLoad(){&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;loadManually = false;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;spjs_GenerateChart();&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Date.prototype.getWeek = function() {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;var onejan = new Date(this.getFullYear(),0,1);&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;var today = new Date(this.getFullYear(),this.getMonth(),this.getDate());&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;var dayOfYear = ((today - onejan + 1)/86400000);&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;return Math.ceil(dayOfYear/7)&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;};&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$(&quot;#MyChart1_CustomFilterSelect_Week&quot;).val(new Date().getWeek()-1).change();&lt;br /&gt;}</content>
 </entry>
 
 <entry>
   <title>2nd Place - Ericsson &amp; North Texas Food Bank Hackathon</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/11/2nd-place-north-texas-food-bank.html"/>
   <updated>2012-11-13T22:54:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/11/2nd-place-north-texas-food-bank</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/generated/assets/images/image-640-a274b837a.png&quot; srcset=&quot;/generated/assets/images/image-400-a274b837a.png 400w, /generated/assets/images/image-600-a274b837a.png 600w, /generated/assets/images/image-640-a274b837a.png 640w&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The “Hackathon” was a programming competition sponsored by Ericsson to solve some of the North Texas Food Bank’s problems.&lt;/p&gt;

&lt;p&gt;We made a scheduling system that allows people to see which days need more volunteers, then sign up to volunteer. The coolest part is that it would call people with a prerecorded message reminding them of their appointment.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Calculate Weeks In Sharepoint</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/11/calculate-weeks-in-sharepoint.html"/>
   <updated>2012-11-13T22:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/11/calculate-weeks-in-sharepoint</id>
   <content type="html">=INT((Created-DATE(YEAR(Created),1,6)+(TEXT(WEEKDAY(DATE(YEAR(Created),0,1)),&quot;d&quot;)))/7)+1&lt;br /&gt;&lt;br /&gt;This is a modified version of this formula which didn&apos;t give me the correct week number (maybe due to regional settings?): &lt;a href=&quot;http://lamahashim.blogspot.com/2009/10/sharepoint-calculated-field-week-number.html&quot;&gt;http://lamahashim.blogspot.com/2009/10/sharepoint-calculated-field-week-number.html&amp;nbsp;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It matches the number of weeks calculated in excel and all the calculators I could find on the internet.&lt;br /&gt;&lt;br /&gt;Update: I also needed to add a 0 before the &quot;Week&quot; if the number is less than 10, because it will cause an error in sorting otherwise.&lt;br /&gt;&lt;br /&gt;Here&apos;s the formula to add a 0 if the number is less than 10:&lt;br /&gt;=IF((INT((Date-DATE(YEAR(Date),1,6)+(TEXT(WEEKDAY(DATE(YEAR(Date),0,1)),&quot;d&quot;)))/7)+1)&amp;lt;10,&quot;0&quot;&amp;amp;(INT((Date-DATE(YEAR(Date),1,6)+(TEXT(WEEKDAY(DATE(YEAR(Date),0,1)),&quot;d&quot;)))/7)+1),(INT((Date-DATE(YEAR(Date),1,6)+(TEXT(WEEKDAY(DATE(YEAR(Date),0,1)),&quot;d&quot;)))/7)+1))&amp;amp;&quot; &quot;&lt;br /&gt;&lt;br /&gt;(Note: the &amp;amp;&quot; &quot; part forces it to be a string rather than a floating point value)</content>
 </entry>
 
 <entry>
   <title>Impressive Javascript</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/11/impressive-javascript.html"/>
   <updated>2012-11-01T19:36:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/11/impressive-javascript</id>
   <content type="html">&lt;a href=&quot;https://github.com/mbostock/d3/wiki/Gallery&quot;&gt;https://github.com/mbostock/d3/wiki/Gallery&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&quot;D3.js is a JavaScript library for manipulating documents based on data. D3 helps you bring data to life using HTML, SVG and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.&quot;</content>
 </entry>
 
 <entry>
   <title>Google Charts - GeoMap vs GeoChart</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/10/google-charts-geomap-vs-geochart.html"/>
   <updated>2012-10-25T18:33:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/10/google-charts-geomap-vs-geochart</id>
   <content type="html">GeoMap -&amp;nbsp;The map is rendered in the browser using an embedded Flash player.&lt;br /&gt;&lt;br /&gt;GeoChart - Rendered using SVG&lt;br /&gt;&lt;br /&gt;I noticed the GeoChart loads faster (at least in Chrome).</content>
 </entry>
 
 <entry>
   <title>&quot;Object date(2012,10,4) has no method &apos;getTimezoneOffset&apos;&quot; Google Charts</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/10/object-date2012104-has-no-method.html"/>
   <updated>2012-10-24T17:41:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/10/object-date2012104-has-no-method</id>
   <content type="html">This error was caused by not lowercase date in&amp;nbsp;date(2012,10,4). It should be Date(2012,10,4).</content>
 </entry>
 
 <entry>
   <title>Sizeof() vs Count() in PHP</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/10/sizeof-vs-count-in-php.html"/>
   <updated>2012-10-22T18:27:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/10/sizeof-vs-count-in-php</id>
   <content type="html">&lt;a href=&quot;http://php.net/manual/en/function.sizeof.php&quot;&gt;http://php.net/manual/en/function.sizeof.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;They&apos;re the same. According to the link above: the sizeof function is an alias of: &lt;a href=&quot;http://www.php.net/manual/en/function.count.php&quot;&gt;count()&lt;/a&gt;.</content>
 </entry>
 
 <entry>
   <title>PHP Date Variables</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/10/php-date-variables.html"/>
   <updated>2012-10-19T19:48:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/10/php-date-variables</id>
   <content type="html">&lt;a href=&quot;http://php.about.com/od/learnphp/ss/php_functions_3.htm&quot;&gt;http://php.about.com/od/learnphp/ss/php_functions_3.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That&apos;s a helpful post for controlling the output of PHP&apos;s date().</content>
 </entry>
 
 <entry>
   <title>Difference Between Echo and Print In PHP</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/10/difference-between-echo-and-print-in-php.html"/>
   <updated>2012-10-19T15:58:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/10/difference-between-echo-and-print-in-php</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/questions/3615679/what-is-basic-difference-echo-vs-print&quot;&gt;http://stackoverflow.com/questions/3615679/what-is-basic-difference-echo-vs-print&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&quot;echo can print more than 1 argument, print can only print 1 argument.&quot;</content>
 </entry>
 
 <entry>
   <title>Triple Equals Sign In Php</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/10/triple-equals-sign-in-php.html"/>
   <updated>2012-10-19T15:50:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/10/triple-equals-sign-in-php</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/questions/80646/how-do-the-equality-double-equals-and-identity-triple-equals-comparis&quot;&gt;http://stackoverflow.com/questions/80646/how-do-the-equality-double-equals-and-identity-triple-equals-comparis&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Since PHP uses $ to declare variables (and not int, etc), one can run into issues with an if statement being unintentionally true.&lt;br /&gt;&lt;br /&gt;For example, 0 == null.&lt;br /&gt;&lt;br /&gt;The triple equals sign (===) allows you to prevent these cases by only returning true if the two inputs are not the same type.&lt;br /&gt;&lt;br /&gt;So, 0 === null is not true. Also, 0 === &quot;0&quot; is not true either.</content>
 </entry>
 
 <entry>
   <title>SQLSRV30.EXE is not a valid Win32 application</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/10/sqlsrv30exe-is-not-valid-win32.html"/>
   <updated>2012-10-15T15:41:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/10/sqlsrv30exe-is-not-valid-win32</id>
   <content type="html">If you want to install the PDO drivers for PHP 5.4, you will need to extract SQLSRV30.EXE with Winrar.&lt;br /&gt;&lt;br /&gt;Since I was using EasyPHP, I needed to extract the files into the following directory (there&apos;s also another php directory in EasyPHP, not sure why, but it&apos;s worth adding the files under &quot;ext&quot; there too): C:\Program Files\EasyPHP-12.1\php\php546x120827090829\ext&lt;br /&gt;&lt;br /&gt;You will also need to add the following lines to your PHP.ini file under PHPExt:&lt;br /&gt;&lt;br /&gt;extension=php_pdo_sqlsrv_54_ts.dll&lt;br /&gt;extension=php_sqlsrv_54_ts.dll&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>Managing SQL Server 2008 with Management Studio 2005</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/10/managing-sql-server-2008-with.html"/>
   <updated>2012-10-12T16:38:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/10/managing-sql-server-2008-with</id>
   <content type="html">When you google &quot;SQL Management Studio&quot;, one of the first things that comes up is this (the 2005 version):&amp;nbsp;&lt;a href=&quot;http://www.microsoft.com/en-us/download/details.aspx?id=8961&quot;&gt;http://www.microsoft.com/en-us/download/details.aspx?id=8961&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I recommend not installing 2005 if you have SQL Server 2008 Express installed! You will not be able to manage your 2008 server, and you will need to uninstall management studio to install the 2008 version here:&amp;nbsp;&lt;a href=&quot;http://www.microsoft.com/en-us/download/details.aspx?id=22985&quot;&gt;http://www.microsoft.com/en-us/download/details.aspx?id=22985&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Find Values With VBA</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/10/find-values-with-vba.html"/>
   <updated>2012-10-04T15:07:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/10/find-values-with-vba</id>
   <content type="html">&lt;a href=&quot;http://www.rondebruin.nl/find.htm&quot;&gt;http://www.rondebruin.nl/find.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The above website has some great snippets of code which can:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4808398841648427911&quot; name=&quot;Select&quot; style=&quot;color: navy; font-family: Arial, Helvetica, sans-serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Kop1&quot; style=&quot;color: black; font-size: 18px; font-weight: bold; text-decoration: underline;&quot;&gt;Use Find to select a cell&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4808398841648427911&quot; name=&quot;Mark&quot; style=&quot;color: navy; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold;&quot;&gt;&lt;span class=&quot;Kop1&quot; style=&quot;color: black; font-size: 18px; text-decoration: underline;&quot;&gt;Mark cells with the same value in column A in the B column&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4808398841648427911&quot; name=&quot;Color&quot; style=&quot;color: navy; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold;&quot;&gt;&lt;span class=&quot;Kop1&quot; style=&quot;color: black; font-size: 18px; text-decoration: underline;&quot;&gt;Color cells with the same value in a Range, worksheet or all worksheets&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4808398841648427911&quot; name=&quot;Copy&quot; style=&quot;color: navy; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold;&quot;&gt;&lt;span class=&quot;Kop1&quot; style=&quot;color: black; font-size: 18px; text-decoration: underline;&quot;&gt;Copy cells to another sheet with Find&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Get Folder Path From User Input</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/09/get-folder-path-from-user-input.html"/>
   <updated>2012-09-28T15:26:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/09/get-folder-path-from-user-input</id>
   <content type="html">&lt;br /&gt;This is some very useful code from &lt;a href=&quot;http://stackoverflow.com/questions/5971292/vba-excel-getting-file-path-ends-with-folder&quot;&gt;Stack Overflow&lt;/a&gt; which allows the user to select a folder in VBA and reads the folder path into a variable. I&apos;m currently making a macro which opens several XML files in a folder, and this will help users to input the folder where those XML files are located:&lt;br /&gt;&lt;br /&gt;Sub SelectFolder()&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim diaFolder As FileDialog&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &apos; Open the file dialog&lt;br /&gt;&amp;nbsp; &amp;nbsp; Set diaFolder = Application.FileDialog(msoFileDialogFolderPicker)&lt;br /&gt;&amp;nbsp; &amp;nbsp; diaFolder.AllowMultiSelect = False&lt;br /&gt;&amp;nbsp; &amp;nbsp; diaFolder.Show&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; MsgBox diaFolder.SelectedItems(1)&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Set diaFolder = Nothing&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;</content>
 </entry>
 
 <entry>
   <title>VBA - Delete Worksheet With A Specific Name If It Exists</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/09/vba-delete-worksheet-with-specific-name.html"/>
   <updated>2012-09-17T18:39:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/09/vba-delete-worksheet-with-specific-name</id>
   <content type="html">&lt;div&gt;Application.DisplayAlerts = False&amp;nbsp;&lt;/div&gt;&lt;div&gt;On Error Resume Next&amp;nbsp;&lt;/div&gt;&lt;div&gt;ThisWorkbook.Sheets(&quot;Sheet1&quot;).Delete&amp;nbsp;&lt;/div&gt;&lt;div&gt;On Error Goto 0&amp;nbsp;&lt;/div&gt;&lt;div&gt;Application.DisplayAlerts = True&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;The code between &quot;On Error Resume Next&quot; and &quot;On Error Goto 0&quot; will be skipped if an error is generated.&amp;nbsp;&lt;/li&gt;&lt;li&gt;It also won&apos;t display the error to the user because of the code on line 1 (Application.DisplayAlerts = False).&lt;/li&gt;&lt;li&gt;&quot;ThisWorkbook&quot; will need to be declared.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/09/error-occurred-during-initialization-of.html"/>
   <updated>2012-09-14T14:51:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/09/error-occurred-during-initialization-of</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/assets/images/java+error.png&quot; alt=&quot;java error&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If you get this error when you just type “java” into the command prompt, then it can be solved by typing “PATH=C:\Program Files\Java\jdk1.7.0_06\bin” (the folder of your java.exe).&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Modifying PhoneGap Childbrowser View</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/08/modifying-phonegap-childbrowser-view.html"/>
   <updated>2012-08-14T16:21:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/08/modifying-phonegap-childbrowser-view</id>
   <content type="html">&lt;p&gt;In IOS, removing the back/forward, refresh, and history buttons from ChildBrowser requires opening its .xib file.&lt;/p&gt;

&lt;p&gt;I removed everything except the done button:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/Screen+Shot+2012-08-14+at+11.15.54+AM.png&quot; alt=&quot;UIWebView&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Childbrowser Plugin</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/08/childbrowser-plugin.html"/>
   <updated>2012-08-14T14:11:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/08/childbrowser-plugin</id>
   <content type="html">&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://blog.digitalbackcountry.com/2012/03/installing-the-childbrowser-plugin-for-ios-with-phonegapcordova-1-5/&quot;&gt;http://blog.digitalbackcountry.com/2012/03/installing-the-childbrowser-plugin-for-ios-with-phonegapcordova-1-5/&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;font-family: arial; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: small;&quot;&gt;I thought that was a really good guide for getting started on Phonegap&apos;s Childbrowser plugin.&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: small;&quot;&gt;I&apos;m using it to open PDFs from phonegap.&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>My First Stack Overflow Answer</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/08/first-stack-overflow-answer.html"/>
   <updated>2012-08-07T18:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/08/first-stack-overflow-answer</id>
   <content type="html">&lt;a href=&quot;http://stackoverflow.com/questions/11783402/iscroll-and-similar-will-not-scroll-horizontally-phonegap-jqtouch-iphone-app/11852309#11852309&quot;&gt;http://stackoverflow.com/questions/11783402/iscroll-and-similar-will-not-scroll-horizontally-phonegap-jqtouch-iphone-app/11852309#11852309&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;I use Stack Overflow a ton, and I&apos;m going to try to make more of an effort to contribute.&lt;br /&gt;&lt;br /&gt;I was having trouble scrolling horizontally with the iscroll plugin, and I solved it by enabling the hScroll option (which I thought should have been enabled by default). I use iscroll&apos;s zoom function to enable zooming on a single div, while the rest of the page does not zoom.</content>
 </entry>
 
 <entry>
   <title>SigPad API</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/08/sigpad-api.html"/>
   <updated>2012-08-07T13:59:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/08/sigpad-api</id>
   <content type="html">I had difficulties getting Thomas J Bradley&apos;s HTML5 Signature Pad to let me to use its API without resetting the field. This Github issue explains a workaround:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://github.com/thomasjbradley/signature-pad/issues/13&quot;&gt;https://github.com/thomasjbradley/signature-pad/issues/13&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;He is saving the signature, declaring the api variable, then regenerating the signature.&lt;br /&gt;&lt;br /&gt;I needed to use the .getSignatureImage() api function which allows me to turn the signature into a base64 string so I could store the signature in a database.</content>
 </entry>
 
 <entry>
   <title>PHP Inline HTML</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/07/php-inline-html.html"/>
   <updated>2012-07-24T18:20:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/07/php-inline-html</id>
   <content type="html">&lt;a href=&quot;http://www.4webhelp.net/tutorials/php/echo.php&quot;&gt;http://www.4webhelp.net/tutorials/php/echo.php&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;The article in the link above describes the process of adding inline HTML to PHP code instead of &quot;echo &apos;&amp;lt;html&amp;gt;&apos;;&quot;. It seems like it&apos;s much faster to not process each echo statement with PHP.&lt;br /&gt;&lt;br /&gt;This is definitely a big &quot;oh!&quot; moment for someone still learning PHP.</content>
 </entry>
 
 <entry>
   <title>Jquery Mobile - Only Load Once</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/07/jquery-mobile-only-load-once.html"/>
   <updated>2012-07-24T14:28:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/07/jquery-mobile-only-load-once</id>
   <content type="html">If you only want something to load once, you can use the &quot;pageinit&quot; event.&lt;br /&gt;&lt;br /&gt;Here&apos;s an example of some code with &quot;pageinit&quot;:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;$(document).&lt;/span&gt;&lt;em style=&quot;background-color: white; font-family: arial, sans-serif; font-size: small; font-style: normal; font-weight: bold; line-height: 16px;&quot;&gt;delegate&lt;/em&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;(&quot;#yourPage&quot;, &quot;&lt;/span&gt;&lt;em style=&quot;background-color: white; font-family: arial, sans-serif; font-size: small; font-style: normal; font-weight: bold; line-height: 16px;&quot;&gt;pageinit&lt;/em&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;&quot;, function(event) { alert&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;( &quot;ALERT!&quot;); });&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;The code above would not run if you visited the page again.&lt;/span&gt;</content>
 </entry>
 
 <entry>
   <title>Make Phonegap Responsive</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/07/make-phonegap-responsive.html"/>
   <updated>2012-07-23T16:34:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/07/make-phonegap-responsive</id>
   <content type="html">The following was absolutely mandatory for me to get my phonegap app to be responsive: &lt;a href=&quot;https://github.com/cargomedia/jquery.touchToClick&quot;&gt;https://github.com/cargomedia/jquery.touchToClick&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Without modification, Phonegap will wait for a &quot;double-click&quot; after the user taps. This results in a&amp;nbsp;noticeable&amp;nbsp;delay. With the plugin above included, it removes the delay.&lt;br /&gt;&lt;br /&gt;Other plugins I tested wanted me to use selectors for each element I didn&apos;t want delayed.</content>
 </entry>
 
 <entry>
   <title>Prevent Scrolling</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/07/prevent-scrolling.html"/>
   <updated>2012-07-16T13:03:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/07/prevent-scrolling</id>
   <content type="html">http://hankchizljaw.co.uk/tutorials/prevent-window-bounce-phonegap-1-7-ios-tip/13/05/2012/&lt;br /&gt;&lt;br /&gt;The above link is the most simple solution I&apos;ve found to prevent phone gap from scrolling outside of the bounds.</content>
 </entry>
 
 <entry>
   <title>Magnifying Glass For Images Plugin</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/07/magnifying-glass-for-images-plugin.html"/>
   <updated>2012-07-13T19:07:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/07/magnifying-glass-for-images-plugin</id>
   <content type="html">Here&apos;s a link to a cool magnifying glass plugin which uses Jquery:&lt;br /&gt;&lt;a href=&quot;http://www.gcmingati.net/wordpress/wp-content/lab/jquery/minizoompan/&quot;&gt;http://www.gcmingati.net/wordpress/wp-content/lab/jquery/minizoompan/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Using Quotes In mysql_fetch_array()</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/07/using-quotes-in-mysqlfetcharray.html"/>
   <updated>2012-07-05T13:28:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/07/using-quotes-in-mysqlfetcharray</id>
   <content type="html">According to this blog post:&amp;nbsp;&lt;a href=&quot;http://www.securityandcaffeine.com/2008/04/03/php-mysql-and-mysql_fetch_array/&quot;&gt;http://www.securityandcaffeine.com/2008/04/03/php-mysql-and-mysql_fetch_array/&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;strong style=&quot;border: 0px; color: #111111; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;mysql_fetch_array()&lt;/strong&gt;&amp;nbsp;can be sped up dramatically by including quotes, like this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #111111; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;border: 0px; color: #111111; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$result[&apos;2&apos;]&lt;/strong&gt;&lt;span style=&quot;color: #111111; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp;rather than this&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;border: 0px; color: #111111; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$result[2]&lt;/strong&gt; &lt;br /&gt;&lt;strong style=&quot;border: 0px; color: #111111; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style=&quot;color: #111111; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;I just changed my code to use quotes, and I haven&apos;t noticed a big speed increase (that&apos;s probably not where the bottleneck is).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #111111; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #111111; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;Edit: This is probably misleading according to the good people at stackoverflow.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://stackoverflow.com/questions/11345894/mysql-fetch-array-quotes-increase-speed&quot;&gt;http://stackoverflow.com/questions/11345894/mysql-fetch-array-quotes-increase-speed&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Sisyphus.js</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/07/sisyphusjs.html"/>
   <updated>2012-07-03T16:56:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/07/sisyphusjs</id>
   <content type="html">I&apos;m really impressed with sisyphus.js and its usage of HTML5 localStorage. It makes it so users won&apos;t need to re-enter data into a form when they close the window.&lt;br /&gt;&lt;br /&gt;It&apos;s super easy to implement, you only need to include the following in your header:&lt;br /&gt;&lt;br /&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;sisyphus.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And, you will need to activate it on the form you want to save with something like this:&lt;/div&gt;$(&apos;form&apos;).sisyphus(); &lt;br /&gt;&lt;br /&gt;Source:&amp;nbsp; &lt;a href=&quot;http://simsalabim.github.com/sisyphus/&quot;&gt;http://simsalabim.github.com/sisyphus/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Write To Closest Div (with certain class)</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/06/write-to-closest-div-with-certain-class.html"/>
   <updated>2012-06-26T15:56:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/06/write-to-closest-div-with-certain-class</id>
   <content type="html">The following code makes it so I don&apos;t have to mention specifically what page needs to load before a script runs. This is good for having the same function on several different pages in Jquery Mobile.&lt;br /&gt;&lt;br /&gt;var pageId = $(this).closest(&apos;div.diagramPage&apos;).attr(&apos;id&apos;);&lt;br /&gt;&lt;br /&gt;$(document).delegate(pageId, &apos;pageshow&apos;, function() { }&lt;br /&gt;&lt;br /&gt;I included the class because I don&apos;t want to end up moving code around and having it write to a different div.</content>
 </entry>
 
 <entry>
   <title>Fixing: &quot;The requested URL /jquery-1.6.3.min.js was not found on this server.&quot;</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/06/requested-url-jquery-163minjs-was-not.html"/>
   <updated>2012-06-19T05:58:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/06/requested-url-jquery-163minjs-was-not</id>
   <content type="html">&lt;h1 style=&quot;margin: 0px 0px 15px;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;In Wordpress, the following is the error message that occurs at the top of the page:&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;margin: 0px 0px 15px;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Bitter, serif; font-size: 2.769230769230769em; font-weight: normal; line-height: 1.3em;&quot;&gt;Not Found&lt;/span&gt;&lt;/h1&gt;&lt;span style=&quot;background-color: white; color: #555555; font-family: Bitter, serif; font-size: 13px; line-height: 21px;&quot;&gt;The requested URL /jquery-1.6.3.min.js was not found on this server.&lt;/span&gt;&lt;br /&gt;&lt;hr style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-color: rgb(231, 231, 231); border-top-style: solid; color: #555555; font-family: Bitter, serif; font-size: 13px; height: 1px; line-height: 21px; margin: 1em 0px 1.692307em; padding: 0px;&quot; /&gt;&lt;i style=&quot;color: #555555; font-family: Bitter, serif; font-size: 13px; line-height: 21px;&quot;&gt;www.4llw4d.freefilesblog.com&lt;/i&gt; &lt;br /&gt;&lt;i style=&quot;color: #555555; font-family: Bitter, serif; font-size: 13px; line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;I fixed this error by editing the all-in-one SEO plugin&apos;s code (all_in_one_seo_pack.php). I&apos;m pretty sure the following part of the code is the culprit:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&amp;nbsp;$url = &quot;http://www.4llw4d.freefilesblog.com/jquery-1.6.3.min.js&quot;;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;$ch = curl_init(); &amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;$timeout = 5; &amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;curl_setopt($ch,CURLOPT_URL,$url);&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;$data = curl_exec($ch); &amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;curl_close($ch);&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;echo &quot;$data&quot;;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I tried changing it to something else, like:&amp;nbsp;&lt;a href=&quot;http://code.jquery.com/jquery-1.6.3.min.js&quot;&gt;http://code.jquery.com/jquery-1.6.3.min.js&lt;/a&gt;&amp;nbsp;However, it just prints the entire contents onto the page.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The solution:&lt;/b&gt; Switch from the Pro 1.72 version of All-In-One SEO to the newest unpaid version.&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Jquery Mobile - Display Loading Message</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/06/jquery-mobile-display-loading-message.html"/>
   <updated>2012-06-18T15:14:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/06/jquery-mobile-display-loading-message</id>
   <content type="html">I&apos;ve been displaying the ajax loading message when loading a php file (especially when there&apos;s a chance it won&apos;t run instantly).&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I&apos;ve been doing the following:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;$.mobile.showPageLoadingMsg ();&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;$(&apos;#phpDiv&apos;).load(&apos;file.php&apos;,function(){&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;$(&apos;#phpDiv&apos;).trigger(&apos;create&apos;);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;});&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;$.mobile.hidePageLoadingMsg ();&lt;/div&gt;&lt;div&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&quot;showPageLoadingMsg&quot; will start to display the ajax loading message and &quot;hidePage~&quot; will close it. The stuff in the middle loads what the php file returns into a div, then creates DOM contents for it with the trigger(&apos;create&apos;) function.&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Best Jquery Mobile Datebox Plugin</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/06/best-jquery-mobile-datebox-plugin.html"/>
   <updated>2012-06-14T15:13:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/06/best-jquery-mobile-datebox-plugin</id>
   <content type="html">The currently reigning champion of datebox plugins for Jquery Mobile:&amp;nbsp;&lt;a href=&quot;http://dev.jtsage.com/jQM-DateBox/&quot;&gt;http://dev.jtsage.com/jQM-DateBox/&lt;/a&gt;</content>
 </entry>
 
 <entry>
   <title>Jquery Mobile - Close Jqm-Datebox When Dialog Closes</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/06/jquery-mobile-close-jqm-datebox-when.html"/>
   <updated>2012-06-14T15:12:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/06/jquery-mobile-close-jqm-datebox-when</id>
   <content type="html">// this will make sure the datebox closes when the dialog closes&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;$(document).delegate(&apos;#closeButton&apos;, &apos;click&apos;, function() {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$(&quot;.ui-datebox-container&quot;).hide();&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$(&quot;.ui-datebox-screen&quot;).hide();&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;});&lt;br /&gt;&lt;br /&gt;Make sure your #closeButton is the same as the button which closes the dialog.</content>
 </entry>
 
 <entry>
   <title>TodoMVC with MySQL Database</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/06/todomvc-with-mysql-database.html"/>
   <updated>2012-06-13T14:37:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/06/todomvc-with-mysql-database</id>
   <content type="html">&lt;a href=&quot;https://github.com/bartcc/app.todos&quot;&gt;https://github.com/bartcc/app.todos&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This project is a modification of the TodoMVC (used to sample how a language is structured by making a To-Do list). It adds database support and ends up being a very cool To-Do list.</content>
 </entry>
 
 <entry>
   <title>Good Jquery Mobile Blog Post</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/06/good-jquery-mobile-blog-post.html"/>
   <updated>2012-06-13T13:39:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/06/good-jquery-mobile-blog-post</id>
   <content type="html">Just got finished reading the following blog post:&amp;nbsp;&lt;a href=&quot;http://roughlybrilliant.com/jquery_mobile_best_practices#0b&quot;&gt;http://roughlybrilliant.com/jquery_mobile_best_practices#0b&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Most of it&apos;s obvious, but it&apos;s definitely on my list of good blog posts for Jquery Mobile beginners.&lt;br /&gt;&lt;br /&gt;Reminds me how Jquery Mobile needs an official &quot;Best Practices&quot; document.</content>
 </entry>
 
 <entry>
   <title>Loading Scripts Dynamically In Jquery Mobile</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/06/loading-scripts-dynamically-in-jquery.html"/>
   <updated>2012-06-11T19:05:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/06/loading-scripts-dynamically-in-jquery</id>
   <content type="html">At first, I loaded all of my scripts in the header (even when the scripts weren&apos;t needed when the page was being loaded).&lt;br /&gt;&lt;br /&gt;I found this website that partially explained how to load scripts when the page loads. However, Jquery Mobile needs to use the delegate function to load the script when a page is showing.&lt;br /&gt;&lt;br /&gt;I copied the function from the website above:&lt;br /&gt;&lt;pre style=&quot;background-color: #efefef; font-size: 13px;&quot;&gt;function loadjscssfile(filename, filetype){&lt;br /&gt; if (filetype==&quot;js&quot;){ //if filename is a external JavaScript file&lt;br /&gt;  var fileref=document.createElement(&apos;script&apos;)&lt;br /&gt;  fileref.setAttribute(&quot;type&quot;,&quot;text/javascript&quot;)&lt;br /&gt;  fileref.setAttribute(&quot;src&quot;, filename)&lt;br /&gt; }&lt;br /&gt; else if (filetype==&quot;css&quot;){ //if filename is an external CSS file&lt;br /&gt;  var fileref=document.createElement(&quot;link&quot;)&lt;br /&gt;  fileref.setAttribute(&quot;rel&quot;, &quot;stylesheet&quot;)&lt;br /&gt;  fileref.setAttribute(&quot;type&quot;, &quot;text/css&quot;)&lt;br /&gt;  fileref.setAttribute(&quot;href&quot;, filename)&lt;br /&gt; }&lt;br /&gt; if (typeof fileref!=&quot;undefined&quot;)&lt;br /&gt;  document.getElementsByTagName(&quot;head&quot;)[0].appendChild(fileref)&lt;br /&gt;}&lt;/pre&gt;&lt;pre style=&quot;font-size: 13px;&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;font-size: 13px;&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;font-size: 13px;&quot;&gt;&lt;/pre&gt;Now, you need to add code to the top of the data-role=&quot;page&quot; where you want the script to load:&lt;br /&gt;&lt;pre&gt;&lt;span style=&quot;background-color: white;&quot;&gt;$(document).delegate(&apos;#page&apos;, &apos;pageshow&apos;, function() {&lt;br /&gt; loadjscssfile(&quot;your.css&quot;, &quot;css&quot;)&lt;br /&gt; loadjscssfile(&quot;your.js&quot;, &quot;js&quot;)&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;background-color: white;&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;</content>
 </entry>
 
 <entry>
   <title>Best Jquery Calendar Plugin</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/06/best-jquery-calendar-plugin.html"/>
   <updated>2012-06-05T18:47:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/06/best-jquery-calendar-plugin</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/generated/assets/images/fullcalendar-793-5638ac2b2.jpg&quot; srcset=&quot;/generated/assets/images/fullcalendar-400-5638ac2b2.jpg 400w, /generated/assets/images/fullcalendar-600-5638ac2b2.jpg 600w, /generated/assets/images/fullcalendar-793-5638ac2b2.jpg 793w&quot; /&gt;&lt;/p&gt;

&lt;p&gt;FullCalendar can be found here: &lt;a href=&quot;http://arshaw.com/fullcalendar/&quot;&gt;http://arshaw.com/fullcalendar/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I thought it looked the best and had the most API functions out of the HTML5 calendars I saw.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Jquery Add/Remove Class</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/06/jquery-addremove-class.html"/>
   <updated>2012-06-05T18:25:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/06/jquery-addremove-class</id>
   <content type="html">Problem: In Jquery Mobile, I used the&amp;nbsp;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;mobile.&lt;/span&gt;&lt;em style=&quot;background-color: white; font-family: arial, sans-serif; font-size: small; font-style: normal; font-weight: bold; line-height: 16px;&quot;&gt;changePage&lt;/em&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;&amp;nbsp;(method)&lt;/span&gt; to switch pages. Now the button for the previous page is still blue.&lt;br /&gt;&lt;br /&gt;Solution: Add Id&apos;s to the list items you&apos;ll be dealing with. Then use Jquery to remove the class &quot;ui-btn-active&quot; from the old button, and add the &quot;ui-btn-active&quot; class to the new button.&lt;br /&gt;&lt;br /&gt;Here&apos;s the code:&lt;br /&gt;$(&apos;#listItem1&apos;).removeClass(&apos;ui-btn-active&apos;)&lt;br /&gt;$(&apos;#listItem2&apos;).addClass(&apos;ui-btn-active&apos;)</content>
 </entry>
 
 <entry>
   <title>Global Variables In Javascript</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/06/global-variables-in-javascript.html"/>
   <updated>2012-06-05T15:14:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/06/global-variables-in-javascript</id>
   <content type="html">Problem: I had two different &amp;lt;script&amp;gt; (javascript) sections, and I was unable to pass a variable from one set of &amp;lt;script&amp;gt; tags to the other.&lt;br /&gt;&lt;br /&gt;Turns out it doesn&apos;t have anything to do with the script tags, and I just needed to learn a bit more about scope in Javascript.&amp;nbsp;Apparently&amp;nbsp;global variables are a common thing (maybe still not a good practice?) and as long as a variable is used outside of a function.. You&apos;ll be able to access the variable anywhere on the page.&lt;br /&gt;&lt;br /&gt;Solution: Take the variable outside of the function.</content>
 </entry>
 
 <entry>
   <title>Jquery Serialize</title>
   <link href="https://www.paulsprogrammingnotes.com/2012/06/jquery-serialize.html"/>
   <updated>2012-06-05T15:05:00+00:00</updated>
   <id>https://www.paulsprogrammingnotes.com/2012/06/jquery-serialize</id>
   <content type="html">&lt;p&gt;I spent a while looking for a good way to pass variables from HTML to Javascript (ajax) to PHP. Turns out Jquery’s serialize function is exactly what I needed.&lt;/p&gt;

&lt;p&gt;Here’s an example of the code:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;//this will send all the inputs in the form to php with ajax
$(&apos;#form&apos;).submit( function() {
     var data = form.$(&apos;input&apos;).serialize();
     $.ajax({
          type: &quot;POST&quot;,
          url: &quot;process.php&quot;,
          data: data,
          success: function(msg){
          alert( &quot;Your quote request has been submitted!&quot; );
          }
     });
     return false;
} );
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://api.jquery.com/serialize/&quot;&gt;http://api.jquery.com/serialize/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, you can use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;serializeArray()&lt;/code&gt; to get the data in a better format. Here’s a picture of the console.log output:
&lt;img src=&quot;/generated/assets/images/array-800-15203e67a.jpg&quot; srcset=&quot;/generated/assets/images/array-400-15203e67a.jpg 400w, /generated/assets/images/array-600-15203e67a.jpg 600w, /generated/assets/images/array-800-15203e67a.jpg 800w, /generated/assets/images/array-1000-15203e67a.jpg 1000w&quot; /&gt;&lt;/p&gt;

</content>
 </entry>
 

</feed>
