Used nodes:
Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux
Linux localhost.localdomain 4.14.5-200.fc26.x86_64 #1 SMP Mon Dec 11 16:29:08 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
聲明: 此並非爲官方聲明。我並非爲 io.js 官方代表,如果有任何問題,歡迎在 node-forward
一起討論
For reference: http://postgis.net/install
The most reliable way to get PostGIS on OSX is to download and install Postgres.app. Great for development and testing. Do not mix with other installations. Select the extension when prompted.
# encoding: UTF-8 | |
require 'optparse' | |
require 'net/http' | |
require 'json' | |
def parse_options(argv) | |
opts = {} | |
@parser = OptionParser.new do |o| |
#Install opencv MacOSX Mavericks
Cloning into '/usr/local/Library/Taps/homebrew-science'... remote: Reusing existing pack: 3765, done.
module PgArrayHstoreFix | |
def self.included(base) | |
base.class_eval do | |
before_save :serialize_array_hash | |
end | |
def serialize_array_hash | |
self.class.attribute_names.each do |attribute| | |
column_definition = self.column_for_attribute(attribute) | |
if column_definition.array && column_definition.type == :hstore |
"Russian-Doll Caching" is great. It embraces the Rails (and Ruby) goal to "make the developer happy". And it does. Not having to worry about cache expiration is superb.
It has its limits, though. If you're trying to avoid any database queries, russian-doll caching will not work for you. If you are trying to represent thousands, or even hundreds, of objects under a single cache fragment, russian-doll caching is not the best option.
We use it whenever it makes sense, but sometimes we just have to bite the bullet and expire a cache fragment manually. When you want to start manually expiring cache on a fairly busy website, you have to start considering race conditions. I recently ran into the following scenario:
class Post < ActiveRecord::Base
after_save :expire_cache
Create droplet of your liking (ubuntu 12.10 x32)
ssh to root in terminal with your server ip
ssh [email protected]
Add ssh fingerprint and enter password provided in email
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |